BleDataEncoder

fun interface BleDataEncoder<in T>

Encodes a value of type T directly into BleData.

Use for server-side operations (GattServer.notify, GattServer.indicate) where BleData is the native currency, avoiding the intermediate ByteArray allocation that BleEncoder would require.

Functions

Link copied to clipboard

Bridge a BleDataEncoder to produce ByteArray via BleData.toByteArray.

Link copied to clipboard
fun <A, B> BleDataEncoder<B>.contramap(transform: (A) -> B): BleDataEncoder<A>

Transform the input of this BleData encoder.

Link copied to clipboard
abstract fun encode(value: T): BleData