Bluetooth: Tester: Add Blob, DFU and DFD tests support

Adding support for automatic testing BLOB, DFU and DFD models.

Co-authored-by: Agata Ponitka <agata.ponitka@codecoup.pl>
Co-authored-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit is contained in:
Krzysztof Kopyściński 2022-05-04 08:05:03 +02:00 committed by Johan Hedberg
parent 68928e050f
commit 51ec2462d6
5 changed files with 1082 additions and 2 deletions

View file

@ -20,7 +20,7 @@ CONFIG_BT_MESH_SAR_CFG_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_MSG_COUNT=3
CONFIG_BT_MESH_TX_SEG_MSG_COUNT=10
CONFIG_BT_MESH_LPN_POLL_TIMEOUT=100
CONFIG_BT_MESH_PROVISIONER=y
CONFIG_BT_MESH_CDB=y
@ -32,5 +32,11 @@ CONFIG_BT_MESH_PROVISIONER=y
CONFIG_BT_MESH_RPR_SRV=y
CONFIG_BT_MESH_RPR_CLI=y
CONFIG_BT_MESH_RPR_AD_TYPES_MAX=2
CONFIG_BT_MESH_BLOB_CLI=y
CONFIG_BT_MESH_DFU_CLI=y
CONFIG_BT_MESH_BLOB_SRV=y
CONFIG_BT_MESH_DFU_SRV=y
CONFIG_BT_MESH_DFD_SRV=y
CONFIG_BT_MESH_DFU_SLOT_CNT=2
CONFIG_SETTINGS=y

View file

@ -895,6 +895,72 @@ struct btp_rpr_reprov_remote_cmd {
bool comp_change;
} __packed;
#define BTP_MMDL_DFU_INFO_GET 0x5f
struct btp_mmdl_dfu_info_get_cmd {
uint8_t limit;
} __packed;
#define BTP_MMDL_BLOB_INFO_GET 0x60
struct btp_mmdl_blob_info_get_cmd {
uint8_t addr_cnt;
uint8_t addr[];
} __packed;
#define BTP_MMDL_DFU_UPDATE_METADATA_CHECK 0x61
struct btp_mmdl_dfu_metadata_check_cmd {
uint8_t index;
uint8_t slot_idx;
uint8_t slot_size;
uint8_t fwid_len;
uint8_t metadata_len;
uint8_t data[];
} __packed;
struct btp_mmdl_dfu_metadata_check_rp {
uint8_t idx;
uint8_t status;
uint8_t effect;
} __packed;
#define BTP_MMDL_DFU_FIRMWARE_UPDATE_GET 0x62
#define BTP_MMDL_DFU_FIRMWARE_UPDATE_CANCEL 0x63
#define BTP_MMDL_DFU_FIRMWARE_UPDATE_START 0x64
struct btp_mmdl_dfu_firmware_update_cmd {
uint8_t addr_cnt;
uint8_t slot_idx;
uint8_t slot_size;
uint8_t fwid_len;
uint8_t metadata_len;
uint8_t block_size;
uint16_t chunk_size;
uint8_t data[];
} __packed;
struct btp_mmdl_dfu_firmware_update_rp {
uint8_t status;
} __packed;
#define BTP_MMDL_BLOB_SRV_RECV 0x65
struct btp_mmdl_blob_srv_recv_cmd {
uint64_t id;
uint16_t timeout;
} __packed;
#define BTP_MMDL_BLOB_TRANSFER_START 0x66
struct btp_mmdl_blob_transfer_start_cmd {
uint64_t id;
uint16_t size;
uint8_t block_size;
uint16_t chunk_size;
uint16_t timeout;
} __packed;
#define BTP_MMDL_BLOB_TRANSFER_CANCEL 0x67
#define BTP_MMDL_BLOB_TRANSFER_GET 0x68
#define BTP_MMDL_BLOB_SRV_CANCEL 0x69
#define BTP_MMDL_DFU_FIRMWARE_UPDATE_APPLY 0x6A
#define BTP_MMDL_DFU_SRV_APPLY 0x6B
/* events */
#define BTP_MESH_EV_OUT_NUMBER_ACTION 0x80
struct btp_mesh_out_number_action_ev {
@ -996,3 +1062,5 @@ struct btp_mesh_model_recv_ev {
uint8_t payload_len;
uint8_t payload[];
} __packed;
#define MESH_EV_BLOB_LOST_TARGET 0x90

View file

@ -73,6 +73,9 @@ uint8_t tester_unregister_vocs(void);
uint8_t tester_init_ias(void);
uint8_t tester_unregister_ias(void);
uint8_t tester_init_mmdl(void);
uint8_t tester_unregister_mmdl(void);
uint8_t tester_init_gap(void);
uint8_t tester_unregister_gap(void);

View file

@ -127,6 +127,9 @@ static uint8_t register_service(const void *cmd, uint16_t cmd_len,
case BTP_SERVICE_ID_MESH:
status = tester_init_mesh();
break;
case BTP_SERVICE_ID_MESH_MDL:
status = tester_init_mmdl();
break;
#endif /* CONFIG_BT_MESH */
#if defined(CONFIG_BT_VCP_VOL_REND) || defined(CONFIG_BT_VCP_VOL_CTLR)
case BTP_SERVICE_ID_VCS:
@ -226,6 +229,9 @@ static uint8_t unregister_service(const void *cmd, uint16_t cmd_len,
case BTP_SERVICE_ID_MESH:
status = tester_unregister_mesh();
break;
case BTP_SERVICE_ID_MESH_MDL:
status = tester_unregister_mmdl();
break;
#endif /* CONFIG_BT_MESH */
#if defined(CONFIG_BT_VCP_VOL_REND)
case BTP_SERVICE_ID_VCS:

File diff suppressed because it is too large Load diff