You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by st...@apache.org on 2016/12/18 21:56:31 UTC

[03/50] incubator-mynewt-core git commit: bletiny: Enhance logs on advertising events

bletiny: Enhance logs on advertising events

This patch add additional logs decoding advertising flags.
This is useful for PTS testing.


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

Branch: refs/heads/sensors_branch
Commit: c7a5c5db613cbca6ba3eca240d9cd29c91378ab6
Parents: e527e30
Author: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Authored: Mon Dec 12 12:02:00 2016 +0100
Committer: Sterling Hughes <st...@apache.org>
Committed: Sun Dec 18 13:56:16 2016 -0800

----------------------------------------------------------------------
 apps/bletiny/src/main.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c7a5c5db/apps/bletiny/src/main.c
----------------------------------------------------------------------
diff --git a/apps/bletiny/src/main.c b/apps/bletiny/src/main.c
index 4ec6d5d..d3a9d38 100755
--- a/apps/bletiny/src/main.c
+++ b/apps/bletiny/src/main.c
@@ -141,7 +141,24 @@ bletiny_print_adv_fields(const struct ble_hs_adv_fields *fields)
     int i;
 
     if (fields->flags_is_present) {
-        console_printf("    flags=0x%02x\n", fields->flags);
+        console_printf("    flags=0x%02x:\n", fields->flags);
+
+        if (!(fields->flags & BLE_HS_ADV_F_DISC_LTD) &&
+                !(fields->flags & BLE_HS_ADV_F_DISC_GEN)) {
+                console_printf("        Non-discoverable mode\n");
+        }
+
+        if (fields->flags & BLE_HS_ADV_F_DISC_LTD) {
+                console_printf("        Limited discoverable mode\n");
+        }
+
+        if (fields->flags & BLE_HS_ADV_F_DISC_GEN) {
+                console_printf("        General discoverable mode\n");
+        }
+
+        if (fields->flags & BLE_HS_ADV_F_BREDR_UNSUP) {
+                console_printf("        BR/EDR not supported\n");
+        }
     }
 
     if (fields->uuids16 != NULL) {