-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BLE connection parameters updated with inconsistent values #38613
Comments
Looks like a mix of not saving the needed state for the fallback, or an incomplete saving of the needed state. bt_conn_le_param_update:
/* if slave conn param update timer expired just send request */
if (atomic_test_bit(conn->flags, BT_CONN_SLAVE_PARAM_UPDATE)) {
return send_conn_le_param_update(conn, param);
}
/* store new conn params to be used by update timer */
conn->le.interval_min = param->interval_min;
conn->le.interval_max = param->interval_max;
conn->le.pending_latency = param->latency;
conn->le.pending_timeout = param->timeout;
atomic_set_bit(conn->flags, BT_CONN_SLAVE_PARAM_SET); Not storing interval here: send_conn_le_param_update:
/* store those in case of fallback to L2CAP */
if (rc == 0) {
conn->le.pending_latency = param->latency;
conn->le.pending_timeout = param->timeout;
} |
@joerchan I think I understand the need to save the |
@ejohnso49 The first code-block shows that all 4 values are saved when the timer is not expired. But when the timer is expired it goes to |
When falling back to L2CAP for connection parameter updates, the interval min and maxes should also be saved. Fixes zephyrproject-rtos#38613. Signed-off-by: Eric Johnson <eric@liveathos.com>
When falling back to L2CAP for connection parameter updates, the interval min and maxes should also be saved. Fixes #38613. Signed-off-by: Eric Johnson <eric@liveathos.com>
When falling back to L2CAP for connection parameter updates, the interval min and maxes should also be saved. Fixes zephyrproject-rtos#38613. Signed-off-by: Eric Johnson <eric@liveathos.com>
Describe the bug
I'm running into some unexpected behavior regarding connection parameters. I have a Zephyr peripheral (v2.6.0) which is connecting to my laptop (central device). I have
BT_GAP_AUTO_UPDATE_CONN_PARAMS
set and I see the peripheral attempt to update the parameters withLL_CONNECTION_PARAM_REQ
in a Wireshark trace. It sends a request with the values I've specified withCONFIG_BT_PERIPHERAL_PREF_MIN_INT
andCONFIG_BT_PERIPHERAL_PREF_MAX_INT
. My central device then rejects this as it claims that is an unsupported feature (not sure if this is a separate issue). Next the peripheral falls back to the L2CAP update procedure and for some reason this request now has different values for the interval min and max. I've found the section of code where the L2CAP procedure initiates with these other parameter values, from le_conn_update_complete:It seems like the conn struct already has these set to 24 for min and 40 for max.
To Reproduce
Steps to reproduce the behavior:
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=y
, enables the LL connection param update feature, and sets preferred interval min and maxes to values different thanBT_GAP_INIT_CONN
.Expected behavior
I would expect that when the update procedure falls back to L2CAP that the same values as specified by
CONFIG_BT_PERIPHERAL_PREF_MIN_INT
/etc are used during this instead ofBT_GAP_INIT_CONN_INT_MIN
/etcImpact
This impacts connection throughput for applications as they might expect a specific interval value range. This potentially could be mitigated by disabling the LL connection parameter update feature as I think the fallback is the specific issue. Additionally if my Central supported the LL connection parameter update feature then I think this issue would be masked.
Logs and console output
Some log output that I added to the code:
I have added a log message at (hci_core.c:1578):
Log Output:
Environment (please complete the following information):
Additional context
The operation that is traced is part of the DFU process via
mcumgr
and the BLE SMP service.The text was updated successfully, but these errors were encountered: