spandsp 3.0.0
hdlc_rx_state_s Struct Reference

#include <hdlc.h>

Public Attributes

int crc_bytes
size_t max_frame_len
 Maximum permitted frame length.
hdlc_frame_handler_t frame_handler
 The callback routine called to process each good received frame.
void * frame_user_data
 An opaque parameter passed to the frame callback routine.
span_modem_status_func_t status_handler
 The callback routine called to report status changes.
void * status_user_data
 An opaque parameter passed to the status callback routine.
bool report_bad_frames
 True if bad frames are to be reported.
int framing_ok_threshold
 The number of consecutive flags which must be seen before framing is declared OK.
bool framing_ok_announced
 True if framing OK has been announced.
int flags_seen
 Number of consecutive flags seen so far.
uint32_t raw_bit_stream
 The raw (stuffed) bit stream buffer.
uint32_t byte_in_progress
 The destuffed bit stream buffer.
int num_bits
 The current number of bits in byte_in_progress.
bool octet_counting_mode
 True if in octet counting mode (e.g. for MTP).
int octet_count
 Octet count, to achieve the functionality needed for things like MTP.
int octet_count_report_interval
 The number of octets to be allowed between octet count reports.
uint8_t buffer [HDLC_MAXFRAME_LEN+4]
 Buffer for a frame in progress.
size_t len
 Length of a frame in progress.
unsigned long int rx_bytes
 The number of bytes of good frames received (CRC not included).
unsigned long int rx_frames
 The number of good frames received.
unsigned long int rx_crc_errors
 The number of frames with CRC errors received.
unsigned long int rx_length_errors
 The number of too short and too long frames received.
unsigned long int rx_aborts
 The number of HDLC aborts received.

Detailed Description

HDLC receive descriptor. This contains all the state information for an HDLC receiver.

Member Data Documentation

◆ buffer

uint8_t hdlc_rx_state_s::buffer[HDLC_MAXFRAME_LEN+4]

Buffer for a frame in progress.

Referenced by hdlc_rx_init(), and hdlc_rx_set_max_frame_len().

◆ byte_in_progress

uint32_t hdlc_rx_state_s::byte_in_progress

The destuffed bit stream buffer.

Referenced by hdlc_rx_restart().

◆ crc_bytes

int hdlc_rx_state_s::crc_bytes

2 for CRC-16, 4 for CRC-32

Referenced by hdlc_rx_init(), and hdlc_rx_set_max_frame_len().

◆ flags_seen

int hdlc_rx_state_s::flags_seen

Number of consecutive flags seen so far.

Referenced by hdlc_rx_restart().

◆ frame_handler

hdlc_frame_handler_t hdlc_rx_state_s::frame_handler

The callback routine called to process each good received frame.

Referenced by hdlc_rx_init(), and hdlc_rx_set_frame_handler().

◆ frame_user_data

void* hdlc_rx_state_s::frame_user_data

An opaque parameter passed to the frame callback routine.

Referenced by hdlc_rx_init(), and hdlc_rx_set_frame_handler().

◆ framing_ok_announced

bool hdlc_rx_state_s::framing_ok_announced

True if framing OK has been announced.

Referenced by hdlc_rx_restart().

◆ framing_ok_threshold

int hdlc_rx_state_s::framing_ok_threshold

The number of consecutive flags which must be seen before framing is declared OK.

Referenced by hdlc_rx_init().

◆ len

size_t hdlc_rx_state_s::len

Length of a frame in progress.

Referenced by hdlc_rx_restart().

◆ max_frame_len

size_t hdlc_rx_state_s::max_frame_len

Maximum permitted frame length.

Referenced by hdlc_rx_init(), and hdlc_rx_set_max_frame_len().

◆ num_bits

int hdlc_rx_state_s::num_bits

The current number of bits in byte_in_progress.

Referenced by hdlc_rx_restart().

◆ octet_count

int hdlc_rx_state_s::octet_count

Octet count, to achieve the functionality needed for things like MTP.

Referenced by hdlc_rx_restart().

◆ octet_count_report_interval

int hdlc_rx_state_s::octet_count_report_interval

The number of octets to be allowed between octet count reports.

Referenced by hdlc_rx_set_octet_counting_report_interval().

◆ octet_counting_mode

bool hdlc_rx_state_s::octet_counting_mode

True if in octet counting mode (e.g. for MTP).

Referenced by hdlc_rx_restart().

◆ raw_bit_stream

uint32_t hdlc_rx_state_s::raw_bit_stream

The raw (stuffed) bit stream buffer.

Referenced by hdlc_rx_put_bit(), hdlc_rx_put_byte(), and hdlc_rx_restart().

◆ report_bad_frames

bool hdlc_rx_state_s::report_bad_frames

True if bad frames are to be reported.

Referenced by hdlc_rx_init().

◆ rx_aborts

unsigned long int hdlc_rx_state_s::rx_aborts

The number of HDLC aborts received.

Referenced by hdlc_rx_get_stats().

◆ rx_bytes

unsigned long int hdlc_rx_state_s::rx_bytes

The number of bytes of good frames received (CRC not included).

Referenced by hdlc_rx_get_stats().

◆ rx_crc_errors

unsigned long int hdlc_rx_state_s::rx_crc_errors

The number of frames with CRC errors received.

Referenced by hdlc_rx_get_stats().

◆ rx_frames

unsigned long int hdlc_rx_state_s::rx_frames

The number of good frames received.

Referenced by hdlc_rx_get_stats().

◆ rx_length_errors

unsigned long int hdlc_rx_state_s::rx_length_errors

The number of too short and too long frames received.

Referenced by hdlc_rx_get_stats().

◆ status_handler

span_modem_status_func_t hdlc_rx_state_s::status_handler

The callback routine called to report status changes.

Referenced by hdlc_rx_set_status_handler().

◆ status_user_data

void* hdlc_rx_state_s::status_user_data

An opaque parameter passed to the status callback routine.

Referenced by hdlc_rx_set_status_handler().


The documentation for this struct was generated from the following file: