Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
smp_shell.h File Reference

Shell transport for the mcumgr SMP protocol. More...

#include <zephyr/types.h>

Go to the source code of this file.

Data Structures

struct  smp_shell_data
 Data used by SMP shell. More...
 

Macros

#define SMP_SHELL_RX_BUF_SIZE   127
 

Functions

size_t smp_shell_rx_bytes (struct smp_shell_data *data, const uint8_t *bytes, size_t size)
 Attempt to process received bytes as part of an SMP frame.
 
void smp_shell_process (struct smp_shell_data *data)
 Processes SMP data and executes command if full frame was received.
 
int smp_shell_init (void)
 Initializes SMP transport over shell.
 

Detailed Description

Shell transport for the mcumgr SMP protocol.

Macro Definition Documentation

◆ SMP_SHELL_RX_BUF_SIZE

#define SMP_SHELL_RX_BUF_SIZE   127

Function Documentation

◆ smp_shell_init()

int smp_shell_init ( void )

Initializes SMP transport over shell.

This function should be called before feeding SMP transport with received data.

Returns
0 on success

◆ smp_shell_process()

void smp_shell_process ( struct smp_shell_data * data)

Processes SMP data and executes command if full frame was received.

This function should be called from thread context.

Parameters
dataSMP shell transfer data.

◆ smp_shell_rx_bytes()

size_t smp_shell_rx_bytes ( struct smp_shell_data * data,
const uint8_t * bytes,
size_t size )

Attempt to process received bytes as part of an SMP frame.

Called to scan buffer from the beginning and consume all bytes that are part of SMP frame until frame or buffer ends.

Parameters
dataSMP shell transfer data.
bytesBuffer with bytes to process
sizeNumber of bytes to process
Returns
number of bytes consumed by the SMP