From: Amit Purwar Date: Wed, 6 Feb 2019 11:34:39 +0000 (+0530) Subject: Fixed NotifyAcquired property for gatt indication X-Git-Tag: accepted/tizen/unified/20190212.084048~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8cd0310086237a6daac3054eb414bfafdf7b21df;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git Fixed NotifyAcquired property for gatt indication Change-Id: I995f79d0964acf6f8c2c0caa62361c58b046eb54 Signed-off-by: Amit Purwar --- diff --git a/bt-api/bt-event-handler.c b/bt-api/bt-event-handler.c index f003f56..a0daa4a 100644 --- a/bt-api/bt-event-handler.c +++ b/bt-api/bt-event-handler.c @@ -3884,7 +3884,7 @@ static void __bt_gatt_server_event_filter(GDBusConnection *connection, bluetooth_gatt_server_notification_changed_t info; memset(&info, 0x00, sizeof(bluetooth_gatt_server_notification_changed_t)); - BT_INFO("GATT Server event[BT_GATT_SERVER_NOTIFICATION_COMPLETED]"); + BT_INFO("GATT Server event[BT_GATT_SERVER_NOTIFICATION_CHANGED]"); /* Extract data from DBUS params */ g_variant_get(parameters, "(i&sib)", &result, &address, &info.handle, &info.notification); 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 949ea0c..57d266b 100644 --- a/bt-oal/bluez_hal/src/bt-hal-gatt-server.c +++ b/bt-oal/bluez_hal/src/bt-hal-gatt-server.c @@ -739,12 +739,14 @@ static void __bt_gatt_manager_method_call(GDBusConnection *connection, char_info->char_flags[i]); if (strncmp(char_info->char_flags[i], "write-without-response", 16) == 0) { - DBG("setting writeAcquired property"); + DBG("setting WriteAcquired property"); writeAcquired = TRUE; } - if (strncmp(char_info->char_flags[i], "notify", 4) == 0) + if (strncmp(char_info->char_flags[i], "notify", 4) == 0) { + DBG("setting NotifyAcquired property"); notifyAcquired = TRUE; + } } flags_val = g_variant_new("as", builder2); @@ -757,14 +759,17 @@ static void __bt_gatt_manager_method_call(GDBusConnection *connection, /* WriteAcquired */ if (writeAcquired == TRUE) { - DBG("adding writeAcquired property"); + DBG("adding WriteAcquired property"); g_variant_builder_add(inner_builder, "{sv}", "WriteAcquired", g_variant_new("b", writeAcquired)); } /* NotifyAcquired */ - g_variant_builder_add(inner_builder, "{sv}", "NotifyAcquired", - g_variant_new("b", notifyAcquired)); + if (notifyAcquired == TRUE) { + DBG("adding NotifyAcquired property"); + g_variant_builder_add(inner_builder, "{sv}", "NotifyAcquired", + g_variant_new("b", notifyAcquired)); + } /* Unicast */ unicast = g_strdup("00:00:00:00:00:00");