Home
last modified time | relevance | path

Searched full:sh (Results 1 – 25 of 421) sorted by relevance

12345678910>>...17

/Zephyr-Core-3.4.0/subsys/shell/
Dshell_ops.c11 void z_shell_op_cursor_vert_move(const struct shell *sh, int32_t delta) in z_shell_op_cursor_vert_move() argument
23 Z_SHELL_VT100_CMD(sh, "\e[%d%c", delta, dir); in z_shell_op_cursor_vert_move()
26 void z_shell_op_cursor_horiz_move(const struct shell *sh, int32_t delta) in z_shell_op_cursor_horiz_move() argument
38 Z_SHELL_VT100_CMD(sh, "\e[%d%c", delta, dir); in z_shell_op_cursor_horiz_move()
44 static inline bool full_line_cmd(const struct shell *sh) in full_line_cmd() argument
46 return ((sh->ctx->cmd_buff_len + z_shell_strlen(sh->ctx->prompt)) in full_line_cmd()
47 % sh->ctx->vt100_ctx.cons.terminal_wid == 0U); in full_line_cmd()
51 bool z_shell_cursor_in_empty_line(const struct shell *sh) in z_shell_cursor_in_empty_line() argument
53 return (((sh->ctx->cmd_buff_pos * sh->ctx->cfg.flags.echo) + in z_shell_cursor_in_empty_line()
54 z_shell_strlen(sh->ctx->prompt)) % in z_shell_cursor_in_empty_line()
[all …]
Dshell.c44 static inline void receive_state_change(const struct shell *sh, in receive_state_change() argument
47 sh->ctx->receive_state = state; in receive_state_change()
50 static void cmd_buffer_clear(const struct shell *sh) in cmd_buffer_clear() argument
52 sh->ctx->cmd_buff[0] = '\0'; /* clear command buffer */ in cmd_buffer_clear()
53 sh->ctx->cmd_buff_pos = 0; in cmd_buffer_clear()
54 sh->ctx->cmd_buff_len = 0; in cmd_buffer_clear()
57 static void shell_internal_help_print(const struct shell *sh) in shell_internal_help_print() argument
63 z_shell_help_cmd_print(sh, &sh->ctx->active_cmd); in shell_internal_help_print()
64 z_shell_help_subcmd_print(sh, &sh->ctx->active_cmd, in shell_internal_help_print()
78 static int cmd_precheck(const struct shell *sh, in cmd_precheck() argument
[all …]
Dshell_ops.h53 static inline bool z_flag_insert_mode_get(const struct shell *sh) in z_flag_insert_mode_get() argument
55 return sh->ctx->cfg.flags.insert_mode == 1; in z_flag_insert_mode_get()
58 static inline bool z_flag_insert_mode_set(const struct shell *sh, bool val) in z_flag_insert_mode_set() argument
62 Z_SHELL_SET_FLAG_ATOMIC(sh, cfg, insert_mode, val, ret); in z_flag_insert_mode_set()
66 static inline bool z_flag_use_colors_get(const struct shell *sh) in z_flag_use_colors_get() argument
68 return sh->ctx->cfg.flags.use_colors == 1; in z_flag_use_colors_get()
71 static inline bool z_flag_use_colors_set(const struct shell *sh, bool val) in z_flag_use_colors_set() argument
75 Z_SHELL_SET_FLAG_ATOMIC(sh, cfg, use_colors, val, ret); in z_flag_use_colors_set()
79 static inline bool z_flag_use_vt100_get(const struct shell *sh) in z_flag_use_vt100_get() argument
81 return sh->ctx->cfg.flags.use_vt100 == 1; in z_flag_use_vt100_get()
[all …]
Dshell_log_backend.c12 static bool process_msg_from_buffer(const struct shell *sh);
32 const struct shell *sh; in z_shell_log_backend_enable() local
34 sh = (const struct shell *)ctx; in z_shell_log_backend_enable()
36 z_flag_sync_mode_set(sh, true); in z_shell_log_backend_enable()
38 err = sh->iface->api->enable(sh->iface, true); in z_shell_log_backend_enable()
58 const struct shell *sh = in z_shell_log_backend_process() local
62 z_flag_use_colors_get(sh); in z_shell_log_backend_process()
69 z_shell_vt100_colors_store(sh, &col); in z_shell_log_backend_process()
70 z_shell_vt100_color_set(sh, SHELL_VT100_COLOR_RED); in z_shell_log_backend_process()
76 z_shell_vt100_colors_restore(sh, &col); in z_shell_log_backend_process()
[all …]
Dshell_cmds.c75 static int cursor_position_get(const struct shell *sh, uint16_t *x, uint16_t *y) in cursor_position_get() argument
84 memset(sh->ctx->temp_buff, 0, sizeof(sh->ctx->temp_buff)); in cursor_position_get()
89 z_shell_raw_fprintf(sh->fprintf_ctx, cmd_get_terminal_size); in cursor_position_get()
94 z_transport_buffer_flush(sh); in cursor_position_get()
99 (void)sh->iface->api->read(sh->iface, &c, in cursor_position_get()
106 (sh->ctx->temp_buff[0] != in cursor_position_get()
112 sh->ctx->temp_buff[buff_idx] = '\0'; in cursor_position_get()
113 if (sh->ctx->temp_buff[1] != '[') { in cursor_position_get()
114 sh->ctx->temp_buff[0] = 0; in cursor_position_get()
123 while (sh->ctx->temp_buff[buff_idx] != ';') { in cursor_position_get()
[all …]
Dshell_help.c19 static void formatted_text_print(const struct shell *sh, const char *str, in formatted_text_print() argument
30 z_shell_op_cursor_horiz_move(sh, terminal_offset); in formatted_text_print()
45 sh->ctx->vt100_ctx.cons.terminal_wid - terminal_offset) { in formatted_text_print()
48 z_transport_buffer_flush(sh); in formatted_text_print()
49 z_shell_write(sh, str + offset, idx); in formatted_text_print()
51 z_cursor_next_line_move(sh); in formatted_text_print()
52 z_shell_op_cursor_horiz_move(sh, in formatted_text_print()
59 z_shell_raw_fprintf(sh->fprintf_ctx, str + offset); in formatted_text_print()
67 length = sh->ctx->vt100_ctx.cons.terminal_wid in formatted_text_print()
80 sh->ctx->vt100_ctx.cons.terminal_wid) { in formatted_text_print()
[all …]
/Zephyr-Core-3.4.0/subsys/net/l2/wifi/
Dwifi_shell.c45 const struct shell *sh; member
62 #define print(sh, level, fmt, ...) \ argument
64 if (sh) { \
65 shell_fprintf(sh, level, fmt, ##__VA_ARGS__); \
71 static bool parse_number(const struct shell *sh, long *param, char *str, long min, long max) in parse_number() argument
78 print(sh, SHELL_ERROR, "Invalid number: %s", str_tmp); in parse_number()
82 print(sh, SHELL_WARNING, "Value out of range: %s, (%ld-%ld)", str_tmp, min, max); in parse_number()
98 print(context.sh, SHELL_NORMAL, in handle_wifi_scan_result()
103 print(context.sh, SHELL_NORMAL, in handle_wifi_scan_result()
166 print(context.sh, SHELL_NORMAL, in handle_wifi_raw_scan_result()
[all …]
/Zephyr-Core-3.4.0/subsys/net/lib/zperf/
Dzperf_shell.c84 static void print_number(const struct shell *sh, uint32_t value, in print_number() argument
102 shell_fprintf(sh, SHELL_NORMAL, "%u.%s%u %s", radix, in print_number()
105 shell_fprintf(sh, SHELL_NORMAL, "%u %s", value, *unit); in print_number()
129 static int parse_ipv6_addr(const struct shell *sh, char *host, char *port, in parse_ipv6_addr() argument
140 shell_fprintf(sh, SHELL_WARNING, in parse_ipv6_addr()
147 shell_fprintf(sh, SHELL_WARNING, in parse_ipv6_addr()
155 static int parse_ipv4_addr(const struct shell *sh, char *host, char *port, in parse_ipv4_addr() argument
166 shell_fprintf(sh, SHELL_WARNING, in parse_ipv4_addr()
173 shell_fprintf(sh, SHELL_WARNING, in parse_ipv4_addr()
181 static int cmd_setip(const struct shell *sh, size_t argc, char *argv[]) in cmd_setip() argument
[all …]
/Zephyr-Core-3.4.0/drivers/edac/
Dshell.c38 static void decode_ecc_error(const struct shell *sh, uint64_t ecc_error) in decode_ecc_error() argument
43 shell_fprintf(sh, SHELL_NORMAL, in decode_ecc_error()
45 shell_fprintf(sh, SHELL_NORMAL, in decode_ecc_error()
49 shell_fprintf(sh, SHELL_NORMAL, in decode_ecc_error()
54 shell_fprintf(sh, SHELL_NORMAL, in decode_ecc_error()
59 static int ecc_error_show(const struct shell *sh, const struct device *dev) in ecc_error_show() argument
66 shell_error(sh, "Error getting error log (err %d)", err); in ecc_error_show()
70 shell_fprintf(sh, SHELL_NORMAL, "ECC Error: 0x%llx\n", error); in ecc_error_show()
73 decode_ecc_error(sh, error); in ecc_error_show()
79 static int parity_error_show(const struct shell *sh, const struct device *dev) in parity_error_show() argument
[all …]
/Zephyr-Core-3.4.0/subsys/fb/
Dcfb_shell.c31 static int cmd_clear(const struct shell *sh, size_t argc, char *argv[]) in cmd_clear() argument
39 shell_error(sh, HELP_INIT); in cmd_clear()
45 shell_error(sh, "Framebuffer clear error=%d", err); in cmd_clear()
51 shell_error(sh, "Framebuffer finalize error=%d", err); in cmd_clear()
55 shell_print(sh, "Display Cleared"); in cmd_clear()
60 static int cmd_cfb_print(const struct shell *sh, int col, int row, char *str) in cmd_cfb_print() argument
66 shell_error(sh, HELP_INIT); in cmd_cfb_print()
74 shell_error(sh, "Framebuffer clear failed error=%d", err); in cmd_cfb_print()
80 shell_error(sh, "Failed to print the string %s error=%d", in cmd_cfb_print()
87 shell_error(sh, in cmd_cfb_print()
[all …]
/Zephyr-Core-3.4.0/samples/subsys/shell/shell_module/src/
Dmain.c36 static int cmd_log_test_start(const struct shell *sh, size_t argc, in cmd_log_test_start() argument
42 shell_print(sh, "Log test started\n"); in cmd_log_test_start()
47 static int cmd_log_test_start_demo(const struct shell *sh, size_t argc, in cmd_log_test_start_demo() argument
50 return cmd_log_test_start(sh, argc, argv, 200); in cmd_log_test_start_demo()
53 static int cmd_log_test_start_flood(const struct shell *sh, size_t argc, in cmd_log_test_start_flood() argument
56 return cmd_log_test_start(sh, argc, argv, 10); in cmd_log_test_start_flood()
59 static int cmd_log_test_stop(const struct shell *sh, size_t argc, in cmd_log_test_stop() argument
66 shell_print(sh, "Log test stopped"); in cmd_log_test_stop()
88 static int cmd_demo_ping(const struct shell *sh, size_t argc, char **argv) in cmd_demo_ping() argument
93 shell_print(sh, "pong"); in cmd_demo_ping()
[all …]
/Zephyr-Core-3.4.0/subsys/logging/
Dlog_cmds.c14 typedef int (*log_backend_cmd_t)(const struct shell *sh,
56 static bool shell_state_precheck(const struct shell *sh) in shell_state_precheck() argument
58 if (sh->log_backend->control_block->state in shell_state_precheck()
60 shell_error(sh, "Shell log backend not initialized."); in shell_state_precheck()
70 static int shell_backend_cmd_execute(const struct shell *sh, in shell_backend_cmd_execute() argument
82 func(sh, backend, argc, argv); in shell_backend_cmd_execute()
84 shell_error(sh, "Invalid backend: %s", name); in shell_backend_cmd_execute()
91 static int log_status(const struct shell *sh, in log_status() argument
100 shell_warn(sh, "Logs are halted!"); in log_status()
103 shell_fprintf(sh, SHELL_NORMAL, "%-40s | current | built-in \r\n", in log_status()
[all …]
/Zephyr-Core-3.4.0/drivers/lora/
Dshell.c34 static int parse_long(long *out, const struct shell *sh, const char *arg) in parse_long() argument
41 shell_error(sh, "'%s' is not an integer", arg); in parse_long()
49 static int parse_long_range(long *out, const struct shell *sh, in parse_long_range() argument
55 ret = parse_long(out, sh, arg); in parse_long_range()
61 shell_error(sh, "Parameter '%s' is out of range. " in parse_long_range()
70 static int parse_freq(uint32_t *out, const struct shell *sh, const char *arg) in parse_freq() argument
77 shell_error(sh, "Invalid frequency, '%s' is not an integer", in parse_freq()
83 shell_error(sh, "Frequency %s out of range", arg); in parse_freq()
91 static const struct device *get_modem(const struct shell *sh) in get_modem() argument
98 shell_error(sh, "LORA Radio device not ready"); in get_modem()
[all …]
/Zephyr-Core-3.4.0/subsys/sip_svc/
Dsip_svc_shell.c19 const struct shell *sh; member
22 static int parse_common_args(const struct shell *sh, char **argv, void **ctrl) in parse_common_args() argument
27 shell_error(sh, "service %s not found", argv[1]); in parse_common_args()
34 shell_error(sh, "ARM SiP services method %s not initialized", argv[1]); in parse_common_args()
40 static int cmd_reg(const struct shell *sh, size_t argc, char **argv) in cmd_reg() argument
46 err = parse_common_args(sh, argv, (void **)&ctrl); in cmd_reg()
53 shell_error(sh, "%s: register fail", ctrl->method); in cmd_reg()
56 shell_print(sh, "%s: register success: client token %08x\n", ctrl->method, c_token); in cmd_reg()
63 static int cmd_unreg(const struct shell *sh, size_t argc, char **argv) in cmd_unreg() argument
70 err = parse_common_args(sh, argv, (void **)&ctrl); in cmd_unreg()
[all …]
Dsip_svc_agilex_mailbox_shell.c22 const struct shell *sh; member
28 static int cmd_reg(const struct shell *sh, size_t argc, char **argv) in cmd_reg() argument
33 shell_print(sh, "Mailbox client already registered"); in cmd_reg()
39 shell_error(sh, "Arm SiP service %s not found", argv[1]); in cmd_reg()
46 shell_error(sh, "Mailbox client register fail"); in cmd_reg()
49 shell_print(sh, "Mailbox client register success (token %08x)", mb_c_token); in cmd_reg()
56 static int cmd_unreg(const struct shell *sh, size_t argc, char **argv) in cmd_unreg() argument
61 shell_print(sh, "Mailbox client is not registered"); in cmd_unreg()
67 shell_error(sh, "Mailbox client unregister fail (%d)", err); in cmd_unreg()
69 shell_print(sh, "Mailbox client unregister success"); in cmd_unreg()
[all …]
/Zephyr-Core-3.4.0/drivers/led/
Dled_shell.c23 static int parse_common_args(const struct shell *sh, char **argv, in parse_common_args() argument
30 shell_error(sh, in parse_common_args()
37 shell_error(sh, "Invalid LED number parameter %s", in parse_common_args()
45 static int cmd_off(const struct shell *sh, size_t argc, char **argv) in cmd_off() argument
51 err = parse_common_args(sh, argv, &dev, &led); in cmd_off()
56 shell_print(sh, "%s: turning off LED %d", dev->name, led); in cmd_off()
60 shell_error(sh, "Error: %d", err); in cmd_off()
66 static int cmd_on(const struct shell *sh, size_t argc, char **argv) in cmd_on() argument
72 err = parse_common_args(sh, argv, &dev, &led); in cmd_on()
77 shell_print(sh, "%s: turning on LED %d", dev->name, led); in cmd_on()
[all …]
/Zephyr-Core-3.4.0/subsys/bluetooth/audio/shell/
Dtbs.c39 static int cmd_tbs_authorize(const struct shell *sh, size_t argc, char *argv[]) in cmd_tbs_authorize() argument
48 shell_print(sh, "Connection with addr %s authorized", addr); in cmd_tbs_authorize()
63 static int cmd_tbs_accept(const struct shell *sh, size_t argc, char *argv[]) in cmd_tbs_accept() argument
70 shell_error(sh, "Could not parse call_index: %d", result); in cmd_tbs_accept()
76 shell_error(sh, "Invalid call_index: %lu", call_index); in cmd_tbs_accept()
83 shell_print(sh, "TBS failed: %d", result); in cmd_tbs_accept()
85 shell_print(sh, "TBS succeeded for call_index: %ld", in cmd_tbs_accept()
92 static int cmd_tbs_terminate(const struct shell *sh, size_t argc, in cmd_tbs_terminate() argument
100 shell_error(sh, "Could not parse call_index: %d", result); in cmd_tbs_terminate()
106 shell_error(sh, "Invalid call_index: %lu", call_index); in cmd_tbs_terminate()
[all …]
Dvcp_vol_rend.c159 static int cmd_vcp_vol_rend_init(const struct shell *sh, size_t argc, in cmd_vcp_vol_rend_init() argument
169 ctx_shell = sh; in cmd_vcp_vol_rend_init()
218 shell_help(sh); in cmd_vcp_vol_rend_init()
222 shell_help(sh); in cmd_vcp_vol_rend_init()
227 shell_help(sh); in cmd_vcp_vol_rend_init()
236 shell_print(sh, "Fail: %d", result); in cmd_vcp_vol_rend_init()
242 shell_error(sh, "Failed to get included services: %d", result); in cmd_vcp_vol_rend_init()
249 static int cmd_vcp_vol_rend_volume_step(const struct shell *sh, size_t argc, in cmd_vcp_vol_rend_volume_step() argument
257 shell_error(sh, "Failed to parse step: %d", result); in cmd_vcp_vol_rend_volume_step()
263 shell_error(sh, "Invalid step %lu", step); in cmd_vcp_vol_rend_volume_step()
[all …]
/Zephyr-Core-3.4.0/subsys/bluetooth/mesh/shell/
Dcfg.c21 static int cmd_reset(const struct shell *sh, size_t argc, char *argv[]) in cmd_reset() argument
29 shell_error(sh, "Unable to send Remote Node Reset (err %d)", err); in cmd_reset()
41 shell_print(sh, "Remote node reset complete"); in cmd_reset()
46 static int cmd_timeout(const struct shell *sh, size_t argc, char *argv[]) in cmd_timeout() argument
55 shell_warn(sh, "Unable to parse input string argument"); in cmd_timeout()
70 shell_print(sh, "Message timeout: forever"); in cmd_timeout()
72 shell_print(sh, "Message timeout: %u seconds", timeout_ms / 1000); in cmd_timeout()
78 static int cmd_get_comp(const struct shell *sh, size_t argc, char *argv[]) in cmd_get_comp() argument
89 shell_warn(sh, "Unable to parse input string argument"); in cmd_get_comp()
97 shell_error(sh, "Getting composition failed (err %d)", err); in cmd_get_comp()
[all …]
Dhealth.c18 static void show_faults(const struct shell *sh, uint8_t test_id, uint16_t cid, uint8_t *faults, in show_faults() argument
24 shell_print(sh, "Health Test ID 0x%02x Company ID 0x%04x: no faults\n", test_id, in show_faults()
29 shell_print(sh, "Health Test ID 0x%02x Company ID 0x%04x Fault Count %zu:\n", test_id, cid, in show_faults()
33 shell_print(sh, "\t0x%02x\n", faults[i]); in show_faults()
37 static int cmd_fault_get(const struct shell *sh, size_t argc, char *argv[]) in cmd_fault_get() argument
54 shell_warn(sh, "Unable to parse input string argument"); in cmd_fault_get()
63 shell_error(sh, "Failed to send Health Fault Get (err %d)", err); in cmd_fault_get()
65 show_faults(sh, test_id, cid, faults, fault_count); in cmd_fault_get()
71 static int fault_clear(const struct shell *sh, size_t argc, char *argv[], bool acked) in fault_clear() argument
86 shell_warn(sh, "Unable to parse input string argument"); in fault_clear()
[all …]
/Zephyr-Core-3.4.0/drivers/fpga/
Dfpga_shell.c13 static int parse_common_args(const struct shell *sh, char **argv, in parse_common_args() argument
18 shell_error(sh, "FPGA device %s not found", argv[1]); in parse_common_args()
24 static int cmd_on(const struct shell *sh, size_t argc, char **argv) in cmd_on() argument
29 err = parse_common_args(sh, argv, &dev); in cmd_on()
34 shell_print(sh, "%s: turning on", dev->name); in cmd_on()
38 shell_error(sh, "Error: %d", err); in cmd_on()
44 static int cmd_off(const struct shell *sh, size_t argc, char **argv) in cmd_off() argument
49 err = parse_common_args(sh, argv, &dev); in cmd_off()
54 shell_print(sh, "%s: turning off", dev->name); in cmd_off()
58 shell_error(sh, "Error: %d", err); in cmd_off()
[all …]
/Zephyr-Core-3.4.0/drivers/flash/
Dflash_shell.c33 static int parse_helper(const struct shell *sh, size_t *argc, in parse_helper() argument
45 shell_error(sh, "Given flash device was not found"); in parse_helper()
51 shell_error(sh, "Default flash driver not ready"); in parse_helper()
57 shell_error(sh, "No flash device specified (required)"); in parse_helper()
65 shell_error(sh, "Missing address."); in parse_helper()
74 static int cmd_erase(const struct shell *sh, size_t argc, char *argv[]) in cmd_erase() argument
81 result = parse_helper(sh, &argc, &argv, &flash_dev, &page_addr); in cmd_erase()
94 shell_error(sh, "Could not determine page size, " in cmd_erase()
105 shell_error(sh, "Erase Failed, code %d.", result); in cmd_erase()
107 shell_print(sh, "Erase success."); in cmd_erase()
[all …]
/Zephyr-Core-3.4.0/subsys/net/l2/ethernet/
Dbridge_shell.c14 static int get_idx(const struct shell *sh, char *index_str) in get_idx() argument
21 shell_warn(sh, "Invalid index %s\n", index_str); in get_idx()
27 static int cmd_bridge_addif(const struct shell *sh, size_t argc, char *argv[]) in cmd_bridge_addif() argument
33 br_idx = get_idx(sh, argv[1]); in cmd_bridge_addif()
37 if_idx = get_idx(sh, argv[2]); in cmd_bridge_addif()
43 shell_warn(sh, "Bridge %d not found\n", br_idx); in cmd_bridge_addif()
48 shell_warn(sh, "Interface %d not found\n", if_idx); in cmd_bridge_addif()
52 shell_warn(sh, "Interface %d is not Ethernet\n", if_idx); in cmd_bridge_addif()
56 shell_warn(sh, "Interface %d cannot do promiscuous mode\n", if_idx); in cmd_bridge_addif()
63 shell_error(sh, "error: eth_bridge_iface_add() returned %d\n", ret); in cmd_bridge_addif()
[all …]
/Zephyr-Core-3.4.0/subsys/usb/device_next/
Dusbd_shell.c32 int cmd_wakeup_request(const struct shell *sh, in cmd_wakeup_request() argument
39 shell_error(sh, "dev: Failed to wakeup remote %d", err); in cmd_wakeup_request()
41 shell_print(sh, "dev: Requested remote wakeup"); in cmd_wakeup_request()
47 static int cmd_register(const struct shell *sh, in cmd_register() argument
57 shell_error(sh, in cmd_register()
61 shell_print(sh, in cmd_register()
69 static int cmd_unregister(const struct shell *sh, in cmd_unregister() argument
78 shell_error(sh, in cmd_unregister()
82 shell_print(sh, in cmd_unregister()
90 static int cmd_usbd_magic(const struct shell *sh, in cmd_usbd_magic() argument
[all …]
/Zephyr-Core-3.4.0/lib/os/
Dcrc_shell.c46 static void usage(const struct shell *sh) in usage() argument
50 shell_print(sh, "crc [options..] <address> <size>"); in usage()
51 shell_print(sh, "options:"); in usage()
52 shell_print(sh, "-f This is the first packet"); in usage()
53 shell_print(sh, "-l This is the last packet"); in usage()
54 shell_print(sh, "-p <poly> Use polynomial 'poly'"); in usage()
55 shell_print(sh, "-r Reflect"); in usage()
56 shell_print(sh, "-s <seed> Use 'seed' as the initial value"); in usage()
57 shell_print(sh, "-t <type> Compute the CRC described by 'type'"); in usage()
58 shell_print(sh, "Note: some options are only useful for certain CRCs"); in usage()
[all …]

12345678910>>...17