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/05/04 22:24:26 UTC

incubator-mynewt-core git commit: BLE host - swap PIN endianness in TK.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop fd3d28ea7 -> a4ee38418


BLE host - swap PIN endianness in TK.


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

Branch: refs/heads/develop
Commit: a4ee384182535a5894d28cc228688022b0d5f86d
Parents: fd3d28e
Author: Christopher Collins <cc...@apache.org>
Authored: Wed May 4 15:24:04 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Wed May 4 15:24:04 2016 -0700

----------------------------------------------------------------------
 net/nimble/host/src/ble_l2cap_sm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a4ee3841/net/nimble/host/src/ble_l2cap_sm.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap_sm.c b/net/nimble/host/src/ble_l2cap_sm.c
index 079ca4a..6eed99a 100644
--- a/net/nimble/host/src/ble_l2cap_sm.c
+++ b/net/nimble/host/src/ble_l2cap_sm.c
@@ -1368,10 +1368,10 @@ ble_l2cap_sm_set_tk(uint16_t conn_handle, struct passkey_action *pkey)
                 goto set_tk_return;
             }
             memset(proc->tk, 0, 16);
-            proc->tk[15] = (pkey->passkey >> 0) & 0xff;
-            proc->tk[14] = (pkey->passkey >> 8) & 0xff;
-            proc->tk[13] = (pkey->passkey >> 16) & 0xff;
-            proc->tk[12] = (pkey->passkey >> 24) & 0xff;
+            proc->tk[0] = (pkey->passkey >> 0) & 0xff;
+            proc->tk[1] = (pkey->passkey >> 8) & 0xff;
+            proc->tk[2] = (pkey->passkey >> 16) & 0xff;
+            proc->tk[3] = (pkey->passkey >> 24) & 0xff;
             sm_error = BLE_L2CAP_SM_ERR_PASSKEY;
             break;
         default: