From 90af8029ba8e346dc8009b39426157e57d5d7b5e Mon Sep 17 00:00:00 2001 From: Kiran K Date: Wed, 4 Oct 2023 16:08:23 +0300 Subject: [PATCH] shared/csip: Fix return of Rank attribute Return Rank attribute as per the configured value. --- src/shared/csip.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/shared/csip.c b/src/shared/csip.c index 53ce15541..e13efb6ce 100644 --- a/src/shared/csip.c +++ b/src/shared/csip.c @@ -280,9 +280,13 @@ static void csis_rank_read_cb(struct gatt_db_attribute *attrib, uint8_t opcode, struct bt_att *att, void *user_data) { - uint8_t value = CSIS_RANK; + struct bt_csis *csis = user_data; + struct iovec iov; - gatt_db_attribute_read_result(attrib, id, 0, &value, sizeof(value)); + iov.iov_base = &csis->rank_val; + iov.iov_len = sizeof(csis->rank_val); + + gatt_db_attribute_read_result(attrib, id, 0, iov.iov_base, iov.iov_len); } static struct bt_csis *csis_new(struct gatt_db *db) -- 2.47.3