Skip to content

Commit

Permalink
Tests: Bluetooth: Tester: Mesh DFUM and BLOB should have own elements
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
m-alperen-sener committed Nov 27, 2024
1 parent ceb683f commit 39665bc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 26 deletions.
2 changes: 1 addition & 1 deletion tests/bluetooth/tester/overlay-mesh.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CONFIG_BT_MESH_HEALTH_CLI=y
CONFIG_BT_MESH_FRIEND=y
CONFIG_BT_MESH_FRIEND_QUEUE_SIZE=32
CONFIG_BT_MESH_RX_SEG_MAX=13
CONFIG_BT_MESH_TX_SEG_MAX=7
CONFIG_BT_MESH_TX_SEG_MAX=8
CONFIG_BT_MESH_TX_SEG_MSG_COUNT=3
CONFIG_BT_MESH_LPN_POLL_TIMEOUT=100
CONFIG_BT_MESH_PROVISIONER=y
Expand Down
67 changes: 42 additions & 25 deletions tests/bluetooth/tester/src/btp_mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ static void oob_store_handler(struct k_work *work)
#endif /* CONFIG_BT_MESH_DFD_SRV_OOB_UPLOAD */
#endif

#if defined(CONFIG_BT_MESH_BLOB_CLI) && !defined(CONFIG_BT_MESH_DFD_SRV)
#if defined(CONFIG_BT_MESH_BLOB_CLI)
static struct {
struct bt_mesh_blob_cli_inputs inputs;
struct bt_mesh_blob_target targets[32];
Expand Down Expand Up @@ -1023,7 +1023,7 @@ static uint8_t proxy_solicit(const void *cmd, uint16_t cmd_len,
static struct bt_mesh_brg_cfg_cli brg_cfg_cli;
#endif /* CONFIG_BT_MESH_BRG_CFG_CLI */

static const struct bt_mesh_model root_models[] = {
static const struct bt_mesh_model primary_models[] = {
BT_MESH_MODEL_CFG_SRV,
BT_MESH_MODEL_CFG_CLI(&cfg_cli),
BT_MESH_MODEL_HEALTH_SRV(&health_srv, &health_pub, health_srv_meta),
Expand Down Expand Up @@ -1052,15 +1052,6 @@ static const struct bt_mesh_model root_models[] = {
#if defined(CONFIG_BT_MESH_RPR_SRV)
BT_MESH_MODEL_RPR_SRV,
#endif
#if defined(CONFIG_BT_MESH_DFD_SRV)
BT_MESH_MODEL_DFD_SRV(&dfd_srv),
#endif
#if defined(CONFIG_BT_MESH_DFU_SRV)
BT_MESH_MODEL_DFU_SRV(&dfu_srv),
#endif
#if defined(CONFIG_BT_MESH_BLOB_CLI) && !defined(CONFIG_BT_MESH_DFD_SRV)
BT_MESH_MODEL_BLOB_CLI(&blob_cli),
#endif
#if defined(CONFIG_BT_MESH_PRIV_BEACON_SRV)
BT_MESH_MODEL_PRIV_BEACON_SRV,
#endif
Expand All @@ -1085,7 +1076,23 @@ static const struct bt_mesh_model root_models[] = {

};

static const struct bt_mesh_model root_models_alt[] = {
#if defined(CONFIG_BT_MESH_DFD_SRV)
static const struct bt_mesh_model dfu_distributor_models[] = {BT_MESH_MODEL_DFD_SRV(&dfd_srv)};
#endif

#if defined(CONFIG_BT_MESH_DFU_SRV)
static const struct bt_mesh_model dfu_target_models[] = {
BT_MESH_MODEL_DFU_SRV(&dfu_srv),
};
#endif

#if defined(CONFIG_BT_MESH_BLOB_CLI)
static const struct bt_mesh_model blob_client_models[] = {
BT_MESH_MODEL_BLOB_CLI(&blob_cli),
};
#endif

static const struct bt_mesh_model primary_models_alt[] = {
BT_MESH_MODEL_CFG_SRV,
BT_MESH_MODEL_CFG_CLI(&cfg_cli),
BT_MESH_MODEL_HEALTH_SRV(&health_srv, &health_pub, health_srv_meta_alt),
Expand Down Expand Up @@ -1114,15 +1121,6 @@ static const struct bt_mesh_model root_models_alt[] = {
#if defined(CONFIG_BT_MESH_RPR_SRV)
BT_MESH_MODEL_RPR_SRV,
#endif
#if defined(CONFIG_BT_MESH_DFD_SRV)
BT_MESH_MODEL_DFD_SRV(&dfd_srv),
#endif
#if defined(CONFIG_BT_MESH_DFU_SRV)
BT_MESH_MODEL_DFU_SRV(&dfu_srv),
#endif
#if defined(CONFIG_BT_MESH_BLOB_CLI) && !defined(CONFIG_BT_MESH_DFD_SRV)
BT_MESH_MODEL_BLOB_CLI(&blob_cli),
#endif
#if defined(CONFIG_BT_MESH_PRIV_BEACON_SRV)
BT_MESH_MODEL_PRIV_BEACON_SRV,
#endif
Expand All @@ -1146,6 +1144,7 @@ static const struct bt_mesh_model root_models_alt[] = {
#endif

};

struct model_data *lookup_model_bound(uint16_t id)
{
int i;
Expand All @@ -1164,11 +1163,29 @@ static const struct bt_mesh_model vnd_models[] = {
};

static const struct bt_mesh_elem elements[] = {
BT_MESH_ELEM(0, root_models, vnd_models),
BT_MESH_ELEM(0, primary_models, vnd_models),
#if defined(CONFIG_BT_MESH_DFD_SRV)
BT_MESH_ELEM(0, dfu_distributor_models, BT_MESH_MODEL_NONE),
#endif
#if defined(CONFIG_BT_MESH_DFU_SRV)
BT_MESH_ELEM(0, dfu_target_models, BT_MESH_MODEL_NONE),
#endif
#if defined(CONFIG_BT_MESH_BLOB_CLI)
BT_MESH_ELEM(0, blob_client_models, BT_MESH_MODEL_NONE),
#endif
};

static const struct bt_mesh_elem elements_alt[] = {
BT_MESH_ELEM(0, root_models_alt, vnd_models),
BT_MESH_ELEM(0, primary_models_alt, vnd_models),
#if defined(CONFIG_BT_MESH_DFD_SRV)
BT_MESH_ELEM(0, dfu_distributor_models, BT_MESH_MODEL_NONE),
#endif
#if defined(CONFIG_BT_MESH_DFU_SRV)
BT_MESH_ELEM(0, dfu_target_models, BT_MESH_MODEL_NONE),
#endif
#if defined(CONFIG_BT_MESH_BLOB_CLI)
BT_MESH_ELEM(0, blob_client_models, BT_MESH_MODEL_NONE),
#endif
};

static void link_open(bt_mesh_prov_bearer_t bearer)
Expand Down Expand Up @@ -4492,7 +4509,7 @@ static uint8_t dfu_firmware_update_apply(const void *cmd, uint16_t cmd_len,
}
#endif

#if defined(CONFIG_BT_MESH_BLOB_CLI) && !defined(CONFIG_BT_MESH_DFD_SRV)
#if defined(CONFIG_BT_MESH_BLOB_CLI)
static void blob_cli_inputs_prepare(uint16_t group, uint16_t app_idx)
{
int i;
Expand Down Expand Up @@ -5315,7 +5332,7 @@ static const struct btp_handler mdl_handlers[] = {
.func = dfu_firmware_update_apply,
},
#endif
#if defined(CONFIG_BT_MESH_BLOB_CLI) && !defined(CONFIG_BT_MESH_DFD_SRV)
#if defined(CONFIG_BT_MESH_BLOB_CLI)
{
.opcode = BTP_MMDL_BLOB_INFO_GET,
.expect_len = BTP_HANDLER_LENGTH_VARIABLE,
Expand Down

0 comments on commit 39665bc

Please sign in to comment.