59#if !defined(_SPANDSP_ASYNC_H_)
60#define _SPANDSP_ASYNC_H_
108typedef void (*put_msg_func_t)(
void *user_data,
const uint8_t *msg,
int len);
112typedef int (*get_msg_func_t)(
void *user_data, uint8_t *msg,
int max_len);
116typedef void (*put_byte_func_t)(
void *user_data,
int byte);
120typedef int (*get_byte_func_t)(
void *user_data);
124typedef void (*put_bit_func_t)(
void *user_data,
int bit);
128typedef int (*get_bit_func_t)(
void *user_data);
132typedef void (*modem_status_func_t)(
void *user_data,
int status);
160#if defined(__cplusplus)
182SPAN_DECLARE(
int) async_rx_get_parity_errors(
async_rx_state_t *s,
bool reset);
184SPAN_DECLARE(
int) async_rx_get_framing_errors(
async_rx_state_t *s,
bool reset);
243#if defined(__cplusplus)
int(* span_get_bit_func_t)(void *user_data)
Definition async.h:127
int(* span_get_msg_func_t)(void *user_data, uint8_t *msg, int max_len)
Definition async.h:111
void(* span_put_byte_func_t)(void *user_data, int byte)
Definition async.h:115
async_rx_state_t * async_rx_init(async_rx_state_t *s, int data_bits, int parity, int stop_bits, bool use_v14, span_put_byte_func_t put_byte, void *user_data)
Initialise an asynchronous data receiver context.
Definition async.c:227
const char * signal_status_to_str(int status)
Convert a signal status to a short text description.
Definition async.c:49
int(* span_get_byte_func_t)(void *user_data)
Definition async.h:119
void async_tx_presend_bits(async_tx_state_t *s, int bits)
Set a minimum number of bit times of stop bit state before character transmission commences.
Definition async.c:341
void(* span_modem_status_func_t)(void *user_data, int status)
Definition async.h:131
void(* span_put_bit_func_t)(void *user_data, int bit)
Definition async.h:123
struct async_rx_state_s async_rx_state_t
Definition async.h:146
@ SIG_STATUS_LINK_CONNECTED
The link protocol (e.g. V.42) has connected.
Definition async.h:97
@ SIG_STATUS_BREAK
A break signal (e.g. an async break) has been received.
Definition async.h:87
@ SIG_STATUS_TRAINING_FAILED
The modem has failed to train.
Definition async.h:79
@ SIG_STATUS_LINK_ERROR
An error has occurred in the link protocol (e.g. V.42).
Definition async.h:101
@ SIG_STATUS_ABORT
An abort signal (e.g. an HDLC abort) has been received.
Definition async.h:85
@ SIG_STATUS_MODEM_RETRAIN_OCCURRED
Notification that a modem retrain has occurred.
Definition async.h:95
@ SIG_STATUS_TRAINING_SUCCEEDED
The modem has trained, and is ready for data exchange.
Definition async.h:77
@ SIG_STATUS_CARRIER_UP
The carrier signal is up. This merely indicates that carrier energy has been seen....
Definition async.h:70
@ SIG_STATUS_CARRIER_DOWN
The carrier signal has dropped.
Definition async.h:66
@ SIG_STATUS_END_OF_DATA
The data stream has ended.
Definition async.h:83
@ SIG_STATUS_FRAMING_OK
Packet framing (e.g. HDLC framing) is OK.
Definition async.h:81
@ SIG_STATUS_TRAINING_IN_PROGRESS
The modem is training. This is an early indication that the signal seems to be of the right type....
Definition async.h:75
@ SIG_STATUS_OCTET_REPORT
Regular octet report for things like HDLC to the MTP standards.
Definition async.h:91
@ SIG_STATUS_SHUTDOWN_COMPLETE
A modem has completed its task, and shut down.
Definition async.h:89
@ SIG_STATUS_POOR_SIGNAL_QUALITY
Notification that a modem has detected signal quality degradation.
Definition async.h:93
@ SIG_STATUS_LINK_DISCONNECTED
The link protocol (e.g. V.42) has disconnected.
Definition async.h:99
@ SIG_STATUS_LINK_IDLE
Keep the link in an idle state, as there is nothing to send.
Definition async.h:103
struct async_tx_state_s async_tx_state_t
Definition async.h:139
void async_rx_put_bit(void *user_data, int bit)
Accept a bit from a received serial bit stream.
Definition async.c:93
@ ASYNC_PARITY_NONE
Definition async.h:151
@ ASYNC_PARITY_ODD
Definition async.h:155
@ ASYNC_PARITY_EVEN
Definition async.h:153
async_tx_state_t * async_tx_init(async_tx_state_t *s, int data_bits, int parity, int stop_bits, bool use_v14, span_get_byte_func_t get_byte, void *user_data)
Initialise an asynchronous data transmit context.
Definition async.c:347
int async_tx_get_bit(void *user_data)
Get the next bit of a transmitted serial bit stream.
Definition async.c:277
void(* span_put_msg_func_t)(void *user_data, const uint8_t *msg, int len)
Definition async.h:107
Definition private/async.h:63
int16_t data_bits
The number of data bits per character.
Definition private/async.h:65
bool use_v14
True if V.14 rate adaption processing should be performed.
Definition private/async.h:71
span_put_byte_func_t put_byte
A pointer to the callback routine used to handle received characters.
Definition private/async.h:73
int16_t parity
The type of parity.
Definition private/async.h:67
void * user_data
An opaque pointer passed when calling put_byte.
Definition private/async.h:75
Definition private/async.h:35