spandsp  3.0.0
private/data_modems.h
Go to the documentation of this file.
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * private/data_modems.h - definitions for the analogue modem set for data processing
5  *
6  * Written by Steve Underwood <steveu@coppice.org>
7  *
8  * Copyright (C) 2011 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_DATA_MODEMS_H_)
29 #define _SPANDSP_PRIVATE_DATA_MODEMS_H_
30 
31 /*!
32  The set of modems needed for data, plus the auxilliary stuff, like tone generation.
33 */
35 {
36  bool calling_party;
37  /*! True is talker echo protection should be sent for the modems which support this */
38  bool use_tep;
39 
40  /*! If true, transmit silence when there is nothing else to transmit. If false return only
41  the actual generated audio. Note that this only affects untimed silences. Timed silences
42  (e.g. the 75ms silence between V.21 and a high speed modem) will alway be transmitted as
43  silent audio. */
45 
46  at_state_t at_state;
47  data_modems_control_handler_t modem_control_handler;
48  void *modem_control_user_data;
49  get_bit_func_t get_bit;
50  void *get_user_data;
51  put_bit_func_t put_bit;
52  void *put_user_data;
53 
54  void *user_data;
55 
56  put_msg_func_t put_msg;
57  get_msg_func_t get_msg;
58 
59  v42_state_t v42;
60  v42bis_state_t v42bis;
61 
62  int use_v14;
63  async_tx_state_t async_tx;
64  async_rx_state_t async_rx;
65 
66  /*! \brief Samples elapsed in the current call */
67  int64_t call_samples;
68 
69  union
70  {
71  v8_state_t v8;
72  struct
73  {
74  /*! \brief Tone generator */
76  /*! \brief Tone detector */
78  } tones;
79  struct
80  {
81  /*! \brief FSK transmit modem context used for 103, V.21 and V.23. */
83  /*! \brief FSK receive modem context used for 103, V.21 and V.23. */
85  } fsk;
86  /*! \brief V.22bis modem context */
88 #if defined(SPANDSP_SUPPORT_V32BIS)
89  /*! \brief V.32bis modem context */
90  v32bis_state_t v32bis;
91 #endif
92 #if defined(SPANDSP_SUPPORT_V34)
93  /*! \brief V.22bis modem context */
94  v34_state_t v34;
95 #endif
96  /*! \brief Used to insert timed silences. */
98  } modems;
99  /*! \brief */
100  dc_restore_state_t dc_restore;
101 
102  int current_modem;
103  int queued_modem;
104  int queued_baud_rate;
105  int queued_bit_rate;
106 
107  /*! \brief The currently select receiver type */
109  /*! \brief The currently select transmitter type */
111 
112  /*! \brief True if a carrier is present. Otherwise false. */
114  /*! \brief True if a modem has trained correctly. */
116  /*! \brief True if an HDLC frame has been received correctly. */
118 
119  /*! The current receive signal handler */
120  span_rx_handler_t rx_handler;
121  /*! The current receive missing signal fill-in handler */
122  span_rx_fillin_handler_t rx_fillin_handler;
123  void *rx_user_data;
124 
125  /*! The current transmit signal handler */
126  span_tx_handler_t tx_handler;
127  void *tx_user_data;
128 
129  /*! \brief Audio logging file handle for received audio. */
131  /*! \brief Audio logging file handle for transmitted audio. */
133  /*! \brief Error and flow logging control */
135 };
136 
137 #endif
138 /*- End of file ------------------------------------------------------------*/
Definition: private/data_modems.h:34
bool rx_trained
True if a modem has trained correctly.
Definition: private/data_modems.h:115
Definition: private/silence_gen.h:29
logging_state_t logging
Error and flow logging control.
Definition: private/data_modems.h:134
void(* put_msg_func_t)(void *user_data, const uint8_t *msg, int len)
Definition: async.h:95
bool rx_frame_received
True if an HDLC frame has been received correctly.
Definition: private/data_modems.h:117
silence_gen_state_t silence_gen
Used to insert timed silences.
Definition: private/data_modems.h:97
span_rx_handler_t rx_handler
Definition: private/data_modems.h:120
fsk_tx_state_t tx
FSK transmit modem context used for 103, V.21 and V.23.
Definition: private/data_modems.h:82
int audio_tx_log
Audio logging file handle for transmitted audio.
Definition: private/data_modems.h:132
Definition: private/fsk.h:58
bool transmit_on_idle
Definition: private/data_modems.h:44
int audio_rx_log
Audio logging file handle for received audio.
Definition: private/data_modems.h:130
Definition: private/fsk.h:33
void(* put_bit_func_t)(void *user_data, int bit)
Definition: async.h:107
fsk_rx_state_t rx
FSK receive modem context used for 103, V.21 and V.23.
Definition: private/data_modems.h:84
bool use_tep
Definition: private/data_modems.h:38
int(* get_bit_func_t)(void *user_data)
Definition: async.h:110
modem_connect_tones_tx_state_t tx
Tone generator.
Definition: private/data_modems.h:75
modem_connect_tones_rx_state_t rx
Tone detector.
Definition: private/data_modems.h:77
Definition: dc_restore.h:57
int(* get_msg_func_t)(void *user_data, uint8_t *msg, int max_len)
Definition: async.h:98
Definition: private/async.h:64
span_tx_handler_t tx_handler
Definition: private/data_modems.h:126
Definition: private/modem_connect_tones.h:37
Definition: private/v42.h:132
span_rx_fillin_handler_t rx_fillin_handler
Definition: private/data_modems.h:122
Definition: private/logging.h:33
Definition: private/async.h:34
Definition: private/v42bis.h:115
Definition: private/v22bis.h:78
Definition: private/modem_connect_tones.h:57
int current_rx_type
The currently select receiver type.
Definition: private/data_modems.h:108
int64_t call_samples
Samples elapsed in the current call.
Definition: private/data_modems.h:67
v22bis_state_t v22bis
V.22bis modem context.
Definition: private/data_modems.h:87
int current_tx_type
The currently select transmitter type.
Definition: private/data_modems.h:110
Definition: private/at_interpreter.h:44
Definition: private/v8.h:29
bool rx_signal_present
True if a carrier is present. Otherwise false.
Definition: private/data_modems.h:113