123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- #ifndef ZEPHYR_INCLUDE_MGMT_SERIAL_H_
- #define ZEPHYR_INCLUDE_MGMT_SERIAL_H_
- #include <zephyr/types.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define MCUMGR_SERIAL_HDR_PKT 0x0609
- #define MCUMGR_SERIAL_HDR_FRAG 0x0414
- #define MCUMGR_SERIAL_MAX_FRAME 128
- #define MCUMGR_SERIAL_HDR_PKT_1 (MCUMGR_SERIAL_HDR_PKT >> 8)
- #define MCUMGR_SERIAL_HDR_PKT_2 (MCUMGR_SERIAL_HDR_PKT & 0xff)
- #define MCUMGR_SERIAL_HDR_FRAG_1 (MCUMGR_SERIAL_HDR_FRAG >> 8)
- #define MCUMGR_SERIAL_HDR_FRAG_2 (MCUMGR_SERIAL_HDR_FRAG & 0xff)
- struct mcumgr_serial_rx_ctxt {
-
- struct net_buf *nb;
-
- uint16_t pkt_len;
- };
- typedef int (*mcumgr_serial_tx_cb)(const void *data, int len, void *arg);
- struct net_buf *mcumgr_serial_process_frag(
- struct mcumgr_serial_rx_ctxt *rx_ctxt,
- const uint8_t *frag, int frag_len);
- int mcumgr_serial_tx_pkt(const uint8_t *data, int len, mcumgr_serial_tx_cb cb,
- void *arg);
- #ifdef __cplusplus
- }
- #endif
- #endif
|