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/15 02:28:08 UTC

[46/50] [abbrv] incubator-mynewt-core git commit: bletiny - Separate pairing from encryption.

bletiny - Separate pairing from encryption.


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

Branch: refs/heads/develop
Commit: ed9fea61fcaea134383aa3a76b48a19f1804a90d
Parents: 67f0192
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Jun 14 16:19:39 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Jun 14 19:24:38 2016 -0700

----------------------------------------------------------------------
 apps/bletiny/src/cmd.c                 |  7 ++++++-
 apps/bletiny/src/main.c                |  2 +-
 net/nimble/host/include/host/ble_gap.h |  6 +++---
 net/nimble/host/src/ble_gap.c          | 10 ++++++++++
 4 files changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ed9fea61/apps/bletiny/src/cmd.c
----------------------------------------------------------------------
diff --git a/apps/bletiny/src/cmd.c b/apps/bletiny/src/cmd.c
index 3ac8592..fc05aa2 100644
--- a/apps/bletiny/src/cmd.c
+++ b/apps/bletiny/src/cmd.c
@@ -388,7 +388,12 @@ cmd_conn(int argc, char **argv)
     }
 
     if (addr_type != BLE_GAP_ADDR_TYPE_WL) {
-        rc = parse_arg_mac("addr", peer_addr);
+        rc = parse_arg_mac("peer_addr", peer_addr);
+        if (rc == ENOENT) {
+            /* Allow "addr" for backwards compatibility. */
+            rc = parse_arg_mac("addr", peer_addr);
+        }
+
         if (rc != 0) {
             return rc;
         }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ed9fea61/apps/bletiny/src/main.c
----------------------------------------------------------------------
diff --git a/apps/bletiny/src/main.c b/apps/bletiny/src/main.c
index ad55e68..5b71700 100755
--- a/apps/bletiny/src/main.c
+++ b/apps/bletiny/src/main.c
@@ -1359,7 +1359,7 @@ bletiny_sec_pair(uint16_t conn_handle)
 
     int rc;
 
-    rc = ble_sm_pair_initiate(conn_handle);
+    rc = ble_gap_pair_initiate(conn_handle);
     return rc;
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ed9fea61/net/nimble/host/include/host/ble_gap.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/include/host/ble_gap.h b/net/nimble/host/include/host/ble_gap.h
index 0b150dd..ba442d1 100644
--- a/net/nimble/host/include/host/ble_gap.h
+++ b/net/nimble/host/include/host/ble_gap.h
@@ -268,9 +268,9 @@ int ble_gap_wl_set(struct ble_gap_white_entry *white_list,
 int ble_gap_update_params(uint16_t conn_handle,
                           struct ble_gap_upd_params *params);
 int ble_gap_security_initiate(uint16_t conn_handle);
-int
-ble_gap_encryption_initiate(uint16_t conn_handle, uint8_t *ltk,
-                            uint16_t ediv, uint64_t rand_val, int auth);
+int ble_gap_pair_initiate(uint16_t conn_handle);
+int ble_gap_encryption_initiate(uint16_t conn_handle, uint8_t *ltk,
+                                uint16_t ediv, uint64_t rand_val, int auth);
 int ble_gap_provide_ltk(uint16_t conn_handle, uint8_t *ltk);
 void ble_gap_init_identity_addr(uint8_t *addr);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/ed9fea61/net/nimble/host/src/ble_gap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_gap.c b/net/nimble/host/src/ble_gap.c
index a0fb13c..3e9a0de 100644
--- a/net/nimble/host/src/ble_gap.c
+++ b/net/nimble/host/src/ble_gap.c
@@ -2157,6 +2157,16 @@ ble_gap_security_initiate(uint16_t conn_handle)
 }
 
 int
+ble_gap_pair_initiate(uint16_t conn_handle)
+{
+    int rc;
+
+    rc = ble_sm_pair_initiate(conn_handle);
+
+    return rc;
+}
+
+int
 ble_gap_encryption_initiate(uint16_t conn_handle,
                             uint8_t *ltk,
                             uint16_t ediv,