Hi all,
i'm trying to implement BLE with an ESP32 chip.
I'm waiting that DataAvailable routine starts, but nothing
All characteristich are enabled for notify (see nRF screenshot)
when I try to enable notify in my app
I always have SetNotify failed.
If I don't use try catch I have this error:
In this thread: https://www.b4x.com/android/forum/threads/ble-setnotify.78403/
Erel says
what mistake can there be?
i'm trying to implement BLE with an ESP32 chip.
I'm waiting that DataAvailable routine starts, but nothing
All characteristich are enabled for notify (see nRF screenshot)
when I try to enable notify in my app
B4X:
Try
manager.SetNotify(S, C300_comando, True)
Log("Notify ok "&C300_comando)
Catch
Log("SetNotify failed "&C300_comando)
End Try
If I don't use try catch I have this error:
B4X:
starter_manager_connected (java line: 218)
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothGattDescriptor.setValue(byte[])' on a null object reference
at anywheresoftware.b4a.objects.BleManager2.setNotify(BleManager2.java:322)
at anywheresoftware.b4a.objects.BleManager2.SetNotify(BleManager2.java:311)
at b4a.example.starter._manager_connected(starter.java:218)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.BA$2.run(BA.java:370)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:7000)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
In this thread: https://www.b4x.com/android/forum/threads/ble-setnotify.78403/
Erel says
But on nRF screenshot we can see NOTIFYBased on the error message the characteristic you specified doesn't support notifications.
what mistake can there be?