Bluetooth Connection
class BluetoothConnection
Properties
Link copied to clipboard
A list with all notifiable characteristics
Link copied to clipboard
Called whenever a connection is lost
Link copied to clipboard
A list with all readable characteristics
Link copied to clipboard
Holds the discovered services
Link copied to clipboard
A list with all writable characteristics
Functions
Link copied to clipboard
fun observe(characteristic: String, interval: Long = 5000, owner: LifecycleOwner? = null, callback: OnCharacteristicValueChangeCallback<ByteArray>)
Observe a given characteristic
Link copied to clipboard
fun observeString(characteristic: String, interval: Long = 5000, owner: LifecycleOwner? = null, charset: Charset = Charsets.UTF_8, callback: OnCharacteristicValueChangeCallback<String>)
Observe a given characteristic
Link copied to clipboard
Request a MTU change Note: even if this method returns true, it is possible that the other device does not accept it, so Android will fallback to the previous negotiated MTU value. This will be reflected by the mtu variable.
Link copied to clipboard
Stops observing the characteristic