This patch fixes a bug where a CCC read on the local GATT server always returned a 0-length value. --- src/gatt-database.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gatt-database.c b/src/gatt-database.c index 5e83ce1..e876141 100644 --- a/src/gatt-database.c +++ b/src/gatt-database.c @@ -495,7 +495,7 @@ static void gatt_ccc_read_cb(struct gatt_db_attribute *attrib, goto done; } - len -= offset; + len = 2 - offset; value = len ? &ccc->value[offset] : NULL; done: @@ -517,7 +517,7 @@ static void gatt_ccc_write_cb(struct gatt_db_attribute *attrib, handle = gatt_db_attribute_get_handle(attrib); - DBG("CCC read called for handle: 0x%04x", handle); + DBG("CCC write called for handle: 0x%04x", handle); if (!value || len != 2) { ecode = BT_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN; -- 2.2.0.rc0.207.ga3a616c -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html