Zephyr Project API 4.2.99
A Scalable Open Source RTOS
|
This allows to use the MCUmgr SMP protocol over serial. More...
Data Structures | |
struct | mcumgr_serial_rx_ctxt |
Maintains state for an incoming mcumgr request packet. More... | |
Macros | |
#define | MCUMGR_SERIAL_HDR_PKT 0x0609 |
Serial packet header. | |
#define | MCUMGR_SERIAL_HDR_FRAG 0x0414 |
Serial fragment header. | |
#define | MCUMGR_SERIAL_MAX_FRAME 127 |
Maximum frame size. | |
#define | MCUMGR_SERIAL_HDR_PKT_1 (MCUMGR_SERIAL_HDR_PKT >> 8) |
First byte of packet header. | |
#define | MCUMGR_SERIAL_HDR_PKT_2 (MCUMGR_SERIAL_HDR_PKT & 0xff) |
Second byte of packet header. | |
#define | MCUMGR_SERIAL_HDR_FRAG_1 (MCUMGR_SERIAL_HDR_FRAG >> 8) |
First byte of fragment header. | |
#define | MCUMGR_SERIAL_HDR_FRAG_2 (MCUMGR_SERIAL_HDR_FRAG & 0xff) |
Second byte of fragment header. | |
Typedefs | |
typedef int(* | mcumgr_serial_tx_cb) (const void *data, int len) |
Transmits a chunk of raw response data. | |
Functions | |
struct net_buf * | mcumgr_serial_process_frag (struct mcumgr_serial_rx_ctxt *rx_ctxt, const uint8_t *frag, int frag_len) |
Processes an mcumgr request fragment received over a serial transport. | |
int | mcumgr_serial_tx_pkt (const uint8_t *data, int len, mcumgr_serial_tx_cb cb) |
Encodes and transmits an mcumgr packet over serial. | |
This allows to use the MCUmgr SMP protocol over serial.
#define MCUMGR_SERIAL_HDR_FRAG 0x0414 |
#include <include/zephyr/mgmt/mcumgr/transport/serial.h>
Serial fragment header.
#define MCUMGR_SERIAL_HDR_FRAG_1 (MCUMGR_SERIAL_HDR_FRAG >> 8) |
#include <include/zephyr/mgmt/mcumgr/transport/serial.h>
First byte of fragment header.
#define MCUMGR_SERIAL_HDR_FRAG_2 (MCUMGR_SERIAL_HDR_FRAG & 0xff) |
#include <include/zephyr/mgmt/mcumgr/transport/serial.h>
Second byte of fragment header.
#define MCUMGR_SERIAL_HDR_PKT 0x0609 |
#include <include/zephyr/mgmt/mcumgr/transport/serial.h>
Serial packet header.
#define MCUMGR_SERIAL_HDR_PKT_1 (MCUMGR_SERIAL_HDR_PKT >> 8) |
#include <include/zephyr/mgmt/mcumgr/transport/serial.h>
First byte of packet header.
#define MCUMGR_SERIAL_HDR_PKT_2 (MCUMGR_SERIAL_HDR_PKT & 0xff) |
#include <include/zephyr/mgmt/mcumgr/transport/serial.h>
Second byte of packet header.
#define MCUMGR_SERIAL_MAX_FRAME 127 |
#include <include/zephyr/mgmt/mcumgr/transport/serial.h>
Maximum frame size.
mcumgr_serial_tx_cb |
#include <include/zephyr/mgmt/mcumgr/transport/serial.h>
Transmits a chunk of raw response data.
data | The data to transmit. |
len | The number of bytes to transmit. |
struct net_buf * mcumgr_serial_process_frag | ( | struct mcumgr_serial_rx_ctxt * | rx_ctxt, |
const uint8_t * | frag, | ||
int | frag_len | ||
) |
#include <include/zephyr/mgmt/mcumgr/transport/serial.h>
Processes an mcumgr request fragment received over a serial transport.
Processes an mcumgr request fragment received over a serial transport. If the fragment is the end of a valid mcumgr request, this function returns a net_buf containing the decoded request. It is the caller's responsibility to free the net_buf after it has been processed.
rx_ctxt | The receive context associated with the serial transport being used. |
frag | The incoming fragment to process. |
frag_len | The length of the fragment, in bytes. |
int mcumgr_serial_tx_pkt | ( | const uint8_t * | data, |
int | len, | ||
mcumgr_serial_tx_cb | cb | ||
) |
#include <include/zephyr/mgmt/mcumgr/transport/serial.h>
Encodes and transmits an mcumgr packet over serial.
data | The mcumgr packet data to send. |
len | The length of the unencoded mcumgr packet. |
cb | A callback used to transmit raw bytes. |