don / cordova-plugin-ble-central

Bluetooth Low Energy (BLE) Central plugin for Apache Cordova (aka PhoneGap)
Apache License 2.0
942 stars 603 forks source link

Starting to receive notifications fails #789

Closed Juarrow closed 4 months ago

Juarrow commented 3 years ago

(I'm using Android 9)

Every time i try to subscribe to notifications i get the error

Set notification failed for 000036f6-0000-1000-8000-00805f9b34fb

But when i register for notifications from within a native test app on the same characteristic, it works just fine.

SSGitAdmin commented 3 years ago

I have used the startNotification successfully with devices implementing BLE 4.1 and 4.2 on Android 8.1 platform. When I use the same code in Android platform 9 or above, the BLE 4.1 device does not return anything (success or error) - the BLE 4.2 device continues to work fine (it is not the location permission etc. which are set).

Both the BLE 4.1 and 4.2 device scan, connect, disconnect, read, write works. This issue is only for the startNotification. Not sure what might be different.

nolife08021 commented 3 years ago

@SSDevAdmin @Juarrow I facing the same issue, did you guys fixed it?

SSGitAdmin commented 3 years ago

I temporarily did a timer based loop read of the characteristics (they were read and notify)... not the desired solution, but was a workaround. The original notification issue is still persisting.

nolife08021 commented 3 years ago

oh, okay i will try it if still haven't found any solution. thanks

lon2347 commented 3 years ago

By using Wireshark, I found the value of notifiction is still "0" not "1"after running ble.startnotification() on my andriod phone, that means notify is disable and any data can not be received from periperal, seems function ble.startnotification did not set CCCD descriptor.

peitschie commented 1 year ago

Is this issue still occurring for anyone?

peitschie commented 4 months ago

Closing due to inactivity