bluejay icon indicating copy to clipboard operation
bluejay copied to clipboard

Feature Request - Indications and Notifications

Open beachcitiessoftware opened this issue 1 year ago • 0 comments

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)

// ...

beachcitiessoftware avatar Jun 23 '23 20:06 beachcitiessoftware