Repository: incubator-mynewt-larva Updated Branches: refs/heads/master d61dbe829 -> 2261599bb
Return all parameters in events even if the status is not success and they may not make sense Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/2261599b Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/2261599b Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/2261599b Branch: refs/heads/master Commit: 2261599bba5be6507c1a16af6bdc9cc62a876d0e Parents: d61dbe8 Author: wes3 <w...@micosa.io> Authored: Wed Jan 27 10:18:06 2016 -0800 Committer: wes3 <w...@micosa.io> Committed: Wed Jan 27 10:18:06 2016 -0800 ---------------------------------------------------------------------- net/nimble/controller/src/ble_ll_conn_hci.c | 18 ++++++++---------- net/nimble/controller/src/ble_ll_hci_ev.c | 8 +++----- 2 files changed, 11 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/2261599b/net/nimble/controller/src/ble_ll_conn_hci.c ---------------------------------------------------------------------- diff --git a/net/nimble/controller/src/ble_ll_conn_hci.c b/net/nimble/controller/src/ble_ll_conn_hci.c index 29c6810..2764bbb 100644 --- a/net/nimble/controller/src/ble_ll_conn_hci.c +++ b/net/nimble/controller/src/ble_ll_conn_hci.c @@ -150,16 +150,14 @@ ble_ll_conn_comp_event_send(struct ble_ll_conn_sm *connsm, uint8_t status) evbuf[1] = BLE_HCI_LE_CONN_COMPLETE_LEN; evbuf[2] = BLE_HCI_LE_SUBEV_CONN_COMPLETE; evbuf[3] = status; - if (status == BLE_ERR_SUCCESS) { - htole16(evbuf + 4, connsm->conn_handle); - evbuf[6] = connsm->conn_role - 1; - evbuf[7] = connsm->peer_addr_type; - memcpy(evbuf + 8, connsm->peer_addr, BLE_DEV_ADDR_LEN); - htole16(evbuf + 14, connsm->conn_itvl); - htole16(evbuf + 16, connsm->slave_latency); - htole16(evbuf + 18, connsm->supervision_tmo); - evbuf[20] = connsm->master_sca; - } + htole16(evbuf + 4, connsm->conn_handle); + evbuf[6] = connsm->conn_role - 1; + evbuf[7] = connsm->peer_addr_type; + memcpy(evbuf + 8, connsm->peer_addr, BLE_DEV_ADDR_LEN); + htole16(evbuf + 14, connsm->conn_itvl); + htole16(evbuf + 16, connsm->slave_latency); + htole16(evbuf + 18, connsm->supervision_tmo); + evbuf[20] = connsm->master_sca; ble_ll_hci_event_send(evbuf); } } http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/2261599b/net/nimble/controller/src/ble_ll_hci_ev.c ---------------------------------------------------------------------- diff --git a/net/nimble/controller/src/ble_ll_hci_ev.c b/net/nimble/controller/src/ble_ll_hci_ev.c index 500525f..ddd2ee5 100644 --- a/net/nimble/controller/src/ble_ll_hci_ev.c +++ b/net/nimble/controller/src/ble_ll_hci_ev.c @@ -115,11 +115,9 @@ ble_ll_hci_ev_rd_rem_used_feat(struct ble_ll_conn_sm *connsm, uint8_t status) evbuf[1] = BLE_HCI_LE_RD_REM_USED_FEAT_LEN; evbuf[2] = BLE_HCI_LE_SUBEV_RD_REM_USED_FEAT; evbuf[3] = status; - if (status == BLE_ERR_SUCCESS) { - htole16(evbuf + 4, connsm->conn_handle); - memset(evbuf + 6, 0, BLE_HCI_RD_LOC_SUPP_FEAT_RSPLEN); - evbuf[6] = connsm->common_features; - } + htole16(evbuf + 4, connsm->conn_handle); + memset(evbuf + 6, 0, BLE_HCI_RD_LOC_SUPP_FEAT_RSPLEN); + evbuf[6] = connsm->common_features; ble_ll_hci_event_send(evbuf); } }