Communicate Rx available antenna mode to the Tx (#3039)
[ExpressLRS.git] / src / lib / SerialUpdate / slip.h
blobb438a90105b58e6c77faf5780459c685f4852485
1 /*
2 * SPDX-FileCopyrightText: 2016 Cesanta Software Limited
4 * SPDX-License-Identifier: GPL-2.0-or-later
6 * SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD
7 */
9 #ifndef SLIP_H_
10 #define SLIP_H_
12 #include <stdint.h>
14 /* Send the SLIP frame begin/end delimiter. */
15 void SLIP_send_frame_delimiter(void);
17 /* Send a single character of SLIP frame data, escaped as per SLIP escaping. */
18 void SLIP_send_frame_data(char ch);
20 /* Send the status byte (prefixed with the error flag). */
21 void SLIP_send_frame_status(char status);
23 /* Send some SLIP frame data, escaped as per SLIP escaping. */
24 void SLIP_send_frame_data_buf(const void *buf, uint32_t size);
26 /* Send a full SLIP frame, with specified contents. */
27 void SLIP_send(const void *pkt, uint32_t size);
29 typedef enum {
30 SLIP_NO_FRAME,
31 SLIP_FRAME,
32 SLIP_FRAME_ESCAPING
33 } slip_state_t;
35 int16_t SLIP_recv_byte(char byte, slip_state_t *state);
37 #define SLIP_FINISHED_FRAME -2
38 #define SLIP_NO_BYTE -1
40 /* Receive a SLIP frame, with specified contents. */
41 uint32_t SLIP_recv(void *pkt, uint32_t max_len);
43 #endif /* SLIP_H_ */