From 82d49f9d66a821d360e0f0c28a905e9cba1f961e Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 12 Jan 2015 19:49:51 -0200 Subject: [PATCH] core/gatt: Fix data caching When writing to the database the offset must be used properly. --- src/gatt-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gatt-client.c b/src/gatt-client.c index a488821fd..f6ef8100c 100644 --- a/src/gatt-client.c +++ b/src/gatt-client.c @@ -347,7 +347,7 @@ static void desc_read_cb(bool success, uint8_t att_ecode, if (!op->offset) gatt_db_attribute_reset(desc->attr); - gatt_db_attribute_write(desc->attr, 0, value, length, 0, NULL, + gatt_db_attribute_write(desc->attr, op->offset, value, length, 0, NULL, write_descriptor_cb, desc); /* @@ -779,7 +779,7 @@ static void chrc_read_cb(bool success, uint8_t att_ecode, const uint8_t *value, if (!op->offset) gatt_db_attribute_reset(chrc->attr); - gatt_db_attribute_write(chrc->attr, 0, value, length, op->offset, NULL, + gatt_db_attribute_write(chrc->attr, op->offset, value, length, 0, NULL, write_characteristic_cb, chrc); /* -- 2.47.3