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

How don't make Parameter Update Requests?

I run into this topic during seeking an answer to my problem and for me, as well as for the author of that question the answer doesn't work properly. But wouldn't it be easier to set max_conn_params_update_count to 0? As far as I understand peripheral device shouldn't make any Connection Parameter Update Requests with this settings. Am I right or I missed something? I work with SDK 11.

Parents
  • Hi,

    If you set max_conn_params_update_count to 0, a BLE_CONN_PARAMS_EVT_FAILED event will be trigged if the received connection parameters are not acceptable. It should not send any Connection Parameter Update Requests to the central, but in some BLE examples in the SDK, this event will disconnect the BLE link. So please check the event handler for the connection parameters module ( on_conn_params_evt / cp_init.evt_handler) on how you are handling this event.

    Take a look at this post on how the negotiation logic is implemented.

    Is there any reason you don't want to send a Connection Parameter Update Request ?

Reply
  • Hi,

    If you set max_conn_params_update_count to 0, a BLE_CONN_PARAMS_EVT_FAILED event will be trigged if the received connection parameters are not acceptable. It should not send any Connection Parameter Update Requests to the central, but in some BLE examples in the SDK, this event will disconnect the BLE link. So please check the event handler for the connection parameters module ( on_conn_params_evt / cp_init.evt_handler) on how you are handling this event.

    Take a look at this post on how the negotiation logic is implemented.

    Is there any reason you don't want to send a Connection Parameter Update Request ?

Children
  • I have control over the peripheral and central application and just don't need it. I suppose that it takes some time to execute this procedure so I want to avoid it.

    When you're writing about disconnection of BLE link in some examples you mean that in these examples cp_init.disconnect_on_fail in conn_params_init is set as true?

    Thanks for link, it's helpful :)

  • No, even if you have set the disconnect_on_fail flag to false or true, it's still possible to disconnect the link in the event handler. This looks like this in some examples:

     * @param[in] p_evt  Event received from the Connection Parameters Module.
     */
    static void on_conn_params_evt(ble_conn_params_evt_t * p_evt)
    {
        ret_code_t err_code;
    
        if (p_evt->evt_type == BLE_CONN_PARAMS_EVT_FAILED)
        {
            err_code = sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_CONN_INTERVAL_UNACCEPTABLE);
            APP_ERROR_CHECK(err_code);
        }
    }
    

    I think the best option is to just set the max/min interval on the peripheral very wide, e.g. min 7.5ms and max 2sec. Then there will be no negotiation and timers in the module will not be started.

Related