You can't trigger a reconnect yourself, but you can do NRF.sleep() to stop advertising (which will make the PC think the device isn't around any more) and then NRF.wake() to wake it up again.
I should add that with firmwares after 1v99 (that's the cutting edge ones at the moment), having a connection doesn't take that much power at all since if nothing is happening it slows right down to almost the same speed as it would if it was normally advertising.
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.
You can't trigger a reconnect yourself, but you can do
NRF.sleep()
to stop advertising (which will make the PC think the device isn't around any more) and thenNRF.wake()
to wake it up again.I should add that with firmwares after 1v99 (that's the cutting edge ones at the moment), having a connection doesn't take that much power at all since if nothing is happening it slows right down to almost the same speed as it would if it was normally advertising.