Bluetooth Low Energy Settings for Alexa Gadgets
This topic describes the settings that your gadget must use to communicate with an Echo device over Bluetooth Low Energy (BLE).
For a description of the pairing, connection, and reconnection communication flows that use these settings, see the following topics:
- Pairing and Connection Flow for Alexa Gadgets over Bluetooth Low Energy
- Reconnection Flow for Alexa Gadgets over Bluetooth Low Energy
At the appropriate steps, the communication flows refer to this topic for the settings that the gadget must use to successfully complete the step.
For Alexa Gadgets Toolkit issues related to Bluetooth, see Bluetooth on the known issues page.
- Advertisement packet for device discovery
- GATT settings
- Bluetooth addressing schemes
- Protocol version packet
Advertisement packet for device discovery
When a user puts an Echo device into pairing mode, the Echo device scans for Bluetooth devices within range. For the Echo device to find the gadget over BLE, the gadget must broadcast advertisement (ADV) packets that contain the data shown in this section. Each byte is stored in little-endian order.
For details on data format types that you can use for this packet, see Supplement to the Bluetooth Core Specification. If your gadget supports other BLE services, we recommend that you use the "Multiple ADV" feature.
For an example of an ADV packet, see the sample code described in Bluetooth Low Energy Handshake Sample Code.
|0||Length of the Flags AD Type.||0x02|
|1||The Flags AD Type identifier.||0x01|
|2||0x06 if the gadget supports BLE only. 0x1A if the gadget supports both BR/EDR and BLE.||0x06 is currently the only supported value.|
|3||Length of the list of 16-bit service class UUID AD type identifiers.||0x03|
|4||List of 16-bit service class UUID AD type identifiers.||0x03|
|5-6||16-bit UUID for Alexa.||0xFE03|
|7||Length of the Service Data AD Type (23 bytes)||0x17|
|8||Service Data AD Type identifier.||0x16|
|9-10||16-bit UUID for Alexa.||0xFE03|
|11-12||Vendor ID assigned by the Bluetooth SIG.||
You can find a list of company IDs on the Bluetooth site. If your gadget does not have this, you can use 0x0171.
|13||Reserved for future use.||0x00|
|15-30||Reserved for future use.||0x00|
This section contains the Generic Attribute Profile (GATT) settings that the gadget must use for data communication for transmit (Tx) and receive (Rx). The Tx channel transmits data from an Echo device to a gadget. The Rx channel transmits data from a gadget to an Echo device. Also, to enable notifications from an Echo device, the gadget must support a descriptor on an Rx characteristic.
|Characteristic Tx||F04EB177-3005-43A7-AC61-A390DDF83076||----||Write (Encrypted)||Write|
|Characteristic Rx||2BEEA05B-1879-4BB4-8A2F-72641F82420B||----||Read (Encrypted)||Notify|
Bluetooth addressing schemes
All gadgets that support BLE (either dual mode or LE only) should use the following addressing scheme for BLE advertisement.
|Device type||Preferred transport||Address type||Advertisement type|
|Dual mode||LE (GATT)||Resolvable private random||Connectable|
|LE only||LE (GATT)||Resolvable private random||Connectable|
Protocol version packet
This section contains the format of the protocol version (PV) packet that the gadget must send the Echo device. The Echo device will not send any packets to the gadget until the Echo device receives the PV packet. The PV packet is 20 bytes long and each byte is stored in big-endian order.
For an example of a PV packet, see the sample code described in Bluetooth Low Energy Handshake Sample Code.
Maximum transmission unit (MTU). This value is the maximum length of the data packets that the gadget and the Echo device exchange over BLE.
In the PV packet, the gadget should specify the MTU value that the gadget and the Echo device negotiated during the GATT discovery phase. If the gadget and the Echo device were unable to negotiate the MTU prior to the PV packet, the gadget should set this value to zero. Maximum: 515
|2||Maximum transactional data size. That is, the maximum size of data chunks that the gadget can send or receive.||Depends on available buffer sizes|