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

Buttonless DFU problems when multiple connections present

I'm using nRF52832 with SDK 15.0 and Softdevice S132.  Within ble_dfu.c anytime a connection is established the on_connect function blindly sets  m_dfu.conn_handle = p_ble_evt->evt.gap_evt.conn_handle.  This creates problems if multiple connections are active (for instance a few central connections and one peripheral connection) since the last connection is always the one that the dfu routine conn_handle will end up pointing to (and this may a connection where the nRF is acting as the central) and  on_rw_authorize_req checks this connection handle anytime a dfu command is received. 

Parents
  • Hi Daniel,

    The ble_dfu.c was not designed with multiple connection in mind. It's more of an example for a very simple use case, 1to1 connection.

    If you want to support multiple connection and allowing any connection to send the DFU command, I think you can remove the check in on_rw_authorize_req()

    if (p_ble_evt->evt.gatts_evt.conn_handle != m_dfu.conn_handle)

    And assign the m_dfu.conn_handle to the event connection handle if the authorizae write handle matched with the dfu control point handle.

Reply
  • Hi Daniel,

    The ble_dfu.c was not designed with multiple connection in mind. It's more of an example for a very simple use case, 1to1 connection.

    If you want to support multiple connection and allowing any connection to send the DFU command, I think you can remove the check in on_rw_authorize_req()

    if (p_ble_evt->evt.gatts_evt.conn_handle != m_dfu.conn_handle)

    And assign the m_dfu.conn_handle to the event connection handle if the authorizae write handle matched with the dfu control point handle.

Children
No Data
Related