spandsp  3.0.0
data_modems.h
Go to the documentation of this file.
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * 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_DATA_MODEMS_H_)
29 #define _SPANDSP_DATA_MODEMS_H_
30 
31 enum
32 {
33  DATA_MODEM_NONE = -1,
34  DATA_MODEM_FLUSH = 0,
35  DATA_MODEM_SILENCE,
36  DATA_MODEM_CED_TONE,
37  DATA_MODEM_CNG_TONE,
38  DATA_MODEM_V8,
39  DATA_MODEM_BELL103,
40  DATA_MODEM_BELL202,
41  DATA_MODEM_V21,
42  DATA_MODEM_V23,
43  DATA_MODEM_V22BIS,
44  DATA_MODEM_V32BIS,
45  DATA_MODEM_V34
46 };
47 
48 /*!
49  The set of modems needed for data, plus the auxilliary stuff, like tone generation.
50 */
52 
53 typedef int (*data_modems_control_handler_t)(data_modems_state_t *s, void *user_data, int op, const char *num);
54 
55 #if defined(__cplusplus)
56 extern "C"
57 {
58 #endif
59 
60 /* N.B. the following are currently a work in progress */
61 SPAN_DECLARE(const char *) data_modems_modulation_to_str(int modulation_scheme);
62 
63 SPAN_DECLARE(void) data_modems_set_tep_mode(data_modems_state_t *s, int use_tep);
64 
65 SPAN_DECLARE(logging_state_t *) data_modems_get_logging_state(data_modems_state_t *s);
66 
67 SPAN_DECLARE(void) data_modems_call_event(data_modems_state_t *s, int event);
68 
69 SPAN_DECLARE(int) data_modems_restart(data_modems_state_t *s);
70 
71 SPAN_DECLARE(void) data_modems_set_async_mode(data_modems_state_t *s,
72  int data_bits,
73  int parity_bits,
74  int stop_bits);
75 
76 SPAN_DECLARE(void) data_modems_set_modem_type(data_modems_state_t *s, int which, int baud_rate, int bit_rate);
77 
78 SPAN_DECLARE(int) data_modems_rx(data_modems_state_t *s, const int16_t amp[], int len);
79 
80 SPAN_DECLARE(int) data_modems_rx_fillin(data_modems_state_t *s, int len);
81 
82 SPAN_DECLARE(int) data_modems_tx(data_modems_state_t *s, int16_t amp[], int max_len);
83 
84 SPAN_DECLARE(void) data_modems_set_at_tx_handler(data_modems_state_t *s,
85  at_tx_handler_t at_tx_handler,
86  void *at_tx_user_data);
87 
88 SPAN_DECLARE(data_modems_state_t *) data_modems_init(data_modems_state_t *s,
89  bool calling_party,
90  at_tx_handler_t at_tx_handler,
91  void *at_tx_user_data,
92  data_modems_control_handler_t modem_control_handler,
93  void *modem_control_user_data,
94  put_msg_func_t put_msg,
95  get_msg_func_t get_msg,
96  void *user_data);
97 
98 SPAN_DECLARE(int) data_modems_release(data_modems_state_t *s);
99 
100 SPAN_DECLARE(int) data_modems_free(data_modems_state_t *s);
101 
102 #if defined(__cplusplus)
103 }
104 #endif
105 
106 #endif
107 /*- End of file ------------------------------------------------------------*/
int(* get_msg_func_t)(void *user_data, uint8_t *msg, int max_len)
Definition: async.h:98
void(* put_msg_func_t)(void *user_data, const uint8_t *msg, int len)
Definition: async.h:95
Definition: private/data_modems.h:35
bool use_tep
Definition: private/data_modems.h:38
Definition: private/logging.h:34