13#ifndef ZEPHYR_INCLUDE_SHELL_SHELL_H_
14#define ZEPHYR_INCLUDE_SHELL_SHELL_H_
28#if defined CONFIG_SHELL_GETOPT
37#ifndef CONFIG_SHELL_PROMPT_BUFF_SIZE
38#define CONFIG_SHELL_PROMPT_BUFF_SIZE 0
41#ifndef CONFIG_SHELL_CMD_BUFF_SIZE
42#define CONFIG_SHELL_CMD_BUFF_SIZE 0
45#ifndef CONFIG_SHELL_PRINTF_BUFF_SIZE
46#define CONFIG_SHELL_PRINTF_BUFF_SIZE 0
49#ifndef CONFIG_SHELL_HISTORY_BUFFER
50#define CONFIG_SHELL_HISTORY_BUFFER 0
53#define Z_SHELL_CMD_ROOT_LVL (0u)
55#define SHELL_HEXDUMP_BYTES_IN_LINE 16
77#define SHELL_OPT_ARG_RAW (0xFE)
82#define SHELL_OPT_ARG_CHECK_SKIP (0xFF)
88#define SHELL_OPT_ARG_MAX (0xFD)
128#define SHELL_CMD_FLAG_REMOTE_ROOT BIT(0)
131#define SHELL_CMD_FLAG_REMOTE_SUBCMD BIT(1)
268 size_t argc,
char **argv);
284 char **argv,
void *data);
290#if (defined(CONFIG_ARCH_POSIX) && defined(CONFIG_64BIT)) || defined(CONFIG_X86_64)
291#define Z_SHELL_STATIC_ENTRY_PADDING 24
293#define Z_SHELL_STATIC_ENTRY_PADDING 0
306 uint8_t padding[Z_SHELL_STATIC_ENTRY_PADDING];
333#define SHELL_STRUCTURED_HELP_MAGIC 0x86D20BC4
347 const uint32_t magic32 = SHELL_STRUCTURED_HELP_MAGIC;
348 const char *magic = (
const char *)&magic32;
355 return help !=
NULL && (magic[0] == help[0]) && (magic[1] == help[1])
356 && (magic[2] == help[2]) && (magic[3] == help[3]);
359#if defined(CONFIG_SHELL_HELP) || defined(__DOXYGEN__)
383#define SHELL_HELP(_description, _usage) \
384 ((const char *)&(const struct shell_cmd_help){ \
385 .magic = SHELL_STRUCTURED_HELP_MAGIC, \
386 .description = (_description), \
390#define SHELL_HELP(_description, _usage) NULL
408#define SHELL_CMD_ARG_REGISTER(syntax, subcmd, help, handler, \
409 mandatory, optional) \
410 static const struct shell_static_entry UTIL_CAT(_shell_, syntax) = \
411 SHELL_CMD_ARG(syntax, subcmd, help, handler, mandatory, optional); \
412 static const TYPE_SECTION_ITERABLE(union shell_cmd_entry, \
413 UTIL_CAT(shell_cmd_, syntax), shell_root_cmds, \
414 UTIL_CAT(shell_cmd_, syntax) \
416 .entry = &UTIL_CAT(_shell_, syntax) \
439#define SHELL_COND_CMD_ARG_REGISTER(flag, syntax, subcmd, help, handler, \
440 mandatory, optional) \
444 SHELL_CMD_ARG_REGISTER(syntax, subcmd, help, handler, \
445 mandatory, optional) \
448 static shell_cmd_handler dummy_##syntax##_handler __unused = \
450 static const union shell_cmd_entry *dummy_subcmd_##syntax \
465#define SHELL_CMD_REGISTER(syntax, subcmd, help, handler) \
466 SHELL_CMD_ARG_REGISTER(syntax, subcmd, help, handler, 0, 0)
481#define SHELL_COND_CMD_REGISTER(flag, syntax, subcmd, help, handler) \
482 SHELL_COND_CMD_ARG_REGISTER(flag, syntax, subcmd, help, handler, 0, 0)
502#define SHELL_STATIC_SUBCMD_SET_CREATE(name, ...) \
503 static const struct shell_static_entry shell_##name[] = { \
506 static const union shell_cmd_entry name = { \
507 .entry = shell_##name \
510#define Z_SHELL_UNDERSCORE(x) _##x
511#define Z_SHELL_SUBCMD_NAME(...) \
512 UTIL_CAT(shell_subcmds, MACRO_MAP_CAT(Z_SHELL_UNDERSCORE, __VA_ARGS__))
513#define Z_SHELL_SUBCMD_SECTION_TAG(...) MACRO_MAP_CAT(Z_SHELL_UNDERSCORE, __VA_ARGS__)
514#define Z_SHELL_SUBCMD_SET_SECTION_TAG(x) \
515 Z_SHELL_SUBCMD_SECTION_TAG(NUM_VA_ARGS_LESS_1 x, __DEBRACKET x)
516#define Z_SHELL_SUBCMD_ADD_SECTION_TAG(x, y) \
517 Z_SHELL_SUBCMD_SECTION_TAG(NUM_VA_ARGS_LESS_1 x, __DEBRACKET x, y)
531#define SHELL_SUBCMD_SET_CREATE(_name, _parent) \
532 static const TYPE_SECTION_ITERABLE(struct shell_static_entry, _name, shell_subcmds, \
533 Z_SHELL_SUBCMD_SET_SECTION_TAG(_parent))
555#define SHELL_SUBCMD_COND_ADD(_flag, _parent, _syntax, _subcmd, _help, _handler, \
558 (static const TYPE_SECTION_ITERABLE(struct shell_static_entry, \
559 Z_SHELL_SUBCMD_NAME(__DEBRACKET _parent, _syntax), \
561 Z_SHELL_SUBCMD_ADD_SECTION_TAG(_parent, _syntax)) = \
562 SHELL_EXPR_CMD_ARG(1, _syntax, _subcmd, _help, \
563 _handler, _mand, _opt, 0, 0)\
565 (static shell_cmd_handler dummy_handler_##_syntax __unused = _handler;\
566 static const union shell_cmd_entry dummy_subcmd_##_syntax __unused = { \
567 .entry = (const struct shell_static_entry *)_subcmd\
584#define SHELL_SUBCMD_ADD(_parent, _syntax, _subcmd, _help, _handler, _mand, _opt) \
585 SHELL_SUBCMD_COND_ADD(1, _parent, _syntax, _subcmd, _help, _handler, _mand, _opt)
591#define SHELL_SUBCMD_SET_END {0}
599#define SHELL_DYNAMIC_CMD_CREATE(name, get) \
600 static const TYPE_SECTION_ITERABLE(union shell_cmd_entry, name, \
601 shell_dynamic_subcmds, name) = \
619#define SHELL_CMD_ARG(syntax, subcmd, help, handler, mand, opt) \
620 SHELL_EXPR_CMD_ARG(1, syntax, subcmd, help, handler, mand, opt, 0, 0)
641#define SHELL_COND_CMD_ARG(flag, syntax, subcmd, help, handler, mand, opt) \
642 SHELL_EXPR_CMD_ARG(IS_ENABLED(flag), syntax, subcmd, help, \
643 handler, mand, opt, 0, 0)
666#define SHELL_EXPR_CMD_ARG(_expr, _syntax, _subcmd, _help, _handler, \
667 _mand, _opt, _remote_cmd, _remote_id) \
669 .syntax = (_expr) ? (const char *)STRINGIFY(_syntax) : "", \
670 .help = (_expr) ? (const char *)_help : NULL, \
671 .subcmd = (const union shell_cmd_entry *)((_expr) ? \
673 .handler = (shell_cmd_handler)((_expr) ? _handler : NULL), \
674 .args = { .mandatory = _mand, .optional = _opt, \
675 .remote_cmd = _remote_cmd, .remote_id = _remote_id } \
686#define SHELL_CMD(_syntax, _subcmd, _help, _handler) \
687 SHELL_CMD_ARG(_syntax, _subcmd, _help, _handler, 0, 0)
701#define SHELL_COND_CMD(_flag, _syntax, _subcmd, _help, _handler) \
702 SHELL_COND_CMD_ARG(_flag, _syntax, _subcmd, _help, _handler, 0, 0)
717#define SHELL_EXPR_CMD(_expr, _syntax, _subcmd, _help, _handler) \
718 SHELL_EXPR_CMD_ARG(_expr, _syntax, _subcmd, _help, _handler, 0, 0, 0, 0)
723#define Z_SHELL_CMD_DICT_HANDLER_CREATE(_data, _handler) \
724static int UTIL_CAT(UTIL_CAT(cmd_dict_, UTIL_CAT(_handler, _)), \
725 GET_ARG_N(1, __DEBRACKET _data))( \
726 const struct shell *sh, size_t argc, char **argv) \
728 return _handler(sh, argc, argv, \
729 (void *)GET_ARG_N(2, __DEBRACKET _data)); \
733#define SHELL_CMD_DICT_CREATE(_data, _handler) \
734 SHELL_CMD_ARG(GET_ARG_N(1, __DEBRACKET _data), NULL, GET_ARG_N(3, __DEBRACKET _data), \
735 UTIL_CAT(UTIL_CAT(cmd_dict_, UTIL_CAT(_handler, _)), \
736 GET_ARG_N(1, __DEBRACKET _data)), 1, 0)
773#define SHELL_SUBCMD_DICT_SET_CREATE(_name, _handler, ...) \
774 FOR_EACH_FIXED_ARG(Z_SHELL_CMD_DICT_HANDLER_CREATE, (), \
775 _handler, __VA_ARGS__) \
776 SHELL_STATIC_SUBCMD_SET_CREATE(_name, \
777 FOR_EACH_FIXED_ARG(SHELL_CMD_DICT_CREATE, (,), _handler, __VA_ARGS__), \
778 SHELL_SUBCMD_SET_END \
787enum shell_receive_state {
788 SHELL_RECEIVE_DEFAULT,
790 SHELL_RECEIVE_ESC_SEQ,
791 SHELL_RECEIVE_TILDE_EXP
798 SHELL_STATE_UNINITIALIZED,
799 SHELL_STATE_INITIALIZED,
801 SHELL_STATE_PANIC_MODE_ACTIVE,
802 SHELL_STATE_PANIC_MODE_INACTIVE
806enum shell_transport_evt {
807 SHELL_TRANSPORT_EVT_RX_RDY,
808 SHELL_TRANSPORT_EVT_TX_RDY
811enum shell_readline_state {
812 SHELL_READLINE_INACTIVE,
813 SHELL_READLINE_ACTIVE,
815 SHELL_READLINE_CANCELED,
916 const void *data,
size_t length,
size_t *cnt);
929 void *data,
size_t length,
size_t *cnt);
963#ifdef CONFIG_SHELL_STATS
964#define Z_SHELL_STATS_DEFINE(_name) static struct shell_stats _name##_stats
965#define Z_SHELL_STATS_PTR(_name) (&(_name##_stats))
967#define Z_SHELL_STATS_DEFINE(_name)
968#define Z_SHELL_STATS_PTR(_name) NULL
974struct shell_backend_config_flags {
985 "Structure must fit in 4 bytes");
990#define SHELL_DEFAULT_BACKEND_CONFIG_FLAGS \
994 .obscure = IS_ENABLED(CONFIG_SHELL_START_OBSCURED), \
1000struct shell_backend_ctx_flags {
1013 "Structure must fit in 4 bytes");
1018union shell_backend_cfg {
1020 struct shell_backend_config_flags
flags;
1026union shell_backend_ctx {
1028 struct shell_backend_ctx_flags
flags;
1032 SHELL_SIGNAL_RXRDY =
BIT(0),
1033 SHELL_SIGNAL_LOG_MSG =
BIT(1),
1034 SHELL_SIGNAL_KILL =
BIT(2),
1035 SHELL_SIGNAL_TXDONE =
BIT(3),
1045#if defined(CONFIG_SHELL_PROMPT_CHANGE) && CONFIG_SHELL_PROMPT_CHANGE
1046 char prompt[CONFIG_SHELL_PROMPT_BUFF_SIZE];
1051 enum shell_state
state;
1052 enum shell_receive_state receive_state;
1055 enum shell_readline_state readline_state;
1058 const char *readline_prompt;
1067 struct shell_vt100_ctx vt100_ctx;
1078 void *bypass_user_data;
1083#if defined CONFIG_SHELL_GETOPT
1095 char cmd_buff[CONFIG_SHELL_CMD_BUFF_SIZE];
1098 char temp_buff[CONFIG_SHELL_CMD_BUFF_SIZE];
1101 char printf_buff[CONFIG_SHELL_PRINTF_BUFF_SIZE];
1103 volatile union shell_backend_cfg cfg;
1104 volatile union shell_backend_ctx ctx;
1108 struct k_sem lock_sem;
1131 const char *default_prompt;
1136 struct shell_history *history;
1142 struct shell_stats *stats;
1154extern void z_shell_print_stream(
const void *user_ctx,
const char *data,
1169#define Z_SHELL_DEFINE(_name, _prompt, _transport_iface, _out_buf, _log_backend, _shell_flag) \
1170 static const struct shell _name; \
1171 static struct shell_ctx UTIL_CAT(_name, _ctx); \
1172 Z_SHELL_HISTORY_DEFINE(_name##_history, CONFIG_SHELL_HISTORY_BUFFER); \
1173 Z_SHELL_FPRINTF_DEFINE(_name##_fprintf, &_name, _out_buf, CONFIG_SHELL_PRINTF_BUFF_SIZE, \
1174 IS_ENABLED(CONFIG_SHELL_PRINTF_AUTOFLUSH), z_shell_print_stream); \
1175 LOG_INSTANCE_REGISTER(shell, _name, CONFIG_SHELL_LOG_LEVEL); \
1176 Z_SHELL_STATS_DEFINE(_name); \
1177 static K_KERNEL_STACK_DEFINE(_name##_stack, CONFIG_SHELL_STACK_SIZE); \
1178 static struct k_thread _name##_thread; \
1179 static const STRUCT_SECTION_ITERABLE(shell, _name) = { \
1180 .default_prompt = _prompt, \
1181 .iface = _transport_iface, \
1182 .ctx = &UTIL_CAT(_name, _ctx), \
1183 .history = IS_ENABLED(CONFIG_SHELL_HISTORY) ? &_name##_history : NULL, \
1184 .shell_flag = _shell_flag, \
1185 .fprintf_ctx = &_name##_fprintf, \
1186 .stats = Z_SHELL_STATS_PTR(_name), \
1187 .log_backend = _log_backend, \
1188 LOG_INSTANCE_PTR_INIT(log, shell, _name).name = \
1189 STRINGIFY(_name), .thread = &_name##_thread, .stack = _name##_stack}
1204#define SHELL_DEFINE(_name, _prompt, _transport_iface, _log_queue_size, _log_timeout, _shell_flag) \
1205 static uint8_t _name##_out_buffer[CONFIG_SHELL_PRINTF_BUFF_SIZE]; \
1206 Z_SHELL_LOG_BACKEND_DEFINE(_name, _name##_out_buffer, CONFIG_SHELL_PRINTF_BUFF_SIZE, \
1207 _log_queue_size, _log_timeout); \
1208 Z_SHELL_DEFINE(_name, _prompt, _transport_iface, _name##_out_buffer, \
1209 Z_SHELL_LOG_BACKEND_PTR(_name), _shell_flag)
1225 struct shell_backend_config_flags cfg_flags,
1257#define SHELL_NORMAL SHELL_VT100_COLOR_DEFAULT
1262#define SHELL_INFO SHELL_VT100_COLOR_GREEN
1267#define SHELL_OPTION SHELL_VT100_COLOR_CYAN
1272#define SHELL_WARNING SHELL_VT100_COLOR_YELLOW
1277#define SHELL_ERROR SHELL_VT100_COLOR_RED
1279#ifdef CONFIG_SHELL_REMOTE_CLI
1285 const
char *fmt, ...);
1300#define shell_fprintf(sh, color, fmt, ...) \
1301 COND_CODE_1(IS_ENABLED(CONFIG_SHELL_REMOTE_CLI), \
1302 (SHELL_REMOTE_CLI_FPRINTF(sh, color, fmt, ##__VA_ARGS__)), \
1303 (shell_fprintf_impl(sh, color, fmt, ##__VA_ARGS__)))
1318 const char *fmt, va_list args);
1348 const uint8_t *data,
size_t len);
1368#define shell_info(_sh, _ft, ...) shell_fprintf(_sh, SHELL_INFO, _ft "\n", ##__VA_ARGS__)
1379#define shell_fprintf_info(_sh, _ft, ...) shell_fprintf(_sh, SHELL_INFO, _ft, ##__VA_ARGS__)
1390#define shell_print(_sh, _ft, ...) shell_fprintf_normal(_sh, _ft "\n", ##__VA_ARGS__)
1401#define shell_fprintf_normal(_sh, _ft, ...) shell_fprintf(_sh, SHELL_NORMAL, _ft, ##__VA_ARGS__)
1412#define shell_warn(_sh, _ft, ...) shell_fprintf_warn(_sh, _ft "\n", ##__VA_ARGS__)
1423#define shell_fprintf_warn(_sh, _ft, ...) shell_fprintf(_sh, SHELL_WARNING, _ft, ##__VA_ARGS__)
1434#define shell_error(_sh, _ft, ...) shell_fprintf_error(_sh, _ft "\n", ##__VA_ARGS__)
1445#define shell_fprintf_error(_sh, _ft, ...) shell_fprintf(_sh, SHELL_ERROR, _ft, ##__VA_ARGS__)
1474#ifdef CONFIG_SHELL_HELP
1484#define SHELL_CMD_HELP_PRINTED (1)
1670#ifdef CONFIG_SHELL_CUSTOM_HEADER
1672#include <zephyr_custom_shell.h>
struct z_thread_stack_element k_thread_stack_t
Typedef of struct z_thread_stack_element.
Definition arch_interface.h:46
long atomic_t
Atomic integer variable.
Definition atomic_types.h:31
static void cmd(uint32_t command)
Execute a display list command by co-processor engine.
Definition ft8xx_reference_api.h:153
#define LOG_INSTANCE_PTR_DECLARE(_name)
Declare a logger instance pointer in the module structure.
Definition log_instance.h:154
int shell_readline(const struct shell *sh, uint8_t *buf, size_t len, k_timeout_t timeout)
Read a line of input from the shell.
static bool shell_help_is_structured(const char *help)
Check if help string is structured help.
Definition shell.h:345
void shell_uninit(const struct shell *sh, shell_uninit_cb_t cb)
Uninitializes the transport layer and the internal shell state.
void(* shell_uninit_cb_t)(const struct shell *sh, int res)
Shell uninitialization completion callback.
Definition shell.h:844
void shell_hexdump_line(const struct shell *sh, unsigned int offset, const uint8_t *data, size_t len)
Print a line of data in hexadecimal format.
int(* shell_dict_cmd_handler)(const struct shell *sh, size_t argc, char **argv, void *data)
Shell dictionary command handler prototype.
Definition shell.h:283
#define shell_fprintf(sh, color, fmt,...)
printf-like function which sends formatted data stream to the shell.
Definition shell.h:1300
int shell_prompt_change(const struct shell *sh, const char *prompt)
Change displayed shell prompt.
void(* shell_transport_handler_t)(enum shell_transport_evt evt, void *context)
Shell transport event handler callback.
Definition shell.h:831
int shell_mode_delete_set(const struct shell *sh, bool val)
Allow application to control whether the delete key backspaces or deletes.
void shell_readline_prompt_set(const struct shell *sh, const char *prompt)
Set a prompt string for the next shell_readline call.
int(* shell_cmd_handler)(const struct shell *sh, size_t argc, char **argv)
Shell command handler prototype.
Definition shell.h:267
void shell_set_bypass(const struct shell *sh, shell_bypass_cb_t bypass, void *user_data)
Set bypass callback.
int shell_get_return_value(const struct shell *sh)
Retrieve return value of most recently executed shell command.
shell_flag
Flags for setting shell output newline sequence.
Definition shell.h:1121
const struct device * shell_device_lookup(size_t idx, const char *prefix)
Get by index a device that matches .
shell_vt100_color
Text colors available for shell output.
Definition shell_types.h:27
void shell_cbpprintf(const struct shell *sh, enum shell_vt100_color color, void *package)
Function which formats cbprintf package and streams it to the shell.
void shell_vfprintf(const struct shell *sh, enum shell_vt100_color color, const char *fmt, va_list args)
vprintf-like function which sends formatted data stream to the shell.
int shell_set_root_cmd(const char *cmd)
Set root command for all shell instances.
bool shell_ready(const struct shell *sh)
Get shell readiness to execute commands.
int shell_use_colors_set(const struct shell *sh, bool val)
Allow application to control whether terminal output uses colored syntax.
void shell_process(const struct shell *sh)
Process function, which should be executed when data is ready in the transport interface.
const struct device * shell_device_get_binding(const char *name)
Get a device reference from its device::name field or label.
int shell_use_vt100_set(const struct shell *sh, bool val)
Allow application to control whether terminal is using vt100 commands.
int shell_obscure_set(const struct shell *sh, bool obscure)
Allow application to control whether user input is obscured with asterisks – useful for implementing ...
int shell_init(const struct shell *sh, const void *transport_config, struct shell_backend_config_flags cfg_flags, bool log_backend, uint32_t init_log_level)
Function for initializing a transport layer and internal shell state.
const struct device * shell_device_lookup_all(size_t idx, const char *prefix)
Get by index a device that matches .
const struct device * shell_device_get_binding_all(const char *name)
Get a device reference from its device::name field or label.
static void shell_help(const struct shell *sh)
Prints the current command help.
Definition shell.h:1477
const struct device * shell_device_lookup_non_ready(size_t idx, const char *prefix)
Get by index a non-initialized device that matches .
bool(* shell_device_filter_t)(const struct device *dev)
Filter callback type, for use with shell_device_filter.
Definition shell.h:198
int shell_execute_cmd(const struct shell *sh, const char *cmd)
Execute command.
void(* shell_bypass_cb_t)(const struct shell *sh, uint8_t *data, size_t len, void *user_data)
Bypass callback.
Definition shell.h:853
int shell_stop(const struct shell *sh)
Function for stopping shell processing.
int shell_start(const struct shell *sh)
Function for starting shell processing.
int shell_echo_set(const struct shell *sh, bool val)
Allow application to control whether user input is echoed back.
const struct device * shell_device_filter(size_t idx, shell_device_filter_t filter)
Get a device by index and filter.
void shell_hexdump(const struct shell *sh, const uint8_t *data, size_t len)
Print data in hexadecimal format.
int shell_insert_mode_set(const struct shell *sh, bool val)
Allow application to control text insert mode.
void(* shell_dynamic_get)(size_t idx, struct shell_static_entry *entry)
Shell dynamic command descriptor.
Definition shell.h:103
@ SHELL_FLAG_CRLF_DEFAULT
Do not map CR or LF.
Definition shell.h:1122
@ SHELL_FLAG_OLF_CRLF
Map LF to CRLF on output.
Definition shell.h:1123
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
#define NULL
Definition iar_missing_defs.h:20
struct k_thread * k_tid_t
Definition thread.h:383
Header file for the logging subsystem.
Header file for log instance registration.
flags
Definition parser.h:97
state
Definition parser_state.h:29
Header file for the shell formatted output helpers.
Header file for the shell command history.
Header file for the shell log backend.
APIs for the remote shell client.
Header file for the shell string conversion helpers.
Header file for the shell terminal types and colors.
#define bool
Definition stdbool.h:13
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
const char * name
Name of the device instance.
Definition device.h:515
Event Structure.
Definition kernel.h:2777
Semaphore structure.
Definition kernel.h:3798
Thread Structure.
Definition thread.h:259
Kernel timeout type.
Definition clock.h:65
Logger backend API.
Definition log_backend.h:74
Logger backend structure.
Definition log_backend.h:118
Shell structured help descriptor.
Definition shell.h:317
const char * usage
Command usage string.
Definition shell.h:322
const char * description
Command description.
Definition shell.h:321
Shell instance context.
Definition shell.h:1043
Argument count constraints and remote routing for a shell command.
Definition shell.h:120
uint16_t remote_id
Remote connection id; valid only if remote_cmd is non-zero.
Definition shell.h:124
uint16_t remote_cmd
Remote shell command type; non-zero for remote shell.
Definition shell.h:123
uint8_t mandatory
Number of mandatory arguments.
Definition shell.h:121
uint8_t optional
Number of optional arguments.
Definition shell.h:122
Shell static command descriptor.
Definition shell.h:299
const union shell_cmd_entry * subcmd
Pointer to subcommand.
Definition shell.h:302
shell_cmd_handler handler
Command handler.
Definition shell.h:303
struct shell_static_args args
Command arguments.
Definition shell.h:304
const char * help
Command help string.
Definition shell.h:301
const char * syntax
Command syntax strings.
Definition shell.h:300
Unified shell transport interface.
Definition shell.h:864
void(* update)(const struct shell_transport *transport)
Function called in shell thread loop.
Definition shell.h:938
int(* init)(const struct shell_transport *transport, const void *config, shell_transport_handler_t evt_handler, void *context)
Function for initializing the shell transport interface.
Definition shell.h:876
int(* write)(const struct shell_transport *transport, const void *data, size_t length, size_t *cnt)
Function for writing data to the transport interface.
Definition shell.h:915
int(* uninit)(const struct shell_transport *transport)
Function for uninitializing the shell transport interface.
Definition shell.h:888
int(* enable)(const struct shell_transport *transport, bool blocking_tx)
Function for enabling transport in given TX mode.
Definition shell.h:902
int(* read)(const struct shell_transport *transport, void *data, size_t length, size_t *cnt)
Function for reading data from the transport interface.
Definition shell.h:928
Shell transport instance.
Definition shell.h:949
void * ctx
Transport instance context.
Definition shell.h:951
const struct shell_transport_api * api
Transport backend operations.
Definition shell.h:950
Shell instance internals.
Definition shell.h:1129
Definition sys_getopt.h:16
Iterable sections helpers.
Shell command descriptor.
Definition shell.h:109
const struct shell_static_entry * entry
Pointer to array of static commands.
Definition shell.h:114
shell_dynamic_get dynamic_get
Pointer to function returning dynamic commands.
Definition shell.h:111