summaryrefslogtreecommitdiff
path: root/src/gatt-client.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2016-09-02 15:22:16 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2016-09-05 12:27:21 +0300
commit16f6ec984ea2b802d13cce07964ce386f3dcf3dc (patch)
tree7dacc768d7509fa74e805a006f8e11308c5e5c57 /src/gatt-client.c
parent23c8c897f08f7568e1f98eefc47be7ae3da5cd54 (diff)
downloadbluez-16f6ec984ea2b802d13cce07964ce386f3dcf3dc.tar.gz
core/gatt-client: Fix not return empty array for ReadValue
The response to ReadValue shall be an array which can be empty.
Diffstat (limited to 'src/gatt-client.c')
-rw-r--r--src/gatt-client.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gatt-client.c b/src/gatt-client.c
index 2af6979ac..57a1f66fb 100644
--- a/src/gatt-client.c
+++ b/src/gatt-client.c
@@ -297,7 +297,7 @@ static void write_descriptor_cb(struct gatt_db_attribute *attr, int err,
}
static void async_dbus_op_reply(struct async_dbus_op *op, int err,
- const uint8_t *value, size_t length)
+ const uint8_t *value, ssize_t length)
{
const struct queue_entry *entry;
DBusMessage *reply;
@@ -319,7 +319,7 @@ static void async_dbus_op_reply(struct async_dbus_op *op, int err,
return;
}
- if (value)
+ if (length >= 0)
message_append_byte_array(reply, value, length);
send_reply:
@@ -489,7 +489,7 @@ static void write_result_cb(bool success, bool reliable_error,
}
done:
- async_dbus_op_reply(op, err, NULL, 0);
+ async_dbus_op_reply(op, err, NULL, -1);
}
static void write_cb(bool success, uint8_t att_ecode, void *user_data)
@@ -1126,7 +1126,7 @@ static void create_notify_reply(struct async_dbus_op *op, bool success,
else
err = att_ecode ? att_ecode : -ENOENT;
- async_dbus_op_reply(op, err, NULL, 0);
+ async_dbus_op_reply(op, err, NULL, -1);
}
static void register_notify_cb(uint16_t att_ecode, void *user_data)