Sample that uses NRF.setServices and NRF.updateServices on Puck.js to publish temperature
var C = { set : "SET", update : "UPDATE", every_30_sec : 30000 }; function publishTemp(cmd) { //digitalPulse(LED2, 1, 200); if (cmd == C.set) NRF.setServices({ 0x1809 : { // Health Thermometer 0x2A6E: { readable: true, broadcast: true, value : [E.getTemperature().toFixed(2)] }}}); if (cmd == C.update) NRF.updateServices({ 0x1809 : { // Health Thermometer 0x2A6E: { readable: true, broadcast: true, value : [E.getTemperature().toFixed(2)] }}}); } // first time publishTemp(C.set); // every 30 sec setInterval(publishTemp,C.every_30_sec,C.update);
check https://www.bluetooth.com/specifications/gatt for further details on GATT Characteristics, Declarations, Descriptors, Services
@MaBe started
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.
Sample that uses NRF.setServices and NRF.updateServices on Puck.js to publish temperature
check https://www.bluetooth.com/specifications/gatt for further details on GATT Characteristics, Declarations, Descriptors, Services