|
ether2ser 0.1.0
Ethernet <-> synchronous V.24 bridge firmware for RP2040 + W5500
|


Go to the source code of this file.
Data Structures | |
| struct | hdlc_decode_stats_t |
| Cumulative HDLC decode failure reason counters. More... | |
Functions | |
| bool | hdlc_decode (const HDLC_FRAME_T *frame, uint8_t *payload, const size_t out_capacity, size_t *payload_length, bool lsb_first) |
| Decode an HDLC bit-stuffed frame. | |
| bool | hdlc_decode_byte (const HDLC_FRAME_T *frame, uint8_t *payload, const size_t out_capacity, size_t *payload_length) |
| Decode a byte-escaped HDLC frame compatibility path. | |
| void | hdlc_decode_stats_snapshot (hdlc_decode_stats_t *out_stats) |
| Copy cumulative HDLC decode statistics. | |
| void | hdlc_decode_stats_reset (void) |
| Reset cumulative HDLC decode statistics. | |
| bool hdlc_decode | ( | const HDLC_FRAME_T * | frame, |
| uint8_t * | payload, | ||
| const size_t | out_capacity, | ||
| size_t * | payload_length, | ||
| bool | lsb_first | ||
| ) |
Decode an HDLC bit-stuffed frame.
| frame | Input HDLC frame. |
| payload | Output payload buffer. |
| out_capacity | Capacity of payload in bytes. |
| payload_length | Output payload length. |
| lsb_first | Bit order selector matching encoder/PIO path. |
Definition at line 171 of file hdlc_decoder.c.
References hdlc_decode_stats_t::crc_mismatch, HDLC_BIT_EOF, HDLC_BIT_ERR, hdlc_crc16(), hdlc_decode_stats, HDLC_FLAG_BYTE, hdlc_get_byte(), hdlc_decode_stats_t::invalid_frame, HDLC_FRAME_T::length, LOG_DEBUG, HDLC_FRAME_T::payload, hdlc_decode_stats_t::payload_too_long, hdlc_decoder_t::raw_bit_index, hdlc_decode_stats_t::too_short, and hdlc_decode_stats_t::unstuff_error.
Referenced by decode_hdlc_to_udp_tx(), and event_dispatch().


| bool hdlc_decode_byte | ( | const HDLC_FRAME_T * | frame, |
| uint8_t * | payload, | ||
| const size_t | out_capacity, | ||
| size_t * | payload_length | ||
| ) |
Decode a byte-escaped HDLC frame compatibility path.
| frame | Input HDLC frame. |
| payload | Output payload buffer. |
| out_capacity | Capacity of payload in bytes. |
| payload_length | Output payload length. |
Definition at line 45 of file hdlc_decoder.c.
References hdlc_decode_stats_t::crc_mismatch, hdlc_crc16(), hdlc_decode_stats, HDLC_ESCAPE_BYTE, HDLC_ESCAPE_XOR, HDLC_FLAG_BYTE, hdlc_decode_stats_t::invalid_frame, HDLC_FRAME_T::length, LOG_DEBUG, HDLC_FRAME_T::payload, hdlc_decode_stats_t::payload_too_long, and hdlc_decode_stats_t::too_short.

| void hdlc_decode_stats_reset | ( | void | ) |
Reset cumulative HDLC decode statistics.
Definition at line 246 of file hdlc_decoder.c.
References hdlc_decode_stats.
| void hdlc_decode_stats_snapshot | ( | hdlc_decode_stats_t * | out_stats | ) |
Copy cumulative HDLC decode statistics.
| out_stats | Destination pointer. |
Definition at line 237 of file hdlc_decoder.c.
References hdlc_decode_stats.
Referenced by update_statistics().
