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_BACKEND_H_
14#define ZEPHYR_INCLUDE_SHELL_BACKEND_H_
15
16#include <zephyr/types.h>
17#include <zephyr/shell/shell.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
31static inline const struct shell *shell_backend_get(uint32_t idx)
32{
33 const struct shell *backend;
34
35 STRUCT_SECTION_GET(shell, idx, &backend);
36
37 return backend;
38}
39
45static inline int shell_backend_count_get(void)
46{
47 int cnt;
48
50
51 return cnt;
52}
53
61const struct shell *shell_backend_get_by_name(const char *backend_name);
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif /* ZEPHYR_INCLUDE_SHELL_BACKEND_H_ */
#define STRUCT_SECTION_GET(struct_type, i, dst)
Get element from section.
Definition iterable_sections.h:282
#define STRUCT_SECTION_COUNT(struct_type, dst)
Count elements in a section.
Definition iterable_sections.h:291
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 backend.
Definition shell_backend.h:31
static int shell_backend_count_get(void)
Get number of backends.
Definition shell_backend.h:45
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Shell instance internals.
Definition shell.h:1063