pxt-calliope/docs/reference/bluetooth/advertise-url.md
Owen Brotherwood 30211aa006 Correction for max. length of advertised url to 17
https://github.com/google/eddystone/tree/master/eddystone-url#frame-specification states 1-17
When one makes a general google for the max length, some have written 18 and some 17 :(
The difference could lie in the https://github.com/google/eddystone/tree/master/eddystone-url#url-scheme-prefix which adds an extra byte but it's use is to in someway allow for more bytes in the 1-17.
The implementation in the micro:bit Lancaster is unknown as to how the url-scheme-prefix is or is not used: there does not seem to be a scheme for "Just take the 1-17" for the url.

At the moment, "play it safe" and write 17 ?
2016-12-06 20:51:44 +01:00

1.2 KiB

Avertise Url

Advertises a 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.advertiseUrl("https://pxt.microbit.org/", 7);

Parameters

  • url - a string containing the URL to broadcast, at most 17 characters long
  • power - a number representing the power level between 0 (short) and 7 (maximum range).

Example: Broadcast a secret code

bluetooth.advertiseUrl("https://pxt.io?secret=42", 7);

See Also

stop-advertising

bluetooth