Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
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 <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 *shell,
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. It provides pointer to shell dummy backend instance.
const struct shell_transport_api shell_dummy_transport_api
void shell_backend_dummy_clear_output(const struct shell *shell)
Clears the output buffer in the shell backend.
const char * shell_backend_dummy_get_output(const struct shell *shell, 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
Definition: shell_dummy.h:24
char buf[CONFIG_SHELL_BACKEND_DUMMY_BUF_SIZE]
Definition: shell_dummy.h:27
Unified shell transport interface.
Definition: shell.h:519
Shell instance internals.
Definition: shell.h:720