Skip to content
Permalink
Browse files

Bluetooth: central_hr: use new API to get value handle

The assumption that the value handle is one past the attribute handle
works for Zephyr servers but may not be true for others.  Avoid the
hard-coded system-specific assumption.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
  • Loading branch information...
pabigot authored and jhedberg committed Jun 20, 2019
1 parent 587c35f commit 42d335982f1f14adeac889c474af4324ae18c386
Showing with 1 addition and 1 deletion.
  1. +1 −1 samples/bluetooth/central_hr/src/main.c
@@ -70,7 +70,7 @@ static u8_t discover_func(struct bt_conn *conn,
discover_params.uuid = &uuid.uuid;
discover_params.start_handle = attr->handle + 2;
discover_params.type = BT_GATT_DISCOVER_DESCRIPTOR;
subscribe_params.value_handle = attr->handle + 1;
subscribe_params.value_handle = bt_gatt_attr_value_handle(attr);

err = bt_gatt_discover(conn, &discover_params);
if (err) {

0 comments on commit 42d3359

Please sign in to comment.
You can’t perform that action at this time.