Peripheral missing disconnect on timeout

When communication fails on NRF connectivity dongle (In Python via pc_ble_driver) and Error code: NRF_ERROR_BUSY is received on attempts to write and one restarts python script, a timeout appears to occur in peripheral. the connection changes state (after delay) from BT_CONN_CONNECTED to BT_CONN_DISCONNECT_COMPLETE.

This does not trigger a callback and application thus does not know to call bt_conn_unref() thus advertising is not resumed.

System runs Zephyr on nRF Connect SDK 1.8.0 as peripheral only.

Parents Reply
  • When debugging I notice that disconnect does not work as it returns that it is not connected, but conn->ref is not 0. Calling unref till it reaches 0 causes it to start advertising again.

    But upon trying to connect to this we get
    ***New connection: 0 (printed by on_gap_evt_connected in our script)
    connect_to_device error: 'NoneType' object is not subscriptable.

    After this, it stops advertising again while state remains in BT_CONN_CONNECT_ADV.

Children
Related