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/20 21:31:23 UTC

incubator-mynewt-core git commit: bleprph - Fix build errors.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 91bc6c245 -> 2efa34424


bleprph - Fix build errors.


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

Branch: refs/heads/develop
Commit: 2efa34424d5cd3dabb679b2b958465cc1dd7feb8
Parents: 91bc6c2
Author: Christopher Collins <cc...@apache.org>
Authored: Mon Jun 20 14:31:09 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon Jun 20 14:31:09 2016 -0700

----------------------------------------------------------------------
 apps/bleprph/src/bleprph.h |  1 +
 apps/bleprph/src/main.c    | 24 ++++++++++++++++--------
 apps/bleprph/src/misc.c    | 10 ++++++++++
 3 files changed, 27 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/2efa3442/apps/bleprph/src/bleprph.h
----------------------------------------------------------------------
diff --git a/apps/bleprph/src/bleprph.h b/apps/bleprph/src/bleprph.h
index 742319f..a353bac 100644
--- a/apps/bleprph/src/bleprph.h
+++ b/apps/bleprph/src/bleprph.h
@@ -60,5 +60,6 @@ int store_write(int obj_type, union ble_store_value *val);
 
 /** Misc. */
 void print_bytes(uint8_t *bytes, int len);
+void print_addr(void *addr);
 
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/2efa3442/apps/bleprph/src/main.c
----------------------------------------------------------------------
diff --git a/apps/bleprph/src/main.c b/apps/bleprph/src/main.c
index f2d0c09..69a4c7a 100755
--- a/apps/bleprph/src/main.c
+++ b/apps/bleprph/src/main.c
@@ -95,17 +95,25 @@ static int bleprph_gap_event(int event, struct ble_gap_conn_ctxt *ctxt,
 static void
 bleprph_print_conn_desc(struct ble_gap_conn_desc *desc)
 {
-    BLEPRPH_LOG(INFO, "handle=%d peer_addr_type=%d peer_addr=",
-                desc->conn_handle,
-                desc->peer_addr_type);
-    print_bytes(desc->peer_addr, 6);
+    BLEPRPH_LOG(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
+                desc->conn_handle, desc->our_ota_addr_type);
+    print_addr(desc->our_ota_addr);
+    BLEPRPH_LOG(INFO, " our_id_addr_type=%d our_id_addr=",
+                desc->our_id_addr_type);
+    print_addr(desc->our_id_addr);
+    BLEPRPH_LOG(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
+                desc->peer_ota_addr_type);
+    print_addr(desc->peer_ota_addr);
+    BLEPRPH_LOG(INFO, " peer_id_addr_type=%d peer_id_addr=",
+                desc->peer_id_addr_type);
+    print_addr(desc->peer_id_addr);
     BLEPRPH_LOG(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
-                      "encrypted=%d authenticated=%d",
-                desc->conn_itvl,
-                desc->conn_latency,
+                "encrypted=%d authenticated=%d bonded=%d\n",
+                desc->conn_itvl, desc->conn_latency,
                 desc->supervision_timeout,
                 desc->sec_state.encrypted,
-                desc->sec_state.authenticated);
+                desc->sec_state.authenticated,
+                desc->sec_state.bonded);
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/2efa3442/apps/bleprph/src/misc.c
----------------------------------------------------------------------
diff --git a/apps/bleprph/src/misc.c b/apps/bleprph/src/misc.c
index 64dfeed..d5d4808 100644
--- a/apps/bleprph/src/misc.c
+++ b/apps/bleprph/src/misc.c
@@ -31,3 +31,13 @@ print_bytes(uint8_t *bytes, int len)
         BLEPRPH_LOG(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
     }
 }
+
+void
+print_addr(void *addr)
+{
+    uint8_t *u8p;
+
+    u8p = addr;
+    BLEPRPH_LOG(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
+                u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
+}