spandsp  3.0.0
private/v8.h
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * private/v8.h - V.8 modem negotiation processing.
5  *
6  * Written by Steve Underwood <steveu@coppice.org>
7  *
8  * Copyright (C) 2004 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_V8_H_)
27 #define _SPANDSP_PRIVATE_V8_H_
28 
29 struct v8_state_s
30 {
31  /*! \brief True if we are the calling party */
33 
34  /*! \brief A handler to process the V.8 signals */
35  v8_result_handler_t result_handler;
36  /*! \brief An opaque pointer passed to result_handler */
38 
39  /*! \brief The current state of the V.8 protocol */
40  int state;
41  bool fsk_tx_on;
42  span_sample_timer_t modem_connect_tone_tx_timer;
43  span_sample_timer_t negotiation_timer;
44  span_sample_timer_t ci_timer;
45  int ci_repetition_count;
46  bool proceed;
47  fsk_tx_state_t v21tx;
48  fsk_rx_state_t v21rx;
49  queue_state_t *tx_queue;
52  modem_connect_tones_rx_state_t calling_tone_rx;
54 
55  v8_parms_t parms;
56  v8_parms_t result;
57 
58  /*! \brief The number of modulation bytes to use when sending. */
60 
61  /* V.8 data parsing */
62  uint32_t bit_stream;
63  int bit_cnt;
64  /* Indicates the type of message coming up */
65  int preamble_type;
66  uint8_t rx_data[64];
67  int rx_data_ptr;
68 
69  /*! \brief a reference copy of the last CM or JM message, used when
70  testing for matches. */
71  uint8_t cm_jm_data[64];
72  int cm_jm_len;
73  bool got_ci;
74  bool got_cm_jm;
75  bool got_cj;
76  int zero_byte_count;
77  /*! \brief Error and flow logging control */
79 };
80 
81 #endif
82 /*- End of file ------------------------------------------------------------*/
Definition: private/queue.h:33
logging_state_t logging
Error and flow logging control.
Definition: private/v8.h:78
bool calling_party
True if we are the calling party.
Definition: private/v8.h:32
Definition: private/fsk.h:58
Definition: private/fsk.h:33
void * result_handler_user_data
An opaque pointer passed to result_handler.
Definition: private/v8.h:37
v8_result_handler_t result_handler
A handler to process the V.8 signals.
Definition: private/v8.h:35
Definition: private/modem_connect_tones.h:37
Definition: private/logging.h:33
uint8_t cm_jm_data[64]
a reference copy of the last CM or JM message, used when testing for matches.
Definition: private/v8.h:71
Definition: private/modem_connect_tones.h:57
int state
The current state of the V.8 protocol.
Definition: private/v8.h:40
int modulation_bytes
The number of modulation bytes to use when sending.
Definition: private/v8.h:59
Definition: v8.h:136
Definition: private/v8.h:29