diff --git a/android/gatt.c b/android/gatt.c
index 5169468..98fb86f 100644
--- a/android/gatt.c
+++ b/android/gatt.c
goto failed;
}
+ ev.incl_srvc_handle = gatt_db_attribute_get_handle(service);
status = HAL_STATUS_SUCCESS;
failed:
ev.srvc_handle = cmd->service_handle;
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;