bindCharacteristic

abstract fun <R> R.bindCharacteristic(uuid: UUID, update: T.(R) -> T = { this }, binding: RemoteCharacteristicBinding.RequiresServicesDiscovered<R>.() -> Unit)

Binds an object of type R to the RemoteCharacteristic at a given UUID whenever it is available and updates the object whenever it changes.

Parameters

uuid

the UUID of the RemoteCharacteristic to bind to

update

the function that updates the object whenever the bound object changes

Type Parameters

R

the type of the object to bind to


open fun <R> R.bindCharacteristic(uuidString: String, update: T.(R) -> T = { this }, binding: RemoteCharacteristicBinding.RequiresServicesDiscovered<R>.() -> Unit)

Binds an object of type R to the RemoteCharacteristic at a given UUID whenever it is available and updates the object whenever it changes.

Parameters

uuidString

the string of the UUID of the RemoteCharacteristic to bind to

update

the function that updates the object whenever the bound object changes

Type Parameters

R

the type of the object to bind to

Throws