You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/01/05 20:27:01 UTC

[2/2] incubator-mynewt-larva git commit: Fix parsing bug for disconnection complete event.

Fix parsing bug for disconnection complete event.


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/5e3d07d7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/5e3d07d7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/5e3d07d7

Branch: refs/heads/master
Commit: 5e3d07d78e1bcacb45ae4f446f1acfda52f2a124
Parents: fe6e81e
Author: Christopher Collins <cc...@gmail.com>
Authored: Tue Jan 5 11:25:36 2016 -0800
Committer: Christopher Collins <cc...@gmail.com>
Committed: Tue Jan 5 11:26:47 2016 -0800

----------------------------------------------------------------------
 net/nimble/host/src/host_hci.c         | 6 +++---
 net/nimble/include/nimble/hci_common.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/5e3d07d7/net/nimble/host/src/host_hci.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/host_hci.c b/net/nimble/host/src/host_hci.c
index e31cedb..42110df 100644
--- a/net/nimble/host/src/host_hci.c
+++ b/net/nimble/host/src/host_hci.c
@@ -174,9 +174,9 @@ host_hci_rx_disconn_complete(uint8_t event_code, uint8_t *data, int len)
         return BLE_HS_EMSGSIZE;
     }
 
-    evt.status = data[0];
-    evt.connection_handle = le16toh(data + 1);
-    evt.reason = data[3];
+    evt.status = data[2];
+    evt.connection_handle = le16toh(data + 3);
+    evt.reason = data[5];
 
     ble_gap_conn_rx_disconn_complete(&evt);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/5e3d07d7/net/nimble/include/nimble/hci_common.h
----------------------------------------------------------------------
diff --git a/net/nimble/include/nimble/hci_common.h b/net/nimble/include/nimble/hci_common.h
index 3a88caa..94037ab 100644
--- a/net/nimble/include/nimble/hci_common.h
+++ b/net/nimble/include/nimble/hci_common.h
@@ -354,7 +354,7 @@
 
 /* Event specific definitions */
 /* Event disconnect complete */
-#define BLE_HCI_EVENT_DISCONN_COMPLETE_LEN  (4)
+#define BLE_HCI_EVENT_DISCONN_COMPLETE_LEN  (6)
 
 /* Event command complete */
 #define BLE_HCI_EVENT_CMD_COMPLETE_HDR_LEN  (5)