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;
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",