spandsp 0.0.6

private/fax_modems.h
Go to the documentation of this file.
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * private/fax_modems.h - definitions for the analogue modem set for fax processing
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2008 Steve Underwood
9 *
10 * All rights reserved.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 2.1,
14 * as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26/*! \file */
27
28#if !defined(_SPANDSP_PRIVATE_FAX_MODEMS_H_)
29#define _SPANDSP_PRIVATE_FAX_MODEMS_H_
30
31/*!
32 The set of modems needed for FAX, plus the auxilliary stuff, like tone generation.
33*/
34 struct fax_modems_state_s
35{
36 /*! TRUE is talker echo protection should be sent for the image modems */
37 int use_tep;
38
39 /*! If TRUE, transmit silence when there is nothing else to transmit. If FALSE return only
40 the actual generated audio. Note that this only affects untimed silences. Timed silences
41 (e.g. the 75ms silence between V.21 and a high speed modem) will alway be transmitted as
42 silent audio. */
43 int transmit_on_idle;
44
45 /*! \brief An HDLC context used when transmitting HDLC messages. */
46 hdlc_tx_state_t hdlc_tx;
47 /*! \brief An HDLC context used when receiving HDLC messages. */
48 hdlc_rx_state_t hdlc_rx;
49 /*! \brief A V.21 FSK modem context used when transmitting HDLC over V.21
50 messages. */
51 fsk_tx_state_t v21_tx;
52 /*! \brief A V.21 FSK modem context used when receiving HDLC over V.21
53 messages. */
54 fsk_rx_state_t v21_rx;
55 struct
56 {
57 /*! \brief A V.17 modem context used when sending FAXes at 7200bps, 9600bps
58 12000bps or 14400bps */
59 v17_tx_state_t v17_tx;
60 /*! \brief A V.29 modem context used when receiving FAXes at 7200bps, 9600bps
61 12000bps or 14400bps */
62 v17_rx_state_t v17_rx;
63 /*! \brief A V.29 modem context used when sending FAXes at 7200bps or
64 9600bps */
65 v29_tx_state_t v29_tx;
66 /*! \brief A V.29 modem context used when receiving FAXes at 7200bps or
67 9600bps */
68 v29_rx_state_t v29_rx;
69 /*! \brief A V.27ter modem context used when sending FAXes at 2400bps or
70 4800bps */
71 v27ter_tx_state_t v27ter_tx;
72 /*! \brief A V.27ter modem context used when receiving FAXes at 2400bps or
73 4800bps */
74 v27ter_rx_state_t v27ter_rx;
75 } fast_modems;
76 /*! \brief Used to insert timed silences. */
77 silence_gen_state_t silence_gen;
78 /*! \brief CED or CNG generator */
79 modem_connect_tones_tx_state_t connect_tx;
80 /*! \brief CED or CNG detector */
81 modem_connect_tones_rx_state_t connect_rx;
82 /*! \brief */
83 dc_restore_state_t dc_restore;
84
85 /*! \brief The currently selected receiver type */
86 int current_rx_type;
87 /*! \brief The currently selected transmitter type */
88 int current_tx_type;
89
90 /*! \brief TRUE if a carrier is present. Otherwise FALSE. */
91 int rx_signal_present;
92 /*! \brief TRUE if a modem has trained correctly. */
93 int rx_trained;
94 /*! \brief TRUE if an HDLC frame has been received correctly. */
95 int rx_frame_received;
96
97 /*! \brief The current receive signal handler */
98 span_rx_handler_t *rx_handler;
99 /*! \brief The current receive missing signal fill-in handler */
100 span_rx_fillin_handler_t *rx_fillin_handler;
101 void *rx_user_data;
102
103 /*! \brief The current transmit signal handler */
104 span_tx_handler_t *tx_handler;
105 void *tx_user_data;
106
107 /*! \brief The next transmit signal handler, for two stage transmit operations.
108 E.g. a short silence followed by a modem signal. */
109 span_tx_handler_t *next_tx_handler;
110 void *next_tx_user_data;
111
112 /*! \brief The current bit rate of the transmitter. */
113 int tx_bit_rate;
114 /*! \brief The current bit rate of the receiver. */
115 int rx_bit_rate;
116
117 /*! \brief If TRUE, transmission is in progress */
118 int transmit;
119 /*! \brief Audio logging file handle for received audio. */
120 int audio_rx_log;
121 /*! \brief Audio logging file handle for transmitted audio. */
122 int audio_tx_log;
123 /*! \brief Error and flow logging control */
124 logging_state_t logging;
125};
126
127#endif
128/*- End of file ------------------------------------------------------------*/
fsk_rx_state_t
struct fsk_rx_state_s fsk_rx_state_t
Definition fsk.h:142
fsk_tx_state_t
struct fsk_tx_state_s fsk_tx_state_t
Definition fsk.h:133
hdlc_rx_state_t
struct hdlc_rx_state_s hdlc_rx_state_t
Definition hdlc.h:54
hdlc_tx_state_t
struct hdlc_tx_state_s hdlc_tx_state_t
Definition hdlc.h:77
logging_state_t
struct logging_state_s logging_state_t
Definition logging.h:75
modem_connect_tones_tx_state_t
struct modem_connect_tones_tx_state_s modem_connect_tones_tx_state_t
Definition modem_connect_tones.h:93
modem_connect_tones_rx_state_t
struct modem_connect_tones_rx_state_s modem_connect_tones_rx_state_t
Definition modem_connect_tones.h:99
dc_restore_state_t
Definition dc_restore.h:58
fax_modems_state_s
Definition private/fax_modems.h:35
fax_modems_state_s::v29_rx
v29_rx_state_t v29_rx
A V.29 modem context used when receiving FAXes at 7200bps or 9600bps.
Definition private/fax_modems.h:68
fax_modems_state_s::rx_handler
span_rx_handler_t * rx_handler
The current receive signal handler.
Definition private/fax_modems.h:98
fax_modems_state_s::current_rx_type
int current_rx_type
The currently selected receiver type.
Definition private/fax_modems.h:86
fax_modems_state_s::v27ter_rx
v27ter_rx_state_t v27ter_rx
A V.27ter modem context used when receiving FAXes at 2400bps or 4800bps.
Definition private/fax_modems.h:74
fax_modems_state_s::hdlc_tx
hdlc_tx_state_t hdlc_tx
An HDLC context used when transmitting HDLC messages.
Definition private/fax_modems.h:46
fax_modems_state_s::v27ter_tx
v27ter_tx_state_t v27ter_tx
A V.27ter modem context used when sending FAXes at 2400bps or 4800bps.
Definition private/fax_modems.h:71
fax_modems_state_s::audio_tx_log
int audio_tx_log
Audio logging file handle for transmitted audio.
Definition private/fax_modems.h:122
fax_modems_state_s::next_tx_handler
span_tx_handler_t * next_tx_handler
The next transmit signal handler, for two stage transmit operations. E.g. a short silence followed by...
Definition private/fax_modems.h:109
fax_modems_state_s::rx_trained
int rx_trained
TRUE if a modem has trained correctly.
Definition private/fax_modems.h:93
fax_modems_state_s::rx_signal_present
int rx_signal_present
TRUE if a carrier is present. Otherwise FALSE.
Definition private/fax_modems.h:91
fax_modems_state_s::use_tep
int use_tep
Definition private/fax_modems.h:37
fax_modems_state_s::silence_gen
silence_gen_state_t silence_gen
Used to insert timed silences.
Definition private/fax_modems.h:77
fax_modems_state_s::tx_bit_rate
int tx_bit_rate
The current bit rate of the transmitter.
Definition private/fax_modems.h:113
fax_modems_state_s::v17_rx
v17_rx_state_t v17_rx
A V.29 modem context used when receiving FAXes at 7200bps, 9600bps 12000bps or 14400bps.
Definition private/fax_modems.h:62
fax_modems_state_s::v17_tx
v17_tx_state_t v17_tx
A V.17 modem context used when sending FAXes at 7200bps, 9600bps 12000bps or 14400bps.
Definition private/fax_modems.h:59
fax_modems_state_s::transmit
int transmit
If TRUE, transmission is in progress.
Definition private/fax_modems.h:118
fax_modems_state_s::connect_rx
modem_connect_tones_rx_state_t connect_rx
CED or CNG detector.
Definition private/fax_modems.h:81
fax_modems_state_s::hdlc_rx
hdlc_rx_state_t hdlc_rx
An HDLC context used when receiving HDLC messages.
Definition private/fax_modems.h:48
fax_modems_state_s::transmit_on_idle
int transmit_on_idle
Definition private/fax_modems.h:43
fax_modems_state_s::v29_tx
v29_tx_state_t v29_tx
A V.29 modem context used when sending FAXes at 7200bps or 9600bps.
Definition private/fax_modems.h:65
fax_modems_state_s::v21_tx
fsk_tx_state_t v21_tx
A V.21 FSK modem context used when transmitting HDLC over V.21 messages.
Definition private/fax_modems.h:51
fax_modems_state_s::rx_fillin_handler
span_rx_fillin_handler_t * rx_fillin_handler
The current receive missing signal fill-in handler.
Definition private/fax_modems.h:100
fax_modems_state_s::logging
logging_state_t logging
Error and flow logging control.
Definition private/fax_modems.h:124
fax_modems_state_s::rx_bit_rate
int rx_bit_rate
The current bit rate of the receiver.
Definition private/fax_modems.h:115
fax_modems_state_s::current_tx_type
int current_tx_type
The currently selected transmitter type.
Definition private/fax_modems.h:88
fax_modems_state_s::audio_rx_log
int audio_rx_log
Audio logging file handle for received audio.
Definition private/fax_modems.h:120
fax_modems_state_s::rx_frame_received
int rx_frame_received
TRUE if an HDLC frame has been received correctly.
Definition private/fax_modems.h:95
fax_modems_state_s::tx_handler
span_tx_handler_t * tx_handler
The current transmit signal handler.
Definition private/fax_modems.h:104
fax_modems_state_s::v21_rx
fsk_rx_state_t v21_rx
A V.21 FSK modem context used when receiving HDLC over V.21 messages.
Definition private/fax_modems.h:54
fax_modems_state_s::connect_tx
modem_connect_tones_tx_state_t connect_tx
CED or CNG generator.
Definition private/fax_modems.h:79
v17_rx_state_t
struct v17_rx_state_s v17_rx_state_t
Definition v17rx.h:216
v17_tx_state_t
struct v17_tx_state_s v17_tx_state_t
Definition v17tx.h:86
v27ter_rx_state_t
struct v27ter_rx_state_s v27ter_rx_state_t
Definition v27ter_rx.h:51
v27ter_tx_state_t
struct v27ter_tx_state_s v27ter_tx_state_t
Definition v27ter_tx.h:69
v29_rx_state_t
struct v29_rx_state_s v29_rx_state_t
Definition v29rx.h:127
v29_tx_state_t
struct v29_tx_state_s v29_tx_state_t
Definition v29tx.h:99