When specifying a service, you can add an onWrite handler function which will get called whenever the service is written to (obviously it also has to be set to writable as well)
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.
Take a look at the examples on http://www.espruino.com/Reference#l_NRF_setServices
When specifying a service, you can add an
onWrite
handler function which will get called whenever the service is written to (obviously it also has to be set towritable
as well)