How to serve queued data via BLE? #3836
Replies: 2 comments 6 replies
-
|
Posted at 2021-08-18 by @gfwilliams
Yes, that's right, and you specify
Unfortunately I don't think there's any way of doing that at the moment. You could try just calling NRF.updateServices until you get an exception?
I think that's probably the best idea. On newer firmwares the device should have been able to negotiate a higher MTU so you can send 50 bytes each time (not 20) as well, which should make things easier. I guess on your
|
Beta Was this translation helpful? Give feedback.
-
I am also trying to push as much data as possible into the 20-byte buffer of a BLE characteristic and therefore I need to know if the lastest data has been sent so that I can send more. Does anyone know if anything has been added since then? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-08-18 by ChristianW
Let's say I have a Puck/Pixl/MDBT42Q collecting data in a queue.
Before any overflow happens this data should be polled via BLE by another system as BLE central.
So as BLE peripheral I use
NRF.setServices()to create someService/Characteristicsfor pushing out data.The thing is: How can I know if the central actually read the data so I can remove it from my queue?
For the other direction
onWriteis a synchronous API for writing data back, but for reading there is only:notify: trueand/orindicate: truewhich is documented as notify + ACK.But how does it work?
As peripheral I am supposed to call
NRF.updateServices()and set a newvalue.But how can I detect if this value was successfully read by the connected central?
How often should I call
updateService()in case the queue got filled up a bit and there areNitems waiting?My current idea is a multipart API:
onWriteso the central can request the next itemupdateServices()If the queue entries have some kind of timestamp or sequence number I can assume that all previous entries are read already and safely remove them.
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions