BlueLink
BlueLink class - Acts as an interface between the BlueLink library and implementers.
Handles device discovery, connection management, and BLE read/write operations, abstracting the details of BLE communication and fragmentation.
If a read or write operation is performed for a characteristic that is not present in the device, an appropriate BlueLinkOpFailReason will be returned. Implementation on handling of these failed scenarios is left up to the implementors. Once the implementor has handled the failing operation, it must call completeOperation() to mark the failed operation as complete
Functions
Returns the BLE peripheral currently tracked for deviceId (discovered during scan), or null if the lock has not been seen yet. Used by the Android manufacturing harness to resolve Pi CONNECT commands to a real BluetoothDevice before connectTo.
Reads data from a characteristic on the specified peripheral. Performs a BLE read operation from the peripheral while also maintaining an active BLE Read operation. To be used in places where multiple BLE reads are required for an operation to complete (eg: fragmented proxy read)
INTERNAL TESTING ONLY, DO NOT USE Issues a single GATT read on the manufacturing data characteristic (6C4D, see UUIDUtils.ManufacturingCharUUID). Results are delivered to BlueLinkEventListener.onCharacteristicRead after BlueLinkPeripheralListenerImpl routes 6C4D payloads without treating them as heartbeat protobuf. The Android manufacturing bridge polls this on a fixed interval (e.g. 100ms), buffers payloads, and sends them to the Pi in one batch when the manufacturing session ends.
Configures indications for a given characteristic.
INTERNAL TESTING ONLY, DO NOT USE Manufacturing / bench capture: When active is true, marks the tracked lock so BlueLink behaves like a “connection requested” session: DTQHandlers will not auto-disconnect when the operation queue is empty (same idea as a lock asking to stay connected via advertisement). Also sets Device.suppressConnectionTimeoutForManufacturing so the central connection monitor does not tear down a long-running GATT session after the normal idle timeout.
Configures notifications for a given characteristic.
Writes data to a characteristic on the specified peripheral, provided characteristic exists on peripheral to write
Starts scanning for BLE peripherals.
Actively begins the heartbeat procedure for all connected devices at an interval specified in BlueLink.
Stops scanning for BLE peripherals.
To be invoked when all devices are disconnected from the bridge; stops any ongoing heartbeat job
Purely writes the payloads to the provided device, provided that the characteristic to write exists on the device. To be used or simple write operations (write single payload to char)