Skip to content

Commit 9eeb85f

Browse files
olivier-le-sagesean-madigan
authored andcommitted
bluetooth: services: ras: Fix RAS RRSP after GATT API changes
I don't fully understand why a80371e72d7a08cf2d7cf2fb6ad2bb7f159e004f broke this service. However the API docs say that using 0 as attr_count will make this function search until the end, which fixes the asserts. Signed-off-by: Olivier Lesage <[email protected]>
1 parent bb30f3a commit 9eeb85f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

subsys/bluetooth/services/ras/rrsp/ras_rrsp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static void ondemand_rd_indicate_sent_cb(struct bt_conn *conn,
477477
static int ondemand_rd_notify_or_indicate(struct bt_conn *conn, struct net_buf_simple *buf)
478478
{
479479
struct bt_gatt_attr *attr =
480-
bt_gatt_find_by_uuid(rrsp_svc.attrs, 1, BT_UUID_RAS_ONDEMAND_RD);
480+
bt_gatt_find_by_uuid(rrsp_svc.attrs, 0, BT_UUID_RAS_ONDEMAND_RD);
481481

482482
__ASSERT_NO_MSG(attr);
483483

@@ -512,7 +512,7 @@ static int ondemand_rd_notify_or_indicate(struct bt_conn *conn, struct net_buf_s
512512

513513
static int rascp_indicate(struct bt_conn *conn, struct net_buf_simple *rsp)
514514
{
515-
struct bt_gatt_attr *attr = bt_gatt_find_by_uuid(rrsp_svc.attrs, 1, BT_UUID_RAS_CP);
515+
struct bt_gatt_attr *attr = bt_gatt_find_by_uuid(rrsp_svc.attrs, 0, BT_UUID_RAS_CP);
516516

517517
__ASSERT_NO_MSG(attr);
518518

@@ -538,7 +538,7 @@ static int rascp_indicate(struct bt_conn *conn, struct net_buf_simple *rsp)
538538
static int rd_status_notify_or_indicate(struct bt_conn *conn, const struct bt_uuid *uuid,
539539
uint16_t ranging_counter)
540540
{
541-
struct bt_gatt_attr *attr = bt_gatt_find_by_uuid(rrsp_svc.attrs, 1, uuid);
541+
struct bt_gatt_attr *attr = bt_gatt_find_by_uuid(rrsp_svc.attrs, 0, uuid);
542542

543543
__ASSERT_NO_MSG(attr);
544544

@@ -617,7 +617,7 @@ static void rascp_cmd_handle(struct bt_ras_rrsp *rrsp)
617617
LOG_DBG("GET_RD %d", ranging_counter);
618618

619619
struct bt_gatt_attr *attr =
620-
bt_gatt_find_by_uuid(rrsp_svc.attrs, 1, BT_UUID_RAS_ONDEMAND_RD);
620+
bt_gatt_find_by_uuid(rrsp_svc.attrs, 0, BT_UUID_RAS_ONDEMAND_RD);
621621

622622
__ASSERT_NO_MSG(attr);
623623

0 commit comments

Comments
 (0)