Go to the source code of this file.
|
typedef int(* | mcumgr_serial_tx_cb) (const void *data, int len) |
| Transmits a chunk of raw response data.
|
|
◆ MCUMGR_SERIAL_HDR_FRAG
#define MCUMGR_SERIAL_HDR_FRAG 0x0414 |
◆ MCUMGR_SERIAL_HDR_FRAG_1
◆ MCUMGR_SERIAL_HDR_FRAG_2
◆ MCUMGR_SERIAL_HDR_PKT
#define MCUMGR_SERIAL_HDR_PKT 0x0609 |
◆ MCUMGR_SERIAL_HDR_PKT_1
◆ MCUMGR_SERIAL_HDR_PKT_2
◆ MCUMGR_SERIAL_MAX_FRAME
#define MCUMGR_SERIAL_MAX_FRAME 127 |
◆ mcumgr_serial_tx_cb
typedef int(* mcumgr_serial_tx_cb) (const void *data, int len) |
Transmits a chunk of raw response data.
- Parameters
-
data | The data to transmit. |
len | The number of bytes to transmit. |
- Returns
- 0 on success; negative error code on failure.
◆ mcumgr_serial_process_frag()
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.
- Parameters
-
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. |
- Returns
- A net_buf containing the decoded request if a complete and valid request has been received. NULL if the packet is incomplete or invalid.
◆ mcumgr_serial_tx_pkt()
Encodes and transmits an mcumgr packet over serial.
- Parameters
-
data | The mcumgr packet data to send. |
len | The length of the unencoded mcumgr packet. |
cb | A callback used to transmit raw bytes. |
- Returns
- 0 on success; negative error code on failure.