pxt-calliope/docs/reference/bluetooth/stop-advertising.md
Juri Wolf 77ed2ccfb1
V4 updates (#210)
* update pxt.json files

* Fix button event enums

fixes https://github.com/microsoft/pxt-calliope/issues/206

* Fix Safari CSS Rule for iOS app

fixes https://github.com/microsoft/pxt-calliope/issues/205

* aprove preffered repos

should fix https://github.com/microsoft/pxt-calliope/issues/167
2023-01-11 09:51:27 -08:00

1006 B

Stop Advertising

Stops advertising URL via the Eddystone protocol over Bluetooth.

~hint

Eddystone

Bluetooth beacons are used to indicate proximity to a place or object of interest. Beacons use Bluetooth advertising to broadcast a small amount of data, which can be received and acted upon by anyone in range with a suitable device and software, typically a smartphone and application.

There are various beacon message formats, which define the way Bluetooth advertising packets are used as containers for beacon data. iBeacon is Apple's beacon message format. Eddystone comes from Google.

Read more at https://lancaster-university.github.io/microbit-docs/ble/eddystone/ .

~

bluetooth.stopAdvertising();

Example: stop advertising on button pressed

input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
    bluetooth.stopAdvertising();
})

See Also

advertise-url

bluetooth