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

A driver for sending and receiving mcumgr packets over UART. More...

#include <stdlib.h>
#include <zephyr/types.h>

Go to the source code of this file.

Data Structures

struct  uart_mcumgr_rx_buf
 Contains an mcumgr fragment received over UART. More...
 

Typedefs

typedef void uart_mcumgr_recv_fn(struct uart_mcumgr_rx_buf *rx_buf)
 Function that gets called when an mcumgr packet is received.
 

Functions

int uart_mcumgr_send (const uint8_t *data, int len)
 Sends an mcumgr packet over UART.
 
void uart_mcumgr_free_rx_buf (struct uart_mcumgr_rx_buf *rx_buf)
 Frees the supplied receive buffer.
 
void uart_mcumgr_register (uart_mcumgr_recv_fn *cb)
 Registers an mcumgr UART receive handler.
 

Detailed Description

A driver for sending and receiving mcumgr packets over UART.

See also
include/mgmt/serial.h

Typedef Documentation

◆ uart_mcumgr_recv_fn

typedef void uart_mcumgr_recv_fn(struct uart_mcumgr_rx_buf *rx_buf)

Function that gets called when an mcumgr packet is received.

Function that gets called when an mcumgr packet is received. This function gets called in the interrupt context. Ownership of the specified buffer is transferred to the callback when this function gets called.

Parameters
rx_bufA buffer containing the incoming mcumgr packet.

Function Documentation

◆ uart_mcumgr_free_rx_buf()

void uart_mcumgr_free_rx_buf ( struct uart_mcumgr_rx_buf * rx_buf)

Frees the supplied receive buffer.

Parameters
rx_bufThe buffer to free.

◆ uart_mcumgr_register()

void uart_mcumgr_register ( uart_mcumgr_recv_fn * cb)

Registers an mcumgr UART receive handler.

Configures the mcumgr UART driver to call the specified function when an mcumgr request packet is received.

Parameters
cbThe callback to execute when an mcumgr request packet is received.

◆ uart_mcumgr_send()

int uart_mcumgr_send ( const uint8_t * data,
int len )

Sends an mcumgr packet over UART.

Parameters
dataBuffer containing the mcumgr packet to send.
lenThe length of the buffer, in bytes.
Returns
0 on success; negative error code on failure.