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
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
Hi,
There should not be any limitations on how often you can call bt_conn_le_param_update(), and updating the connection parameters several times during a connection is common. In what way does it not work?
Is there no requirement for the interval between the first call to bt_conn_le_param_update() and the second call?
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.
Sorry for chiming in. Are you using LLPM your application? In other words, are you using a connection interval less than 7.5ms in the first connection update call? If so, keep in mind that LLPM is only supported on 2M PHY. See https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/llpm/README.html for more details
Thank you for your reply. LLPM was not enabled, and the connection interval was set at 30ms. I feel that the two calls to update connection parameters were too short, resulting in the failure of the first call
Thank you for your reply. LLPM was not enabled, and the connection interval was set at 30ms. I feel that the two calls to update connection parameters were too short, resulting in the failure of the first call
That is odd, because it is the only condition that SDC_HCI_OPCODE_CMD_LE_CONN_UPDATE would return error code 0x0C. Could you confirm you are using Softdevice Controller? You could check if CONFIG_BT_LL_SOFTDEVICE is set to y
My conf file does not use CONFIG_BT_LL_SOFTDEVICE=y because my program is modified based on routines from the nRF connect SDK
Hi,
You need to check the generated .config file in your build folder to see what you actually use, as there his a hiarachy of configs, and they also have default values. If you are building for a nRF devices, you will have CONFIG_BT_LL_SOFTDEVICE=y by default unless you explicitly picked the Zephyr LL instead.