Bluetooth Beacons are hardware transmitters - a class of Bluetooth low energy (LE) devices that broadcast their identifier to nearby portable electronic devices. The technology enables smartphones, tablets and other devices to perform actions when in close proximity to a beacon. Bluetooth Framework includes feature that allows your application to monitor Bluetooth LE Beacons and to advertise as Bluetooth LE Beacon.
Monitoring Bluetooth LE Beacons
There is a class that allows your application to monitor Bluetooth LE devices and capture its advertisement frames. The class can decode the following Bluetooth LE Advertisement frames:
- Appearance
- Basic Information
- Extended Information
- 16 bit Service Data
- 32 bit Service Data
- 128 bit Service Data
- 16 bit Solicitation Service
- 32 bit Solicitation Service
- 128 bit Solicitation Service
- TX Power
- 128 bit UUID
- Alt Beacon
- Eddystone TLM
- Eddystone UID
- Eddystone URL
- iBeacon (Proximity Beacon)
- Microsoft CDP Beacon
- Drone Remote ID
- Manufacturer Raw
Other frames are reported to an application as raw bytes array so application can handle any type of frames.
The library supports Bluetooth LE Beacons Monitoring feature on Windows 10 and above platforms with Microsoft Bluetooth drivers and on any Windows platforms with BLED112 USB Bluetooth dongle.
Advertising As Bluetooth LE Beacons
Bluetooth Framework includes a class that can switche your application into Bluetooth LE Advertiser mode. The class allows to advertise few predefined advertisements as well as any custom advertisement (there are some restrictions described below).
Supported Advertisement Types
The following advertisement types are reserved and are not allowed:
Data Type | Constant (wclUUIDs} | Description |
---|---|---|
0x00 | LE_GAP_AD_TYPE_NONE | Empty flags |
0x01 | LE_GAP_AD_TYPE_FLAGS | Flags |
0x08 | LE_GAP_AD_TYPE_LOCAL_NAME_SHORT | Shortened Local Name |
0x09 | LE_GAP_AD_TYPE_LOCAL_NAME_COMPLETE | Complete Local Name |
0x1B | LE_GAP_AD_TYPE_ADDRESS | LE Bluetooth Device Address |
0x1C | LE_GAP_AD_TYPE_ROLE | LE Role |
The following advertisement types are system-reserved and are not allowed if the advertisement is used with Microsoft Bluetooth driver:
Data Type | Constant (wclUUIDs} | Description |
---|---|---|
0x02 | LE_GAP_AD_TYPE_SERVICES_16_MORE | Incomplete List of 16-bit Service UUIDs |
0x03 | LE_GAP_AD_TYPE_SERVICES_16_ALL | Complete List of 16-bit Service Class UUIDs |
0x04 | LE_GAP_AD_TYPE_SERVICES_32_MORE | Incomplete List of 32-bit Service UUIDs |
0x05 | LE_GAP_AD_TYPE_SERVICES_32_ALL | Complete List of 32-bit Service Class UUIDs |
0x06 | LE_GAP_AD_TYPE_SERVICES_128_MORE | Incomplete List of 128-bit Service UUIDs |
0x07 | LE_GAP_AD_TYPE_SERVICES_128_ALL | Complete List of 128-bit Service Class UUIDs |
0x0A | LE_GAP_AD_TYPE_TXPOWER | Tx Power Level |
0x0D | LE_GAP_AD_TYPE_COD | Class of Device |
0x0E | LE_GAP_AD_TYPE_PAIRING_HASH_C | Simple Pairing Hash C192 |
0x0F | LE_GAP_AD_TYPE_PAIRING_RAND_R | Simple Pairing Randomizer R192 |
0x10 | LE_GAP_AD_TYPE_DEVICE_ID | Security Manager TK Values |
0x11 | LE_GAP_AD_TYPE_SM_OOB_FLAGS | Security Manager Out-of-Band Flags |
0x12 | LE_GAP_AD_TYPE_CON_INTERVALS | Slave Connection Interval Range |
0x17 | LE_GAP_AD_TYPE_PUBLIC_TARGET_ADDRESS | Public Target Address |
0x18 | LE_GAP_AD_TYPE_RANDOM_TARGET_ADDRESS | Random Target Address |
0x19 | LE_GAP_AD_TYPE_APPEARANCE | Appearance |
0x1A | LE_GAP_AD_TYPE_ADV_INTERVAL | Advertising Interval |
0x1D | LE_GAP_AD_TYPE_PAIRING_HASH_C_256 | Simple Pairing Hash C256 |
0x1E | LE_GAP_AD_TYPE_PAIRING_RAND_R_256 | Simple Pairing Randomizer R256 |
0x3D | LE_GAP_AD_TYPE_3D_INFO | 3D Information Data |
Extended Advertisement
If your hardware supports Bluetooth 5 and above Bluetooth Framework allows to enable the Extended Advertisement Format when used with Microsoft Bluetooth drivers on Windows 10 and above. The Extended Advertisement Format can be enabled by settings the UseExtendedAdvertisement property of the Bluetooth LE Advertiser. When this property is set to True the three additional properties are used during advertisement:
- Anonymous
If set to True the device address is not included in the advertisement heade. - IndlucdeTxRssi
If set to True the transmit power level is included in the advertisement header. - PrefferedTxRssi
If enabled (to disable set the property's value to -127 requests that the radio use the indicated transmit power level for the advertisement.
If your application enables the Extened Advertisement by setting the UseExtendedAdvertisement property to True but your hardware or OS does not support this feature the WCL_E_BLUETOOTH_LE_EXT_ADV_NOT_SUPPORTED error will be returned when an application starts the advertismeent.
Sample Application
The Bluetooth Framework package includes the Beacons sample application that shows how to enable Bluetooth LE Beacon advertising and monitoring. This feature is supported on Windows 10 and above platforms with Microsoft Bluetooth drivers and on any Windows platforms with BLED112 USB Bluetooth dongle. Should you have any questions please do not hesitate to contact us.
Additional Resources
- Download Bluetooth Framework
- BLED112 USB Bluetooth dongle
- Bluetooth LE scan parameters
- Bluetooth LE sniffer
- Drone Remote ID