How to dynamically change the connection interval

Why do I use this function bt_conn_le_param_update( ), only after the power on the first time to work, then do not work

Parents Reply Children
  • Hi,

    The warning is regarding HCI command 0x2013, which is SDC_HCI_OPCODE_CMD_LE_CONN_UPDATE, so that makes sense. I do not seee the full log though nor do I know which parameters you are tryign to udpate to, but it seems the operation is successfull?

    Regarding parallell procedures, I means more than one link layer (LL) procedure at one time. That is not allowed per the Bluetooth specification.


  • Here I call bt_conn_le_param_update() twice, but only the second time to start the rental, the previous call does not work, the first call is to set the connection interval smaller, faster data synchronization, the second call is to set the connection interval larger, which is lower power consumption

  • Hi,

    What is the return value of the first call? I see you do not check that, but you should, and handle it accordingly. I see no point in calling twice, but it could be that by chance the timing there cause problems. Perhaps you can add CONFIG_BT_CONN_PARAM_UPDATE_TIMEOUT=7000 or similar to your prj.conf and see if that matters (you can adjust the numer, which is a delay between when the connection is established and the first conn params update procedure. Also note that it is not allowed to perform a connection parameter update the first 5 seconds after establishing the link per Bleutooth specification. 

    It could also be that conn pams update is allready ongoing but you don't know it? If so, I woudl recomend making a sniffer trace to see what happens on the link.

  • Can I dynamically adjust CONFIG_BT_CONN_PARAM_UPDATE_TIMEOUT?

  • No. This is static. But note that this only delays connection parameter update after connection establishment. It doe snot delay subsequent connection parameter updates.

    One other thing, is CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS enabled? If so, it will automatically appen after the configured delay after the connection is established.

Related