* rename "microbit" package to "core" #414 * shouldn't edit the package id. * updating package.json * updated the wrong version * missed updating pxt.json of tests
This commit is contained in:
committed by
Peli de Halleux
parent
80131f2928
commit
277d5a721c
1
libs/devices/README.md
Normal file
1
libs/devices/README.md
Normal file
@ -0,0 +1 @@
|
||||
# devices
|
18
libs/devices/_locales/microbit-devices-jsdoc-strings.json
Normal file
18
libs/devices/_locales/microbit-devices-jsdoc-strings.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"devices": "Control a phone with the BBC micro:bit via Bluetooth.",
|
||||
"devices.onGamepadButton": "Register code to run when the micro:bit receives a command from the paired gamepad.",
|
||||
"devices.onGamepadButton|param|body": "code to run when button is pressed",
|
||||
"devices.onGamepadButton|param|name": "button name",
|
||||
"devices.onNotified": "Registers code to run when the device notifies about a particular event.",
|
||||
"devices.onNotified|param|body": "code handler when event is triggered",
|
||||
"devices.onNotified|param|event": "event description",
|
||||
"devices.onSignalStrengthChanged": "Registers code to run when the device notifies about a change of signal strength.",
|
||||
"devices.onSignalStrengthChanged|param|body": "Code run when the signal strength changes.",
|
||||
"devices.raiseAlertTo": "Sends an ``alert`` command to the parent device.",
|
||||
"devices.raiseAlertTo|param|event": "event description",
|
||||
"devices.signalStrength": "Returns the last signal strength reported by the paired device.",
|
||||
"devices.tellCameraTo": "Sends a ``camera`` command to the parent device.",
|
||||
"devices.tellCameraTo|param|event": "event description",
|
||||
"devices.tellRemoteControlTo": "Sends a ``remote control`` command to the parent device.",
|
||||
"devices.tellRemoteControlTo|param|event": "event description"
|
||||
}
|
10
libs/devices/_locales/microbit-devices-strings.json
Normal file
10
libs/devices/_locales/microbit-devices-strings.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"devices.onGamepadButton|block": "on gamepad button|%NAME",
|
||||
"devices.onNotified|block": "on notified|%event",
|
||||
"devices.onSignalStrengthChanged|block": "on signal strength changed",
|
||||
"devices.raiseAlertTo|block": "raise alert to|%property",
|
||||
"devices.signalStrength|block": "signal strength",
|
||||
"devices.tellCameraTo|block": "tell camera to|%property",
|
||||
"devices.tellRemoteControlTo|block": "tell remote control to|%property",
|
||||
"devices|block": "devices"
|
||||
}
|
217
libs/devices/devices.cpp
Normal file
217
libs/devices/devices.cpp
Normal file
@ -0,0 +1,217 @@
|
||||
#include "pxt.h"
|
||||
#include "MESEvents.h"
|
||||
|
||||
using namespace pxt;
|
||||
|
||||
enum class MesCameraEvent {
|
||||
//% block="take photo"
|
||||
TakePhoto = MES_CAMERA_EVT_TAKE_PHOTO,
|
||||
//% block="start video capture"
|
||||
StartVideoCapture = MES_CAMERA_EVT_START_VIDEO_CAPTURE,
|
||||
//% block="stop video capture"
|
||||
StopVideoCapture = MES_CAMERA_EVT_STOP_VIDEO_CAPTURE,
|
||||
//% block="toggle front-rear"
|
||||
ToggleFrontRear = MES_CAMERA_EVT_TOGGLE_FRONT_REAR,
|
||||
//% block="launch photo mode"
|
||||
LaunchPhotoMode = MES_CAMERA_EVT_LAUNCH_PHOTO_MODE,
|
||||
//% block="launch video mode"
|
||||
LaunchVideoMode = MES_CAMERA_EVT_LAUNCH_VIDEO_MODE,
|
||||
//% block="stop photo mode"
|
||||
StopPhotoMode = MES_CAMERA_EVT_STOP_PHOTO_MODE,
|
||||
//% block="stop video mode"
|
||||
StopVideoMode = MES_CAMERA_EVT_STOP_VIDEO_MODE,
|
||||
};
|
||||
|
||||
enum class MesAlertEvent {
|
||||
//% block="display toast"
|
||||
DisplayToast = MES_ALERT_EVT_DISPLAY_TOAST,
|
||||
//% block="vibrate"
|
||||
Vibrate = MES_ALERT_EVT_VIBRATE,
|
||||
//% block="play sound"
|
||||
PlaySound = MES_ALERT_EVT_PLAY_SOUND,
|
||||
//% block="play ring tone"
|
||||
PlayRingtone = MES_ALERT_EVT_PLAY_RINGTONE,
|
||||
//% block="find my phone"
|
||||
FindMyPhone = MES_ALERT_EVT_FIND_MY_PHONE,
|
||||
//% block="ring alarm"
|
||||
RingAlarm = MES_ALERT_EVT_ALARM1,
|
||||
//% block="ring alarm 2"
|
||||
RingAlarm2 = MES_ALERT_EVT_ALARM2,
|
||||
//% block="ring alarm 3"
|
||||
RingAlarm3 = MES_ALERT_EVT_ALARM3,
|
||||
//% block="ring alarm 4"
|
||||
RingAlarm4 = MES_ALERT_EVT_ALARM4,
|
||||
//% block="ring alarm 5"
|
||||
RingAlarm5 = MES_ALERT_EVT_ALARM5,
|
||||
//% block="ring alarm 6"
|
||||
RingAlarm6 = MES_ALERT_EVT_ALARM6,
|
||||
};
|
||||
|
||||
enum class MesDeviceInfo {
|
||||
//% block="incoming call"
|
||||
IncomingCall = MES_DEVICE_INCOMING_CALL,
|
||||
//% block="incoming message"
|
||||
IncomingMessage = MES_DEVICE_INCOMING_MESSAGE,
|
||||
//% block="orientation landscape"
|
||||
OrientationLandscape = MES_DEVICE_ORIENTATION_LANDSCAPE,
|
||||
//% block="orientation portrait"
|
||||
OrientationPortrait = MES_DEVICE_ORIENTATION_PORTRAIT,
|
||||
//% block="shaken"
|
||||
Shaken = MES_DEVICE_GESTURE_DEVICE_SHAKEN,
|
||||
//% block="display off"
|
||||
DisplayOff = MES_DEVICE_DISPLAY_OFF,
|
||||
//% block="display on"
|
||||
DisplayOn = MES_DEVICE_DISPLAY_ON,
|
||||
};
|
||||
|
||||
enum class MesRemoteControlEvent {
|
||||
//% block="play"
|
||||
play = MES_REMOTE_CONTROL_EVT_PLAY,
|
||||
//% block="pause"
|
||||
pause = MES_REMOTE_CONTROL_EVT_PAUSE,
|
||||
//% block="stop"
|
||||
stop = MES_REMOTE_CONTROL_EVT_STOP,
|
||||
//% block="next track"
|
||||
nextTrack = MES_REMOTE_CONTROL_EVT_NEXTTRACK,
|
||||
//% block="previous track"
|
||||
previousTrack = MES_REMOTE_CONTROL_EVT_PREVTRACK,
|
||||
//% block="forward"
|
||||
forward = MES_REMOTE_CONTROL_EVT_FORWARD,
|
||||
//% block="rewind"
|
||||
rewind = MES_REMOTE_CONTROL_EVT_REWIND,
|
||||
//% block="volume up"
|
||||
volumeUp = MES_REMOTE_CONTROL_EVT_VOLUMEUP,
|
||||
//% block="volume down"
|
||||
volumeDown = MES_REMOTE_CONTROL_EVT_VOLUMEDOWN,
|
||||
};
|
||||
|
||||
enum class MesDpadButtonInfo {
|
||||
//% block="A down"
|
||||
ADown = MES_DPAD_BUTTON_A_DOWN,
|
||||
//% block="A up"
|
||||
AUp = MES_DPAD_BUTTON_A_UP,
|
||||
//% block="B down"
|
||||
BDown = MES_DPAD_BUTTON_B_DOWN,
|
||||
//% block="B up"
|
||||
BUp = MES_DPAD_BUTTON_B_UP,
|
||||
//% block="C down"
|
||||
CDown = MES_DPAD_BUTTON_C_DOWN,
|
||||
//% block="C up"
|
||||
CUp = MES_DPAD_BUTTON_C_UP,
|
||||
//% block="D down"
|
||||
DDown = MES_DPAD_BUTTON_D_DOWN,
|
||||
//% block="D up"
|
||||
DUp = MES_DPAD_BUTTON_D_UP,
|
||||
//% block="1 down"
|
||||
_1Down = MES_DPAD_BUTTON_1_UP,
|
||||
//% block="1 up"
|
||||
_1Up = MES_DPAD_BUTTON_1_DOWN,
|
||||
//% block="2 down"
|
||||
_2Down = MES_DPAD_BUTTON_2_DOWN,
|
||||
//% block="2 up"
|
||||
_2Up = MES_DPAD_BUTTON_2_UP,
|
||||
//% block="3 down"
|
||||
_3Down = MES_DPAD_BUTTON_3_DOWN,
|
||||
//% block="3 up"
|
||||
_3Up = MES_DPAD_BUTTON_3_UP,
|
||||
//% block="4 down"
|
||||
_4Down = MES_DPAD_BUTTON_4_DOWN,
|
||||
//% block="4 up"
|
||||
_4Up = MES_DPAD_BUTTON_4_UP,
|
||||
};
|
||||
|
||||
/**
|
||||
* Control a phone with the BBC micro:bit via Bluetooth.
|
||||
*/
|
||||
//% color=156 weight=80
|
||||
namespace devices {
|
||||
static void genEvent(int id, int event) {
|
||||
MicroBitEvent e(id, event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a ``camera`` command to the parent device.
|
||||
* @param event event description
|
||||
*/
|
||||
//% weight=30 help=devices/tell-camera-to
|
||||
//% blockId=devices_camera icon="\uf030" block="tell camera to|%property" blockGap=8
|
||||
void tellCameraTo(MesCameraEvent event) {
|
||||
genEvent(MES_CAMERA_ID, (int)event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a ``remote control`` command to the parent device.
|
||||
* @param event event description
|
||||
*/
|
||||
//% weight=29 help=devices/tell-remote-control-to
|
||||
//% blockId=devices_remote_control block="tell remote control to|%property" blockGap=14 icon="\uf144"
|
||||
void tellRemoteControlTo(MesRemoteControlEvent event) {
|
||||
genEvent(MES_REMOTE_CONTROL_ID, (int)event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an ``alert`` command to the parent device.
|
||||
* @param event event description
|
||||
*/
|
||||
//% weight=27 help=devices/raise-alert-to
|
||||
//% blockId=devices_alert block="raise alert to|%property" icon="\uf0f3"
|
||||
void raiseAlertTo(MesAlertEvent event) {
|
||||
genEvent(MES_ALERTS_ID, (int)event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers code to run when the device notifies about a particular event.
|
||||
* @param event event description
|
||||
* @param body code handler when event is triggered
|
||||
*/
|
||||
//% help=devices/on-notified weight=26
|
||||
//% blockId=devices_device_info_event block="on notified|%event" icon="\uf10a"
|
||||
void onNotified(MesDeviceInfo event, Action body) {
|
||||
registerWithDal(MES_DEVICE_INFO_ID, (int)event, body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register code to run when the micro:bit receives a command from the paired gamepad.
|
||||
* @param name button name
|
||||
* @param body code to run when button is pressed
|
||||
*/
|
||||
//% help=devices/on-gamepad-button weight=40
|
||||
//% weight=25
|
||||
//% blockId=devices_gamepad_event block="on gamepad button|%NAME" icon="\uf11b"
|
||||
void onGamepadButton(MesDpadButtonInfo name, Action body) {
|
||||
registerWithDal(MES_DPAD_CONTROLLER_ID, (int)name, body);
|
||||
}
|
||||
|
||||
static int _signalStrength = -1;
|
||||
static void signalStrengthHandler(MicroBitEvent ev) {
|
||||
// keep in sync with MESEvents.h
|
||||
_signalStrength = ev.value - 1;
|
||||
}
|
||||
static void initSignalStrength() {
|
||||
if (_signalStrength < 0) {
|
||||
_signalStrength = 0;
|
||||
uBit.messageBus.listen(MES_SIGNAL_STRENGTH_ID, MICROBIT_EVT_ANY, signalStrengthHandler);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the last signal strength reported by the paired device.
|
||||
*/
|
||||
//% help=devices/signal-strength weight=24
|
||||
//% blockId=devices_signal_strength block="signal strength" blockGap=14 icon="\uf012" blockGap=14
|
||||
int signalStrength() {
|
||||
initSignalStrength();
|
||||
return _signalStrength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers code to run when the device notifies about a change of signal strength.
|
||||
* @param body Code run when the signal strength changes.
|
||||
*/
|
||||
//% weight=23 help=devices/on-signal-strength-changed
|
||||
//% blockId=devices_signal_strength_changed_event block="on signal strength changed" icon="\uf012"
|
||||
void onSignalStrengthChanged(Action body) {
|
||||
initSignalStrength();
|
||||
registerWithDal(MES_SIGNAL_STRENGTH_ID, MICROBIT_EVT_ANY, body);
|
||||
}
|
||||
}
|
127
libs/devices/enums.d.ts
vendored
Normal file
127
libs/devices/enums.d.ts
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
// Auto-generated. Do not edit.
|
||||
|
||||
|
||||
declare enum MesCameraEvent {
|
||||
//% block="take photo"
|
||||
TakePhoto = 3, // MES_CAMERA_EVT_TAKE_PHOTO
|
||||
//% block="start video capture"
|
||||
StartVideoCapture = 4, // MES_CAMERA_EVT_START_VIDEO_CAPTURE
|
||||
//% block="stop video capture"
|
||||
StopVideoCapture = 5, // MES_CAMERA_EVT_STOP_VIDEO_CAPTURE
|
||||
//% block="toggle front-rear"
|
||||
ToggleFrontRear = 8, // MES_CAMERA_EVT_TOGGLE_FRONT_REAR
|
||||
//% block="launch photo mode"
|
||||
LaunchPhotoMode = 1, // MES_CAMERA_EVT_LAUNCH_PHOTO_MODE
|
||||
//% block="launch video mode"
|
||||
LaunchVideoMode = 2, // MES_CAMERA_EVT_LAUNCH_VIDEO_MODE
|
||||
//% block="stop photo mode"
|
||||
StopPhotoMode = 6, // MES_CAMERA_EVT_STOP_PHOTO_MODE
|
||||
//% block="stop video mode"
|
||||
StopVideoMode = 7, // MES_CAMERA_EVT_STOP_VIDEO_MODE
|
||||
}
|
||||
|
||||
|
||||
declare enum MesAlertEvent {
|
||||
//% block="display toast"
|
||||
DisplayToast = 1, // MES_ALERT_EVT_DISPLAY_TOAST
|
||||
//% block="vibrate"
|
||||
Vibrate = 2, // MES_ALERT_EVT_VIBRATE
|
||||
//% block="play sound"
|
||||
PlaySound = 3, // MES_ALERT_EVT_PLAY_SOUND
|
||||
//% block="play ring tone"
|
||||
PlayRingtone = 4, // MES_ALERT_EVT_PLAY_RINGTONE
|
||||
//% block="find my phone"
|
||||
FindMyPhone = 5, // MES_ALERT_EVT_FIND_MY_PHONE
|
||||
//% block="ring alarm"
|
||||
RingAlarm = 6, // MES_ALERT_EVT_ALARM1
|
||||
//% block="ring alarm 2"
|
||||
RingAlarm2 = 7, // MES_ALERT_EVT_ALARM2
|
||||
//% block="ring alarm 3"
|
||||
RingAlarm3 = 8, // MES_ALERT_EVT_ALARM3
|
||||
//% block="ring alarm 4"
|
||||
RingAlarm4 = 9, // MES_ALERT_EVT_ALARM4
|
||||
//% block="ring alarm 5"
|
||||
RingAlarm5 = 10, // MES_ALERT_EVT_ALARM5
|
||||
//% block="ring alarm 6"
|
||||
RingAlarm6 = 11, // MES_ALERT_EVT_ALARM6
|
||||
}
|
||||
|
||||
|
||||
declare enum MesDeviceInfo {
|
||||
//% block="incoming call"
|
||||
IncomingCall = 7, // MES_DEVICE_INCOMING_CALL
|
||||
//% block="incoming message"
|
||||
IncomingMessage = 8, // MES_DEVICE_INCOMING_MESSAGE
|
||||
//% block="orientation landscape"
|
||||
OrientationLandscape = 1, // MES_DEVICE_ORIENTATION_LANDSCAPE
|
||||
//% block="orientation portrait"
|
||||
OrientationPortrait = 2, // MES_DEVICE_ORIENTATION_PORTRAIT
|
||||
//% block="shaken"
|
||||
Shaken = 4, // MES_DEVICE_GESTURE_DEVICE_SHAKEN
|
||||
//% block="display off"
|
||||
DisplayOff = 5, // MES_DEVICE_DISPLAY_OFF
|
||||
//% block="display on"
|
||||
DisplayOn = 6, // MES_DEVICE_DISPLAY_ON
|
||||
}
|
||||
|
||||
|
||||
declare enum MesRemoteControlEvent {
|
||||
//% block="play"
|
||||
play = 1, // MES_REMOTE_CONTROL_EVT_PLAY
|
||||
//% block="pause"
|
||||
pause = 2, // MES_REMOTE_CONTROL_EVT_PAUSE
|
||||
//% block="stop"
|
||||
stop = 3, // MES_REMOTE_CONTROL_EVT_STOP
|
||||
//% block="next track"
|
||||
nextTrack = 4, // MES_REMOTE_CONTROL_EVT_NEXTTRACK
|
||||
//% block="previous track"
|
||||
previousTrack = 5, // MES_REMOTE_CONTROL_EVT_PREVTRACK
|
||||
//% block="forward"
|
||||
forward = 6, // MES_REMOTE_CONTROL_EVT_FORWARD
|
||||
//% block="rewind"
|
||||
rewind = 7, // MES_REMOTE_CONTROL_EVT_REWIND
|
||||
//% block="volume up"
|
||||
volumeUp = 8, // MES_REMOTE_CONTROL_EVT_VOLUMEUP
|
||||
//% block="volume down"
|
||||
volumeDown = 9, // MES_REMOTE_CONTROL_EVT_VOLUMEDOWN
|
||||
}
|
||||
|
||||
|
||||
declare enum MesDpadButtonInfo {
|
||||
//% block="A down"
|
||||
ADown = 1, // MES_DPAD_BUTTON_A_DOWN
|
||||
//% block="A up"
|
||||
AUp = 2, // MES_DPAD_BUTTON_A_UP
|
||||
//% block="B down"
|
||||
BDown = 3, // MES_DPAD_BUTTON_B_DOWN
|
||||
//% block="B up"
|
||||
BUp = 4, // MES_DPAD_BUTTON_B_UP
|
||||
//% block="C down"
|
||||
CDown = 5, // MES_DPAD_BUTTON_C_DOWN
|
||||
//% block="C up"
|
||||
CUp = 6, // MES_DPAD_BUTTON_C_UP
|
||||
//% block="D down"
|
||||
DDown = 7, // MES_DPAD_BUTTON_D_DOWN
|
||||
//% block="D up"
|
||||
DUp = 8, // MES_DPAD_BUTTON_D_UP
|
||||
//% block="1 down"
|
||||
_1Down = 10, // MES_DPAD_BUTTON_1_UP
|
||||
//% block="1 up"
|
||||
_1Up = 9, // MES_DPAD_BUTTON_1_DOWN
|
||||
//% block="2 down"
|
||||
_2Down = 11, // MES_DPAD_BUTTON_2_DOWN
|
||||
//% block="2 up"
|
||||
_2Up = 12, // MES_DPAD_BUTTON_2_UP
|
||||
//% block="3 down"
|
||||
_3Down = 13, // MES_DPAD_BUTTON_3_DOWN
|
||||
//% block="3 up"
|
||||
_3Up = 14, // MES_DPAD_BUTTON_3_UP
|
||||
//% block="4 down"
|
||||
_4Down = 15, // MES_DPAD_BUTTON_4_DOWN
|
||||
//% block="4 up"
|
||||
_4Up = 16, // MES_DPAD_BUTTON_4_UP
|
||||
}
|
||||
declare namespace devices {
|
||||
}
|
||||
|
||||
// Auto-generated. Do not edit. Really.
|
24
libs/devices/pxt.json
Normal file
24
libs/devices/pxt.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "devices",
|
||||
"description": "The BLE specific services",
|
||||
"files": [
|
||||
"README.md",
|
||||
"enums.d.ts",
|
||||
"shims.d.ts",
|
||||
"devices.cpp"
|
||||
],
|
||||
"public": true,
|
||||
"dependencies": {
|
||||
"core": "file:../core"
|
||||
},
|
||||
"yotta": {
|
||||
"config": {
|
||||
"microbit-dal": {
|
||||
"bluetooth": {
|
||||
"enabled": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"installedVersion": "ljipgq"
|
||||
}
|
69
libs/devices/shims.d.ts
vendored
Normal file
69
libs/devices/shims.d.ts
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
// Auto-generated. Do not edit.
|
||||
|
||||
|
||||
/**
|
||||
* Control a phone with the BBC micro:bit via Bluetooth.
|
||||
*/
|
||||
//% color=156 weight=80
|
||||
declare namespace devices {
|
||||
|
||||
/**
|
||||
* Sends a ``camera`` command to the parent device.
|
||||
* @param event event description
|
||||
*/
|
||||
//% weight=30 help=devices/tell-camera-to
|
||||
//% blockId=devices_camera icon="\uf030" block="tell camera to|%property" blockGap=8 shim=devices::tellCameraTo
|
||||
function tellCameraTo(event: MesCameraEvent): void;
|
||||
|
||||
/**
|
||||
* Sends a ``remote control`` command to the parent device.
|
||||
* @param event event description
|
||||
*/
|
||||
//% weight=29 help=devices/tell-remote-control-to
|
||||
//% blockId=devices_remote_control block="tell remote control to|%property" blockGap=14 icon="\uf144" shim=devices::tellRemoteControlTo
|
||||
function tellRemoteControlTo(event: MesRemoteControlEvent): void;
|
||||
|
||||
/**
|
||||
* Sends an ``alert`` command to the parent device.
|
||||
* @param event event description
|
||||
*/
|
||||
//% weight=27 help=devices/raise-alert-to
|
||||
//% blockId=devices_alert block="raise alert to|%property" icon="\uf0f3" shim=devices::raiseAlertTo
|
||||
function raiseAlertTo(event: MesAlertEvent): void;
|
||||
|
||||
/**
|
||||
* Registers code to run when the device notifies about a particular event.
|
||||
* @param event event description
|
||||
* @param body code handler when event is triggered
|
||||
*/
|
||||
//% help=devices/on-notified weight=26
|
||||
//% blockId=devices_device_info_event block="on notified|%event" icon="\uf10a" shim=devices::onNotified
|
||||
function onNotified(event: MesDeviceInfo, body: () => void): void;
|
||||
|
||||
/**
|
||||
* Register code to run when the micro:bit receives a command from the paired gamepad.
|
||||
* @param name button name
|
||||
* @param body code to run when button is pressed
|
||||
*/
|
||||
//% help=devices/on-gamepad-button weight=40
|
||||
//% weight=25
|
||||
//% blockId=devices_gamepad_event block="on gamepad button|%NAME" icon="\uf11b" shim=devices::onGamepadButton
|
||||
function onGamepadButton(name: MesDpadButtonInfo, body: () => void): void;
|
||||
|
||||
/**
|
||||
* Returns the last signal strength reported by the paired device.
|
||||
*/
|
||||
//% help=devices/signal-strength weight=24
|
||||
//% blockId=devices_signal_strength block="signal strength" blockGap=14 icon="\uf012" blockGap=14 shim=devices::signalStrength
|
||||
function signalStrength(): number;
|
||||
|
||||
/**
|
||||
* Registers code to run when the device notifies about a change of signal strength.
|
||||
* @param body Code run when the signal strength changes.
|
||||
*/
|
||||
//% weight=23 help=devices/on-signal-strength-changed
|
||||
//% blockId=devices_signal_strength_changed_event block="on signal strength changed" icon="\uf012" shim=devices::onSignalStrengthChanged
|
||||
function onSignalStrengthChanged(body: () => void): void;
|
||||
}
|
||||
|
||||
// Auto-generated. Do not edit. Really.
|
Reference in New Issue
Block a user