Merge "Fixed the unicast address for send indication" into tizen accepted/tizen/unified/20190212.084048 submit/tizen/20190211.065813 submit/tizen/20190211.100729
authorPyun DoHyun <dh79.pyun@samsung.com>
Mon, 11 Feb 2019 06:57:05 +0000 (06:57 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 11 Feb 2019 06:57:05 +0000 (06:57 +0000)
bt-api/bt-event-handler.c
bt-oal/bluez_hal/src/bt-hal-gatt-server.c

index f003f56..a0daa4a 100644 (file)
@@ -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);
 
index 020c0a0..a280c3d 100644 (file)
@@ -737,11 +737,16 @@ static void __bt_gatt_manager_method_call(GDBusConnection *connection,
                                for (i = 0; i < char_info->flags_length; i++) {
                                        g_variant_builder_add(builder2, "s",
                                                        char_info->char_flags[i]);
-                                       if (strncmp(char_info->char_flags[i], "write-without-response", 16) == 0)
+
+                                       if (strncmp(char_info->char_flags[i], "write-without-response", 16) == 0) {
+                                               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);
@@ -752,13 +757,19 @@ static void __bt_gatt_manager_method_call(GDBusConnection *connection,
                                g_variant_builder_add(inner_builder, "{sv}", "Notifying",
                                                g_variant_new("b", notify));
 
-                               /* Unicast */
-                               g_variant_builder_add(inner_builder, "{sv}", "WriteAcquired",
+                               /* WriteAcquired */
+                               if (writeAcquired == TRUE) {
+                                       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");