GattClientAPI
Interface around native Android API. For real BLE connections it uses BluetoothGatt, whereas for mock device it utilizes MockEngine.
Properties
Parameter obtained from BleGattConnectOptions.autoConnect created during connection.
Parameter indicating that Gatt should be closed on first disconnected event.
A server device which has been used to establish connection. It can be either mock or real BLE server device.
Flow which emits BLE events. For real BLE connections it collects events from BluetoothGattCallback under the hood, for mock device it gets events from MockEngine.
Functions
Aborts reliable write. All writes to a characteristics which supports reliable writes will be reverted to a state preceding call to beginReliableWrite.
Begins reliable write. All writes to a characteristics which supports this feature will be transactional which means that they can be reverted in case of data inconsistency.
Clears services cache. It should invoke BluetoothGattCallback.onServiceChanged callback.
Releases connection resources. It should be called after disconnect succeeds.
Disables notifications on a characteristic.
Disconnects from a peripheral.
Discover services available on a remote server device.
Enables notifications on a characteristic.
Executes reliable write. All writes to a characteristics which supports reliable write will be executed and new values will be set permanently.
Internal function for propagating events to event shared flow. For internal usage only.
Reads value from a characteristic.
Reads value from a descriptor.
Reads rssi of a remote server device.
Connects to a peripheral after disconnection. Works only if BleGattConnectOptions.closeOnDisconnect is set to false.
Requests connection priority. It will influence latency and power consumption.
Requests mtu. Max value is 517, min 23.
Sets preferred phy for the connection.
Writes value to a characteristic.
Writes value to a descriptor.