-
• #2
Hi,
Are my BLE changes effective already (I'm guessing "no")
No, but they will be effective as soon as you disconnect the computer you used to program the Pixl via Bluetooth.
do I need to first restart the Pixl.js. i.e. is a reset() equivalent to a power-down?
No need for this - as soon as nothing is connected via bluetooth it'll restart the Bluetooth stack and pull in the services.
Are my changes lost during restart because they were only in RAM?
If you were only saving to RAM then yes. Calling
save()
would help, but you should have the code that creates the services in a function calledonInit
to be sure: http://www.espruino.com/SavingOtherwise you can just choose to 'save to flash'...
Is there a way to force a BLE restart?
Yes - you can do
NRF.restart()
which will queue a restart if you're connected, thenNRF.disconnect()
will forcibly disconnect any connected devices from Bluetooth which will then force the restart. -
• #3
Thank you Gordon.
I'm writing some BLE services and characteristics for my Pixl.js, and after uploading to RAM I always see the message "BLE Connected, queueing BLE restart for later". I have a few questions:
Thanks for any assistance.