diff --git a/src/gatt-database.c b/src/gatt-database.c
index 3b4bc7c..4af9b81 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
const uint8_t *value;
uint16_t len;
bool indicate;
+ GDBusProxy *proxy;
};
static void conf_cb(void *user_data)
{
+ GDBusProxy *proxy = user_data;
DBG("GATT server received confirmation");
+
+ if (proxy != NULL)
+ {
+ g_dbus_proxy_method_call(proxy, "Confirm", NULL, NULL, NULL, NULL);
+ }
}
static void send_notification_to_device(void *data, void *user_data)
DBG("GATT server sending indication");
bt_gatt_server_send_indication(server, notify->handle, notify->value,
notify->len, conf_cb,
- NULL, NULL);
+ notify->proxy, NULL);
return;
static void send_notification_to_devices(struct btd_gatt_database *database,
uint16_t handle, const uint8_t *value,
uint16_t len, uint16_t ccc_handle,
- bool indicate)
+ bool indicate, GDBusProxy *proxy)
{
struct notify notify;
notify.value = value;
notify.len = len;
notify.indicate = indicate;
+ notify.proxy = proxy;
queue_foreach(database->device_states, send_notification_to_device,
¬ify);
put_le16(end, value + 2);
send_notification_to_devices(database, handle, value, sizeof(value),
- ccc_handle, true);
+ ccc_handle, true, NULL);
}
static void gatt_db_service_added(struct gatt_db_attribute *attrib,
gatt_db_attribute_get_handle(chrc->attrib),
value, len,
gatt_db_attribute_get_handle(chrc->ccc),
- chrc->props & BT_GATT_CHRC_PROP_INDICATE);
+ chrc->props & BT_GATT_CHRC_PROP_INDICATE, proxy);
}
static bool database_add_ccc(struct external_service *service,