This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to determine if a disconnection is due to a bad signal (signal loss)

Hi,

I am trying to detect if a disconnection occurs due to a signal loss.

In the application's BLE Stack event handler, I have found that there is a disconnect reason in the ble_evt_t parameter : p_ble_evt->evt->gap_evt->params->disconnected->reason

In case of proper disconnection from peripheral or central, I have got 0x13 or 0x16 which are correct values accordign to the SDK : devzone.nordicsemi.com/.../a01162.html

But the reason value is never the same (0x90, 0x8F, 0x4E, ... not initialized?) in case of disconnection due to a bad signal, I don't find any constant in the documentation for this case.

Is there a possibility to know that a disconnection occurs due to a signal loss?

Thanks

Parents
  • Hi Sebastien,

    In case of signal loss, (no connect event receives from master until timeout occurs) you will receive Disconnect event with reason = BLE_HCI_CONNECTION_TIMEOUT (0x08). You can find this in our linkloss service (ble_lls.c) example.

    You can test this by move the device out of range or power off (remove battery) the phone or unplug the dongle if you test with Master Control Panel.

Reply
  • Hi Sebastien,

    In case of signal loss, (no connect event receives from master until timeout occurs) you will receive Disconnect event with reason = BLE_HCI_CONNECTION_TIMEOUT (0x08). You can find this in our linkloss service (ble_lls.c) example.

    You can test this by move the device out of range or power off (remove battery) the phone or unplug the dongle if you test with Master Control Panel.

Children
Related