private/t38_terminal.h

Go to the documentation of this file.
00001 /*
00002  * SpanDSP - a series of DSP components for telephony
00003  *
00004  * private/t38_terminal.h - T.38 termination, less the packet exchange part
00005  *
00006  * Written by Steve Underwood <steveu@coppice.org>
00007  *
00008  * Copyright (C) 2005 Steve Underwood
00009  *
00010  * All rights reserved.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU Lesser General Public License version 2.1,
00014  * as published by the Free Software Foundation.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Lesser General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public
00022  * License along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00024  *
00025  * $Id: t38_terminal.h,v 1.2 2008/12/31 13:57:13 steveu Exp $
00026  */
00027 
00028 /*! \file */
00029 
00030 #if !defined(_SPANDSP_PRIVATE_T38_TERMINAL_H_)
00031 #define _SPANDSP_PRIVATE_T38_TERMINAL_H_
00032 
00033 typedef struct
00034 {
00035     /*! \brief Internet Aware FAX mode bit mask. */
00036     int iaf;
00037     /*! \brief Required time between T.38 transmissions, in ms. */
00038     int ms_per_tx_chunk;
00039     /*! \brief Bit fields controlling the way data is packed into chunked for transmission. */
00040     int chunking_modes;
00041 
00042     /*! \brief Core T.38 IFP support */
00043     t38_core_state_t t38;
00044 
00045     /*! \brief The current transmit step being timed */
00046     int timed_step;
00047 
00048     /*! \brief TRUE is there has been some T.38 data missed (i.e. lost packets) in the current
00049                reception period. */
00050     int rx_data_missing;
00051 
00052     /*! \brief The number of octets to send in each image packet (non-ECM or ECM) at the current
00053                rate and the current specified packet interval. */
00054     int octets_per_data_packet;
00055 
00056     struct
00057     {
00058         /*! \brief HDLC receive buffer */
00059         uint8_t buf[T38_MAX_HDLC_LEN];
00060         /*! \brief The length of the contents of the HDLC receive buffer */
00061         int len;
00062     } hdlc_rx;
00063 
00064     struct
00065     {
00066         /*! \brief HDLC transmit buffer */
00067         uint8_t buf[T38_MAX_HDLC_LEN];
00068         /*! \brief The length of the contents of the HDLC transmit buffer */
00069         int len;
00070         /*! \brief Current pointer within the contents of the HDLC transmit buffer */
00071         int ptr;
00072         /*! \brief The number of extra bits in a fully stuffed version of the
00073                    contents of the HDLC transmit buffer. This is needed to accurately
00074                    estimate the playout time for this frame, through an analogue modem. */
00075         int extra_bits;
00076     } hdlc_tx;
00077 
00078     /*! \brief Counter for trailing non-ECM bytes, used to flush out the far end's modem. */
00079     int non_ecm_trailer_bytes;
00080 
00081     /*! \brief The next T.38 indicator queued for transmission. */
00082     int next_tx_indicator;
00083     /*! \brief The current T.38 data type being transmitted. */
00084     int current_tx_data_type;
00085 
00086     /*! \brief TRUE if a carrier is present. Otherwise FALSE. */
00087     int rx_signal_present;
00088 
00089     /*! \brief The current operating mode of the receiver. */
00090     int current_rx_type;
00091     /*! \brief The current operating mode of the transmitter. */
00092     int current_tx_type;
00093 
00094     /*! \brief Current transmission bit rate. */
00095     int tx_bit_rate;
00096     /*! \brief A "sample" count, used to time events. */
00097     int32_t samples;
00098     /*! \brief The value for samples at the next transmission point. */
00099     int32_t next_tx_samples;
00100     /*! \brief The current receive timeout. */
00101     int32_t timeout_rx_samples;
00102 } t38_terminal_front_end_state_t;
00103 
00104 /*!
00105     T.38 terminal state.
00106 */
00107 struct t38_terminal_state_s
00108 {
00109     /*! \brief The T.30 back-end */
00110     t30_state_t t30;
00111 
00112     /*! \brief The T.38 front-end */
00113     t38_terminal_front_end_state_t t38_fe;
00114 
00115     /*! \brief Error and flow logging control */
00116     logging_state_t logging;
00117 };
00118 
00119 #endif
00120 /*- End of file ------------------------------------------------------------*/

Generated by  doxygen 1.6.2