Hi,
Yes, it's really easy to get Espruino to advertise standard services - you just look up the service you want on the bluetooth site: https://www.bluetooth.com/specifications/gatt/services
In this case: https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.battery_service.xml
Then you just use setServices/updateServices with the info from that page, so something like:
NRF.setServices({ 0x180F : { 0x2A19 : { value : Puck.getBatteryPercentage(), readable : true } } }); setInterval(function() { NRF.updateServices({ 0x180F : { 0x2A19 : { value : Puck.getBatteryPercentage() } } }); }, 60000);
@Gordon 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.
Hi,
Yes, it's really easy to get Espruino to advertise standard services - you just look up the service you want on the bluetooth site: https://www.bluetooth.com/specifications/gatt/services
In this case: https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.battery_service.xml
Then you just use setServices/updateServices with the info from that page, so something like: