From aa149f23da62e22bed50b2af8d90b1fe31c7d883 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 3 Nov 2023 14:15:32 -0500 Subject: [PATCH] Update BLE for version 2.0 (#42) * Update BLE for version 2.0 * adjust * Update src/ble.md * Update src/ble.md --- src/ble.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/ble.md b/src/ble.md index 6a244f9..2df40b0 100644 --- a/src/ble.md +++ b/src/ble.md @@ -28,9 +28,12 @@ If the gadget is unable to connect an error is returned. If the gadget required The client is able to send an `identify` command to the Improv service if it is in the states "Require Authorization" and "Authorized". When received, and enabled, the gadget will identify itself, like playing a sound or flashing a light. It is up to the gadget to decide if and what interaction to pick. -## Bluetooth LE Service +## Revision history -Service UUID: `00467768-6228-2272-4663-277478268000` +- 1.0 - Initial release +- 2.0 - Added Service Data `4677` + +## GATT Services ### Characteristic: Capabilities @@ -145,3 +148,29 @@ This characteristic is where the client can read results from the RPC service if | X...Y | String 2 | | ... | etc | | last byte | Checksum - A simple sum checksum keeping only the LSB | + +## Bluetooth LE Advertisement + +The device MUST advertise the Service UUID. + +Service UUID: `00467768-6228-2272-4663-277478268000` + +With version 2.0 of the specification: + +- The Service Data and Service UUID MUST be advertised periodically and when the state changes. +- The Service Data and Service UUID MUST be in the same advertisement. +- The Service Data and Service UUID MUST NOT be in the scan response or require active scans. +- If the device cannot fit all of its advertising data in 31 bytes, it should cycle between advertising data. + +### Service Data format + +Service Data UUID: `4677` (`00004677-0000-1000-8000-00805f9b34fb`) + +| Byte | Description | +| --------- | ----------------------------------------------------- | +| 1 | Current state | +| 2 | Capabilities | +| 3 | 0 (RESERVED) | +| 4 | 0 (RESERVED) | +| 5 | 0 (RESERVED) | +| 6 | 0 (RESERVED) |