Skip to content

Commit 2ad0eaa

Browse files
Michał Narajowskijhedberg
authored andcommitted
tests: Bluetooth: tester: Add Models Metadata Page 128
Add Models Metadata Page 128 support to tester. Signed-off-by: Michal Narajowski <[email protected]> Signed-off-by: Pavel Vasilyev <[email protected]>
1 parent 26e697b commit 2ad0eaa

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/bluetooth/tester/src/btp_mesh.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,31 @@ static uint8_t health_tests[] = {
542542
BT_MESH_HEALTH_TEST_INFO(COMPANY_ID_NORDIC_SEMI, 3, 0x01, 0x02, 0x03),
543543
};
544544

545+
static uint8_t zero_metadata[100];
546+
545547
static struct bt_mesh_models_metadata_entry health_srv_meta[] = {
546548
BT_MESH_HEALTH_TEST_INFO_METADATA(health_tests),
549+
{
550+
.len = ARRAY_SIZE(zero_metadata),
551+
.id = 0xABCD,
552+
.data = zero_metadata,
553+
},
554+
BT_MESH_MODELS_METADATA_END,
555+
};
556+
557+
static uint8_t health_tests_alt[] = {
558+
BT_MESH_HEALTH_TEST_INFO(COMPANY_ID_LF, 6, 0x11, 0x22, 0x33, 0x44, 0x55,
559+
0x66),
560+
BT_MESH_HEALTH_TEST_INFO(COMPANY_ID_NORDIC_SEMI, 3, 0x11, 0x22, 0x33),
561+
};
562+
563+
static struct bt_mesh_models_metadata_entry health_srv_meta_alt[] = {
564+
BT_MESH_HEALTH_TEST_INFO_METADATA(health_tests_alt),
565+
{
566+
.len = ARRAY_SIZE(zero_metadata),
567+
.id = 0xFEED,
568+
.data = zero_metadata,
569+
},
547570
BT_MESH_MODELS_METADATA_END,
548571
};
549572
#endif
@@ -1709,6 +1732,13 @@ static uint8_t change_prepare(const void *cmd, uint16_t cmd_len,
17091732
return BTP_STATUS_FAILED;
17101733
}
17111734

1735+
#if CONFIG_BT_MESH_LARGE_COMP_DATA_SRV
1736+
err = bt_mesh_models_metadata_change_prepare();
1737+
if (err < 0) {
1738+
return BTP_STATUS_FAILED;
1739+
}
1740+
#endif
1741+
17121742
return BTP_STATUS_SUCCESS;
17131743
}
17141744

@@ -5026,6 +5056,9 @@ uint8_t tester_init_mesh(void)
50265056
if (default_comp) {
50275057
err = bt_mesh_init(&prov, &comp);
50285058
} else {
5059+
#ifdef CONFIG_BT_MESH_LARGE_COMP_DATA_SRV
5060+
health_srv.metadata = health_srv_meta_alt;
5061+
#endif
50295062
err = bt_mesh_init(&prov, &comp_alt);
50305063
}
50315064

0 commit comments

Comments
 (0)