You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/11/17 11:26:28 UTC

[GitHub] [mynewt-nimble] sjanc commented on a change in pull request #1088: Update ble_ll_conn_hci.c

sjanc commented on a change in pull request #1088:
URL: https://github.com/apache/mynewt-nimble/pull/1088#discussion_r751148502



##########
File path: nimble/controller/src/ble_ll_conn_hci.c
##########
@@ -225,7 +228,10 @@ ble_ll_conn_comp_event_send(struct ble_ll_conn_sm *connsm, uint8_t status,
             ev->conn_itvl = htole16(connsm->conn_itvl);
             ev->conn_latency = htole16(connsm->slave_latency);
             ev->supervision_timeout = htole16(connsm->supervision_tmo);
-            ev->mca = connsm->master_sca;
+            if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER)
+                enh_ev->mca = 0;

Review comment:
       same here
   
   also copy-and-paste error? shouldn't this be ev->mca ?

##########
File path: nimble/controller/src/ble_ll_conn_hci.c
##########
@@ -200,7 +200,10 @@ ble_ll_conn_comp_event_send(struct ble_ll_conn_sm *connsm, uint8_t status,
             enh_ev->conn_itvl = htole16(connsm->conn_itvl);
             enh_ev->conn_latency = htole16(connsm->slave_latency);
             enh_ev->supervision_timeout = htole16(connsm->supervision_tmo);
-            enh_ev->mca = connsm->master_sca;
+            if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER)

Review comment:
       I think that since event is zeroed we can just set it for slave eg:
   
   if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
       enh_ev->mca = connsm->master_sca;
   }
   
   
   also note that our coding style require {} also single line ifs




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org