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/06/05 11:52:06 UTC

[19/43] incubator-mynewt-core git commit: BLE Host - Fix incorrect IO capabilities table.

BLE Host - Fix incorrect IO capabilities table.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/e4bab333
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/e4bab333
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/e4bab333

Branch: refs/heads/develop
Commit: e4bab3334c5cced1023443403b4eb78d42cb83cf
Parents: 892a80a
Author: Christopher Collins <cc...@apache.org>
Authored: Tue May 31 22:47:00 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Sun Jun 5 19:15:39 2016 +0800

----------------------------------------------------------------------
 net/nimble/host/src/ble_sm_lgcy.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e4bab333/net/nimble/host/src/ble_sm_lgcy.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_sm_lgcy.c b/net/nimble/host/src/ble_sm_lgcy.c
index 275d942..38c1c13 100644
--- a/net/nimble/host/src/ble_sm_lgcy.c
+++ b/net/nimble/host/src/ble_sm_lgcy.c
@@ -37,24 +37,25 @@
 /* This is the initiator passkey action action dpeneding on the io
  * capabilties of both parties
  */
-static const uint8_t ble_sm_lgcy_init_pka[5 /*init*/ ][5 /*resp */] =
+static const uint8_t ble_sm_lgcy_init_pka[5 /*resp*/ ][5 /*init */] =
 {
     {PKACT_NONE,    PKACT_NONE,   PKACT_INPUT, PKACT_NONE, PKACT_INPUT},
     {PKACT_NONE,    PKACT_NONE,   PKACT_INPUT, PKACT_NONE, PKACT_INPUT},
     {PKACT_DISP,    PKACT_DISP,   PKACT_INPUT, PKACT_NONE, PKACT_DISP},
     {PKACT_NONE,    PKACT_NONE,   PKACT_NONE,  PKACT_NONE, PKACT_NONE},
-    {PKACT_DISP,    PKACT_DISP,   PKACT_DISP,  PKACT_NONE, PKACT_DISP},
+    {PKACT_DISP,    PKACT_DISP,   PKACT_INPUT, PKACT_NONE, PKACT_DISP},
 };
 
-/* This is the initiator passkey action action depending on the io
- * capabilities of both parties */
+/* This is the responder passkey action action depending on the io
+ * capabilities of both parties
+ */
 static const uint8_t ble_sm_lgcy_resp_pka[5 /*init*/ ][5 /*resp */] =
 {
     {PKACT_NONE,    PKACT_NONE,   PKACT_DISP,  PKACT_NONE, PKACT_DISP},
     {PKACT_NONE,    PKACT_NONE,   PKACT_DISP,  PKACT_NONE, PKACT_DISP},
     {PKACT_INPUT,   PKACT_INPUT,  PKACT_INPUT, PKACT_NONE, PKACT_INPUT},
     {PKACT_NONE,    PKACT_NONE,   PKACT_NONE,  PKACT_NONE, PKACT_NONE},
-    {PKACT_INPUT,   PKACT_INPUT,  PKACT_INPUT, PKACT_NONE, PKACT_INPUT},
+    {PKACT_INPUT,   PKACT_INPUT,  PKACT_DISP,  PKACT_NONE, PKACT_INPUT},
 };
 
 int
@@ -69,11 +70,11 @@ ble_sm_lgcy_passkey_action(struct ble_sm_proc *proc)
 
         action = BLE_SM_PKACT_NONE;
     } else if (proc->flags & BLE_SM_PROC_F_INITIATOR) {
-        action = ble_sm_lgcy_init_pka[proc->pair_req.io_cap]
-                                     [proc->pair_rsp.io_cap];
+        action = ble_sm_lgcy_init_pka[proc->pair_rsp.io_cap]
+                                     [proc->pair_req.io_cap];
     } else {
-        action = ble_sm_lgcy_resp_pka[proc->pair_req.io_cap]
-                                     [proc->pair_rsp.io_cap];
+        action = ble_sm_lgcy_resp_pka[proc->pair_rsp.io_cap]
+                                     [proc->pair_req.io_cap];
     }
 
     switch (action) {