Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
shell_backend.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Meta
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_SHELL_SHELL_BACKEND_H_
14#define ZEPHYR_INCLUDE_SHELL_SHELL_BACKEND_H_
15
16#include <zephyr/types.h>
17#include <zephyr/shell/shell.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
46
54static inline const struct shell *shell_backend_get(uint32_t idx)
55{
56 const struct shell *backend;
57
58 STRUCT_SECTION_GET(shell, idx, &backend);
59
60 return backend;
61}
62
68static inline int shell_backend_count_get(void)
69{
70 int cnt;
71
73
74 return cnt;
75}
76
84const struct shell *shell_backend_get_by_name(const char *backend_name);
85
87
88#ifdef __cplusplus
89}
90#endif
91
92#endif /* ZEPHYR_INCLUDE_SHELL_SHELL_BACKEND_H_ */
#define STRUCT_SECTION_GET(struct_type, i, dst)
Get element from section.
Definition iterable_sections.h:337
#define STRUCT_SECTION_COUNT(struct_type, dst)
Count elements in a section.
Definition iterable_sections.h:346
const struct shell * shell_backend_get_by_name(const char *backend_name)
Get backend by name.
static const struct shell * shell_backend_get(uint32_t idx)
Get a shell backend by index.
Definition shell_backend.h:54
static int shell_backend_count_get(void)
Get number of backends.
Definition shell_backend.h:68
Header file for the shell subsystem.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Shell instance internals.
Definition shell.h:1128
Iterable sections helpers.