2016-03-10 23:01:04 +01:00
|
|
|
enum MesCameraEvent {
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_CAMERA_EVT_TAKE_PHOTO block="take photo"
|
2016-03-10 23:01:04 +01:00
|
|
|
TakePhoto,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_CAMERA_EVT_START_VIDEO_CAPTURE block="start video capture"
|
2016-03-10 23:01:04 +01:00
|
|
|
StartVideoCapture,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_CAMERA_EVT_STOP_VIDEO_CAPTURE block="stop video capture"
|
2016-03-10 23:01:04 +01:00
|
|
|
StopVideoCapture,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_CAMERA_EVT_TOGGLE_FRONT_REAR block="toggle front-rear"
|
2016-03-10 23:01:04 +01:00
|
|
|
ToggleFrontRear,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_CAMERA_EVT_LAUNCH_PHOTO_MODE block="launch photo mode"
|
2016-03-10 23:01:04 +01:00
|
|
|
LaunchPhotoMode,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_CAMERA_EVT_LAUNCH_VIDEO_MODE block="launch video mode"
|
2016-03-10 23:01:04 +01:00
|
|
|
LaunchVideoMode,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_CAMERA_EVT_STOP_PHOTO_MODE block="stop photo mode"
|
2016-03-10 23:01:04 +01:00
|
|
|
StopPhotoMode,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_CAMERA_EVT_STOP_VIDEO_MODE block="stop video mode"
|
2016-03-10 23:01:04 +01:00
|
|
|
StopVideoMode,
|
|
|
|
}
|
|
|
|
|
|
|
|
enum MesAlertEvent {
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_ALERT_EVT_DISPLAY_TOAST block="display toast"
|
2016-03-10 23:01:04 +01:00
|
|
|
DisplayToast,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_ALERT_EVT_VIBRATE block="vibrate"
|
2016-03-10 23:01:04 +01:00
|
|
|
Vibrate,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_ALERT_EVT_PLAY_SOUND block="play sound"
|
2016-03-10 23:01:04 +01:00
|
|
|
PlaySound,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_ALERT_EVT_PLAY_RINGTONE block="play ring tone"
|
2016-03-10 23:01:04 +01:00
|
|
|
PlayRingtone,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_ALERT_EVT_FIND_MY_PHONE block="find my phone"
|
2016-03-10 23:01:04 +01:00
|
|
|
FindMyPhone,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_ALERT_EVT_ALARM1 block="ring alarm"
|
2016-03-10 23:01:04 +01:00
|
|
|
RingAlarm,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_ALERT_EVT_ALARM2 block="ring alarm 2"
|
2016-03-10 23:01:04 +01:00
|
|
|
RingAlarm2,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_ALERT_EVT_ALARM3 block="ring alarm 3"
|
2016-03-10 23:01:04 +01:00
|
|
|
RingAlarm3,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_ALERT_EVT_ALARM4 block="ring alarm 4"
|
2016-03-10 23:01:04 +01:00
|
|
|
RingAlarm4,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_ALERT_EVT_ALARM5 block="ring alarm 5"
|
2016-03-10 23:01:04 +01:00
|
|
|
RingAlarm5,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_ALERT_EVT_ALARM6 block="ring alarm 6"
|
2016-03-10 23:01:04 +01:00
|
|
|
RingAlarm6,
|
|
|
|
}
|
|
|
|
|
|
|
|
enum MesDeviceInfo {
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DEVICE_INCOMING_CALL block="incoming call"
|
2016-03-10 23:01:04 +01:00
|
|
|
IncomingCall,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DEVICE_INCOMING_MESSAGE block="incoming message"
|
2016-03-10 23:01:04 +01:00
|
|
|
IncomingMessage,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DEVICE_ORIENTATION_LANDSCAPE block="orientation landscape"
|
2016-03-10 23:01:04 +01:00
|
|
|
OrientationLandscape,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DEVICE_ORIENTATION_PORTRAIT block="orientation portrait"
|
2016-03-10 23:01:04 +01:00
|
|
|
OrientationPortrait,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DEVICE_GESTURE_DEVICE_SHAKEN block="shaken"
|
2016-03-10 23:01:04 +01:00
|
|
|
Shaken,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DEVICE_DISPLAY_OFF block="display off"
|
2016-03-10 23:01:04 +01:00
|
|
|
DisplayOff,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DEVICE_DISPLAY_ON block="display on"
|
2016-03-10 23:01:04 +01:00
|
|
|
DisplayOn,
|
|
|
|
}
|
|
|
|
|
|
|
|
enum MesRemoteControlEvent {
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_REMOTE_CONTROL_EVT_PLAY block="play"
|
2016-03-10 23:01:04 +01:00
|
|
|
play,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_REMOTE_CONTROL_EVT_PAUSE block="pause"
|
2016-03-10 23:01:04 +01:00
|
|
|
pause,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_REMOTE_CONTROL_EVT_STOP block="stop"
|
2016-03-10 23:01:04 +01:00
|
|
|
stop,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_REMOTE_CONTROL_EVT_NEXTTRACK block="next track"
|
2016-03-10 23:01:04 +01:00
|
|
|
nextTrack,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_REMOTE_CONTROL_EVT_PREVTRACK block="previous track"
|
2016-03-10 23:01:04 +01:00
|
|
|
previousTrack,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_REMOTE_CONTROL_EVT_FORWARD block="forward"
|
2016-03-10 23:01:04 +01:00
|
|
|
forward,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_REMOTE_CONTROL_EVT_REWIND block="rewind"
|
2016-03-10 23:01:04 +01:00
|
|
|
rewind,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_REMOTE_CONTROL_EVT_VOLUMEUP block="volume up"
|
2016-03-10 23:01:04 +01:00
|
|
|
volumeUp,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_REMOTE_CONTROL_EVT_VOLUMEDOWN block="volume down"
|
2016-03-10 23:01:04 +01:00
|
|
|
volumeDown,
|
|
|
|
}
|
|
|
|
|
|
|
|
enum MesDpadButtonInfo {
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_A_DOWN block="A down"
|
2016-03-10 23:01:04 +01:00
|
|
|
ADown,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_A_UP block="A up"
|
2016-03-10 23:01:04 +01:00
|
|
|
AUp,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_B_DOWN block="B down"
|
2016-03-10 23:01:04 +01:00
|
|
|
BDown,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_B_UP block="B up"
|
2016-03-10 23:01:04 +01:00
|
|
|
BUp,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_C_DOWN block="C down"
|
2016-03-10 23:01:04 +01:00
|
|
|
CDown,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_C_UP block="C up"
|
2016-03-10 23:01:04 +01:00
|
|
|
CUp,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_D_DOWN block="D down"
|
2016-03-10 23:01:04 +01:00
|
|
|
DDown,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_D_UP block="D up"
|
2016-03-10 23:01:04 +01:00
|
|
|
DUp,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_1_UP block="1 down"
|
2016-03-10 23:01:04 +01:00
|
|
|
_1Down,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_1_DOWN block="1 up"
|
2016-03-10 23:01:04 +01:00
|
|
|
_1Up,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_2_DOWN block="2 down"
|
2016-03-10 23:01:04 +01:00
|
|
|
_2Down,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_2_UP block="2 up"
|
2016-03-10 23:01:04 +01:00
|
|
|
_2Up,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_3_DOWN block="3 down"
|
2016-03-10 23:01:04 +01:00
|
|
|
_3Down,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_3_UP block="3 up"
|
2016-03-10 23:01:04 +01:00
|
|
|
_3Up,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_4_DOWN block="4 down"
|
2016-03-10 23:01:04 +01:00
|
|
|
_4Down,
|
2016-03-29 07:16:07 +02:00
|
|
|
//% enumval=MES_DPAD_BUTTON_4_UP block="4 up"
|
2016-03-10 23:01:04 +01:00
|
|
|
_4Up,
|
|
|
|
}
|
|
|
|
|
|
|
|
//% color=156 weight=80
|
|
|
|
namespace devices {
|
|
|
|
/**
|
|
|
|
* Sends a ``camera`` command to the parent device.
|
|
|
|
* @param event TODO
|
|
|
|
*/
|
2016-03-22 06:13:39 +01:00
|
|
|
//% weight=30 help=devices/tell-camera-to shim=micro_bit::devices::camera
|
2016-03-10 23:01:04 +01:00
|
|
|
//% blockId=devices_camera icon="\uf030" block="tell camera to|%property" blockGap=8
|
|
|
|
export function tellCameraTo(event: MesCameraEvent): void { }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends a ``remote control`` command to the parent device.
|
|
|
|
* @param event TODO
|
|
|
|
*/
|
2016-03-22 06:13:39 +01:00
|
|
|
//% weight=29 help=devices/tell-remote-control-to shim=micro_bit::devices::remote_control
|
2016-03-10 23:01:04 +01:00
|
|
|
//% blockId=devices_remote_control block="tell remote control to|%property" blockGap=14 icon="\uf144"
|
|
|
|
export function tellRemoteControlTo(event: MesRemoteControlEvent): void { }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends an ``alert`` command to the parent device.
|
|
|
|
* @param event TODO
|
|
|
|
*/
|
2016-03-22 06:13:39 +01:00
|
|
|
//% weight=27 help=devices/raise-alert-to shim=micro_bit::devices::alert
|
2016-03-10 23:01:04 +01:00
|
|
|
//% blockId=devices_alert block="raise alert to|%property" icon="\uf0f3"
|
|
|
|
export function raiseAlertTo(event: MesAlertEvent): void { }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Registers code to run when the device notifies about a particular event.
|
|
|
|
* @param event TODO
|
|
|
|
* @param body TODO
|
|
|
|
*/
|
2016-03-22 06:13:39 +01:00
|
|
|
//% shim=micro_bit::onDeviceInfo help=devices/on-notified
|
2016-03-10 23:01:04 +01:00
|
|
|
//% weight=26
|
|
|
|
//% blockId=devices_device_info_event block="on notified" icon="\uf10a"
|
|
|
|
export function onNotified(event: MesDeviceInfo, body: Action): void { }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register code to run when the micro:bit receives a command from the paired gamepad.
|
|
|
|
* @param name TODO
|
|
|
|
* @param body TODO
|
|
|
|
*/
|
2016-03-22 06:13:39 +01:00
|
|
|
//% help=devices/on-gamepad-button weight=40 shim=micro_bit::onGamepadButton
|
2016-03-10 23:01:04 +01:00
|
|
|
//% weight=25
|
|
|
|
//% blockId=devices_gamepad_event block="on gamepad button|%NAME" icon="\uf11b"
|
|
|
|
export function onGamepadButton(name: MesDpadButtonInfo, body: Action): void { }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the last signal strength reported by the paired device.
|
|
|
|
*/
|
2016-03-22 06:13:39 +01:00
|
|
|
//% help=devices/signal-strength weight=24 shim=micro_bit::signalStrength
|
2016-03-10 23:01:04 +01:00
|
|
|
//% blockId=devices_signal_strength block="signal strength" blockGap=14 icon="\uf012" blockGap=14
|
|
|
|
export function signalStrength(): number {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Registers code to run when the device notifies about a change of signal strength.
|
|
|
|
* @param body TODO
|
|
|
|
*/
|
2016-03-22 06:13:39 +01:00
|
|
|
//% shim=micro_bit::onSignalStrengthChanged weight=23 help=devices/on-signal-strength-changed
|
2016-03-10 23:01:04 +01:00
|
|
|
//% blockId=devices_signal_strength_changed_event block="on signal strength changed" icon="\uf012"
|
|
|
|
export function onSignalStrengthChanged(body: Action): void { }
|
|
|
|
}
|
|
|
|
|