Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
shell_remote.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7
13
14#ifndef ZEPHYR_INCLUDE_SHELL_SHELL_REMOTE_H_
15#define ZEPHYR_INCLUDE_SHELL_SHELL_REMOTE_H_
16
23
25#include <zephyr/shell/shell.h>
27#include <zephyr/sys/slist.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#ifndef CONFIG_SHELL_REMOTE_TMP_BUF_SIZE
35#define CONFIG_SHELL_REMOTE_TMP_BUF_SIZE 128
36#endif
37
49
53 struct ipc_ept ept;
54
56 struct k_sem sem;
57
59 struct k_work work;
60
62 const struct shell *sh;
63
66
69
71 int result;
72
74 size_t msg_len;
75
77 void *msg;
78
80 bool ready;
81};
82
86 const char *name;
87
89 const struct device *ipc;
90
93};
94
100#define SHELL_REMOTE_CONN(_name, ipc_node) \
101 static struct shell_remote_data shell_remote_data_##_name; \
102 static const STRUCT_SECTION_ITERABLE(shell_remote, _name) = { \
103 .name = STRINGIFY(_name), .ipc = DEVICE_DT_GET(ipc_node), \
104 .ep_cfg = {.name = CONFIG_SHELL_REMOTE_EP_NAME, \
105 .cb = \
106 { \
107 .bound = shell_remote_ep_bound, \
108 .received = shell_remote_ep_recv, \
109 }, \
110 .priv = &shell_remote_data_##_name}}
111
120const struct shell_static_entry *z_shell_remote_cmd_get(const struct shell_static_entry *parent,
121 size_t idx,
122 struct shell_static_entry *dloc);
123
134int z_shell_remote_cmd_exec(const struct shell *shell, const struct shell_static_entry *cmd,
135 uint8_t argc, const char **argv, size_t cmd_lvl);
136
141void shell_remote_ep_bound(void *priv);
142
149void shell_remote_ep_recv(const void *data, size_t len, void *priv);
150
152
153#ifdef __cplusplus
154}
155#endif
156
157#endif /* ZEPHYR_INCLUDE_SHELL_SHELL_REMOTE_H_ */
static void cmd(uint32_t command)
Execute a display list command by co-processor engine.
Definition ft8xx_reference_api.h:153
#define CONFIG_SHELL_REMOTE_TMP_BUF_SIZE
Default size of the temporary buffer for remote shell command data.
Definition shell_remote.h:35
void shell_remote_ep_bound(void *priv)
Callback function to handle the bound event of the remote shell instance.
void shell_remote_ep_recv(const void *data, size_t len, void *priv)
Callback function to handle the received event of the remote shell instance.
Common APIs for the remote shell.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Endpoint configuration structure.
Definition ipc_service.h:206
Endpoint instance.
Definition ipc_service.h:196
Semaphore structure.
Definition kernel.h:3663
A structure used to submit work.
Definition kernel.h:4561
Structure to store the data for the remote shell command.
Definition shell_remote.h:39
struct shell_static_entry cmd
Command entry.
Definition shell_remote.h:41
char tmp_buf[128]
Temporary buffer for the command syntax and help text.
Definition shell_remote.h:47
const struct shell_static_entry * rem_cmd
Pointer to the parent remote command.
Definition shell_remote.h:44
Structure to store the data for the remote shell instance.
Definition shell_remote.h:51
struct shell_remote_cmd * current_cmd
Pointer to the current command.
Definition shell_remote.h:68
size_t msg_len
Length of the print message.
Definition shell_remote.h:74
struct ipc_ept ept
IPC endpoint.
Definition shell_remote.h:53
bool ready
Flag to indicate if the remote shell instance is ready (bounded).
Definition shell_remote.h:80
const struct shell * sh
Pointer to the shell instance.
Definition shell_remote.h:62
struct k_work work
Work queue to process the print messages.
Definition shell_remote.h:59
int result
Result of the last command.
Definition shell_remote.h:71
struct shell_remote_cmd cmds[2]
Space to store the two most recent commands (current and parent).
Definition shell_remote.h:65
void * msg
Pointer to the print message (heap allocated).
Definition shell_remote.h:77
struct k_sem sem
Semaphore to synchronize the access to the remote shell instance.
Definition shell_remote.h:56
Structure to store the configuration for the remote shell instance.
Definition shell_remote.h:84
struct ipc_ept_cfg ep_cfg
IPC endpoint configuration.
Definition shell_remote.h:92
const char * name
Name of the remote shell instance (command syntax).
Definition shell_remote.h:86
const struct device * ipc
IPC device.
Definition shell_remote.h:89
Definition shell.h:291
Shell instance internals.
Definition shell.h:1076