I'm afraid those constants aren't defined in JS - they just come from the Nordic Softdevice.
Doing var BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION = 0x13 as you suggest would really help I reckon.
var BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION = 0x13
Of course I guess you could also do:
var reasons = []; NRF.on('disconnect', function (reason) { reasons.push(reason); });
And then check out what was in reasons when you reconnect?
reasons
Alright, then i misunderstood. Ah yeah that's great, thanks Gordon.
@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.
I'm afraid those constants aren't defined in JS - they just come from the Nordic Softdevice.
Doing
var BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION = 0x13
as you suggest would really help I reckon.Of course I guess you could also do:
And then check out what was in
reasons
when you reconnect?