DefaultBluetoothGattWrapper

Default implementation of BluetoothGattWrapper

Parameters

gatt

the BluetoothGatt being wrapped

Constructors

Link copied to clipboard
constructor(gatt: BluetoothGatt)

Functions

Link copied to clipboard
open override fun close()

Close connection to the Bluetooth Gatt server

Link copied to clipboard
open override fun connect(): Boolean

Connect to the Bluetooth device

Link copied to clipboard
open override fun disconnect()

Disconnects the current connection or cancels the current attempt if it is in progress

Link copied to clipboard
open override fun discoverServices(): Boolean

Discovers services offered by a remote device as well as their characteristics and descriptors.

Link copied to clipboard
open override fun readCharacteristic(wrapper: CharacteristicWrapper): Boolean

Reads the value of the CharacteristicWrapper from the device

Link copied to clipboard
open override fun readDescriptor(wrapper: DescriptorWrapper): Boolean

Reads the value of the DeviceWrapper from the device

Link copied to clipboard
open override fun readRemoteRssi(): Boolean

Reads the RSSI value

Link copied to clipboard
open override fun requestMtu(mtu: MTU): Boolean

Request a MTU size

Link copied to clipboard

Enable or disable notifications for a given CharacteristicWrapper

Link copied to clipboard
open override fun writeCharacteristic(wrapper: CharacteristicWrapper, value: ByteArray): Boolean

Writes a value to the CharacteristicWrapper from the device

Link copied to clipboard
open override fun writeDescriptor(wrapper: DescriptorWrapper, value: ByteArray): Boolean

Writes a value to the DescriptorWrapper from the device