even-realities / EvenDemoApp

BSD 2-Clause "Simplified" License
76 stars 10 forks source link

Device Order (DEVICE-TO-HOST) long press notification. #9

Closed FilipposPirpilidis closed 2 weeks ago

FilipposPirpilidis commented 2 weeks ago

According to the README, on a long press I should receive the device order 0xF5 with the parameter 0x17. However, I don't get any response on long press. My firmware version is the latest, v1.3.4.

iOSliuh commented 2 weeks ago

According to the README, on a long press I should receive the device order 0xF5 with the parameter 0x17. However, I don't get any response on long press. My firmware version is the latest, v1.3.4.

Long press the left-side TouchBar? If this is the case, it is recommended that you check the Bluetooth connection status first.

FilipposPirpilidis commented 2 weeks ago

According to the README, on a long press I should receive the device order 0xF5 with the parameter 0x17. However, I don't get any response on long press. My firmware version is the latest, v1.3.4.

Long press the left-side TouchBar? If this is the case, it is recommended that you check the Bluetooth connection status first.

Successfully connected the left and right devices. Successfully sent strings to the screen and maintained the Bluetooth connection, verified through the heartbeat process. However, the host device still doesn’t receive anything on a long press.

FilipposPirpilidis commented 2 weeks ago

Oh! Found it: func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) { guard let data = characteristic.value else { return } handleNotification(from: peripheral, data: data) }

It looks like the problem was here. The update value is coming in, but the guard statement is preventing it from proceeding. Sorry for the confusion—I’ll figure out what’s going on. Thanks!

iOSliuh commented 2 weeks ago

Oh! Found it: func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) { guard let data = characteristic.value else { return } handleNotification(from: peripheral, data: data) }

It looks like the problem was here. The update value is coming in, but the guard statement is preventing it from proceeding. Sorry for the confusion—I’ll figure out what’s going on. Thanks!

That's ok! Glad you solved the problem now.

FilipposPirpilidis commented 2 weeks ago

Worked perfectly! :)