ConnectionProvider

class ConnectionProvider(val bufferSize: Int)

Provides a connection parameters.

MTU and connection state is shared between many components. To avoid propagating those values changes to all of the components, the ConnectionProvider is shared in a constructor.

Constructors

Link copied to clipboard
constructor(bufferSize: Int)

Properties

Link copied to clipboard
Link copied to clipboard

Returns last GattConnectionState without it's status.

Link copied to clipboard

Returns last observed GattConnectionState with it's corresponding status BleGattConnectionStatus.

Link copied to clipboard

Returns whether a device is connected.

Link copied to clipboard
val mtu: StateFlow<Int>

Most recent MTU value.

Functions

Link copied to clipboard
fun availableMtu(writeType: BleWriteType): Int

Calculates available size for write operation when a particular writeType is going to be used.

Link copied to clipboard
fun updateMtu(mtu: Int)

Updates MTU value and notifies observers.