Skip to content

Commit

Permalink
mgmt: mcumgr: grp: img_mgmt: Remove dummy header
Browse files Browse the repository at this point in the history
The dummy header was an opt-in feature to allow testing without a
real image but since we support testing on Qemu in CI which
supports flash partitions, there isn't a need for this option. Not
being deprecated as Kconfig would only have been used as part of
CI, not user applications.

Signed-off-by: Jamie McCrae <[email protected]>
  • Loading branch information
nordicjm authored and carlescufi committed Apr 21, 2023
1 parent 951a37d commit c8a0e8c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
6 changes: 0 additions & 6 deletions subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ config MCUMGR_GRP_IMG_VERBOSE_ERR
Add additional "rsn" key to SMP responses, where provided, explaining
non-0 "rc" codes.

config MCUMGR_GRP_IMG_DUMMY_HDR
bool "Return dummy image header data for imgr functions"
help
Returns dummy image header data for imgr functions,
useful when there are no images present, Eg: unit tests.

config MCUMGR_GRP_IMG_DIRECT_UPLOAD
bool "Allow direct image upload"
help
Expand Down
24 changes: 0 additions & 24 deletions subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,6 @@ int
img_mgmt_read_info(int image_slot, struct image_version *ver, uint8_t *hash,
uint32_t *flags)
{

#ifdef CONFIG_MCUMGR_GRP_IMG_DUMMY_HDR
uint8_t dummy_hash[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x00, 0x11, 0x22,
0x33, 0x44, 0x55, 0x66, 0x77};

if (!hash && !ver && !flags) {
return 0;
}

if (hash) {
memcpy(hash, dummy_hash, IMG_MGMT_HASH_LEN);
}

if (ver) {
memset(ver, 0xff, sizeof(*ver));
}

if (flags) {
*flags = 0;
}

return 0;
#endif

struct image_header hdr;
struct image_tlv tlv;
size_t data_off;
Expand Down

0 comments on commit c8a0e8c

Please sign in to comment.