You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by na...@apache.org on 2019/01/11 16:07:32 UTC

[mynewt-nimble] 02/07: host/gatts: Show local included services

This is an automated email from the ASF dual-hosted git repository.

naraj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit 79d4d26b2e61abd7952af49d52327aadacf846da
Author: MichaƂ Narajowski <mi...@codecoup.pl>
AuthorDate: Mon Dec 17 15:37:50 2018 +0100

    host/gatts: Show local included services
---
 nimble/host/src/ble_gatts_lcl.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/nimble/host/src/ble_gatts_lcl.c b/nimble/host/src/ble_gatts_lcl.c
index 52da541..c524ef5 100644
--- a/nimble/host/src/ble_gatts_lcl.c
+++ b/nimble/host/src/ble_gatts_lcl.c
@@ -134,6 +134,18 @@ ble_gatt_show_local_chr(const struct ble_gatt_svc_def *svc,
 }
 
 static void
+ble_gatt_show_local_inc_svc(const struct ble_gatt_svc_def *svc, char *uuid_buf)
+{
+    const struct ble_gatt_svc_def *inc_svc;
+
+    console_printf("%" FIELD_INDENT "s %" FIELD_NAME_LEN "s ", " ", "includes");
+    for (inc_svc = *svc->includes; inc_svc; ++inc_svc) {
+            console_printf("%s ", ble_uuid_to_str(inc_svc->uuid, uuid_buf));
+    }
+    console_printf("\n");
+}
+
+static void
 ble_gatt_show_local_svc(const struct ble_gatt_svc_def *svc,
                         uint16_t handle, uint16_t end_group_handle,
                         void *arg)
@@ -153,6 +165,9 @@ ble_gatt_show_local_svc(const struct ble_gatt_svc_def *svc,
     console_printf("%" FIELD_INDENT "s %" FIELD_NAME_LEN "s "
                    "%d\n", " ", "end_handle",
                    end_group_handle);
+    if (svc->includes) {
+        ble_gatt_show_local_inc_svc(svc, uuid_buf);
+    }
     ble_gatt_show_local_chr(svc, handle+1,
                             uuid_buf, flags_buf);
 }