But how can I detect if this value was successfully read by the connected central?
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?
My current idea is a multipart API:
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 onWrite event you could have different message types:
request a packet of data
acknowledge receipt of last packet of data, request a new one
acknowledge receipt of last packet of data and request a new one
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Yes, that's right, and you specify
notify:true
: http://www.espruino.com/Reference#l_NRF_updateServicesUnfortunately 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
onWrite
event you could have different message types: