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 
00026 /*! \file */
00027 
00028 #if !defined(_SPANDSP_PRIVATE_T38_TERMINAL_H_)
00029 #define _SPANDSP_PRIVATE_T38_TERMINAL_H_
00030 
00031 typedef struct
00032 {
00033     /*! \brief Internet Aware FAX mode bit mask. */
00034     int iaf;
00035     /*! \brief Required time between T.38 transmissions, in ms. */
00036     int ms_per_tx_chunk;
00037     /*! \brief Bit fields controlling the way data is packed into chunked for transmission. */
00038     int chunking_modes;
00039 
00040     /*! \brief Core T.38 IFP support */
00041     t38_core_state_t t38;
00042 
00043     /*! \brief The current transmit step being timed */
00044     int timed_step;
00045 
00046     /*! \brief TRUE is there has been some T.38 data missed (i.e. lost packets) in the current
00047                reception period. */
00048     int rx_data_missing;
00049 
00050     /*! \brief The number of octets to send in each image packet (non-ECM or ECM) at the current
00051                rate and the current specified packet interval. */
00052     int octets_per_data_packet;
00053 
00054     struct
00055     {
00056         /*! \brief HDLC receive buffer */
00057         uint8_t buf[T38_MAX_HDLC_LEN];
00058         /*! \brief The length of the contents of the HDLC receive buffer */
00059         int len;
00060     } hdlc_rx;
00061 
00062     struct
00063     {
00064         /*! \brief HDLC transmit buffer */
00065         uint8_t buf[T38_MAX_HDLC_LEN];
00066         /*! \brief The length of the contents of the HDLC transmit buffer */
00067         int len;
00068         /*! \brief Current pointer within the contents of the HDLC transmit buffer */
00069         int ptr;
00070         /*! \brief The number of extra bits in a fully stuffed version of the
00071                    contents of the HDLC transmit buffer. This is needed to accurately
00072                    estimate the playout time for this frame, through an analogue modem. */
00073         int extra_bits;
00074     } hdlc_tx;
00075 
00076     /*! \brief Counter for trailing non-ECM bytes, used to flush out the far end's modem. */
00077     int non_ecm_trailer_bytes;
00078 
00079     /*! \brief The next T.38 indicator queued for transmission. */
00080     int next_tx_indicator;
00081     /*! \brief The current T.38 data type being transmitted. */
00082     int current_tx_data_type;
00083 
00084     /*! \brief TRUE if a carrier is present. Otherwise FALSE. */
00085     int rx_signal_present;
00086 
00087     /*! \brief The current operating mode of the receiver. */
00088     int current_rx_type;
00089     /*! \brief The current operating mode of the transmitter. */
00090     int current_tx_type;
00091 
00092     /*! \brief Current transmission bit rate. */
00093     int tx_bit_rate;
00094     /*! \brief A "sample" count, used to time events. */
00095     int32_t samples;
00096     /*! \brief The value for samples at the next transmission point. */
00097     int32_t next_tx_samples;
00098     /*! \brief The current transmit timeout. */
00099     //int32_t timeout_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 on 9 Jul 2012 for spandsp by  doxygen 1.6.1