You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2022/08/29 13:03:44 UTC

[mynewt-nimble] branch master updated (3f1e0252 -> 5098c288)

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

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


    from 3f1e0252 nimble/ll: Fix Read Local Supported Commands
     new 1a27fe64 nimble/ll/css: Add vs event to indicate slot change
     new 6d88641a nimble/ll/css: Add HCI vs command to read current slot for connection
     new 5098c288 nimble/ll/css: Add separate vs hci commands for css.

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/controller/include/controller/ble_ll_ctrl.h |  5 ++
 nimble/controller/src/ble_ll_conn.c                |  5 ++
 nimble/controller/src/ble_ll_hci_ev.c              | 32 +++++++++-
 nimble/controller/src/ble_ll_hci_vs.c              | 72 +++++++++++++---------
 nimble/include/nimble/hci_common.h                 | 35 ++++++-----
 5 files changed, 103 insertions(+), 46 deletions(-)


[mynewt-nimble] 01/03: nimble/ll/css: Add vs event to indicate slot change

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1a27fe6494caa299ab67cd0e9a05fa7ad439c47a
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Fri Aug 12 13:35:14 2022 +0200

    nimble/ll/css: Add vs event to indicate slot change
    
    If hci_vs support is enabled for CSS, an event will be sent every time
    slot chanes for a connection.
---
 nimble/controller/include/controller/ble_ll_ctrl.h |  5 ++++
 nimble/controller/src/ble_ll_conn.c                |  5 ++++
 nimble/controller/src/ble_ll_hci_ev.c              | 32 ++++++++++++++++++++--
 nimble/include/nimble/hci_common.h                 | 11 ++++++--
 4 files changed, 48 insertions(+), 5 deletions(-)

diff --git a/nimble/controller/include/controller/ble_ll_ctrl.h b/nimble/controller/include/controller/ble_ll_ctrl.h
index 379960ec..6e7ad13d 100644
--- a/nimble/controller/include/controller/ble_ll_ctrl.h
+++ b/nimble/controller/include/controller/ble_ll_ctrl.h
@@ -350,6 +350,11 @@ void ble_ll_hci_ev_sca_update(struct ble_ll_conn_sm *connsm,
 void ble_ll_hci_ev_subrate_change(struct ble_ll_conn_sm *connsm, uint8_t status);
 #endif
 
+#if MYNEWT_VAL(BLE_LL_HCI_VS_CONN_STRICT_SCHED)
+void ble_ll_hci_ev_send_vs_css_slot_changed(uint16_t conn_handle,
+                                            uint16_t slot_idx);
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/nimble/controller/src/ble_ll_conn.c b/nimble/controller/src/ble_ll_conn.c
index 2a8c0c05..b625a0e3 100644
--- a/nimble/controller/src/ble_ll_conn.c
+++ b/nimble/controller/src/ble_ll_conn.c
@@ -2496,6 +2496,11 @@ ble_ll_conn_next_event(struct ble_ll_conn_sm *connsm)
                 ble_ll_sched_css_set_conn_anchor(connsm);
                 anchor_calc_for_css = 0;
             }
+
+#if MYNEWT_VAL(BLE_LL_HCI_VS_CONN_STRICT_SCHED)
+            ble_ll_hci_ev_send_vs_css_slot_changed(connsm->conn_handle,
+                                                   connsm->css_slot_idx);
+#endif
         }
 #endif
 
diff --git a/nimble/controller/src/ble_ll_hci_ev.c b/nimble/controller/src/ble_ll_hci_ev.c
index 6da2545c..b0d9fa07 100644
--- a/nimble/controller/src/ble_ll_hci_ev.c
+++ b/nimble/controller/src/ble_ll_hci_ev.c
@@ -523,10 +523,36 @@ ble_ll_hci_ev_subrate_change(struct ble_ll_conn_sm *connsm, uint8_t status)
 }
 #endif
 
