-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impossible to write into server #3
Comments
onPartialWrite works, but onWrite never raise |
Hi. Do you use the "Full GATT Server Example (Peripheral)" as is in the readme? |
yes, without any changes |
Hmm that works fine for me when I just tested. You could try to have "sudo btmon" running in another terminal. Then start and run the example, connect through nRF Connect and write something to that characteristic. By doing so I get the following output in btmon:
The javascript console prints:
|
javascript console
btmon `
` using centos 8 on raspberry, instaled in node_modules
|
sorry now it starts to working, really dont understand it is few hours i tested again and again and now i get response, the only think what i did was to start btmon |
Note that, as written in the documentation at https://github.com/Emill/node-ble-host/blob/master/docs/api/gatt-server.md#characteristiconpartialwriteconnection-needsresponse-offset-value-callback, |
i know, but i tested before without partial, partial was just test if any write is made |
Not sure but maybe if you have modified the gatt db your phone could potentially incorrectly have cached the old gatt db so it becomes out of sync and therefore writes could fail. Otherwise if you can reproduce the issue I would appreciate a full btmon log. |
thanks, now it works P.S.: is there an example how the communication architecture should be build if i need answer? i sent some message, for example command to list some values, and i need the anser to get me the list which i want to render on phone so i should note that i am waiting for list, and waiting for read callback? after i write command like LIST? when i received callback value of list, so i delete that i am waiting for and can continue in communication? |
A common approach is to use "Write Without Response" for the "commands" and then to use "Notifications" for delivering the response. Just make sure you have negotiated a large enough MTU so the response fits within the notification. |
There is no output from console.log in service 22222222-3333-4444-5555-666666666669.
I assume that the write data was not received? How to debug this?
For testing i used BLE scanner and nRF Connect.
The text was updated successfully, but these errors were encountered: