Fixed the WriteAcquired property for char write 07/199107/1
authorAmit Purwar <amit.purwar@samsung.com>
Mon, 4 Feb 2019 06:32:06 +0000 (12:02 +0530)
committerAmit Purwar <amit.purwar@samsung.com>
Mon, 4 Feb 2019 06:35:11 +0000 (12:05 +0530)
Change-Id: Ic49087d5c6a6efc45c102a4d5224e8e5eef3eb31
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
bt-oal/bluez_hal/src/bt-hal-gatt-server.c

index bfeee9a8a5f0d004d2f18043fe713e45f14bfa53..949ea0c1e0099fae4f122dcae8b50e06c216fb3a 100644 (file)
@@ -737,8 +737,11 @@ 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)
                                                notifyAcquired = TRUE;
@@ -752,9 +755,12 @@ 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",