Skip to content

Commit b78eea2

Browse files
m-alperen-senerkartben
authored andcommitted
Tests: Bluetooth: Tester: Mesh DFUM and BLOB should have own elements
Moving the blob client, dfd server and dfu server to their own elements and increasing the CONFIG_BT_MESH_TX_SEG_MAX to 8 to fit new composition data into composition data page status message. Standalone mesh blob client and DFU distributor/update server models requires one element and those elements only contain the main models and the models they extend to. Referring to MshMBT_v1.0 Section 6.1: The BLOB Transfer Client model defines the messages listed in Table 6.1 , and requires one element: the BLOB Transfer Client Main element. The BLOB Transfer Client Main element contains the BLOB Transfer Client main model. And referring to MshDFU_v1.0 Sections 6.1.1 and 6.2.1: 6.1.1 The Firmware Update Server model adds the state instances listed in Table 6.1 and Table 6.2 and the messages listed in Table 6.3 to the model it extends, and requires one element: the Firmware Update Main element. The Firmware Update Main element contains the Firmware Update Server main model and all the models that the main model extends. 6.2.1 The Firmware Distribution Server model adds the state instances listed in Table 6.7 and Table 6.8 and the messages listed in Table 6.9 to the model it extends, and requires one element: the Firmware Distribution Main element. The Firmware Distribution Main element contains the Firmware Distribution Server main model and all the models that the main model extends. Signed-off-by: alperen sener <[email protected]>
1 parent e653a39 commit b78eea2

File tree

2 files changed

+43
-26
lines changed

2 files changed

+43
-26
lines changed

tests/bluetooth/tester/overlay-mesh.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ CONFIG_BT_MESH_HEALTH_CLI=y
1515
CONFIG_BT_MESH_FRIEND=y
1616
CONFIG_BT_MESH_FRIEND_QUEUE_SIZE=32
1717
CONFIG_BT_MESH_RX_SEG_MAX=13
18-
CONFIG_BT_MESH_TX_SEG_MAX=7
18+
CONFIG_BT_MESH_TX_SEG_MAX=8
1919
CONFIG_BT_MESH_TX_SEG_MSG_COUNT=3
2020
CONFIG_BT_MESH_LPN_POLL_TIMEOUT=100
2121
CONFIG_BT_MESH_PROVISIONER=y

tests/bluetooth/tester/src/btp_mesh.c

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static void oob_store_handler(struct k_work *work)
290290
#endif /* CONFIG_BT_MESH_DFD_SRV_OOB_UPLOAD */
291291
#endif
292292

