I'd have to see your code to be sure, but are you calling NRF.setServices anywhere other than where it'd used to enable Bluetooth HID mode?
Basically, when you call NRF.setServices, HID will take effect after a disconnect and reconnect - before that time you'll get the BLE HID not enabled error.
It works the other way too. If you were connected with HID enabled, then you uploaded code that didn't enable it, or that actually disabled it, the changes wouldn't take effect until you disconnected and reconnected - which might explain the problems you're having?
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,
I'd have to see your code to be sure, but are you calling
NRF.setServices
anywhere other than where it'd used to enable Bluetooth HID mode?Basically, when you call
NRF.setServices
, HID will take effect after a disconnect and reconnect - before that time you'll get theBLE HID not enabled
error.It works the other way too. If you were connected with HID enabled, then you uploaded code that didn't enable it, or that actually disabled it, the changes wouldn't take effect until you disconnected and reconnected - which might explain the problems you're having?