spandsp 0.0.6
async.c File Reference
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "spandsp/telephony.h"
#include "spandsp/async.h"
#include "spandsp/private/async.h"

Functions

const char * signal_status_to_str (int status)
 Convert a signal status to a short text description.
async_rx_state_tasync_rx_init (async_rx_state_t *s, int data_bits, int parity, int stop_bits, int use_v14, put_byte_func_t put_byte, void *user_data)
 Initialise an asynchronous data receiver context.
int async_rx_release (async_rx_state_t *s)
int async_rx_free (async_rx_state_t *s)
void async_rx_put_bit (void *user_data, int bit)
async_tx_state_tasync_tx_init (async_tx_state_t *s, int data_bits, int parity, int stop_bits, int use_v14, get_byte_func_t get_byte, void *user_data)
 Initialise an asynchronous data transmit context.
int async_tx_release (async_tx_state_t *s)
int async_tx_free (async_tx_state_t *s)
int async_tx_get_bit (void *user_data)

Function Documentation

◆ async_rx_init()

async_rx_state_t * async_rx_init ( async_rx_state_t * s,
int data_bits,
int parity_bits,
int stop_bits,
int use_v14,
put_byte_func_t put_byte,
void * user_data )

Initialise an asynchronous data receiver context.

Initialise an asynchronous data receiver context.

Parameters
sThe receiver context.
data_bitsThe number of data bits.
parity_bitsThe type of parity.
stop_bitsThe number of stop bits.
use_v14TRUE if V.14 rate adaption processing should be used.
put_byteThe callback routine used to put the received data.
user_dataAn opaque pointer.
Returns
A pointer to the initialised context, or NULL if there was a problem.

References async_rx_state_s::bitpos, async_rx_state_s::byte_in_progress, async_rx_state_s::data_bits, async_rx_state_s::framing_errors, async_rx_state_s::parity, async_rx_state_s::parity_bit, async_rx_state_s::parity_errors, async_rx_state_s::put_byte, async_rx_state_s::stop_bits, async_rx_state_s::use_v14, and async_rx_state_s::user_data.

◆ async_tx_init()

async_tx_state_t * async_tx_init ( async_tx_state_t * s,
int data_bits,
int parity_bits,
int stop_bits,
int use_v14,
get_byte_func_t get_byte,
void * user_data )

Initialise an asynchronous data transmit context.

Initialise an asynchronous data transmit context.

Parameters
sThe transmitter context.
data_bitsThe number of data bit.
parity_bitsThe type of parity.
stop_bitsThe number of stop bits.
use_v14TRUE if V.14 rate adaption processing should be used.
get_byteThe callback routine used to get the data to be transmitted.
user_dataAn opaque pointer.
Returns
A pointer to the initialised context, or NULL if there was a problem.

References ASYNC_PARITY_NONE, async_tx_state_s::bitpos, async_tx_state_s::byte_in_progress, async_tx_state_s::data_bits, async_tx_state_s::get_byte, async_tx_state_s::parity, async_tx_state_s::parity_bit, async_tx_state_s::stop_bits, and async_tx_state_s::user_data.

Referenced by v18_init().

◆ signal_status_to_str()

const char * signal_status_to_str ( int status)