1 /*
2  * Copyright (c) 2018-2021 mcumgr authors
3  * Copyright (c) 2023 Nordic Semiconductor ASA
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #ifndef H_STAT_MGMT_
9 #define H_STAT_MGMT_
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 /**
16  * Command IDs for statistics management group.
17  */
18 #define STAT_MGMT_ID_SHOW   0
19 #define STAT_MGMT_ID_LIST   1
20 
21 /**
22  * Command result codes for statistics management group.
23  */
24 enum stat_mgmt_err_code_t {
25 	/** No error, this is implied if there is no ret value in the response */
26 	STAT_MGMT_ERR_OK = 0,
27 
28 	/** Unknown error occurred. */
29 	STAT_MGMT_ERR_UNKNOWN,
30 
31 	/** The provided statistic group name was not found. */
32 	STAT_MGMT_ERR_INVALID_GROUP,
33 
34 	/** The provided statistic name was not found. */
35 	STAT_MGMT_ERR_INVALID_STAT_NAME,
36 
37 	/** The size of the statistic cannot be handled. */
38 	STAT_MGMT_ERR_INVALID_STAT_SIZE,
39 
40 	/** Walk through of statistics was aborted. */
41 	STAT_MGMT_ERR_WALK_ABORTED,
42 };
43 
44 /**
45  * @brief Represents a single value in a statistics group.
46  */
47 struct stat_mgmt_entry {
48 	const char *name;
49 	uint64_t value;
50 };
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 
56 #endif /* H_STAT_MGMT_ */
57