Zephyr API Documentation  3.6.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
7#ifndef SHELL_BACKEND_H__
8#define SHELL_BACKEND_H__
9
10#include <zephyr/types.h>
11#include <zephyr/shell/shell.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
25static inline const struct shell *shell_backend_get(uint32_t idx)
26{
27 const struct shell *backend;
28
29 STRUCT_SECTION_GET(shell, idx, &backend);
30
31 return backend;
32}
33
39static inline int shell_backend_count_get(void)
40{
41 int cnt;
42
44
45 return cnt;
46}
47
55const struct shell *shell_backend_get_by_name(const char *backend_name);
56
57#ifdef __cplusplus
58}
59#endif
60
61#endif /* 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:25
static int shell_backend_count_get(void)
Get number of backends.
Definition: shell_backend.h:39
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
Shell instance internals.
Definition: shell.h:890