Zephyr Project API  3.3.0
A Scalable Open Source RTOS
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 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef H_OS_MGMT_
9#define H_OS_MGMT_
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
18#define OS_MGMT_ID_ECHO 0
19#define OS_MGMT_ID_CONS_ECHO_CTRL 1
20#define OS_MGMT_ID_TASKSTAT 2
21#define OS_MGMT_ID_MPSTAT 3
22#define OS_MGMT_ID_DATETIME_STR 4
23#define OS_MGMT_ID_RESET 5
24#define OS_MGMT_ID_MCUMGR_PARAMS 6
25#define OS_MGMT_ID_INFO 7
26
27/* Bitmask values used by the os info command handler. Note that the width of this variable is
28 * 32-bits, allowing 32 flags, custom user-level implementations should start at
29 * OS_MGMT_INFO_FORMAT_USER_CUSTOM_START and reference that directly as additional format
30 * specifiers might be added to this list in the future.
31 */
42
44};
45
46/* Structure provided in the MGMT_EVT_OP_OS_MGMT_INFO_CHECK notification callback */
48 /* Input format string from the mcumgr client */
49 struct zcbor_string *format;
50 /* Bitmask of values specifying which outputs should be present */
52 /* Number of valid format characters parsed, must be incremented by 1 for each valid
53 * character
54 */
56 /* Needs to be set to true if the OS name is being provided by external code */
58};
59
60/* Structure provided in the MGMT_EVT_OP_OS_MGMT_INFO_APPEND notification callback */
62 /* The format bitmask from the processed commands, the bits should be cleared once
63 * processed, note that if all_format_specified is specified, the corrisponding bits here
64 * will not be set
65 */
67 /* Will be true if the all 'a' specifier was provided */
69 /* The output buffer which the responses should be appended to. If prior_output is true, a
70 * space must be added prior to the output response
71 */
73 /* The current size of the output response in the output buffer, must be updated to be the
74 * size of the output response after appending data
75 */
77 /* The size of the output buffer, including null terminator character, if the output
78 * response would exceed this size, the function must abort and return false to return a
79 * memory error to the client
80 */
82 /* If there has been prior output, must be set to true if a response has been output */
84};
85
86#ifdef __cplusplus
87}
88#endif
89
90#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_info_formats
Definition: os_mgmt.h:32
@ OS_MGMT_INFO_FORMAT_KERNEL_VERSION
Definition: os_mgmt.h:36
@ OS_MGMT_INFO_FORMAT_PROCESSOR
Definition: os_mgmt.h:39
@ OS_MGMT_INFO_FORMAT_KERNEL_RELEASE
Definition: os_mgmt.h:35
@ OS_MGMT_INFO_FORMAT_HARDWARE_PLATFORM
Definition: os_mgmt.h:40
@ OS_MGMT_INFO_FORMAT_MACHINE
Definition: os_mgmt.h:38
@ OS_MGMT_INFO_FORMAT_NODE_NAME
Definition: os_mgmt.h:34
@ OS_MGMT_INFO_FORMAT_OPERATING_SYSTEM
Definition: os_mgmt.h:41
@ OS_MGMT_INFO_FORMAT_USER_CUSTOM_START
Definition: os_mgmt.h:43
@ OS_MGMT_INFO_FORMAT_BUILD_DATE_TIME
Definition: os_mgmt.h:37
@ OS_MGMT_INFO_FORMAT_KERNEL_NAME
Definition: os_mgmt.h:33
__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:61
uint8_t * output
Definition: os_mgmt.h:72
uint32_t * format_bitmask
Definition: os_mgmt.h:66
bool all_format_specified
Definition: os_mgmt.h:68
bool * prior_output
Definition: os_mgmt.h:83
uint16_t * output_length
Definition: os_mgmt.h:76
uint16_t buffer_size
Definition: os_mgmt.h:81
Definition: os_mgmt.h:47
uint32_t * format_bitmask
Definition: os_mgmt.h:51
bool * custom_os_name
Definition: os_mgmt.h:57
uint16_t * valid_formats
Definition: os_mgmt.h:55
struct zcbor_string * format
Definition: os_mgmt.h:49