moving blocks to advanced
This commit is contained in:
parent
6c11dbcdf4
commit
019b00209e
@ -2,7 +2,7 @@
|
|||||||
"bluetooth": "Support for additional Bluetooth services.",
|
"bluetooth": "Support for additional Bluetooth services.",
|
||||||
"bluetooth.advertiseUrl": "Advertise an Eddystone URL",
|
"bluetooth.advertiseUrl": "Advertise an Eddystone URL",
|
||||||
"bluetooth.advertiseUrl|param|connectable": "true to keep bluetooth connectable for other services, false otherwise.",
|
"bluetooth.advertiseUrl|param|connectable": "true to keep bluetooth connectable for other services, false otherwise.",
|
||||||
"bluetooth.advertiseUrl|param|power": "power level between 0 and 7, e.g.: 7",
|
"bluetooth.advertiseUrl|param|power": "power level between 0 and 7, eg: 7",
|
||||||
"bluetooth.advertiseUrl|param|url": "the url to transmit. Must be no longer than the supported eddystone url length, eg: \"https://pxt.io/\"",
|
"bluetooth.advertiseUrl|param|url": "the url to transmit. Must be no longer than the supported eddystone url length, eg: \"https://pxt.io/\"",
|
||||||
"bluetooth.onBluetoothConnected": "Register code to run when the micro:bit is connected to over Bluetooth",
|
"bluetooth.onBluetoothConnected": "Register code to run when the micro:bit is connected to over Bluetooth",
|
||||||
"bluetooth.onBluetoothConnected|param|body": "Code to run when a Bluetooth connection is established",
|
"bluetooth.onBluetoothConnected|param|body": "Code to run when a Bluetooth connection is established",
|
||||||
|
@ -123,7 +123,7 @@ namespace bluetooth {
|
|||||||
/**
|
/**
|
||||||
* Advertise an Eddystone URL
|
* Advertise an Eddystone URL
|
||||||
* @param url the url to transmit. Must be no longer than the supported eddystone url length, eg: "https://pxt.io/"
|
* @param url the url to transmit. Must be no longer than the supported eddystone url length, eg: "https://pxt.io/"
|
||||||
* @param power power level between 0 and 7, e.g.: 7
|
* @param power power level between 0 and 7, eg: 7
|
||||||
* @param connectable true to keep bluetooth connectable for other services, false otherwise.
|
* @param connectable true to keep bluetooth connectable for other services, false otherwise.
|
||||||
*/
|
*/
|
||||||
//% blockId=eddystone_advertise_url block="bluetooth advertise url %url|with power %power|connectable %connectable"
|
//% blockId=eddystone_advertise_url block="bluetooth advertise url %url|with power %power|connectable %connectable"
|
||||||
@ -140,7 +140,7 @@ namespace bluetooth {
|
|||||||
* Sets the bluetooth transmit power between 0 (minimal) and 7 (maximum).
|
* Sets the bluetooth transmit power between 0 (minimal) and 7 (maximum).
|
||||||
* @param power power level between 0 (minimal) and 7 (maximum), eg: 7.
|
* @param power power level between 0 (minimal) and 7 (maximum), eg: 7.
|
||||||
*/
|
*/
|
||||||
//% parts=bluetooth weight=5 help=bluetooth/set-transmit-power
|
//% parts=bluetooth weight=5 help=bluetooth/set-transmit-power advanced=true
|
||||||
//% blockId=bluetooth_settransmitpower block="bluetooth set transmit power %power"
|
//% blockId=bluetooth_settransmitpower block="bluetooth set transmit power %power"
|
||||||
void setTransmitPower(int power) {
|
void setTransmitPower(int power) {
|
||||||
uBit.bleManager.setTransmitPower(min(MICROBIT_BLE_POWER_LEVELS-1, max(0, power)));
|
uBit.bleManager.setTransmitPower(min(MICROBIT_BLE_POWER_LEVELS-1, max(0, power)));
|
||||||
@ -151,7 +151,7 @@ namespace bluetooth {
|
|||||||
*/
|
*/
|
||||||
//% blockId=eddystone_stop_advertising block="bluetooth stop advertising"
|
//% blockId=eddystone_stop_advertising block="bluetooth stop advertising"
|
||||||
//% parts=bluetooth weight=10
|
//% parts=bluetooth weight=10
|
||||||
//% help=bluetooth/stop-advertising
|
//% help=bluetooth/stop-advertising advanced=true
|
||||||
void stopAdvertising() {
|
void stopAdvertising() {
|
||||||
uBit.bleManager.stopAdvertising();
|
uBit.bleManager.stopAdvertising();
|
||||||
}
|
}
|
||||||
|
6
libs/bluetooth/shims.d.ts
vendored
6
libs/bluetooth/shims.d.ts
vendored
@ -84,7 +84,7 @@ declare namespace bluetooth {
|
|||||||
/**
|
/**
|
||||||
* Advertise an Eddystone URL
|
* Advertise an Eddystone URL
|
||||||
* @param url the url to transmit. Must be no longer than the supported eddystone url length, eg: "https://pxt.io/"
|
* @param url the url to transmit. Must be no longer than the supported eddystone url length, eg: "https://pxt.io/"
|
||||||
* @param power power level between 0 and 7, e.g.: 7
|
* @param power power level between 0 and 7, eg: 7
|
||||||
* @param connectable true to keep bluetooth connectable for other services, false otherwise.
|
* @param connectable true to keep bluetooth connectable for other services, false otherwise.
|
||||||
*/
|
*/
|
||||||
//% blockId=eddystone_advertise_url block="bluetooth advertise url %url|with power %power|connectable %connectable"
|
//% blockId=eddystone_advertise_url block="bluetooth advertise url %url|with power %power|connectable %connectable"
|
||||||
@ -96,7 +96,7 @@ declare namespace bluetooth {
|
|||||||
* Sets the bluetooth transmit power between 0 (minimal) and 7 (maximum).
|
* Sets the bluetooth transmit power between 0 (minimal) and 7 (maximum).
|
||||||
* @param power power level between 0 (minimal) and 7 (maximum), eg: 7.
|
* @param power power level between 0 (minimal) and 7 (maximum), eg: 7.
|
||||||
*/
|
*/
|
||||||
//% parts=bluetooth weight=5 help=bluetooth/set-transmit-power
|
//% parts=bluetooth weight=5 help=bluetooth/set-transmit-power advanced=true
|
||||||
//% blockId=bluetooth_settransmitpower block="bluetooth set transmit power %power" shim=bluetooth::setTransmitPower
|
//% blockId=bluetooth_settransmitpower block="bluetooth set transmit power %power" shim=bluetooth::setTransmitPower
|
||||||
function setTransmitPower(power: number): void;
|
function setTransmitPower(power: number): void;
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ declare namespace bluetooth {
|
|||||||
*/
|
*/
|
||||||
//% blockId=eddystone_stop_advertising block="bluetooth stop advertising"
|
//% blockId=eddystone_stop_advertising block="bluetooth stop advertising"
|
||||||
//% parts=bluetooth weight=10
|
//% parts=bluetooth weight=10
|
||||||
//% help=bluetooth/stop-advertising shim=bluetooth::stopAdvertising
|
//% help=bluetooth/stop-advertising advanced=true shim=bluetooth::stopAdvertising
|
||||||
function stopAdvertising(): void;
|
function stopAdvertising(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user