7#ifndef ZEPHYR_INCLUDE_MGMT_SERIAL_H_
8#define ZEPHYR_INCLUDE_MGMT_SERIAL_H_
24#define MCUMGR_SERIAL_HDR_PKT 0x0609
26#define MCUMGR_SERIAL_HDR_FRAG 0x0414
28#define MCUMGR_SERIAL_MAX_FRAME 127
31#define MCUMGR_SERIAL_HDR_PKT_1 (MCUMGR_SERIAL_HDR_PKT >> 8)
33#define MCUMGR_SERIAL_HDR_PKT_2 (MCUMGR_SERIAL_HDR_PKT & 0xff)
35#define MCUMGR_SERIAL_HDR_FRAG_1 (MCUMGR_SERIAL_HDR_FRAG >> 8)
37#define MCUMGR_SERIAL_HDR_FRAG_2 (MCUMGR_SERIAL_HDR_FRAG & 0xff)
83 const uint8_t *frag,
int frag_len);
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_cb)(const void *data, int len)
Transmits a chunk of raw response data.
Definition serial.h:60
int mcumgr_serial_tx_pkt(const uint8_t *data, int len, mcumgr_serial_tx_cb cb)
Encodes and transmits an mcumgr packet over serial.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Maintains state for an incoming mcumgr request packet.
Definition serial.h:42
uint16_t pkt_len
Length of full packet, as read from header.
Definition serial.h:49
struct net_buf * nb
Contains the partially- or fully-received mcumgr request.
Definition serial.h:46
Network buffer representation.
Definition net_buf.h:1006
uint8_t * data
Pointer to the start of data in the buffer.
Definition net_buf.h:1032
uint16_t len
Length of the data behind the data pointer.
Definition net_buf.h:1035