BleConnection
Encapsulates a BLE connection to a BleDevice.
Inheritors
Properties
A flow of BleConnectionState changes. StateFlow semantics ensure the latest state is always observable and distinct-equals deduplication avoids spurious re-emissions.
A flow of the current device. StateFlow semantics: replays the latest value to new collectors and conflates rapid updates.
Functions
Disconnects from the current device.
Returns the maximum write value length for the given write type, or null if unknown.
Executes setup after the requested BLE profile is available. This is shared by radio, OTA, and DFU flows, so implementations should keep profile-entry setup bounded and avoid transfer-hot-path work here when a caller can reuse an already discovered BleService.
Requests the platform to return to balanced BLE connection priority (default ~30–50 ms interval). Call after latency-sensitive operations (initial config drain, DFU) to reduce ongoing battery draw. Default implementation returns false for platforms that don't support it.
Asks the platform to switch to a high-throughput / low-latency BLE connection priority for the duration of the connection. Used by latency-sensitive flows like firmware updates. Returns true if the request was issued. Default implementation returns false for platforms that don't support it.