Skip to content

Commit 0922ec7

Browse files
nordicjmstephanosio
authored andcommitted
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 <[email protected]>
1 parent 4cf008c commit 0922ec7

File tree

4 files changed

+30
-29
lines changed

4 files changed

+30
-29
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2021 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#ifndef ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_ZEPHYR_BASIC_H_
7+
#define ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_ZEPHYR_BASIC_H_
8+
9+
#ifdef __cplusplus
10+
extern "C" {
11+
#endif
12+
13+
/**
14+
* Command IDs for zephyr basic management group.
15+
*/
16+
#define ZEPHYR_MGMT_GRP_BASIC_CMD_ERASE_STORAGE 0 /* Command to erase storage partition */
17+
18+
#ifdef __cplusplus
19+
}
20+
#endif
21+
22+
#endif /* ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_ZEPHYR_BASIC_H_ */

include/zephyr/mgmt/mcumgr/grp/zephyr/zephyr_groups.h

Lines changed: 0 additions & 28 deletions
This file was deleted.

include/zephyr/mgmt/mcumgr/mgmt/mgmt.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ extern "C" {
3636
#define MGMT_GROUP_ID_RUN 7
3737
#define MGMT_GROUP_ID_FS 8
3838
#define MGMT_GROUP_ID_SHELL 9
39+
40+
/** Zephyr-specific groups decrease from PERUSER to avoid collision with user defined groups. */
41+
#define ZEPHYR_MGMT_GRP_BASE (MGMT_GROUP_ID_PERUSER - 1)
42+
43+
/** Basic group */
44+
#define ZEPHYR_MGMT_GRP_BASIC ZEPHYR_MGMT_GRP_BASE
45+
3946
#define MGMT_GROUP_ID_PERUSER 64
4047

4148
/**

subsys/mgmt/mcumgr/grp/zephyr_basic/src/basic_mgmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <zephyr/storage/flash_map.h>
1111

1212
#include <zephyr/mgmt/mcumgr/mgmt/mgmt.h>
13-
#include <zephyr/mgmt/mcumgr/grp/zephyr/zephyr_groups.h>
13+
#include <zephyr/mgmt/mcumgr/grp/zephyr/zephyr_basic.h>
1414

1515
LOG_MODULE_REGISTER(mcumgr_zephyr_grp);
1616

0 commit comments

Comments
 (0)