Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
shell.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef SHELL_H__
8#define SHELL_H__
9
10#include <zephyr.h>
11#include <shell/shell_types.h>
12#include <shell/shell_history.h>
13#include <shell/shell_fprintf.h>
16#include <logging/log.h>
17#include <sys/util.h>
18
19#if defined CONFIG_SHELL_GETOPT
20#include <getopt.h>
21#endif
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#ifndef CONFIG_SHELL_CMD_BUFF_SIZE
28#define CONFIG_SHELL_CMD_BUFF_SIZE 0
29#endif
30
31#ifndef CONFIG_SHELL_PRINTF_BUFF_SIZE
32#define CONFIG_SHELL_PRINTF_BUFF_SIZE 0
33#endif
34
35#ifndef CONFIG_SHELL_HISTORY_BUFFER
36#define CONFIG_SHELL_HISTORY_BUFFER 0
37#endif
38
39#define Z_SHELL_CMD_ROOT_LVL (0u)
40
41#define SHELL_HEXDUMP_BYTES_IN_LINE 16
42
54#define SHELL_OPT_ARG_RAW (0xFE)
55
59#define SHELL_OPT_ARG_CHECK_SKIP (0xFF)
60
65#define SHELL_OPT_ARG_MAX (0xFD)
66
75
87typedef void (*shell_dynamic_get)(size_t idx,
88 struct shell_static_entry *entry);
89
98
101 } u;
102};
103
104struct shell;
105
109};
110
126const struct device *shell_device_lookup(size_t idx,
127 const char *prefix);
128
141typedef int (*shell_cmd_handler)(const struct shell *shell,
142 size_t argc, char **argv);
143
157typedef int (*shell_dict_cmd_handler)(const struct shell *shell, size_t argc,
158 char **argv, void *data);
159
160/*
161 * @brief Shell static command descriptor.
162 */
164 const char *syntax;
165 const char *help;
166 const struct shell_cmd_entry *subcmd;
169};
170
186#define SHELL_CMD_ARG_REGISTER(syntax, subcmd, help, handler, \
187 mandatory, optional) \
188 static const struct shell_static_entry UTIL_CAT(_shell_, syntax) = \
189 SHELL_CMD_ARG(syntax, subcmd, help, handler, mandatory, optional); \
190 static const struct shell_cmd_entry UTIL_CAT(shell_cmd_, syntax) \
191 __attribute__ ((section("." \
192 STRINGIFY(UTIL_CAT(shell_root_cmd_, syntax))))) \
193 __attribute__((used)) = { \
194 .is_dynamic = false, \
195 .u = {.entry = &UTIL_CAT(_shell_, syntax)} \
196 }
197
218#define SHELL_COND_CMD_ARG_REGISTER(flag, syntax, subcmd, help, handler, \
219 mandatory, optional) \
220 COND_CODE_1(\
221 flag, \
222 (\
223 SHELL_CMD_ARG_REGISTER(syntax, subcmd, help, handler, \
224 mandatory, optional) \
225 ), \
226 (\
227 static shell_cmd_handler dummy_##syntax##_handler __unused = \
228 handler;\
229 static const struct shell_cmd_entry *dummy_subcmd_##syntax \
230 __unused = subcmd\
231 )\
232 )
244#define SHELL_CMD_REGISTER(syntax, subcmd, help, handler) \
245 SHELL_CMD_ARG_REGISTER(syntax, subcmd, help, handler, 0, 0)
246
260#define SHELL_COND_CMD_REGISTER(flag, syntax, subcmd, help, handler) \
261 SHELL_COND_CMD_ARG_REGISTER(flag, syntax, subcmd, help, handler, 0, 0)
262
279#define SHELL_STATIC_SUBCMD_SET_CREATE(name, ...) \
280 static const struct shell_static_entry shell_##name[] = { \
281 __VA_ARGS__ \
282 }; \
283 static const struct shell_cmd_entry name = { \
284 .is_dynamic = false, \
285 .u = { .entry = shell_##name } \
286 }
287
292#define SHELL_SUBCMD_SET_END {NULL}
293
300#define SHELL_DYNAMIC_CMD_CREATE(name, get) \
301 static const struct shell_cmd_entry name = { \
302 .is_dynamic = true, \
303 .u = { .dynamic_get = get } \
304 }
305
319#define SHELL_CMD_ARG(syntax, subcmd, help, handler, mand, opt) \
320 SHELL_EXPR_CMD_ARG(1, syntax, subcmd, help, handler, mand, opt)
321
341#define SHELL_COND_CMD_ARG(flag, syntax, subcmd, help, handler, mand, opt) \
342 SHELL_EXPR_CMD_ARG(IS_ENABLED(flag), syntax, subcmd, help, \
343 handler, mand, opt)
344
364#define SHELL_EXPR_CMD_ARG(_expr, _syntax, _subcmd, _help, _handler, \
365 _mand, _opt) \
366 { \
367 .syntax = (_expr) ? (const char *)STRINGIFY(_syntax) : "", \
368 .help = (_expr) ? (const char *)_help : NULL, \
369 .subcmd = (const struct shell_cmd_entry *)((_expr) ? \
370 _subcmd : NULL), \
371 .handler = (shell_cmd_handler)((_expr) ? _handler : NULL), \
372 .args = { .mandatory = _mand, .optional = _opt} \
373 }
374
383#define SHELL_CMD(_syntax, _subcmd, _help, _handler) \
384 SHELL_CMD_ARG(_syntax, _subcmd, _help, _handler, 0, 0)
385
398#define SHELL_COND_CMD(_flag, _syntax, _subcmd, _help, _handler) \
399 SHELL_COND_CMD_ARG(_flag, _syntax, _subcmd, _help, _handler, 0, 0)
400
414#define SHELL_EXPR_CMD(_expr, _syntax, _subcmd, _help, _handler) \
415 SHELL_EXPR_CMD_ARG(_expr, _syntax, _subcmd, _help, _handler, 0, 0)
416
417/* Internal macro used for creating handlers for dictionary commands. */
418#define Z_SHELL_CMD_DICT_HANDLER_CREATE(_data, _handler) \
419static int UTIL_CAT(UTIL_CAT(cmd_dict_, UTIL_CAT(_handler, _)), \
420 GET_ARG_N(1, __DEBRACKET _data))( \
421 const struct shell *shell, size_t argc, char **argv) \
422{ \
423 return _handler(shell, argc, argv, \
424 (void *)GET_ARG_N(2, __DEBRACKET _data)); \
425}
426
427/* Internal macro used for creating dictionary commands. */
428#define SHELL_CMD_DICT_CREATE(_data, _handler) \
429 SHELL_CMD_ARG(GET_ARG_N(1, __DEBRACKET _data), NULL, NULL, \
430 UTIL_CAT(UTIL_CAT(cmd_dict_, UTIL_CAT(_handler, _)), \
431 GET_ARG_N(1, __DEBRACKET _data)), 1, 0)
432
463#define SHELL_SUBCMD_DICT_SET_CREATE(_name, _handler, ...) \
464 FOR_EACH_FIXED_ARG(Z_SHELL_CMD_DICT_HANDLER_CREATE, (), \
465 _handler, __VA_ARGS__) \
466 SHELL_STATIC_SUBCMD_SET_CREATE(_name, \
467 FOR_EACH_FIXED_ARG(SHELL_CMD_DICT_CREATE, (,), _handler, __VA_ARGS__), \
468 SHELL_SUBCMD_SET_END \
469 )
470
481
492
498
500 void *context);
501
502
503typedef void (*shell_uninit_cb_t)(const struct shell *shell, int res);
504
511typedef void (*shell_bypass_cb_t)(const struct shell *shell,
512 uint8_t *data,
513 size_t len);
514
515struct shell_transport;
516
532 int (*init)(const struct shell_transport *transport,
533 const void *config,
534 shell_transport_handler_t evt_handler,
535 void *context);
536
544 int (*uninit)(const struct shell_transport *transport);
545
558 int (*enable)(const struct shell_transport *transport,
559 bool blocking_tx);
560
571 int (*write)(const struct shell_transport *transport,
572 const void *data, size_t length, size_t *cnt);
573
584 int (*read)(const struct shell_transport *transport,
585 void *data, size_t length, size_t *cnt);
586
594 void (*update)(const struct shell_transport *transport);
595
596};
597
600 void *ctx;
601};
602
608};
609
610#ifdef CONFIG_SHELL_STATS
611#define Z_SHELL_STATS_DEFINE(_name) static struct shell_stats _name##_stats
612#define Z_SHELL_STATS_PTR(_name) (&(_name##_stats))
613#else
614#define Z_SHELL_STATS_DEFINE(_name)
615#define Z_SHELL_STATS_PTR(_name) NULL
616#endif /* CONFIG_SHELL_STATS */
617
628};
629
630BUILD_ASSERT((sizeof(struct shell_backend_config_flags) == sizeof(uint32_t)),
631 "Structure must fit in 4 bytes");
632
636#define SHELL_DEFAULT_BACKEND_CONFIG_FLAGS \
637{ \
638 .insert_mode = 0, \
639 .echo = 1, \
640 .obscure = 0, \
641 .mode_delete = 1, \
642 .use_colors = 1, \
643 .use_vt100 = 1, \
644};
645
654};
655
656BUILD_ASSERT((sizeof(struct shell_backend_ctx_flags) == sizeof(uint32_t)),
657 "Structure must fit in 4 bytes");
658
665};
666
673};
674
679 SHELL_SIGNAL_TXDONE, /* TXDONE must be last one before SHELL_SIGNALS */
682
686struct shell_ctx {
687 const char *prompt;
694
695 /* New root command. If NULL shell uses default root commands. */
697
700
705
708
709#if defined CONFIG_SHELL_GETOPT
711 struct getopt_state getopt;
712#endif
713
721
724
727
728 volatile union shell_backend_cfg cfg;
729 volatile union shell_backend_ctx ctx;
730
732
737
740};
741
742extern const struct log_backend_api log_backend_shell_api;
743
748 SHELL_FLAG_CRLF_DEFAULT = (1<<0), /* Do not map CR or LF */
749 SHELL_FLAG_OLF_CRLF = (1<<1) /* Map LF to CRLF on output */
751
755struct shell {
756 const char *default_prompt;
758 const struct shell_transport *iface;
759 struct shell_ctx *ctx;
762
764
766
768
770
772
773 const char *thread_name;
776};
777
778extern void z_shell_print_stream(const void *user_ctx, const char *data,
779 size_t data_len);
793#define SHELL_DEFINE(_name, _prompt, _transport_iface, \
794 _log_queue_size, _log_timeout, _shell_flag) \
795 static const struct shell _name; \
796 static struct shell_ctx UTIL_CAT(_name, _ctx); \
797 static uint8_t _name##_out_buffer[CONFIG_SHELL_PRINTF_BUFF_SIZE]; \
798 Z_SHELL_LOG_BACKEND_DEFINE(_name, _name##_out_buffer, \
799 CONFIG_SHELL_PRINTF_BUFF_SIZE, \
800 _log_queue_size, _log_timeout); \
801 Z_SHELL_HISTORY_DEFINE(_name##_history, CONFIG_SHELL_HISTORY_BUFFER); \
802 Z_SHELL_FPRINTF_DEFINE(_name##_fprintf, &_name, _name##_out_buffer, \
803 CONFIG_SHELL_PRINTF_BUFF_SIZE, \
804 true, z_shell_print_stream); \
805 LOG_INSTANCE_REGISTER(shell, _name, CONFIG_SHELL_LOG_LEVEL); \
806 Z_SHELL_STATS_DEFINE(_name); \
807 static K_KERNEL_STACK_DEFINE(_name##_stack, CONFIG_SHELL_STACK_SIZE); \
808 static struct k_thread _name##_thread; \
809 static const STRUCT_SECTION_ITERABLE(shell, _name) = { \
810 .default_prompt = _prompt, \
811 .iface = _transport_iface, \
812 .ctx = &UTIL_CAT(_name, _ctx), \
813 .history = IS_ENABLED(CONFIG_SHELL_HISTORY) ? \
814 &_name##_history : NULL, \
815 .shell_flag = _shell_flag, \
816 .fprintf_ctx = &_name##_fprintf, \
817 .stats = Z_SHELL_STATS_PTR(_name), \
818 .log_backend = Z_SHELL_LOG_BACKEND_PTR(_name), \
819 LOG_INSTANCE_PTR_INIT(log, shell, _name) \
820 .thread_name = STRINGIFY(_name), \
821 .thread = &_name##_thread, \
822 .stack = _name##_stack \
823 }
824
838int shell_init(const struct shell *shell, const void *transport_config,
839 struct shell_backend_config_flags cfg_flags,
840 bool log_backend, uint32_t init_log_level);
841
849
857int shell_start(const struct shell *shell);
858
866int shell_stop(const struct shell *shell);
867
871#define SHELL_NORMAL SHELL_VT100_COLOR_DEFAULT
872
876#define SHELL_INFO SHELL_VT100_COLOR_GREEN
877
881#define SHELL_OPTION SHELL_VT100_COLOR_CYAN
882
886#define SHELL_WARNING SHELL_VT100_COLOR_YELLOW
887
891#define SHELL_ERROR SHELL_VT100_COLOR_RED
892
904void __printf_like(3, 4) shell_fprintf(const struct shell *shell,
905 enum shell_vt100_color color,
906 const char *fmt, ...);
907
920void shell_vfprintf(const struct shell *shell, enum shell_vt100_color color,
921 const char *fmt, va_list args);
922
938void shell_hexdump_line(const struct shell *shell, unsigned int offset,
939 const uint8_t *data, size_t len);
940
948void shell_hexdump(const struct shell *shell, const uint8_t *data, size_t len);
949
959#define shell_info(_sh, _ft, ...) \
960 shell_fprintf(_sh, SHELL_INFO, _ft "\n", ##__VA_ARGS__)
961
971#define shell_print(_sh, _ft, ...) \
972 shell_fprintf(_sh, SHELL_NORMAL, _ft "\n", ##__VA_ARGS__)
973
983#define shell_warn(_sh, _ft, ...) \
984 shell_fprintf(_sh, SHELL_WARNING, _ft "\n", ##__VA_ARGS__)
985
995#define shell_error(_sh, _ft, ...) \
996 shell_fprintf(_sh, SHELL_ERROR, _ft "\n", ##__VA_ARGS__)
997
1004void shell_process(const struct shell *shell);
1005
1015int shell_prompt_change(const struct shell *shell, const char *prompt);
1016
1025void shell_help(const struct shell *shell);
1026
1027/* @brief Command's help has been printed */
1028#define SHELL_CMD_HELP_PRINTED (1)
1029
1047int shell_execute_cmd(const struct shell *shell, const char *cmd);
1048
1060int shell_set_root_cmd(const char *cmd);
1061
1070void shell_set_bypass(const struct shell *shell, shell_bypass_cb_t bypass);
1071
1082int shell_insert_mode_set(const struct shell *shell, bool val);
1083
1095int shell_use_colors_set(const struct shell *shell, bool val);
1096
1107int shell_echo_set(const struct shell *shell, bool val);
1108
1120int shell_obscure_set(const struct shell *shell, bool obscure);
1121
1133int shell_mode_delete_set(const struct shell *shell, bool val);
1134
1139#ifdef __cplusplus
1140}
1141#endif
1142
1143#endif /* SHELL_H__ */
struct z_thread_stack_element k_thread_stack_t
Typedef of struct z_thread_stack_element.
Definition: arch_interface.h:44
long atomic_t
Definition: atomic.h:22
static void cmd(uint32_t command)
Execute a display list command by co-processor engine.
Definition: ft8xx_reference_api.h:153
int shell_prompt_change(const struct shell *shell, const char *prompt)
Change displayed shell prompt.
int shell_execute_cmd(const struct shell *shell, const char *cmd)
Execute command.
void shell_uninit(const struct shell *shell, shell_uninit_cb_t cb)
Uninitializes the transport layer and the internal shell state.
int(* shell_cmd_handler)(const struct shell *shell, size_t argc, char **argv)
Shell command handler prototype.
Definition: shell.h:141
void(* shell_transport_handler_t)(enum shell_transport_evt evt, void *context)
Definition: shell.h:499
void shell_set_bypass(const struct shell *shell, shell_bypass_cb_t bypass)
Set bypass callback.
int shell_use_colors_set(const struct shell *shell, bool val)
Allow application to control whether terminal output uses colored syntax. Value is modified atomicall...
int shell_init(const struct shell *shell, 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.
shell_flag
Flags for setting shell output newline sequence.
Definition: shell.h:747
const struct device * shell_device_lookup(size_t idx, const char *prefix)
Get by index a device that matches .
shell_signal
Definition: shell.h:675
int shell_mode_delete_set(const struct shell *shell, bool val)
Allow application to control whether the delete key backspaces or deletes. Value is modified atomical...
int shell_set_root_cmd(const char *cmd)
Set root command for all shell instances.
void shell_hexdump(const struct shell *shell, const uint8_t *data, size_t len)
Print data in hexadecimal format.
shell_receive_state
Definition: shell.h:475
void(* shell_bypass_cb_t)(const struct shell *shell, uint8_t *data, size_t len)
Bypass callback.
Definition: shell.h:511
int shell_insert_mode_set(const struct shell *shell, bool val)
Allow application to control text insert mode. Value is modified atomically and the previous value is...
void shell_help(const struct shell *shell)
Prints the current command help.
void shell_vfprintf(const struct shell *shell, enum shell_vt100_color color, const char *fmt, va_list args)
vprintf-like function which sends formatted data stream to the shell.
int shell_start(const struct shell *shell)
Function for starting shell processing.
void shell_hexdump_line(const struct shell *shell, unsigned int offset, const uint8_t *data, size_t len)
Print a line of data in hexadecimal format.
int shell_obscure_set(const struct shell *shell, bool obscure)
Allow application to control whether user input is obscured with asterisks – useful for implementing ...
const struct log_backend_api log_backend_shell_api
int shell_stop(const struct shell *shell)
Function for stopping shell processing.
int shell_echo_set(const struct shell *shell, bool val)
Allow application to control whether user input is echoed back. Value is modified atomically and the ...
int(* shell_dict_cmd_handler)(const struct shell *shell, size_t argc, char **argv, void *data)
Shell dictionary command handler prototype.
Definition: shell.h:157
shell_transport_evt
Shell transport event.
Definition: shell.h:494
void(* shell_uninit_cb_t)(const struct shell *shell, int res)
Definition: shell.h:503
shell_state
Definition: shell.h:485
void(* shell_dynamic_get)(size_t idx, struct shell_static_entry *entry)
Shell dynamic command descriptor.
Definition: shell.h:87
void shell_process(const struct shell *shell)
Process function, which should be executed when data is ready in the transport interface....
@ SHELL_FLAG_CRLF_DEFAULT
Definition: shell.h:748
@ SHELL_FLAG_OLF_CRLF
Definition: shell.h:749
@ SHELL_SIGNALS
Definition: shell.h:680
@ SHELL_SIGNAL_TXDONE
Definition: shell.h:679
@ SHELL_SIGNAL_RXRDY
Definition: shell.h:676
@ SHELL_SIGNAL_LOG_MSG
Definition: shell.h:677
@ SHELL_SIGNAL_KILL
Definition: shell.h:678
@ SHELL_RECEIVE_DEFAULT
Definition: shell.h:476
@ SHELL_RECEIVE_ESC_SEQ
Definition: shell.h:478
@ SHELL_RECEIVE_ESC
Definition: shell.h:477
@ SHELL_RECEIVE_TILDE_EXP
Definition: shell.h:479
@ SHELL_TRANSPORT_EVT_TX_RDY
Definition: shell.h:496
@ SHELL_TRANSPORT_EVT_RX_RDY
Definition: shell.h:495
@ SHELL_STATE_UNINITIALIZED
Definition: shell.h:486
@ SHELL_STATE_PANIC_MODE_INACTIVE
Definition: shell.h:490
@ SHELL_STATE_ACTIVE
Definition: shell.h:488
@ SHELL_STATE_PANIC_MODE_ACTIVE
Definition: shell.h:489
@ SHELL_STATE_INITIALIZED
Definition: shell.h:487
flags
Definition: http_parser.h:131
#define CONFIG_SHELL_CMD_BUFF_SIZE
Definition: shell.h:28
#define CONFIG_SHELL_PRINTF_BUFF_SIZE
Definition: shell.h:32
shell_vt100_color
Definition: shell_types.h:14
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
__UINT16_TYPE__ uint16_t
Definition: stdint.h:59
Runtime device structure (in ROM) per driver instance.
Definition: device.h:450
Definition: kernel.h:2629
Poll Event.
Definition: kernel.h:5417
Definition: kernel.h:5393
Definition: thread.h:216
Logger backend API.
Definition: log_backend.h:32
Logger backend structure.
Definition: log_backend.h:65
Definition: shell.h:621
uint32_t use_vt100
Definition: shell.h:627
uint32_t mode_delete
Definition: shell.h:625
uint32_t echo
Definition: shell.h:623
uint32_t insert_mode
Definition: shell.h:622
uint32_t obscure
Definition: shell.h:624
uint32_t use_colors
Definition: shell.h:626
Definition: shell.h:646
uint32_t print_noinit
Definition: shell.h:652
uint32_t sync_mode
Definition: shell.h:653
uint32_t tx_rdy
Definition: shell.h:648
uint32_t processing
Definition: shell.h:647
uint32_t last_nl
Definition: shell.h:650
uint32_t history_exit
Definition: shell.h:649
uint32_t cmd_ctx
Definition: shell.h:651
Shell command descriptor.
Definition: shell.h:93
bool is_dynamic
Definition: shell.h:94
union shell_cmd_entry::union_cmd_entry u
Shell instance context.
Definition: shell.h:686
const struct shell_static_entry * selected_cmd
Definition: shell.h:696
shell_uninit_cb_t uninit_cb
Definition: shell.h:704
struct shell_vt100_ctx vt100_ctx
Definition: shell.h:699
const char * prompt
Definition: shell.h:687
k_tid_t tid
Definition: shell.h:739
char temp_buff[0]
Definition: shell.h:723
char cmd_buff[0]
Definition: shell.h:720
struct shell_static_entry active_cmd
Definition: shell.h:693
volatile union shell_backend_cfg cfg
Definition: shell.h:728
uint16_t cmd_tmp_buff_len
Definition: shell.h:717
struct k_poll_signal signals[SHELL_SIGNALS]
Definition: shell.h:731
enum shell_state state
Definition: shell.h:689
struct k_mutex wr_mtx
Definition: shell.h:738
shell_bypass_cb_t bypass
Definition: shell.h:707
uint16_t cmd_buff_len
Definition: shell.h:714
uint16_t cmd_buff_pos
Definition: shell.h:715
char printf_buff[0]
Definition: shell.h:726
struct k_poll_event events[SHELL_SIGNALS]
Definition: shell.h:736
enum shell_receive_state receive_state
Definition: shell.h:690
volatile union shell_backend_ctx ctx
Definition: shell.h:729
fprintf context
Definition: shell_fprintf.h:29
Definition: shell_history.h:21
Shell log backend instance structure (RO data).
Definition: shell_log_backend.h:36
Definition: shell.h:106
uint8_t mandatory
Definition: shell.h:107
uint8_t optional
Definition: shell.h:108
Definition: shell.h:163
const struct shell_cmd_entry * subcmd
Definition: shell.h:166
shell_cmd_handler handler
Definition: shell.h:167
struct shell_static_args args
Definition: shell.h:168
const char * help
Definition: shell.h:165
const char * syntax
Definition: shell.h:164
Shell statistics structure.
Definition: shell.h:606
atomic_t log_lost_cnt
Definition: shell.h:607
Unified shell transport interface.
Definition: shell.h:520
void(* update)(const struct shell_transport *transport)
Function called in shell thread loop.
Definition: shell.h:594
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:532
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:571
int(* uninit)(const struct shell_transport *transport)
Function for uninitializing the shell transport interface.
Definition: shell.h:544
int(* enable)(const struct shell_transport *transport, bool blocking_tx)
Function for enabling transport in given TX mode.
Definition: shell.h:558
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:584
Definition: shell.h:598
void * ctx
Definition: shell.h:600
const struct shell_transport_api * api
Definition: shell.h:599
Definition: shell_types.h:44
Shell instance internals.
Definition: shell.h:755
struct k_thread * thread
Definition: shell.h:774
const char * thread_name
Definition: shell.h:773
LOG_INSTANCE_PTR_DECLARE(log)
enum shell_flag shell_flag
Definition: shell.h:763
const struct shell_log_backend * log_backend
Definition: shell.h:769
struct shell_history * history
Definition: shell.h:761
struct shell_stats * stats
Definition: shell.h:767
const char * default_prompt
Definition: shell.h:756
const struct shell_fprintf * fprintf_ctx
Definition: shell.h:765
struct shell_ctx * ctx
Definition: shell.h:759
const struct shell_transport * iface
Definition: shell.h:758
k_thread_stack_t * stack
Definition: shell.h:775
static fdata_t data[2]
Definition: test_fifo_contexts.c:15
Definition: shell.h:662
atomic_t value
Definition: shell.h:663
Definition: shell.h:670
uint32_t value
Definition: shell.h:671
Definition: shell.h:95
const struct shell_static_entry * entry
Definition: shell.h:100
shell_dynamic_get dynamic_get
Definition: shell.h:97
Misc utilities.