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 <jamie.mccrae@nordicsemi.no>
This commit is contained in:
Jamie McCrae 2022-11-18 09:10:03 +00:00 committed by Stephanos Ioannidis
commit 0922ec7d75
4 changed files with 30 additions and 29 deletions

View file

@ -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_ */

View file

@ -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 <zephyr/kernel.h>
#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_ */

View file

@ -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
/**

View file

@ -10,7 +10,7 @@
#include <zephyr/storage/flash_map.h>
#include <zephyr/mgmt/mcumgr/mgmt/mgmt.h>
#include <zephyr/mgmt/mcumgr/grp/zephyr/zephyr_groups.h>
#include <zephyr/mgmt/mcumgr/grp/zephyr/zephyr_basic.h>
LOG_MODULE_REGISTER(mcumgr_zephyr_grp);