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