Zephyr API Documentation  3.5.0
A Scalable Open Source RTOS
3.5.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
os_mgmt.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018-2021 mcumgr authors
3 * Copyright (c) 2022 Laird Connectivity
4 * Copyright (c) 2023 Nordic Semiconductor ASA
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
9#ifndef H_OS_MGMT_
10#define H_OS_MGMT_
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
19#define OS_MGMT_ID_ECHO 0
20#define OS_MGMT_ID_CONS_ECHO_CTRL 1
21#define OS_MGMT_ID_TASKSTAT 2
22#define OS_MGMT_ID_MPSTAT 3
23#define OS_MGMT_ID_DATETIME_STR 4
24#define OS_MGMT_ID_RESET 5
25#define OS_MGMT_ID_MCUMGR_PARAMS 6
26#define OS_MGMT_ID_INFO 7
27#define OS_MGMT_ID_BOOTLOADER_INFO 8
28
35
38
41
44};
45
46/* Bitmask values used by the os info command handler. Note that the width of this variable is
47 * 32-bits, allowing 32 flags, custom user-level implementations should start at
48 * OS_MGMT_INFO_FORMAT_USER_CUSTOM_START and reference that directly as additional format
49 * specifiers might be added to this list in the future.
50 */
61
63};
64
65/* Structure provided in the MGMT_EVT_OP_OS_MGMT_INFO_CHECK notification callback */
67 /* Input format string from the mcumgr client */
68 struct zcbor_string *format;
69 /* Bitmask of values specifying which outputs should be present */
71 /* Number of valid format characters parsed, must be incremented by 1 for each valid
72 * character
73 */
75 /* Needs to be set to true if the OS name is being provided by external code */
77};
78
79/* Structure provided in the MGMT_EVT_OP_OS_MGMT_INFO_APPEND notification callback */
81 /* The format bitmask from the processed commands, the bits should be cleared once
82 * processed, note that if all_format_specified is specified, the corrisponding bits here
83 * will not be set
84 */
86 /* Will be true if the all 'a' specifier was provided */
88 /* The output buffer which the responses should be appended to. If prior_output is true, a
89 * space must be added prior to the output response
90 */
92 /* The current size of the output response in the output buffer, must be updated to be the
93 * size of the output response after appending data
94 */
96 /* The size of the output buffer, including null terminator character, if the output
97 * response would exceed this size, the function must abort and return false to return a
98 * memory error to the client
99 */
101 /* If there has been prior output, must be set to true if a response has been output */
103};
104
105#ifdef __cplusplus
106}
107#endif
108
109#endif /* H_OS_MGMT_ */
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition: util_macro.h:44
os_mgmt_err_code_t
Command result codes for OS management group.
Definition: os_mgmt.h:32
@ OS_MGMT_ERR_OK
No error, this is implied if there is no ret value in the response.
Definition: os_mgmt.h:34
@ OS_MGMT_ERR_UNKNOWN
Unknown error occurred.
Definition: os_mgmt.h:37
@ OS_MGMT_ERR_INVALID_FORMAT
The provided format value is not valid.
Definition: os_mgmt.h:40
@ OS_MGMT_ERR_QUERY_YIELDS_NO_ANSWER
Query was not recognized.
Definition: os_mgmt.h:43
os_mgmt_info_formats
Definition: os_mgmt.h:51
@ OS_MGMT_INFO_FORMAT_KERNEL_VERSION
Definition: os_mgmt.h:55
@ OS_MGMT_INFO_FORMAT_PROCESSOR
Definition: os_mgmt.h:58
@ OS_MGMT_INFO_FORMAT_KERNEL_RELEASE
Definition: os_mgmt.h:54
@ OS_MGMT_INFO_FORMAT_HARDWARE_PLATFORM
Definition: os_mgmt.h:59
@ OS_MGMT_INFO_FORMAT_MACHINE
Definition: os_mgmt.h:57
@ OS_MGMT_INFO_FORMAT_NODE_NAME
Definition: os_mgmt.h:53
@ OS_MGMT_INFO_FORMAT_OPERATING_SYSTEM
Definition: os_mgmt.h:60
@ OS_MGMT_INFO_FORMAT_USER_CUSTOM_START
Definition: os_mgmt.h:62
@ OS_MGMT_INFO_FORMAT_BUILD_DATE_TIME
Definition: os_mgmt.h:56
@ OS_MGMT_INFO_FORMAT_KERNEL_NAME
Definition: os_mgmt.h:52
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
Definition: os_mgmt.h:80
uint8_t * output
Definition: os_mgmt.h:91
uint32_t * format_bitmask
Definition: os_mgmt.h:85
bool all_format_specified
Definition: os_mgmt.h:87
bool * prior_output
Definition: os_mgmt.h:102
uint16_t * output_length
Definition: os_mgmt.h:95
uint16_t buffer_size
Definition: os_mgmt.h:100
Definition: os_mgmt.h:66
uint32_t * format_bitmask
Definition: os_mgmt.h:70
bool * custom_os_name
Definition: os_mgmt.h:76
uint16_t * valid_formats
Definition: os_mgmt.h:74
struct zcbor_string * format
Definition: os_mgmt.h:68