From ef34eccc366c5e6421a34fadb86170f3c16abe79 Mon Sep 17 00:00:00 2001 From: Abhishek Chandra Date: Mon, 3 Sep 2018 17:49:00 +0530 Subject: [PATCH] Gatt server ReadValue parsing fix Gatt server ReadValue parsing was always returning NULL as addr was always NULL when passed to __bt_find_remote_gatt_client_info ,To fix this address and request id is extracted from the variant parameter. Change-Id: If4b19109e893662b66663013c0051111461cc9bd Signed-off-by: Abhishek Chandra --- bt-oal/bluez_hal/src/bt-hal-gatt-server.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bt-oal/bluez_hal/src/bt-hal-gatt-server.c b/bt-oal/bluez_hal/src/bt-hal-gatt-server.c index b90ed57..e802ef3 100644 --- a/bt-oal/bluez_hal/src/bt-hal-gatt-server.c +++ b/bt-oal/bluez_hal/src/bt-hal-gatt-server.c @@ -230,7 +230,7 @@ static const gchar characteristics_introspection_xml[] = " " " " " " -" " +" " " " " " " " @@ -1069,8 +1069,13 @@ static void __bt_gatt_char_method_call(GDBusConnection *connection, struct gatt_client_info_t *conn_info = NULL; struct gatt_service_info *svc_info = NULL; + g_variant_get(parameters, "(&suq)", + &addr, &req_id, &offset); + + DBG("Request id = %u, Offset = %u", req_id, offset); DBG("Application path = %s", object_path); DBG("Sender = %s", sender); + DBG("Address = %s", addr); /* Check if device is already in connected list */ conn_info = __bt_find_remote_gatt_client_info(addr); @@ -1113,7 +1118,6 @@ static void __bt_gatt_char_method_call(GDBusConnection *connection, /* Convert address to hex */ _bt_hal_convert_addr_string_to_type(ev.bdaddr, addr); - event_cb(HAL_EV_GATT_READ_REQUESTED, (void *)&ev, sizeof(ev)); return; } else if (g_strcmp0(method_name, "WriteValue") == 0) { -- 2.7.4