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/22 19:18:41 UTC

[mynewt-nimble] branch master updated (e50cb6d5 -> 2aafc341)

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 e50cb6d5 nimble: Fix hci defs order
     new bed2f82b nimble/ll: Fix periodic data length check
     new 2aafc341 nimble/ll: Fix adv macros

The 2 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/src/ble_ll_adv.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)


[mynewt-nimble] 02/02: nimble/ll: Fix adv macros

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 2aafc341ae85f50433625bded347a45a30b87e34
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Aug 22 19:31:56 2022 +0200

    nimble/ll: Fix adv macros
    
    Use parentheses around macro parameters to avoid issue when expanding
    macro. Also some macros uses "advsm" instead of "_advsm" parameter.
---
 nimble/controller/src/ble_ll_adv.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/nimble/controller/src/ble_ll_adv.c b/nimble/controller/src/ble_ll_adv.c
index f0e0ae6b..0ffa1afc 100644
--- a/nimble/controller/src/ble_ll_adv.c
+++ b/nimble/controller/src/ble_ll_adv.c
@@ -193,19 +193,23 @@ struct ble_ll_adv_sm
 #define BLE_LL_ADV_SM_FLAG_CONN_RSP_TXD_ERR         0x8000
 
 #define ADV_DATA_LEN(_advsm) \
-                ((_advsm->adv_data) ? OS_MBUF_PKTLEN(advsm->adv_data) : 0)
+    (((_advsm)->adv_data) ? OS_MBUF_PKTLEN((_advsm)->adv_data) : 0)
 #define SCAN_RSP_DATA_LEN(_advsm) \
-                ((_advsm->scan_rsp_data) ? OS_MBUF_PKTLEN(advsm->scan_rsp_data) : 0)
-#define AUX_DATA_LEN(_advsm) \
-                (*(_advsm->aux_data) ? OS_MBUF_PKTLEN(*advsm->aux_data) : 0)
+    (((_advsm)->scan_rsp_data) ? OS_MBUF_PKTLEN((_advsm)->scan_rsp_data) : 0)
 
-#define AUX_CURRENT(_advsm)     (&(_advsm->aux[_advsm->aux_index]))
-#define AUX_NEXT(_advsm)        (&(_advsm->aux[_advsm->aux_index ^ 1]))
+#define AUX_CURRENT(_advsm) \
+    (&((_advsm)->aux[(_advsm)->aux_index]))
+#define AUX_NEXT(_advsm) \
+    (&((_advsm)->aux[(_advsm)->aux_index ^ 1]))
+#define AUX_DATA_LEN(_advsm) \
+    (*((_advsm)->aux_data) ? OS_MBUF_PKTLEN(*(_advsm)->aux_data) : 0)
 
-#define SYNC_CURRENT(_advsm) (&(_advsm->periodic_sync[_advsm->periodic_sync_index]))
-#define SYNC_NEXT(_advsm)    (&(_advsm->periodic_sync[_advsm->periodic_sync_index ^ 1]))
+#define SYNC_CURRENT(_advsm) \
+    (&((_advsm)->periodic_sync[(_advsm)->periodic_sync_index]))
+#define SYNC_NEXT(_advsm) \
+    (&((_advsm)->periodic_sync[(_advsm)->periodic_sync_index ^ 1]))
 #define SYNC_DATA_LEN(_advsm) \
-                (_advsm->periodic_adv_data ? OS_MBUF_PKTLEN(advsm->periodic_adv_data) : 0)
+    ((_advsm)->periodic_adv_data ? OS_MBUF_PKTLEN((_advsm)->periodic_adv_data) : 0)
 
 /* The advertising state machine global object */
 struct ble_ll_adv_sm g_ble_ll_adv_sm[BLE_ADV_INSTANCES];


[mynewt-nimble] 01/02: nimble/ll: Fix periodic data length check

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 bed2f82b71f0dfdb469d583fa7364a6cb0f989aa
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Aug 22 20:00:46 2022 +0200

    nimble/ll: Fix periodic data length check
    
    Ticks were added to usecs and this does not work as expected.
    
    This fixes HCI/DDI/BI-52-C.
---
 nimble/controller/src/ble_ll_adv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/nimble/controller/src/ble_ll_adv.c b/nimble/controller/src/ble_ll_adv.c
index 8e7df3a3..f0e0ae6b 100644
--- a/nimble/controller/src/ble_ll_adv.c
+++ b/nimble/controller/src/ble_ll_adv.c
@@ -3748,8 +3748,7 @@ ble_ll_adv_periodic_check_data_itvl(uint16_t payload_len, uint16_t props,
         pdu_len = ble_ll_adv_sync_get_pdu_len(payload_len, &offset, props);
 
         max_usecs += ble_ll_pdu_tx_time_get(pdu_len, phy);
-        max_usecs += ble_ll_tmr_u2t_up(BLE_LL_MAFS +
-                                       MYNEWT_VAL(BLE_LL_SCHED_AUX_CHAIN_MAFS_DELAY));
+        max_usecs += BLE_LL_MAFS + MYNEWT_VAL(BLE_LL_SCHED_AUX_CHAIN_MAFS_DELAY);
     }
 
     itvl_usecs = (uint32_t)itvl * BLE_LL_ADV_PERIODIC_ITVL;