• 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:

    1. Are my BLE changes effective already (I'm guessing "no"), or do I need to first restart the Pixl.js. i.e. is a reset() equivalent to a power-down?
    2. Are my changes lost during restart because they were only in RAM? Should I have done a save()?
    3. Is there a way to force a BLE restart?

    Thanks for any assistance.

  • 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 called onInit to be sure: http://www.espruino.com/Saving

    Otherwise 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, then NRF.disconnect() will forcibly disconnect any connected devices from Bluetooth which will then force the restart.

  • Thank you Gordon.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Meaning of: BLE Connected, queueing BLE restart for later

Posted by Avatar for cmumford @cmumford

Actions