+#if MYNEWT_VAL(BLE_LL_HCI_VS_CONN_STRICT_SCHED)
+void
+ble_ll_hci_ev_send_vs_css_slot_changed(uint16_t conn_handle, uint16_t slot_idx)
+{
+    struct ble_hci_ev_vs_css_slot_changed *ev;
+    struct ble_hci_ev_vs *ev_vs;
+    struct ble_hci_ev *hci_ev;
+
+    hci_ev = ble_transport_alloc_evt(0);
+    if (!hci_ev) {
+        return;
+
+    }
+
+    hci_ev->opcode = BLE_HCI_EVCODE_VS;
+    hci_ev->length = sizeof(*ev_vs) + sizeof(*ev);
+    ev_vs = (void *)hci_ev->data;
+    ev_vs->id = BLE_HCI_VS_SUBEV_ID_CSS_SLOT_CHANGED;
+    ev = (void *)ev_vs->data;
+    ev->conn_handle = htole16(conn_handle);
+    ev->slot_idx = htole16(slot_idx);
+
+    ble_ll_hci_event_send(hci_ev);
+}
+#endif
+
 void
 ble_ll_hci_ev_send_vs_assert(const char *file, uint32_t line)
 {
-    struct ble_hci_ev_vs_debug *ev;
+    struct ble_hci_ev_vs *ev;
     struct ble_hci_ev *hci_ev;
     unsigned int str_len;
     bool skip = true;
@@ -541,12 +567,12 @@ ble_ll_hci_ev_send_vs_assert(const char *file, uint32_t line)
 
     hci_ev = ble_transport_alloc_evt(0);
     if (hci_ev) {
-        hci_ev->opcode = BLE_HCI_EVCODE_VS_DEBUG;
+        hci_ev->opcode = BLE_HCI_EVCODE_VS;
         hci_ev->length = sizeof(*ev);
         ev = (void *) hci_ev->data;
 
         /* Debug id for future use */
-        ev->id = 0x00;
+        ev->id = BLE_HCI_VS_SUBEV_ID_ASSERT;
 
         /* snprintf would be nicer but this is heavy on flash
          * len = snprintf((char *) ev->data, max_len, "%s:%u", file, line);
diff --git a/nimble/include/nimble/hci_common.h b/nimble/include/nimble/hci_common.h
index 40602d7b..b690eeb2 100644
--- a/nimble/include/nimble/hci_common.h
+++ b/nimble/include/nimble/hci_common.h
@@ -1554,12 +1554,19 @@ struct ble_hci_ev_auth_pyld_tmo {
 
 #define BLE_HCI_EVCODE_SAM_STATUS_CHG       (0x58)
 
-#define BLE_HCI_EVCODE_VS_DEBUG             (0xFF)
-struct ble_hci_ev_vs_debug {
+#define BLE_HCI_EVCODE_VS                   (0xff)
+struct ble_hci_ev_vs {
     uint8_t id;
     uint8_t data[0];
 } __attribute__((packed));
 
+#define BLE_HCI_VS_SUBEV_ID_ASSERT              (0x01)
+#define BLE_HCI_VS_SUBEV_ID_CSS_SLOT_CHANGED    (0x02)
+struct ble_hci_ev_vs_css_slot_changed {
+    uint16_t conn_handle;
+    uint16_t slot_idx;
+};
+
 /* LE sub-event codes */
 #define BLE_HCI_LE_SUBEV_CONN_COMPLETE          (0x01)
 struct ble_hci_ev_le_subev_conn_complete {


[mynewt-nimble] 02/03: nimble/ll/css: Add HCI vs command to read current slot for connection

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6d88641ab25a28447290d4509315f393b4741a00
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Fri Aug 19 14:48:34 2022 +0200

    nimble/ll/css: Add HCI vs command to read current slot for connection
---
 nimble/controller/src/ble_ll_hci_vs.c | 33 +++++++++++++++++++++++++++++++++
 nimble/include/nimble/hci_common.h    | 10 ++++++++++
 2 files changed, 43 insertions(+)

diff --git a/nimble/controller/src/ble_ll_hci_vs.c b/nimble/controller/src/ble_ll_hci_vs.c
index 8effae54..7aa2e8d1 100644
--- a/nimble/controller/src/ble_ll_hci_vs.c
+++ b/nimble/controller/src/ble_ll_hci_vs.c
@@ -268,6 +268,37 @@ ble_ll_hci_vs_css_set_conn_slot(const uint8_t *cmdbuf, uint8_t cmdlen,
     return BLE_ERR_SUCCESS;
 }
 
+static int
+ble_ll_hci_vs_css_read_conn_slot(const uint8_t *cmdbuf, uint8_t cmdlen,
+                                uint8_t *rspbuf, uint8_t *rsplen)
+{
+    const struct ble_hci_vs_css_read_conn_slot_cp *cmd = (const void *)cmdbuf;
+    struct ble_hci_vs_css_read_conn_slot_rp *rsp = (void *)rspbuf;
+    struct ble_ll_conn_sm *connsm;
+    uint16_t conn_handle;
+
+    if (cmdlen != sizeof(*cmd)) {
+        return BLE_ERR_INV_HCI_CMD_PARMS;
+    }
+
+    if (!ble_ll_sched_css_is_enabled()) {
+        return BLE_ERR_CMD_DISALLOWED;
+    }
+
+    conn_handle = le16toh(cmd->conn_handle);
+    connsm = ble_ll_conn_find_by_handle(conn_handle);
+    if (!connsm) {
+        return BLE_ERR_UNK_CONN_ID;
+    }
+
+    *rsplen = sizeof(*rsp);
+    rsp->opcode = cmd->opcode;
+    rsp->conn_handle = cmd->conn_handle;
+    rsp->slot_idx = htole16(connsm->css_slot_idx);
+
+    return BLE_ERR_SUCCESS;
+}
+
 static int
 ble_ll_hci_vs_css(uint16_t ocf, const uint8_t *cmdbuf, uint8_t cmdlen,
                   uint8_t *rspbuf, uint8_t *rsplen)
@@ -291,6 +322,8 @@ ble_ll_hci_vs_css(uint16_t ocf, const uint8_t *cmdbuf, uint8_t cmdlen,
         return ble_ll_hci_vs_css_set_next_slot(cmdbuf, cmdlen, rspbuf, rsplen);
     case BLE_HCI_VS_CSS_OP_SET_CONN_SLOT:
         return ble_ll_hci_vs_css_set_conn_slot(cmdbuf, cmdlen, rspbuf, rsplen);
+    case BLE_HCI_VS_CSS_OP_READ_CONN_SLOT:
+        return ble_ll_hci_vs_css_read_conn_slot(cmdbuf, cmdlen, rspbuf, rsplen);
     }
 
     return BLE_ERR_INV_HCI_CMD_PARMS;
diff --git a/nimble/include/nimble/hci_common.h b/nimble/include/nimble/hci_common.h
index b690eeb2..a4615843 100644
--- a/nimble/include/nimble/hci_common.h
+++ b/nimble/include/nimble/hci_common.h
@@ -1168,6 +1168,16 @@ struct ble_hci_vs_css_set_conn_slot_cp {
     uint16_t conn_handle;
     uint16_t slot_idx;
 } __attribute__((packed));
+#define BLE_HCI_VS_CSS_OP_READ_CONN_SLOT                0x05
+struct ble_hci_vs_css_read_conn_slot_cp {
+    uint8_t opcode;
+    uint16_t conn_handle;
+} __attribute__((packed));
+struct ble_hci_vs_css_read_conn_slot_rp {
+    uint8_t opcode;
+    uint16_t conn_handle;
+    uint16_t slot_idx;
+} __attribute__((packed));
 
 /* Command Specific Definitions */
 /* --- Set controller to host flow control (OGF 0x03, OCF 0x0031) --- */


[mynewt-nimble] 03/03: nimble/ll/css: Add separate vs hci commands for css.

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5098c2889e894521d2008c2a036c687335e4fd79
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Tue Aug 23 16:23:54 2022 +0200

    nimble/ll/css: Add separate vs hci commands for css.
---
 nimble/controller/src/ble_ll_hci_vs.c | 71 +++++++++++++----------------------
 nimble/include/nimble/hci_common.h    | 20 +++-------
 2 files changed, 31 insertions(+), 60 deletions(-)

diff --git a/nimble/controller/src/ble_ll_hci_vs.c b/nimble/controller/src/ble_ll_hci_vs.c
index 7aa2e8d1..d0034650 100644
--- a/nimble/controller/src/ble_ll_hci_vs.c
+++ b/nimble/controller/src/ble_ll_hci_vs.c
@@ -138,7 +138,7 @@ ble_ll_hci_vs_set_tx_power(uint16_t ocf, const uint8_t *cmdbuf, uint8_t cmdlen,
 #if MYNEWT_VAL(BLE_LL_HCI_VS_CONN_STRICT_SCHED)
 #if !MYNEWT_VAL(BLE_LL_CONN_STRICT_SCHED_FIXED)
 static int
-ble_ll_hci_vs_css_configure(const uint8_t *cmdbuf, uint8_t cmdlen,
+ble_ll_hci_vs_css_configure(uint16_t ocf, const uint8_t *cmdbuf, uint8_t cmdlen,
                             uint8_t *rspbuf, uint8_t *rsplen)
 {
     const struct ble_hci_vs_css_configure_cp *cmd = (const void *)cmdbuf;
@@ -149,9 +149,8 @@ ble_ll_hci_vs_css_configure(const uint8_t *cmdbuf, uint8_t cmdlen,
         return BLE_ERR_INV_HCI_CMD_PARMS;
     }
 
-    if (ble_ll_sched_css_is_enabled() &&
-        !SLIST_EMPTY(&g_ble_ll_conn_css_list)) {
-        return BLE_ERR_CTLR_BUSY;
+    if (ble_ll_sched_css_is_enabled()) {
+        return BLE_ERR_CMD_DISALLOWED;
     }
 
     slot_us = le32toh(cmd->slot_us);
@@ -172,7 +171,7 @@ ble_ll_hci_vs_css_configure(const uint8_t *cmdbuf, uint8_t cmdlen,
 #endif
 
 static int
-ble_ll_hci_vs_css_enable(const uint8_t *cmdbuf, uint8_t cmdlen,
+ble_ll_hci_vs_css_enable(uint16_t ocf, const uint8_t *cmdbuf, uint8_t cmdlen,
                          uint8_t *rspbuf, uint8_t *rsplen)
 {
     const struct ble_hci_vs_css_enable_cp *cmd = (const void *)cmdbuf;
@@ -182,7 +181,7 @@ ble_ll_hci_vs_css_enable(const uint8_t *cmdbuf, uint8_t cmdlen,
     }
 
     if (!SLIST_EMPTY(&g_ble_ll_conn_active_list)) {
-        return BLE_ERR_CTLR_BUSY;
+        return BLE_ERR_CMD_DISALLOWED;
     }
 
     if (cmd->enable & 0xfe) {
@@ -195,8 +194,9 @@ ble_ll_hci_vs_css_enable(const uint8_t *cmdbuf, uint8_t cmdlen,
 }
 
 static int
-ble_ll_hci_vs_css_set_next_slot(const uint8_t *cmdbuf, uint8_t cmdlen,
-                                uint8_t *rspbuf, uint8_t *rsplen)
+ble_ll_hci_vs_css_set_next_slot(uint16_t ocf, const uint8_t *cmdbuf,
+                                uint8_t cmdlen, uint8_t *rspbuf,
+                                uint8_t *rsplen)
 {
     const struct ble_hci_vs_css_set_next_slot_cp *cmd = (const void *)cmdbuf;
     uint16_t slot_idx;
@@ -221,8 +221,9 @@ ble_ll_hci_vs_css_set_next_slot(const uint8_t *cmdbuf, uint8_t cmdlen,
 }
 
 static int
-ble_ll_hci_vs_css_set_conn_slot(const uint8_t *cmdbuf, uint8_t cmdlen,
-                                uint8_t *rspbuf, uint8_t *rsplen)
+ble_ll_hci_vs_css_set_conn_slot(uint16_t ocf, const uint8_t *cmdbuf,
+                                uint8_t cmdlen, uint8_t *rspbuf,
+                                uint8_t *rsplen)
 {
     const struct ble_hci_vs_css_set_conn_slot_cp *cmd = (const void *)cmdbuf;
     struct ble_ll_conn_sm *connsm;
@@ -269,8 +270,9 @@ ble_ll_hci_vs_css_set_conn_slot(const uint8_t *cmdbuf, uint8_t cmdlen,
 }
 
 static int
-ble_ll_hci_vs_css_read_conn_slot(const uint8_t *cmdbuf, uint8_t cmdlen,
-                                uint8_t *rspbuf, uint8_t *rsplen)
+ble_ll_hci_vs_css_read_conn_slot(uint16_t ocf, const uint8_t *cmdbuf,
+                                 uint8_t cmdlen, uint8_t *rspbuf,
+                                 uint8_t *rsplen)
 {
     const struct ble_hci_vs_css_read_conn_slot_cp *cmd = (const void *)cmdbuf;
     struct ble_hci_vs_css_read_conn_slot_rp *rsp = (void *)rspbuf;
@@ -292,42 +294,11 @@ ble_ll_hci_vs_css_read_conn_slot(const uint8_t *cmdbuf, uint8_t cmdlen,
     }
 
     *rsplen = sizeof(*rsp);
-    rsp->opcode = cmd->opcode;
     rsp->conn_handle = cmd->conn_handle;
     rsp->slot_idx = htole16(connsm->css_slot_idx);
 
     return BLE_ERR_SUCCESS;
 }
-
-static int
-ble_ll_hci_vs_css(uint16_t ocf, const uint8_t *cmdbuf, uint8_t cmdlen,
-                  uint8_t *rspbuf, uint8_t *rsplen)
-{
-    const struct ble_hci_vs_css_cp *cmd = (const void *)cmdbuf;
-
-    if (cmdlen < sizeof(*cmd)) {
-        return BLE_ERR_INV_HCI_CMD_PARMS;
-    }
-
-    *rsplen = 0;
-
-    switch (cmd->opcode) {
-#if !MYNEWT_VAL(BLE_LL_CONN_STRICT_SCHED_FIXED)
-    case BLE_HCI_VS_CSS_OP_CONFIGURE:
-        return ble_ll_hci_vs_css_configure(cmdbuf, cmdlen, rspbuf, rsplen);
-#endif
-    case BLE_HCI_VS_CSS_OP_ENABLE:
-        return ble_ll_hci_vs_css_enable(cmdbuf, cmdlen, rspbuf, rsplen);
-    case BLE_HCI_VS_CSS_OP_SET_NEXT_SLOT:
-        return ble_ll_hci_vs_css_set_next_slot(cmdbuf, cmdlen, rspbuf, rsplen);
-    case BLE_HCI_VS_CSS_OP_SET_CONN_SLOT:
-        return ble_ll_hci_vs_css_set_conn_slot(cmdbuf, cmdlen, rspbuf, rsplen);
-    case BLE_HCI_VS_CSS_OP_READ_CONN_SLOT:
-        return ble_ll_hci_vs_css_read_conn_slot(cmdbuf, cmdlen, rspbuf, rsplen);
-    }
-
-    return BLE_ERR_INV_HCI_CMD_PARMS;
-}
 #endif
 
 static struct ble_ll_hci_vs_cmd g_ble_ll_hci_vs_cmds[] = {
@@ -336,8 +307,18 @@ static struct ble_ll_hci_vs_cmd g_ble_ll_hci_vs_cmds[] = {
     BLE_LL_HCI_VS_CMD(BLE_HCI_OCF_VS_SET_TX_PWR,
             ble_ll_hci_vs_set_tx_power),
 #if MYNEWT_VAL(BLE_LL_HCI_VS_CONN_STRICT_SCHED)
-    BLE_LL_HCI_VS_CMD(BLE_HCI_OCF_VS_CSS,
-                      ble_ll_hci_vs_css),
+#if !MYNEWT_VAL(BLE_LL_CONN_STRICT_SCHED_FIXED)
+    BLE_LL_HCI_VS_CMD(BLE_HCI_OCF_VS_CSS_CONFIGURE,
+                      ble_ll_hci_vs_css_configure),
+#endif
+    BLE_LL_HCI_VS_CMD(BLE_HCI_OCF_VS_CSS_ENABLE,
+                      ble_ll_hci_vs_css_enable),
+    BLE_LL_HCI_VS_CMD(BLE_HCI_OCF_VS_CSS_SET_NEXT_SLOT,
+                      ble_ll_hci_vs_css_set_next_slot),
+    BLE_LL_HCI_VS_CMD(BLE_HCI_OCF_VS_CSS_SET_CONN_SLOT,
+                      ble_ll_hci_vs_css_set_conn_slot),
+    BLE_LL_HCI_VS_CMD(BLE_HCI_OCF_VS_CSS_READ_CONN_SLOT,
+                      ble_ll_hci_vs_css_read_conn_slot),
 #endif
 };
 
diff --git a/nimble/include/nimble/hci_common.h b/nimble/include/nimble/hci_common.h
index a4615843..b83c35aa 100644
--- a/nimble/include/nimble/hci_common.h
+++ b/nimble/include/nimble/hci_common.h
@@ -1142,39 +1142,29 @@ struct ble_hci_vs_set_tx_pwr_rp {
     int8_t tx_power;
 } __attribute__((packed));
 
-#define BLE_HCI_OCF_VS_CSS                              (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0003))
-struct ble_hci_vs_css_cp {
-    uint8_t opcode;
-} __attribute__((packed));
-#define BLE_HCI_VS_CSS_OP_CONFIGURE                     0x01
+#define BLE_HCI_OCF_VS_CSS_CONFIGURE                    (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0003))
 struct ble_hci_vs_css_configure_cp {
-    uint8_t opcode;
     uint32_t slot_us;
     uint32_t period_slots;
 } __attribute__((packed));
-#define BLE_HCI_VS_CSS_OP_ENABLE                        0x02
+#define BLE_HCI_OCF_VS_CSS_ENABLE                       (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0004))
 struct ble_hci_vs_css_enable_cp {
-    uint8_t opcode;
     uint8_t enable;
 } __attribute__((packed));
-#define BLE_HCI_VS_CSS_OP_SET_NEXT_SLOT                 0x03
+#define BLE_HCI_OCF_VS_CSS_SET_NEXT_SLOT                (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0005))
 struct ble_hci_vs_css_set_next_slot_cp {
-    uint8_t opcode;
     uint16_t slot_idx;
 } __attribute__((packed));
-#define BLE_HCI_VS_CSS_OP_SET_CONN_SLOT                 0x04
+#define BLE_HCI_OCF_VS_CSS_SET_CONN_SLOT                (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0006))
 struct ble_hci_vs_css_set_conn_slot_cp {
-    uint8_t opcode;
     uint16_t conn_handle;
     uint16_t slot_idx;
 } __attribute__((packed));
-#define BLE_HCI_VS_CSS_OP_READ_CONN_SLOT                0x05
+#define BLE_HCI_OCF_VS_CSS_READ_CONN_SLOT               (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0007))
 struct ble_hci_vs_css_read_conn_slot_cp {
-    uint8_t opcode;
     uint16_t conn_handle;
 } __attribute__((packed));
 struct ble_hci_vs_css_read_conn_slot_rp {
-    uint8_t opcode;
     uint16_t conn_handle;
     uint16_t slot_idx;
 } __attribute__((packed));