tests: bsim: Bluetooth: central_hr peripheral_hr coverage

Add bsim test coverage for central_hr and peripheral_hr
samples.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2024-03-15 14:05:11 +01:00 committed by Fabio Baltieri
commit 12dc399c4d
16 changed files with 268 additions and 0 deletions

View file

@ -27,6 +27,8 @@ static struct bt_uuid_16 discover_uuid = BT_UUID_INIT_16(0);
static struct bt_gatt_discover_params discover_params;
static struct bt_gatt_subscribe_params subscribe_params;
uint64_t total_rx_count; /* This value is exposed to test code */
static uint8_t notify_func(struct bt_conn *conn,
struct bt_gatt_subscribe_params *params,
const void *data, uint16_t length)
@ -39,6 +41,8 @@ static uint8_t notify_func(struct bt_conn *conn,
printk("[NOTIFICATION] data %p length %u\n", data, length);
total_rx_count++;
return BT_GATT_ITER_CONTINUE;
}
@ -224,6 +228,8 @@ static void connected(struct bt_conn *conn, uint8_t conn_err)
printk("Connected: %s\n", addr);
total_rx_count = 0U;
if (conn == default_conn) {
memcpy(&discover_uuid, BT_UUID_HRS, sizeof(discover_uuid));
discover_params.uuid = &discover_uuid.uuid;