Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
shell_dummy.h
Go to the documentation of this file.
1/*
2 * Shell backend used for testing
3 *
4 * Copyright (c) 2018 Nordic Semiconductor ASA
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
9#ifndef SHELL_DUMMY_H__
10#define SHELL_DUMMY_H__
11
12#include <zephyr/shell/shell.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
19
22
24 size_t len;
25
27 char buf[CONFIG_SHELL_BACKEND_DUMMY_BUF_SIZE];
28};
29
30#define SHELL_DUMMY_DEFINE(_name) \
31 static struct shell_dummy _name##_shell_dummy; \
32 struct shell_transport _name = { \
33 .api = &shell_dummy_transport_api, \
34 .ctx = (struct shell_dummy *)&_name##_shell_dummy \
35 }
36
47
57const char *shell_backend_dummy_get_output(const struct shell *sh,
58 size_t *sizep);
59
66
67#ifdef __cplusplus
68}
69#endif
70
71#endif /* SHELL_DUMMY_H__ */
const struct shell * shell_backend_dummy_get_ptr(void)
This function shall not be used directly.
const struct shell_transport_api shell_dummy_transport_api
void shell_backend_dummy_clear_output(const struct shell *sh)
Clears the output buffer in the shell backend.
const char * shell_backend_dummy_get_output(const struct shell *sh, size_t *sizep)
Returns the buffered output in the shell and resets the pointer.
Definition: shell_dummy.h:20
bool initialized
Definition: shell_dummy.h:21
size_t len
current number of bytes in buffer (0 if no output)
Definition: shell_dummy.h:24
char buf[CONFIG_SHELL_BACKEND_DUMMY_BUF_SIZE]
output buffer to collect shell output
Definition: shell_dummy.h:27
Unified shell transport interface.
Definition: shell.h:646
Shell instance internals.
Definition: shell.h:890