async.c File Reference

#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <assert.h>
#include "spandsp/telephony.h"
#include "spandsp/async.h"

Functions

void async_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.
void async_rx_bit (void *user_data, int bit)
 Accept a bit from a received serial bit stream.
void async_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_bit (void *user_data)
 Get the next bit of a transmitted serial bit stream.

Detailed Description


Function Documentation

void async_rx_bit ( void *  user_data,
int  bit 
)

Accept a bit from a received serial bit stream.

Accept a bit from a received serial bit stream

Parameters:
user_data An opaque point which must point to a receiver context.
bit The new bit. Some special values are supported for this field.
  • PUTBIT_CARRIER_UP
  • PUTBIT_CARRIER_DOWN
  • PUTBIT_TRAINING_SUCCEEDED
  • PUTBIT_TRAINING_FAILED
  • PUTBIT_END_OF_DATA

void 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:
s The receiver context.
data_bits The number of data bits.
parity_bits The type of parity.
stop_bits The number of stop bits.
use_v14 TRUE if V.14 rate adaption processing should be used.
put_byte The callback routine used to put the received data.
user_data An opaque pointer.

int async_tx_bit ( void *  user_data  ) 

Get the next bit of a transmitted serial bit stream.

Get the next bit of a transmitted serial bit stream.

Parameters:
user_data An opaque point which must point to a transmitter context.
Returns:
the next bit, or PUTBIT_END_OF_DATA to indicate the data stream has ended.

void 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:
s The transmitter context.
data_bits The number of data bit.
parity_bits The type of parity.
stop_bits The number of stop bits.
use_v14 TRUE if V.14 rate adaption processing should be used.
get_byte The callback routine used to get the data to be transmitted.
user_data An opaque pointer.


Generated on Fri Nov 10 09:40:24 2006 for libspandsp by  doxygen 1.5.1