private/fax_modems.h

Go to the documentation of this file.
00001 /*
00002  * SpanDSP - a series of DSP components for telephony
00003  *
00004  * private/fax_modems.h - definitions for the analogue modem set for fax processing
00005  *
00006  * Written by Steve Underwood <steveu@coppice.org>
00007  *
00008  * Copyright (C) 2008 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: fax_modems.h,v 1.3 2009/03/23 14:17:42 steveu Exp $
00026  */
00027 
00028 /*! \file */
00029 
00030 #if !defined(_SPANDSP_PRIVATE_FAX_MODEMS_H_)
00031 #define _SPANDSP_PRIVATE_FAX_MODEMS_H_
00032 
00033 /*!
00034     The set of modems needed for FAX, plus the auxilliary stuff, like tone generation.
00035 */
00036 struct fax_modems_state_s
00037 {
00038     /*! TRUE is talker echo protection should be sent for the image modems */
00039     int use_tep;
00040 
00041     /*! If TRUE, transmit silence when there is nothing else to transmit. If FALSE return only
00042         the actual generated audio. Note that this only affects untimed silences. Timed silences
00043         (e.g. the 75ms silence between V.21 and a high speed modem) will alway be transmitted as
00044         silent audio. */
00045     int transmit_on_idle;
00046 
00047     /*! \brief An HDLC context used when transmitting HDLC messages. */
00048     hdlc_tx_state_t hdlc_tx;
00049     /*! \brief An HDLC context used when receiving HDLC messages. */
00050     hdlc_rx_state_t hdlc_rx;
00051     /*! \brief A V.21 FSK modem context used when transmitting HDLC over V.21
00052                messages. */
00053     fsk_tx_state_t v21_tx;
00054     /*! \brief A V.21 FSK modem context used when receiving HDLC over V.21
00055                messages. */
00056     fsk_rx_state_t v21_rx;
00057     /*! \brief A V.17 modem context used when sending FAXes at 7200bps, 9600bps
00058                12000bps or 14400bps */
00059     v17_tx_state_t v17_tx;
00060     /*! \brief A V.29 modem context used when receiving FAXes at 7200bps, 9600bps
00061                12000bps or 14400bps */
00062     v17_rx_state_t v17_rx;
00063     /*! \brief A V.29 modem context used when sending FAXes at 7200bps or
00064                9600bps */
00065     v29_tx_state_t v29_tx;
00066     /*! \brief A V.29 modem context used when receiving FAXes at 7200bps or
00067                9600bps */
00068     v29_rx_state_t v29_rx;
00069     /*! \brief A V.27ter modem context used when sending FAXes at 2400bps or
00070                4800bps */
00071     v27ter_tx_state_t v27ter_tx;
00072     /*! \brief A V.27ter modem context used when receiving FAXes at 2400bps or
00073                4800bps */
00074     v27ter_rx_state_t v27ter_rx;
00075     /*! \brief Used to insert timed silences. */
00076     silence_gen_state_t silence_gen;
00077     /*! \brief CED or CNG generator */
00078     modem_connect_tones_tx_state_t connect_tx;
00079     /*! \brief CED or CNG detector */
00080     modem_connect_tones_rx_state_t connect_rx;
00081     /*! \brief */
00082     dc_restore_state_t dc_restore;
00083 
00084     /*! \brief The currently select receiver type */
00085     int current_rx_type;
00086     /*! \brief The currently select transmitter type */
00087     int current_tx_type;
00088 
00089     /*! \brief TRUE if a carrier is present. Otherwise FALSE. */
00090     int rx_signal_present;
00091     /*! \brief TRUE if a modem has trained correctly. */
00092     int rx_trained;
00093     /*! \brief TRUE if an HDLC frame has been received correctly. */
00094     int rx_frame_received;
00095 
00096     /*! The current receive signal handler */
00097     span_rx_handler_t *rx_handler;
00098     void *rx_user_data;
00099 
00100     /*! The current receive missing signal fill-in handler */
00101     span_rx_fillin_handler_t *rx_fillin_handler;
00102     void *rx_fillin_user_data;
00103 
00104     /*! The current transmit signal handler */
00105     span_tx_handler_t *tx_handler;
00106     void *tx_user_data;
00107 
00108     /*! The next transmit signal handler, for two stage transmit operations.
00109         E.g. a short silence followed by a modem signal. */
00110     span_tx_handler_t *next_tx_handler;
00111     void *next_tx_user_data;
00112 
00113     /*! The current bit rate of the transmitter. */
00114     int tx_bit_rate;
00115     /*! The current bit rate of the receiver. */
00116     int rx_bit_rate;
00117 
00118     /*! If TRUE, transmission is in progress */
00119     int transmit;
00120     /*! \brief Audio logging file handle for received audio. */
00121     int audio_rx_log;
00122     /*! \brief Audio logging file handle for transmitted audio. */
00123     int audio_tx_log;
00124     /*! \brief Error and flow logging control */
00125     logging_state_t logging;
00126 };
00127 
00128 #endif
00129 /*- End of file ------------------------------------------------------------*/

Generated on Tue Aug 4 03:35:57 2009 for spandsp by  doxygen 1.5.9