bluejay
bluejay copied to clipboard
Feature Request - Indications and Notifications
Summary: I need to be able to distinguish between incoming BLE indications and incoming BLE notifications. I can't find a way to do this now, with the current BlueJay::listen methods. I would greatly appreciate having this feature added. You could use the following logic, then expose a new listen method, or extend ReadResult to indicate which it is.
func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {
let isIndication = characteristic.isNotifying && characteristic.properties.contains(CBCharacteristicProperties.indicate) && !characteristic.properties.contains(CBCharacteristicProperties.notify)
let isNotification = characteristic.isNotifying && characteristic.properties.contains(CBCharacteristicProperties.notify) && !characteristic.properties.contains(CBCharacteristicProperties.indicate)
// ...