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 0a172aa30c13b31be16b21409e189e9ee2daf8f0
Author: Szymon Janc <[email protected]>
AuthorDate: Wed Oct 7 18:34:40 2026 +0200

    nimble/ll/test: Add test for LE Terminate BIG length check
    
    Verify that HCI LE Terminate BIG command with invalid parameters length
    is rejected.
    
    Assisted-by: Claude:claude-opus-5-5
---
 nimble/controller/test/src/ble_ll_hci_test.c | 24 ++++++++++++++++++++++++
 nimble/controller/test/syscfg.yml            |  1 +
 2 files changed, 25 insertions(+)

diff --git a/nimble/controller/test/src/ble_ll_hci_test.c 
b/nimble/controller/test/src/ble_ll_hci_test.c
index a11f2ec07..7a61a12d2 100644
--- a/nimble/controller/test/src/ble_ll_hci_test.c
+++ b/nimble/controller/test/src/ble_ll_hci_test.c
@@ -22,6 +22,7 @@
 #include <nimble/ble.h>
 #include <nimble/hci_common.h>
 #include <testutil/testutil.h>
+#include <controller/ble_ll_iso_big.h>
 #include "ble_ll_conn_priv.h"
 
 /* Handle of a connection that does not exist */
@@ -101,6 +102,26 @@ TEST_CASE_SELF(test_ll_hci_subrate_req_len)
 }
 #endif
 
+#if MYNEWT_VAL(BLE_LL_ISO_BROADCASTER)
+TEST_CASE_SELF(test_ll_hci_terminate_big_len)
+{
+    struct ble_hci_le_terminate_big_cp cmd = {
+        .big_handle = 0x00,
+        .reason = BLE_ERR_REM_USER_CONN_TERM,
+    };
+    int rc;
+
+    rc = ble_ll_iso_big_hci_terminate((uint8_t *)&cmd, 0);
+    TEST_ASSERT(rc == BLE_ERR_INV_HCI_CMD_PARMS);
+
+    rc = ble_ll_iso_big_hci_terminate((uint8_t *)&cmd, sizeof(cmd) - 1);
+    TEST_ASSERT(rc == BLE_ERR_INV_HCI_CMD_PARMS);
+
+    rc = ble_ll_iso_big_hci_terminate((uint8_t *)&cmd, sizeof(cmd));
+    TEST_ASSERT(rc == BLE_ERR_UNK_ADV_INDENT);
+}
+#endif
+
 TEST_SUITE(ble_ll_hci_test_suite)
 {
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL) || MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
@@ -110,4 +131,7 @@ TEST_SUITE(ble_ll_hci_test_suite)
     test_ll_hci_set_default_subrate_len();
     test_ll_hci_subrate_req_len();
 #endif
+#if MYNEWT_VAL(BLE_LL_ISO_BROADCASTER)
+    test_ll_hci_terminate_big_len();
+#endif
 }
diff --git a/nimble/controller/test/syscfg.yml 
b/nimble/controller/test/syscfg.yml
index 60870d20b..c66da72ed 100644
--- a/nimble/controller/test/syscfg.yml
+++ b/nimble/controller/test/syscfg.yml
@@ -19,6 +19,7 @@
 syscfg.vals:
     BLE_LL_CFG_FEAT_LE_CSA2: 1
     BLE_LL_ISO: 1
+    BLE_LL_ISO_BROADCASTER: 1
     BLE_VERSION: 54
     BLE_CONN_SUBRATING: 1
     BLE_EXT_ADV: 1

Reply via email to