You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2026/10/12 19:37:31 UTC
(mynewt-nimble) 02/02: nimble/ll: Allow VS Set Data Length to keep current RX values
This is an automated email from the ASF dual-hosted git repository.
sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit 70966de48ca2dcd4239e05cf28ded7df322cb349
Author: Szymon Janc <sz...@codecoup.pl>
AuthorDate: Fri Oct 9 16:38:19 2026 +0200
nimble/ll: Allow VS Set Data Length to keep current RX values
ble_ll_conn_set_data_len() leaves RX values unchanged if 0 is passed for
rx_octets or rx_time, but VS Set Data Length command rejected 0 values
for RX parameters so this was never possible to use from HCI.
Allow Rx_Octets and Rx_Time both set to 0 to leave current RX values
unchanged. Non-zero values are still validated.
Assisted-by: Claude:claude-opus-5-5
---
nimble/controller/src/ble_ll_hci_vs.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/nimble/controller/src/ble_ll_hci_vs.c b/nimble/controller/src/ble_ll_hci_vs.c
index 2027ce61a..9906d4f10 100644
--- a/nimble/controller/src/ble_ll_hci_vs.c
+++ b/nimble/controller/src/ble_ll_hci_vs.c
@@ -289,8 +289,12 @@ ble_ll_hci_vs_set_data_len(uint16_t ocf, const uint8_t *cmdbuf, uint8_t cmdlen,
rx_octets = le16toh(cmd->rx_octets);
rx_time = le16toh(cmd->rx_time);
- if (!ble_ll_hci_check_dle(tx_octets, tx_time) ||
- !ble_ll_hci_check_dle(rx_octets, rx_time)) {
+ if (!ble_ll_hci_check_dle(tx_octets, tx_time)) {
+ return BLE_ERR_INV_HCI_CMD_PARMS;
+ }
+
+ /* Rx_Octets and Rx_Time both set to 0 leave current RX values unchanged */
+ if ((rx_octets || rx_time) && !ble_ll_hci_check_dle(rx_octets, rx_time)) {
return BLE_ERR_INV_HCI_CMD_PARMS;
}