spandsp 3.0.0
private/v18.h
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * private/v18.h - V.18 text telephony for the deaf.
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2004-2009 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#if !defined(_SPANDSP_PRIVATE_V18_H_)
27#define _SPANDSP_PRIVATE_V18_H_
28
30{
31 /*! \brief True if we are the calling modem */
33 int mode;
34 int initial_mode;
35 int current_mode;
36 int nation;
37 put_msg_func_t put_msg;
38 void *user_data;
39 bool repeat_shifts;
40 bool autobauding;
41
42 union
43 {
44 queue_state_t queue;
45 uint8_t buf[QUEUE_STATE_T_SIZE(128)];
46 } queue;
47 tone_gen_descriptor_t alert_tone_desc;
48 tone_gen_state_t alert_tone_gen;
49 fsk_tx_state_t fsk_tx;
50 dtmf_tx_state_t dtmf_tx;
51 async_tx_state_t async_tx;
52 int baudot_tx_shift;
53 int tx_signal_on;
54 bool tx_draining;
55 uint8_t next_byte;
56
57 fsk_rx_state_t fsk_rx;
58 dtmf_rx_state_t dtmf_rx;
59
60#if defined(SPANDSP_USE_FIXED_POINTx)
61 /*! Minimum acceptable tone level for detection. */
62 int32_t threshold;
63 /*! The accumlating total energy on the same period over which the Goertzels work. */
64 int32_t energy;
65#else
66 /*! Minimum acceptable tone level for detection. */
67 float threshold;
68 /*! The accumlating total energy on the same period over which the Goertzels work. */
69 float energy;
70#endif
71 goertzel_state_t tone_390;
72 goertzel_state_t tone_980;
73 goertzel_state_t tone_1180;
74 goertzel_state_t tone_1270;
75 goertzel_state_t tone_1300;
76 goertzel_state_t tone_1400;
77 goertzel_state_t tone_1650;
78 goertzel_state_t tone_1800;
79 /*! The current sample number within a processing block. */
81 /*! Tone state duration */
83 int target_duration;
84 int in_tone;
85
86 int baudot_rx_shift;
87 int consecutive_ones;
88 uint8_t rx_msg[256 + 1];
89 int rx_msg_len;
90 int bit_pos;
91 int in_progress;
92 int rx_suppression;
93 int tx_suppression;
94
95 /*! \brief Error and flow logging control */
97};
98
99#endif
100/*- End of file ------------------------------------------------------------*/
void(* put_msg_func_t)(void *user_data, const uint8_t *msg, int len)
Definition async.h:95
Definition private/async.h:35
Definition private/dtmf.h:55
Definition private/dtmf.h:34
Definition private/fsk.h:59
Definition private/fsk.h:34
Definition tone_detect.h:46
Definition private/logging.h:34
Definition private/queue.h:34
Definition private/tone_generate.h:43
Definition private/tone_generate.h:54
Definition private/v18.h:30
float threshold
Definition private/v18.h:67
float energy
Definition private/v18.h:69
logging_state_t logging
Error and flow logging control.
Definition private/v18.h:96
int duration
Definition private/v18.h:82
int current_sample
Definition private/v18.h:80
bool calling_party
True if we are the calling modem.
Definition private/v18.h:32