Zephyr Project API 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
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
51
52/* Bitmask values used by the os info command handler. Note that the width of this variable is
53 * 32-bits, allowing 32 flags, custom user-level implementations should start at
54 * OS_MGMT_INFO_FORMAT_USER_CUSTOM_START and reference that directly as additional format
55 * specifiers might be added to this list in the future.
56 */
70
71/* Structure provided in the MGMT_EVT_OP_OS_MGMT_INFO_CHECK notification callback */
73 /* Input format string from the mcumgr client */
74 struct zcbor_string *format;
75 /* Bitmask of values specifying which outputs should be present */
77 /* Number of valid format characters parsed, must be incremented by 1 for each valid
78 * character
79 */
81 /* Needs to be set to true if the OS name is being provided by external code */
83};
84
85/* Structure provided in the MGMT_EVT_OP_OS_MGMT_INFO_APPEND notification callback */
87 /* The format bitmask from the processed commands, the bits should be cleared once
88 * processed, note that if all_format_specified is specified, the corresponding bits here
89 * will not be set
90 */
92 /* Will be true if the all 'a' specifier was provided */
94 /* The output buffer which the responses should be appended to. If prior_output is true, a
95 * space must be added prior to the output response
96 */
98 /* The current size of the output response in the output buffer, must be updated to be the
99 * size of the output response after appending data
100 */
102 /* The size of the output buffer, including null terminator character, if the output
103 * response would exceed this size, the function must abort and return false to return a
104 * memory error to the client
105 */
107 /* If there has been prior output, must be set to true if a response has been output */
109};
110
111#ifdef __cplusplus
112}
113#endif
114
115#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_RTC_COMMAND_FAILED
RTC command failed.
Definition os_mgmt.h:49
@ 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_RTC_NOT_SET
RTC is not set.
Definition os_mgmt.h:46
@ 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:57
@ OS_MGMT_INFO_FORMAT_KERNEL_VERSION
Definition os_mgmt.h:61
@ OS_MGMT_INFO_FORMAT_PROCESSOR
Definition os_mgmt.h:64
@ OS_MGMT_INFO_FORMAT_KERNEL_RELEASE
Definition os_mgmt.h:60
@ OS_MGMT_INFO_FORMAT_HARDWARE_PLATFORM
Definition os_mgmt.h:65
@ OS_MGMT_INFO_FORMAT_MACHINE
Definition os_mgmt.h:63
@ OS_MGMT_INFO_FORMAT_NODE_NAME
Definition os_mgmt.h:59
@ OS_MGMT_INFO_FORMAT_OPERATING_SYSTEM
Definition os_mgmt.h:66
@ OS_MGMT_INFO_FORMAT_USER_CUSTOM_START
Definition os_mgmt.h:68
@ OS_MGMT_INFO_FORMAT_BUILD_DATE_TIME
Definition os_mgmt.h:62
@ OS_MGMT_INFO_FORMAT_KERNEL_NAME
Definition os_mgmt.h:58
__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:86
uint8_t * output
Definition os_mgmt.h:97
uint32_t * format_bitmask
Definition os_mgmt.h:91
bool all_format_specified
Definition os_mgmt.h:93
bool * prior_output
Definition os_mgmt.h:108
uint16_t * output_length
Definition os_mgmt.h:101
uint16_t buffer_size
Definition os_mgmt.h:106
Definition os_mgmt.h:72
uint32_t * format_bitmask
Definition os_mgmt.h:76
bool * custom_os_name
Definition os_mgmt.h:82
uint16_t * valid_formats
Definition os_mgmt.h:80
struct zcbor_string * format
Definition os_mgmt.h:74