From adef3a64870458cd10119961b6d622e4de6088bb Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Wed, 30 Nov 2016 04:19:17 -0800 Subject: [PATCH] updated docs --- docs/reference/bluetooth/advertise-url.md | 6 +++++- docs/reference/bluetooth/stop-advertising.md | 10 +++++++++- libs/bluetooth/bluetooth.cpp | 8 ++++---- libs/bluetooth/shims.d.ts | 8 ++++---- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/docs/reference/bluetooth/advertise-url.md b/docs/reference/bluetooth/advertise-url.md index e969d21c..9a0a808d 100644 --- a/docs/reference/bluetooth/advertise-url.md +++ b/docs/reference/bluetooth/advertise-url.md @@ -29,9 +29,13 @@ bluetooth.advertiseUrl("https://pxt.microbit.org/", 7); ### Example: Broadcast a secret code ```blocks -bluetooth.advertiseUrl("https://pxt.io?secret=42") +bluetooth.advertiseUrl("https://pxt.io?secret=42", 7); ``` ## See Also [stop-advertising](/reference/bluetooth/stop-advertising) + +```package +bluetooth +``` \ No newline at end of file diff --git a/docs/reference/bluetooth/stop-advertising.md b/docs/reference/bluetooth/stop-advertising.md index 27a2ce29..1f0c41c4 100644 --- a/docs/reference/bluetooth/stop-advertising.md +++ b/docs/reference/bluetooth/stop-advertising.md @@ -18,9 +18,17 @@ Read more at https://lancaster-university.github.io/microbit-docs/ble/eddystone/ ## ~ ```sig -bluetooth.stop-advertising(); +bluetooth.stopAdvertising(); ``` ## See Also [advertise-url](/reference/bluetooth/advertise-url) + +```blocks +bluetooth.stopAdvertising(); +``` + +```package +bluetooth +``` \ No newline at end of file diff --git a/libs/bluetooth/bluetooth.cpp b/libs/bluetooth/bluetooth.cpp index fc2add8e..82424b74 100644 --- a/libs/bluetooth/bluetooth.cpp +++ b/libs/bluetooth/bluetooth.cpp @@ -127,8 +127,8 @@ namespace bluetooth { * @param url the url to transmit. Must be no longer than the supported eddystone url length * @param power power level between 0 and 7, e.g.: 7 */ - //% blockId=eddystone_advertise_url block="eddystone advertise url %url|power %powerLevel" - //% parts=bluetooth + //% blockId=eddystone_advertise_url block="advertise url %url|power %power" + //% parts=bluetooth weight=11 //% help=bluetooth/advertise-url void advertiseUrl(StringData* url, int power) { int8_t level = CALIBRATED_POWERS[min(7, max(0, power))]; @@ -138,8 +138,8 @@ namespace bluetooth { /** * Stops advertising Eddystone end points */ - //% blockId=eddystone_stop_advertising block="eddystone stop advertising" - //% parts=bluetooth + //% blockId=eddystone_stop_advertising block="stop advertising" + //% parts=bluetooth weight=10 //% help=bluetooth/stop-advertising void stopAdvertising() { uBit.bleManager.stopAdvertising(); diff --git a/libs/bluetooth/shims.d.ts b/libs/bluetooth/shims.d.ts index 1df83b16..adce4f03 100644 --- a/libs/bluetooth/shims.d.ts +++ b/libs/bluetooth/shims.d.ts @@ -86,16 +86,16 @@ declare namespace bluetooth { * @param url the url to transmit. Must be no longer than the supported eddystone url length * @param power power level between 0 and 7, e.g.: 7 */ - //% blockId=eddystone_advertise_url block="eddystone advertise url %url|power %powerLevel" - //% parts=bluetooth + //% blockId=eddystone_advertise_url block="advertise url %url|power %power" + //% parts=bluetooth weight=11 //% help=bluetooth/advertise-url shim=bluetooth::advertiseUrl function advertiseUrl(url: string, power: number): void; /** * Stops advertising Eddystone end points */ - //% blockId=eddystone_stop_advertising block="eddystone stop advertising" - //% parts=bluetooth + //% blockId=eddystone_stop_advertising block="stop advertising" + //% parts=bluetooth weight=10 //% help=bluetooth/stop-advertising shim=bluetooth::stopAdvertising function stopAdvertising(): void; }