• I am using the Bluetooth Widget to know the connection status between my Bangle.js and a MDBT42Q module. I built a specific BLE service. When NRF.on('connect'...) event is raised, I expected to see the BLE logo appear in blue. However, it stays greyed.
    From what I see in the widget script , the connection status is based on NRF.getSecurityStatus().connected boolean.

    Does it make sense to show the BLE widget appears active even if the connection is not secured, maybe with another color, like orange or red?

  • When NRF.on('connect'...) event is raised, I expected to see the BLE logo appear in blue

    Yes, I'd hope that'd be the case! I'm pretty sure it happens even when the connection is insecure though. Are you saying you checked and sometimes NRF.on('connect'...) gets called but NRF.getSecurityStatus().connected is false?

    Does it make sense to show the BLE widget appears active even if the connection is not secured

    Yes, I'd say so. I guess maybe a little padlock icon if connected and secured?

  • Actually after deeper test, I realize that the boolean returned by NRF.getSecurityStatus().connected is set to trueonly if the device is a peripheral, right? if used as a central device (my Bangle requests connection to the MDBT42Q module), I suspect this boolean to stay at false

  • if used as a central device (my Bangle requests connection to the MDBT42Q module), I suspect this boolean to stay at false

    Ahh, yes - that's the case. You can check also check getSecurityStatus on the BluetoothDevice you're using to connect to, but there's no global 'am I connected to anything at all?' function at the moment

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

Bluetooth Widget: only enabled when connection is secured?

Posted by Avatar for Jean-Philippe_Rey @Jean-Philippe_Rey

Actions