-
• #2
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);
Hi
I'm new to espruino and I wondered if there was a way to expose the standard bluetooth services, for example the Battery Service ?
I wish to use the scriptability for example to send IR codes when a temperature is met however don't want to step away from tooling/libraries for interacting with standard bluetooth.
How would this best be achieved ?
Thanks
John Jones