From df57b0f976038be67b662c9478956ee9e6e95cf9 Mon Sep 17 00:00:00 2001 From: Marcin Kraglak Date: Mon, 17 Nov 2014 11:30:54 +0100 Subject: [PATCH] android/gatt: Set Descriptor handle and Include Service handle Set newly created attribute's handle in notification data. --- android/gatt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/android/gatt.c b/android/gatt.c index 516946824..98fb86f90 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -4322,6 +4322,7 @@ static void handle_server_add_included_service(const void *buf, uint16_t len) goto failed; } + ev.incl_srvc_handle = gatt_db_attribute_get_handle(service); status = HAL_STATUS_SUCCESS; failed: ev.srvc_handle = cmd->service_handle; @@ -5049,10 +5050,13 @@ static void handle_server_add_descriptor(const void *buf, uint16_t len) attrib = gatt_db_service_add_descriptor(attrib, &uuid, permissions, read_cb, write_cb, INT_TO_PTR(app_id)); - if (!attrib) + if (!attrib) { status = HAL_STATUS_FAILED; - else - status = HAL_STATUS_SUCCESS; + goto failed; + } + + ev.descr_handle = gatt_db_attribute_get_handle(attrib); + status = HAL_STATUS_SUCCESS; failed: ev.server_if = app_id; -- 2.47.3