293-
#if defined(CONFIG_BT_MESH_BLOB_CLI) && !defined(CONFIG_BT_MESH_DFD_SRV)
293+
#if defined(CONFIG_BT_MESH_BLOB_CLI)
294294
static struct {
295295
struct bt_mesh_blob_cli_inputs inputs;
296296
struct bt_mesh_blob_target targets[32];
@@ -1023,7 +1023,7 @@ static uint8_t proxy_solicit(const void *cmd, uint16_t cmd_len,
10231023
static struct bt_mesh_brg_cfg_cli brg_cfg_cli;
10241024
#endif /* CONFIG_BT_MESH_BRG_CFG_CLI */
10251025

1026-
static const struct bt_mesh_model root_models[] = {
1026+
static const struct bt_mesh_model primary_models[] = {
10271027
BT_MESH_MODEL_CFG_SRV,
10281028
BT_MESH_MODEL_CFG_CLI(&cfg_cli),
10291029
BT_MESH_MODEL_HEALTH_SRV(&health_srv, &health_pub, health_srv_meta),
@@ -1052,15 +1052,6 @@ static const struct bt_mesh_model root_models[] = {
10521052
#if defined(CONFIG_BT_MESH_RPR_SRV)
10531053
BT_MESH_MODEL_RPR_SRV,
10541054
#endif
1055-
#if defined(CONFIG_BT_MESH_DFD_SRV)
1056-
BT_MESH_MODEL_DFD_SRV(&dfd_srv),
1057-
#endif
1058-
#if defined(CONFIG_BT_MESH_DFU_SRV)
1059-
BT_MESH_MODEL_DFU_SRV(&dfu_srv),
1060-
#endif
1061-
#if defined(CONFIG_BT_MESH_BLOB_CLI) && !defined(CONFIG_BT_MESH_DFD_SRV)
1062-
BT_MESH_MODEL_BLOB_CLI(&blob_cli),
1063-
#endif
10641055
#if defined(CONFIG_BT_MESH_PRIV_BEACON_SRV)
10651056
BT_MESH_MODEL_PRIV_BEACON_SRV,
10661057
#endif
@@ -1085,7 +1076,23 @@ static const struct bt_mesh_model root_models[] = {
10851076

10861077
};
10871078

1088-
static const struct bt_mesh_model root_models_alt[] = {
1079+
#if defined(CONFIG_BT_MESH_DFD_SRV)
1080+
static const struct bt_mesh_model dfu_distributor_models[] = {BT_MESH_MODEL_DFD_SRV(&dfd_srv)};
1081+
#endif
1082+
1083+
#if defined(CONFIG_BT_MESH_DFU_SRV)
1084+
static const struct bt_mesh_model dfu_target_models[] = {
1085+
BT_MESH_MODEL_DFU_SRV(&dfu_srv),
1086+
};
1087+
#endif
1088+
1089+
#if defined(CONFIG_BT_MESH_BLOB_CLI)
1090+
static const struct bt_mesh_model blob_client_models[] = {
1091+
BT_MESH_MODEL_BLOB_CLI(&blob_cli),
1092+
};
1093+
#endif
1094+
1095+
static const struct bt_mesh_model primary_models_alt[] = {
10891096
BT_MESH_MODEL_CFG_SRV,
10901097
BT_MESH_MODEL_CFG_CLI(&cfg_cli),
10911098
BT_MESH_MODEL_HEALTH_SRV(&health_srv, &health_pub, health_srv_meta_alt),
@@ -1114,15 +1121,6 @@ static const struct bt_mesh_model root_models_alt[] = {
11141121
#if defined(CONFIG_BT_MESH_RPR_SRV)
11151122
BT_MESH_MODEL_RPR_SRV,
11161123
#endif
1117-
#if defined(CONFIG_BT_MESH_DFD_SRV)
1118-
BT_MESH_MODEL_DFD_SRV(&dfd_srv),
1119-
#endif
1120-
#if defined(CONFIG_BT_MESH_DFU_SRV)
1121-
BT_MESH_MODEL_DFU_SRV(&dfu_srv),
1122-
#endif
1123-
#if defined(CONFIG_BT_MESH_BLOB_CLI) && !defined(CONFIG_BT_MESH_DFD_SRV)
1124-
BT_MESH_MODEL_BLOB_CLI(&blob_cli),
1125-
#endif
11261124
#if defined(CONFIG_BT_MESH_PRIV_BEACON_SRV)
11271125
BT_MESH_MODEL_PRIV_BEACON_SRV,
11281126
#endif
@@ -1146,6 +1144,7 @@ static const struct bt_mesh_model root_models_alt[] = {
11461144
#endif
11471145

11481146
};
1147+
11491148
struct model_data *lookup_model_bound(uint16_t id)
11501149
{
11511150
int i;
@@ -1164,11 +1163,29 @@ static const struct bt_mesh_model vnd_models[] = {
11641163
};
11651164

11661165
static const struct bt_mesh_elem elements[] = {
1167-
BT_MESH_ELEM(0, root_models, vnd_models),
1166+
BT_MESH_ELEM(0, primary_models, vnd_models),
1167+
#if defined(CONFIG_BT_MESH_DFD_SRV)
1168+
BT_MESH_ELEM(0, dfu_distributor_models, BT_MESH_MODEL_NONE),
1169+
#endif
1170+
#if defined(CONFIG_BT_MESH_DFU_SRV)
1171+
BT_MESH_ELEM(0, dfu_target_models, BT_MESH_MODEL_NONE),
1172+
#endif
1173+
#if defined(CONFIG_BT_MESH_BLOB_CLI)
1174+
BT_MESH_ELEM(0, blob_client_models, BT_MESH_MODEL_NONE),
1175+
#endif
11681176
};
11691177

11701178
static const struct bt_mesh_elem elements_alt[] = {
1171-
BT_MESH_ELEM(0, root_models_alt, vnd_models),
1179+
BT_MESH_ELEM(0, primary_models_alt, vnd_models),
1180+
#if defined(CONFIG_BT_MESH_DFD_SRV)
1181+
BT_MESH_ELEM(0, dfu_distributor_models, BT_MESH_MODEL_NONE),
1182+
#endif
1183+
#if defined(CONFIG_BT_MESH_DFU_SRV)
1184+
BT_MESH_ELEM(0, dfu_target_models, BT_MESH_MODEL_NONE),
1185+
#endif
1186+
#if defined(CONFIG_BT_MESH_BLOB_CLI)
1187+
BT_MESH_ELEM(0, blob_client_models, BT_MESH_MODEL_NONE),
1188+
#endif
11721189
};
11731190

11741191
static void link_open(bt_mesh_prov_bearer_t bearer)
@@ -4492,7 +4509,7 @@ static uint8_t dfu_firmware_update_apply(const void *cmd, uint16_t cmd_len,
44924509
}
44934510
#endif
44944511

4495-
#if defined(CONFIG_BT_MESH_BLOB_CLI) && !defined(CONFIG_BT_MESH_DFD_SRV)
4512+
#if defined(CONFIG_BT_MESH_BLOB_CLI)
44964513
static void blob_cli_inputs_prepare(uint16_t group, uint16_t app_idx)
44974514
{
44984515
int i;
@@ -5315,7 +5332,7 @@ static const struct btp_handler mdl_handlers[] = {
53155332
.func = dfu_firmware_update_apply,
53165333
},
53175334
#endif
5318-
#if defined(CONFIG_BT_MESH_BLOB_CLI) && !defined(CONFIG_BT_MESH_DFD_SRV)
5335+
#if defined(CONFIG_BT_MESH_BLOB_CLI)
53195336
{
53205337
.opcode = BTP_MMDL_BLOB_INFO_GET,
53215338
.expect_len = BTP_HANDLER_LENGTH_VARIABLE,

0 commit comments

Comments
 (0)