From 0922ec7d759f9dbeff15d12b34950c53efe05a44 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 18 Nov 2022 09:10:03 +0000 Subject: [PATCH] mgmt: mcumgr: Move zephyr basic group defines to standard files Moves the zephyr group ID defines to the mgmt header file as it is with other group IDs and moves the zephyr basic group command IDs to the the same header-location style as other groups. Signed-off-by: Jamie McCrae --- .../mgmt/mcumgr/grp/zephyr/zephyr_basic.h | 22 +++++++++++++++ .../mgmt/mcumgr/grp/zephyr/zephyr_groups.h | 28 ------------------- include/zephyr/mgmt/mcumgr/mgmt/mgmt.h | 7 +++++ .../mcumgr/grp/zephyr_basic/src/basic_mgmt.c | 2 +- 4 files changed, 30 insertions(+), 29 deletions(-) create mode 100644 include/zephyr/mgmt/mcumgr/grp/zephyr/zephyr_basic.h delete mode 100644 include/zephyr/mgmt/mcumgr/grp/zephyr/zephyr_groups.h diff --git a/include/zephyr/mgmt/mcumgr/grp/zephyr/zephyr_basic.h b/include/zephyr/mgmt/mcumgr/grp/zephyr/zephyr_basic.h new file mode 100644 index 00000000000..baf6e8c071c --- /dev/null +++ b/include/zephyr/mgmt/mcumgr/grp/zephyr/zephyr_basic.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_ZEPHYR_BASIC_H_ +#define ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_ZEPHYR_BASIC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Command IDs for zephyr basic management group. + */ +#define ZEPHYR_MGMT_GRP_BASIC_CMD_ERASE_STORAGE 0 /* Command to erase storage partition */ + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_ZEPHYR_BASIC_H_ */ diff --git a/include/zephyr/mgmt/mcumgr/grp/zephyr/zephyr_groups.h b/include/zephyr/mgmt/mcumgr/grp/zephyr/zephyr_groups.h deleted file mode 100644 index a1760cdddfd..00000000000 --- a/include/zephyr/mgmt/mcumgr/grp/zephyr/zephyr_groups.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ -#ifndef ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_ -#define ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* The file contains definitions of Zephyr specific mgmt commands. The group numbers decrease - * from PERUSER to avoid collision with user defined groups. - */ -#define ZEPHYR_MGMT_GRP_BASE (MGMT_GROUP_ID_PERUSER - 1) - -/* Basic group */ -#define ZEPHYR_MGMT_GRP_BASIC ZEPHYR_MGMT_GRP_BASE -#define ZEPHYR_MGMT_GRP_BASIC_CMD_ERASE_STORAGE 0 /* Command to erase storage partition */ - -#ifdef __cplusplus -} -#endif - -#endif /* ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_ */ diff --git a/include/zephyr/mgmt/mcumgr/mgmt/mgmt.h b/include/zephyr/mgmt/mcumgr/mgmt/mgmt.h index bc5b9c89f56..b47a7e7f8df 100644 --- a/include/zephyr/mgmt/mcumgr/mgmt/mgmt.h +++ b/include/zephyr/mgmt/mcumgr/mgmt/mgmt.h @@ -36,6 +36,13 @@ extern "C" { #define MGMT_GROUP_ID_RUN 7 #define MGMT_GROUP_ID_FS 8 #define MGMT_GROUP_ID_SHELL 9 + +/** Zephyr-specific groups decrease from PERUSER to avoid collision with user defined groups. */ +#define ZEPHYR_MGMT_GRP_BASE (MGMT_GROUP_ID_PERUSER - 1) + +/** Basic group */ +#define ZEPHYR_MGMT_GRP_BASIC ZEPHYR_MGMT_GRP_BASE + #define MGMT_GROUP_ID_PERUSER 64 /** diff --git a/subsys/mgmt/mcumgr/grp/zephyr_basic/src/basic_mgmt.c b/subsys/mgmt/mcumgr/grp/zephyr_basic/src/basic_mgmt.c index 9fbd616663c..bfd64c89249 100644 --- a/subsys/mgmt/mcumgr/grp/zephyr_basic/src/basic_mgmt.c +++ b/subsys/mgmt/mcumgr/grp/zephyr_basic/src/basic_mgmt.c @@ -10,7 +10,7 @@ #include #include -#include +#include LOG_MODULE_REGISTER(mcumgr_zephyr_grp);