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

BLE_GAP_EVT_CONN_PARAM_UPDATE Issues

Hello,

I have a question regarding BLE_GAP_EVT_CONN_PARAM_UPDATE (nrf52840, SDK 15.2).

I'm evaluating the BLE_UART example using multiple peripherals.

The goal is to scan for peripherals on the central, start a connection, send one data packet from the peripheral to the central, send one packet back and close the connection.

In general it works but sometimes the ble_evt_handler on the peripheral is called with BLE_GAP_EVT_CONN_PARAM_UPDATE. If I ignore this, my peripheral does not work anymore (I am waiting for nus_data_handler with event id BLE_NUS_EVT_COMM_STARTED for sending the packet to the central. But this is then not called.)

I have to call sd_ble_gap_disconnect if BLE_GAP_EVT_CONN_PARAM_UPDATE is called and try it again.

My question is why? As far as I can see it connection parameter update is called because of these two defines (in peripheral).

#define FIRST_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(3000)
#define NEXT_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(30000)

So if connection establishing takes more time an update parameters will be called? But if I get the event on the peripheral then this update should already have worked, shouldn't it?

Maybe I am missing something?

Thanks, Andreas

  • Hi,

    Not sure what may be failing here, the BLE_GAP_EVT_CONN_PARAM_UPDATE is just really an event telling that the connection parameters are updated. This should not really be a problem. However if you have included conn_params_init() then you can find in ble_conn_params_on_ble_evt() (in ble_conn_params.c) that it will react to BLE_GAP_EVT_CONN_PARAM_UPDATE. You may simply comment out the handling of the BLE_GAP_EVT_CONN_PARAM_UPDATE event here if that seems to become a problem for your specific application?

    Best regards,
    Kenneth

Related