Actually I just tried this on a Pixl.js - what happens is when you disconnect it does the Bluetooth restart and tries to add the service. However the Bluetooth stack itself throws an error, because 1800 isn't something you're supposed to add your own characteristics too as far as I can see: https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.generic_access.xml
1800
That error would get reported to the console, but obviously it can't because you're disconnected!
I think you meant to use 0x180D not 0x1800? https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.heart_rate.xml
0x180D
0x1800
If you use that it'll be fine.
@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.
Actually I just tried this on a Pixl.js - what happens is when you disconnect it does the Bluetooth restart and tries to add the service. However the Bluetooth stack itself throws an error, because
1800
isn't something you're supposed to add your own characteristics too as far as I can see: https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.generic_access.xmlThat error would get reported to the console, but obviously it can't because you're disconnected!
I think you meant to use
0x180D
not0x1800
? https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.heart_rate.xmlIf you use that it'll be fine.