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/09/11 09:08:53 UTC

(mynewt-nimble) branch master updated (2cf66a2b1 -> 6e354a944)

This is an automated email from the ASF dual-hosted git repository.

sjanc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


    from 2cf66a2b1 nimble/bttester: Report connectable state in controller info
     new 358645a8c nimble/host: Fix the iso connection handle type
     new 528377189 nimble/host: Fix uninitialized ISO conn handle
     new 6e354a944 nimble/host: Refactor ble_iso_big_conn_handles_init

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 nimble/host/src/ble_iso.c | 66 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 23 deletions(-)


(mynewt-nimble) 01/03: nimble/host: Fix the iso connection handle type

Posted by ja...@apache.org.
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 358645a8c09efcb6fe16e94f255a4bb095c081a5
Author: Mariusz Skamra <ma...@codecoup.pl>
AuthorDate: Wed Apr 29 13:13:54 2026 +0200

    nimble/host: Fix the iso connection handle type
    
    This fixes the connection handle type, which is two octet value as per
    Core specification.
---
 nimble/host/src/ble_iso.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nimble/host/src/ble_iso.c b/nimble/host/src/ble_iso.c
index 600e7ed5b..9ac20760f 100644
--- a/nimble/host/src/ble_iso.c
+++ b/nimble/host/src/ble_iso.c
@@ -73,7 +73,7 @@ struct ble_iso_big {
 struct ble_iso_conn {
     SLIST_ENTRY(ble_iso_conn) next;
     enum ble_iso_conn_type type;
-    uint8_t handle;
+    uint16_t handle;
 
     struct ble_iso_rx_data_info rx_info;
     struct os_mbuf *rx_buf;


(mynewt-nimble) 03/03: nimble/host: Refactor ble_iso_big_conn_handles_init

Posted by ja...@apache.org.
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 6e354a94429493661c99705f917175d9c76b55ad
Author: Mariusz Skamra <ma...@codecoup.pl>
AuthorDate: Wed Apr 29 13:18:38 2026 +0200

    nimble/host: Refactor ble_iso_big_conn_handles_init
    
    This refactors ble_iso_big_conn_handles_init macro into function.
    Few asserts have been added to catch the potential issues. The nested
    loop has been removed.
---
 nimble/host/src/ble_iso.c | 63 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 41 insertions(+), 22 deletions(-)

diff --git a/nimble/host/src/ble_iso.c b/nimble/host/src/ble_iso.c
index ab5f43393..a76c64cdf 100644
--- a/nimble/host/src/ble_iso.c
+++ b/nimble/host/src/ble_iso.c
@@ -34,28 +34,6 @@
 #define min(a, b) ((a) < (b) ? (a) : (b))
 #endif
 
-#define ble_iso_big_conn_handles_init(_big, _handles, _num_handles)         \
-    do {                                                                    \
-        struct ble_iso_conn *conn = SLIST_FIRST(&ble_iso_conns);            \
-                                                                            \
-        for (uint8_t i = 0; i < (_num_handles); i++) {                      \
-            while (conn != NULL) {                                          \
-                if (conn->type == BLE_ISO_CONN_BIS) {                       \
-                    struct ble_iso_bis *bis;                                \
-                                                                            \
-                    bis = CONTAINER_OF(conn, struct ble_iso_bis, conn);     \
-                    if (bis->big == (_big)) {                               \
-                        conn->handle = le16toh((_handles)[i]);              \
-                        conn = SLIST_NEXT(conn, next);                      \
-                        break;                                              \
-                    }                                                       \
-                }                                                           \
-                                                                            \
-                conn = SLIST_NEXT(conn, next);                              \
-            }                                                               \
-        }                                                                   \
-    } while (0);
-
 enum ble_iso_conn_type {
     BLE_ISO_CONN_BIS,
 };
@@ -96,6 +74,47 @@ static struct os_mempool ble_iso_bis_pool;
 static os_membuf_t ble_iso_bis_mem[
     OS_MEMPOOL_SIZE(MYNEWT_VAL(BLE_ISO_MAX_BISES), sizeof (struct ble_iso_bis))];
 
+static int
+ble_iso_big_conn_handles_init(struct ble_iso_big *big, const void *data, uint8_t num_handles)
+{
+    const uint8_t *handles = data;
+    struct ble_iso_conn *conn;
+    struct ble_iso_bis *bis;
+    uint8_t num_bis;
+
+    BLE_HS_DBG_ASSERT(big != NULL);
+    BLE_HS_DBG_ASSERT(handles != NULL);
+    BLE_HS_DBG_ASSERT(num_handles > 0);
+
+    num_bis = 0;
+
+    SLIST_FOREACH(conn, &ble_iso_conns, next) {
+        if (conn->type != BLE_ISO_CONN_BIS) {
+            continue;
+        }
+
+        bis = CONTAINER_OF(conn, struct ble_iso_bis, conn);
+        if (bis->big != big) {
+            continue;
+        }
+
+        BLE_HS_DBG_ASSERT(conn->handle == BLE_HS_CONN_HANDLE_NONE);
+
+        conn->handle = get_le16(&handles[num_bis * sizeof(uint16_t)]);
+
+        if (++num_bis == num_handles) {
+            break;
+        }
+    }
+
+    if (num_bis != num_handles) {
+        BLE_HS_LOG_ERROR("Not enough handles for BIG\n");
+        return BLE_HS_EINVAL;
+    }
+
+    return 0;
+}
+
 static void
 ble_iso_conn_append(struct ble_iso_conn *conn)
 {


(mynewt-nimble) 02/03: nimble/host: Fix uninitialized ISO conn handle

Posted by ja...@apache.org.
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 528377189934b1cfccf610254b372385fd7e2ccf
Author: Mariusz Skamra <ma...@codecoup.pl>
AuthorDate: Wed Apr 29 13:15:34 2026 +0200

    nimble/host: Fix uninitialized ISO conn handle
    
    This sets the initial conn handle value to 0xFFFF, which is the value
    outside of valid range.
---
 nimble/host/src/ble_iso.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/nimble/host/src/ble_iso.c b/nimble/host/src/ble_iso.c
index 9ac20760f..ab5f43393 100644
--- a/nimble/host/src/ble_iso.c
+++ b/nimble/host/src/ble_iso.c
@@ -184,6 +184,7 @@ ble_iso_bis_alloc(struct ble_iso_big *big)
 
     memset(new_bis, 0, sizeof *new_bis);
     new_bis->conn.type = BLE_ISO_CONN_BIS;
+    new_bis->conn.handle = BLE_HS_CONN_HANDLE_NONE;
     new_bis->big = big;
 
     ble_iso_conn_append(&new_bis->conn);