diff --git a/src/gatt-client.c b/src/gatt-client.c
index eae5419..7e04c7d 100644
--- a/src/gatt-client.c
+++ b/src/gatt-client.c
return TRUE;
}
+static gboolean
+characteristic_get_write_acquired(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *data)
+{
+ struct characteristic *chrc = data;
+ dbus_bool_t locked = chrc->write_io ? TRUE : FALSE;
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &locked);
+
+ return TRUE;
+}
+
+static gboolean
+characteristic_write_acquired_exists(const GDBusPropertyTable *property,
+ void *data)
+{
+ struct characteristic *chrc = data;
+
+ return (chrc->props & BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP);
+}
+
static void write_characteristic_cb(struct gatt_db_attribute *attr, int err,
void *user_data)
{
if (io == chrc->write_io) {
io_destroy(chrc->write_io);
chrc->write_io = NULL;
+ g_dbus_emit_property_changed(btd_get_dbus_connection(),
+ chrc->path,
+ GATT_CHARACTERISTIC_IFACE,
+ "WriteAcquired");
}
}
close(pipefd[dir]);
- if (dir)
+ if (dir) {
chrc->write_io = io;
+ g_dbus_emit_property_changed(btd_get_dbus_connection(),
+ chrc->path,
+ GATT_CHARACTERISTIC_IFACE,
+ "WriteAcquired");
+ }
DBG("%s: sender %s io %p", dbus_message_get_member(msg),
dbus_message_get_sender(msg), io);
{ "Notifying", "b", characteristic_get_notifying, NULL,
characteristic_notifying_exists },
{ "Flags", "as", characteristic_get_flags, NULL, NULL },
+ { "WriteAcquired", "b", characteristic_get_write_acquired, NULL,
+ characteristic_write_acquired_exists,
+ G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
{ }
};