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/12/13 23:08:35 UTC

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

Branch: refs/heads/develop
Commit: 0c5bae698fc81df181477f7e4736a2f0bacd013d
Parents: bd546f7
Author: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Authored: Mon Dec 12 12:02:00 2016 +0100
Committer: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Committed: Tue Dec 13 22:08:10 2016 +0100

----------------------------------------------------------------------
 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/0c5bae69/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) {