Zephyr API Documentation 4.0.0-rc3
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
shell_transport_api Struct Reference

Unified shell transport interface. More...

#include <shell.h>

Data Fields

int(* init )(const struct shell_transport *transport, const void *config, shell_transport_handler_t evt_handler, void *context)
 Function for initializing the shell transport interface.
 
int(* uninit )(const struct shell_transport *transport)
 Function for uninitializing the shell transport interface.
 
int(* enable )(const struct shell_transport *transport, bool blocking_tx)
 Function for enabling transport in given TX mode.
 
int(* write )(const struct shell_transport *transport, const void *data, size_t length, size_t *cnt)
 Function for writing data to the transport interface.
 
int(* read )(const struct shell_transport *transport, void *data, size_t length, size_t *cnt)
 Function for reading data from the transport interface.
 
void(* update )(const struct shell_transport *transport)
 Function called in shell thread loop.
 

Detailed Description

Unified shell transport interface.

Field Documentation

◆ enable

int(* shell_transport_api::enable) (const struct shell_transport *transport, bool blocking_tx)

Function for enabling transport in given TX mode.

Function can be used to reconfigure TX to work in blocking mode.

Parameters
transportPointer to the transfer instance.
blocking_txIf true, the transport TX is enabled in blocking mode.
Returns
NRF_SUCCESS on successful enabling, error otherwise (also if not supported).

◆ init

int(* shell_transport_api::init) (const struct shell_transport *transport, const void *config, shell_transport_handler_t evt_handler, void *context)

Function for initializing the shell transport interface.

Parameters
[in]transportPointer to the transfer instance.
[in]configPointer to instance configuration.
[in]evt_handlerEvent handler.
[in]contextPointer to the context passed to event handler.
Returns
Standard error code.

◆ read

int(* shell_transport_api::read) (const struct shell_transport *transport, void *data, size_t length, size_t *cnt)

Function for reading data from the transport interface.

Parameters
[in]transportPointer to the transfer instance.
[in]dataPointer to the destination buffer.
[in]lengthDestination buffer length.
[out]cntPointer to the received bytes counter.
Returns
Standard error code.

◆ uninit

int(* shell_transport_api::uninit) (const struct shell_transport *transport)

Function for uninitializing the shell transport interface.

Parameters
[in]transportPointer to the transfer instance.
Returns
Standard error code.

◆ update

void(* shell_transport_api::update) (const struct shell_transport *transport)

Function called in shell thread loop.

Can be used for backend operations that require longer execution time

Parameters
[in]transportPointer to the transfer instance.

◆ write

int(* shell_transport_api::write) (const struct shell_transport *transport, const void *data, size_t length, size_t *cnt)

Function for writing data to the transport interface.

Parameters
[in]transportPointer to the transfer instance.
[in]dataPointer to the source buffer.
[in]lengthSource buffer length.
[out]cntPointer to the sent bytes counter.
Returns
Standard error code.

The documentation for this struct was generated from the following file: