And the error is "Uncaught InternalError: BLE task completed that wasn't scheduled (3/4)" ?
I see you are calling it from NRF.on('connect', function(addr) { handler. maybe it will help if you schedule your Connect method a little bit later via setTimeout if you really want to call it at that time? Thing is that there is some communication still in progress right after something connect to the Bangle so it is not a best moment to start connecting to something else, try to wait like 500ms
And you really want for it to work in a way that anytime something connects to bangle the bangle will immediately try to connect to something else? That's a bit odd.
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.
And the error is "Uncaught InternalError: BLE task completed that wasn't scheduled (3/4)" ?
I see you are calling it from
NRF.on('connect', function(addr) {
handler. maybe it will help if you schedule yourConnect
method a little bit later viasetTimeout
if you really want to call it at that time? Thing is that there is some communication still in progress right after something connect to the Bangle so it is not a best moment to start connecting to something else, try to wait like 500msAnd you really want for it to work in a way that anytime something connects to bangle the bangle will immediately try to connect to something else? That's a bit odd.