triggerNotification

fun triggerNotification(properties: Set<CharacteristicProperty.Notifiable> = setOf(CharacteristicProperty.Notify), encrypted: Boolean = false, toByteArray: Trigger.() -> ByteArray)

Makes this LocalCharacteristic a LocalCharacteristic.Notifiable and automatically sends a ByteArray notification upon Trigger This method can only be called once.

Parameters

properties

the CharacteristicProperty.Notifiable of the characteristic. Must not be empty

encrypted

true if subscribing to the characteristic should be encrypted.

toByteArray

method to convert the Trigger to a ByteArray


fun triggerNotification(properties: Set<CharacteristicProperty.Notifiable> = setOf(CharacteristicProperty.Notify), encrypted: Boolean = false, serializationStrategy: SerializationStrategy<Trigger>, bluetoothFormat: BluetoothFormat = BluetoothFormat)

Makes this LocalCharacteristic a LocalCharacteristic.Notifiable and automatically sends a ByteArray notification upon Trigger This method can only be called once.

Parameters

properties

the CharacteristicProperty.Notifiable of the characteristic. Must not be empty

encrypted

true if subscribing to the characteristic should be encrypted.

serializationStrategy

the SerializationStrategy to use to encode the Trigger to a ByteArray

bluetoothFormat

the BluetoothFormat to use to encode the Trigger to a ByteArray