ConnectableDeviceImpl
Implementation of ConnectableDevice
Parameters
The Identifier of the device
the initial DeviceInfoImpl known about the device
the ConnectionSettings to apply to the DeviceConnectionManager associated with this device
creates a DeviceConnectionManager to manage connecting this device
the CoroutineScope this device is running on]
creates a ConnectableDeviceStateFlowRepo to manage the device connection state
Constructors
Properties
A StateFlow of the latest DeviceInfo of the device
A Flow of the latest DeviceState of the device
Functions
Notifies the device that the BaseAdvertisementData has updated
The RemoteCharacteristic for serviceUUID/characteristicUUID of this ConnectableDevice, suspending until available.
The Flow of the RemoteCharacteristic for serviceUUID/characteristicUUID of this ConnectableDevice. Only emits after services have been discovered.
The RemoteCharacteristic for serviceUUID/characteristicUUID of this ConnectableDevice, or null if not available.
The Flow of the RemoteCharacteristic for serviceUUID/characteristicUUID of this ConnectableDevice, or null if not available.
Attempts to connect to the device. Cancelling this call tears down any in-flight connection attempt (CoreBluetooth has no connection timeout, so wrap this in e.g. withTimeoutOrNull to bound it).
The Flow of the ByteArray value of the RemoteCharacteristic for serviceUUID/characteristicUUID of this ConnectableDevice. Only emits after services have been discovered.
The Flow of the T value of the RemoteCharacteristic for serviceUUID/characteristicUUID of this ConnectableDevice. Only emits after services have been discovered.
The Flow of the ByteArray value of the RemoteCharacteristic for serviceUUID/characteristicUUID of this ConnectableDevice. Emits an empty ByteArray if not available.
The Flow of the T value of the RemoteCharacteristic for serviceUUID/characteristicUUID of this ConnectableDevice. Emits null if not available.
The RemoteDescriptor for serviceUUID/characteristicUUID/descriptorUUID of this ConnectableDevice, suspending until available.
The Flow of the RemoteDescriptor for serviceUUID/characteristicUUID/descriptorUUID of this ConnectableDevice. Only emits after services have been discovered.
The Flow of the RemoteDescriptor for serviceUUID/characteristicUUID/descriptorUUID of this ConnectableDevice, or null if not available.
Attempts to disconnect from the device
Gets a (Flow of) the list of Service associated with the ConnectableDevice This will automatically discover services if the device is in a ConnectableDeviceState.Connected.NoServices state. This differs from services in that the resulting flow will only emit once services are discovered.
Gets the (Flow of) the distance in meters between the scanner and a ConnectableDevice. To get a more stable result, this method will average the distance over the last averageOver results.
Gets a (Flow of) ConnectableDeviceState.Connected.DiscoveredServices from a ConnectableDevice This will automatically start discovering services if the device is in a ConnectableDeviceState.Connected.NoServices state.
Notifies the device that is has connected
Notifies the device that is has disconnected
Gets the (Flow of) the MTU from a ConnectableDevice
Attempts to request a MTU size for the ConnectableDevice from a ConnectableDevice
Notifies the device that the RSSI has updated
The RemoteService for serviceUUID of this ConnectableDevice, suspending until services have been discovered.
The Flow of the RemoteService for serviceUUID of this ConnectableDevice. Only emits after services have been discovered.
The RemoteService for serviceUUID of this ConnectableDevice, or null if not available.
The Flow of the RemoteService for serviceUUID of this ConnectableDevice, or null if not available.
Gets a (Flow of) the list of Service associated with the ConnectableDevice This will automatically discover services if the device is in a ConnectableDeviceState.Connected.NoServices state.
Attempts to request an update to the RSSI of the ConnectableDevice from a ConnectableDevice When this method completes, the devices should have had ConnectableDeviceState.Connected.readRssi called