diff --git a/src/gatt-database.c b/src/gatt-database.c
index a1e8ff3..1d262cc 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
struct btd_device *device;
unsigned int id;
uint16_t offset;
+ uint8_t link_type;
struct gatt_db_attribute *attrib;
struct queue *owner_queue;
struct iovec data;
static struct pending_op *pending_read_new(struct btd_device *device,
struct queue *owner_queue,
struct gatt_db_attribute *attrib,
- unsigned int id, uint16_t offset)
+ unsigned int id, uint16_t offset,
+ uint8_t link_type)
{
struct pending_op *op;
op->attrib = attrib;
op->id = id;
op->offset = offset;
+ op->link_type = link_type;
queue_push_tail(owner_queue, op);
return op;
{
struct pending_op *op = user_data;
const char *path = device_get_path(op->device);
+ const char *link;
+
+ switch (op->link_type) {
+ case BT_ATT_LINK_BREDR:
+ link = "BR/EDR";
+ break;
+ case BT_ATT_LINK_LE:
+ link = "LE";
+ break;
+ default:
+ link = NULL;
+ break;
+ }
dict_append_entry(iter, "device", DBUS_TYPE_OBJECT_PATH, &path);
if (op->offset)
dict_append_entry(iter, "offset", DBUS_TYPE_UINT16,
&op->offset);
+ if (link)
+ dict_append_entry(iter, "link", DBUS_TYPE_STRING, &link);
}
static void read_setup_cb(DBusMessageIter *iter, void *user_data)
GDBusProxy *proxy,
struct queue *owner_queue,
unsigned int id,
- uint16_t offset)
+ uint16_t offset,
+ uint8_t link_type)
{
struct pending_op *op;
- op = pending_read_new(device, owner_queue, attrib, id, offset);
+ op = pending_read_new(device, owner_queue, attrib, id, offset,
+ link_type);
if (g_dbus_proxy_method_call(proxy, "ReadValue", read_setup_cb,
read_reply_cb, op, pending_op_free) == TRUE)
unsigned int id,
const uint8_t *value,
size_t len,
- uint16_t offset)
+ uint16_t offset, uint8_t link_type)
{
struct pending_op *op;
op->attrib = attrib;
op->id = id;
op->offset = offset;
+ op->link_type = link_type;
queue_push_tail(owner_queue, op);
return op;
struct queue *owner_queue,
unsigned int id,
const uint8_t *value, size_t len,
- uint16_t offset)
+ uint16_t offset, uint8_t link_type)
{
struct pending_op *op;
op = pending_write_new(device, owner_queue, attrib, id, value, len,
- offset);
+ offset, link_type);
if (g_dbus_proxy_method_call(proxy, "WriteValue", write_setup_cb,
owner_queue ? write_reply_cb : NULL,
retry:
send_write(op->device, op->attrib, chrc->proxy, NULL, op->id,
- op->data.iov_base, op->data.iov_len, 0);
+ op->data.iov_base, op->data.iov_len, 0,
+ op->link_type);
}
static void acquire_write_setup(DBusMessageIter *iter, void *user_data)
struct btd_device *device,
struct gatt_db_attribute *attrib,
unsigned int id,
- const uint8_t *value, size_t len)
+ const uint8_t *value, size_t len,
+ uint8_t link_type)
{
struct pending_op *op;
- op = pending_write_new(device, NULL, attrib, id, value, len, 0);
+ op = pending_write_new(device, NULL, attrib, id, value, len, 0,
+ link_type);
if (g_dbus_proxy_method_call(chrc->proxy, "AcquireWrite",
acquire_write_setup,
}
if (send_read(device, attrib, desc->proxy, desc->pending_reads, id,
- offset))
+ offset, bt_att_get_link_type(att)))
return;
fail:
}
if (send_write(device, attrib, desc->proxy, desc->pending_writes, id,
- value, len, offset))
+ value, len, offset, bt_att_get_link_type(att)))
return;
fail:
}
if (send_read(device, attrib, chrc->proxy, chrc->pending_reads, id,
- offset))
+ offset, bt_att_get_link_type(att)))
return;
fail:
}
if (g_dbus_proxy_get_property(chrc->proxy, "WriteAcquired", &iter)) {
- if (acquire_write(chrc, device, attrib, id, value, len))
+ if (acquire_write(chrc, device, attrib, id, value, len,
+ bt_att_get_link_type(att)))
return;
}
queue = NULL;
if (send_write(device, attrib, chrc->proxy, queue, id, value, len,
- offset))
+ offset, bt_att_get_link_type(att)))
return;
fail: