write

Attempts to write a ByteArray to the attribute on the device and suspends until the write completes.

Return

the GattResponse.WriteResponse received from the remote device.

Parameters

newValue

the ByteArray to write.


suspend fun <T> write(serializationStrategy: SerializationStrategy<T>, bluetoothFormat: BluetoothFormat = BluetoothFormat, newValue: T): GattResponse.WriteResponse

Attempts to write a value of T to the attribute on the device and suspends until the write completes.

Return

the GattResponse.WriteResponse received from the remote device.

Parameters

serializationStrategy

the SerializationStrategy to use to serialize the value.

bluetoothFormat

the BluetoothFormat to use to serialize the value.

newValue

the T to write.

Type Parameters

T

the type of the data object to write.


inline suspend fun <T> write(bluetoothFormat: BluetoothFormat = BluetoothFormat, newValue: T): GattResponse.WriteResponse

Attempts to write a value of T to the attribute on the device and suspends until the write completes.

Return

the GattResponse.WriteResponse received from the remote device.

Parameters

bluetoothFormat

the BluetoothFormat to use to serialize the value.

newValue

the T to write.

Type Parameters

T

the type of the data object to write.