This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new 0ef8d59 nimble/ll: Fix master SCA in LE Connection Complete Event
0ef8d59 is described below
commit 0ef8d590db8bc741f3e25610c6e3e6d11dba2c6c
Author: Kaka1234-ai <[email protected]>
AuthorDate: Thu Nov 18 10:26:25 2021 +0800
nimble/ll: Fix master SCA in LE Connection Complete Event
MCA in LE (Enhanced) Connection Complete Event is valid only for
peripheral role (5.3 V4 Part E 7.7.6.5.1).
---
nimble/controller/src/ble_ll_conn_hci.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/nimble/controller/src/ble_ll_conn_hci.c
b/nimble/controller/src/ble_ll_conn_hci.c
index 7e47377..6489af0 100644
--- a/nimble/controller/src/ble_ll_conn_hci.c
+++ b/nimble/controller/src/ble_ll_conn_hci.c
@@ -200,7 +200,9 @@ 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_SLAVE) {
+ enh_ev->mca = connsm->master_sca;
+ }
}
ble_ll_hci_event_send(hci_ev);
@@ -225,7 +227,9 @@ 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_SLAVE) {
+ ev->mca = connsm->master_sca;
+ }
}
ble_ll_hci_event_send(hci_ev);