Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Transport backends that connect a shell instance to a communication channel. More...

Topics

 ADSP memory window shell backend
 Shell access over an ADSP memory window.
 Dummy shell backend
 In-memory shell backend used for testing.
 MQTT shell backend
 Shell access over an MQTT connection.
 RPMsg shell backend
 Shell access over an RPMsg endpoint.
 RTT shell backend
 Shell access over a SEGGER RTT channel.
 SSH shell backend
 Shell access over an SSH connection.
 Telnet shell backend
 Shell access over a TELNET connection.
 UART shell backend
 Shell access over a UART serial connection.
 Websocket shell backend
 Shell access over a WebSocket connection.

Files

file  shell_backend.h
 Header file for the shell backend accessors.

Functions

static const struct shellshell_backend_get (uint32_t idx)
 Get a shell backend by index.
static int shell_backend_count_get (void)
 Get number of backends.
const struct shellshell_backend_get_by_name (const char *backend_name)
 Get backend by name.

Detailed Description

Transport backends that connect a shell instance to a communication channel.

A shell instance is driven by a transport backend (UART, RTT, Telnet, MQTT, WebSocket, SSH, RPMsg, ...). Backends are normally selected and enabled through their Kconfig options (for example CONFIG_SHELL_BACKEND_SERIAL), and the shell subsystem instantiates the configured backend automatically. Applications usually do not reference the symbols in this group directly.

What each backend header exposes is therefore a small, mostly implementation oriented surface:

  • a SHELL_<name>_DEFINE() macro that instantiates a transport, used by the backend implementation itself (and available for custom instances);
  • a shell_backend_<name>_get_ptr() accessor returning that backend's shell instance, for the few callers that need to address a specific backend (e.g. the dummy backend in tests, or UART in management code);
  • occasional backend-specific helpers.

Function Documentation

◆ shell_backend_count_get()

int shell_backend_count_get ( void )
inlinestatic

#include <zephyr/shell/shell_backend.h>

Get number of backends.

Returns
Number of backends.

◆ shell_backend_get()

const struct shell * shell_backend_get ( uint32_t idx)
inlinestatic

#include <zephyr/shell/shell_backend.h>

Get a shell backend by index.

Parameters
[in]idxIndex of the backend, from 0 to shell_backend_count_get() - 1.
Returns
Pointer to the backend instance at the given index.

◆ shell_backend_get_by_name()

const struct shell * shell_backend_get_by_name ( const char * backend_name)

#include <zephyr/shell/shell_backend.h>

Get backend by name.

Parameters
[in]backend_nameName of the backend as defined by the SHELL_DEFINE.
Returns
Pointer to the backend instance if found, NULL if backend is not found.