Hi! As @fanoush says having a write to trigger a notification is probably the best bet.
Puck.js doesn't provide any onRead event, and as you say the softdevice doesn't appear to provide an event which we could hook onto. For the security event, do you mean BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST ? I'm not sure if you could actually rely on that to happen for every read?
I think so, if I could require authorization on every read then I could use this to know if a read is happening. Not sure how to configure security in Espruino to make this happen and if I would receive an NRF.on('security' event - that was the hope.
Edit: I don't see a JS event being fired for BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST in https://github.com/espruino/Espruino/blob/master/targets/nrf5x/bluetooth.c around line 1355 but I'm not that familiar with the Espruino source.
© Espruino, powered by microcosm.
Report a problem