spandsp 0.0.6

private/t38_terminal.h
Go to the documentation of this file.
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * private/t38_terminal.h - T.38 termination, less the packet exchange part
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2005 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_T38_TERMINAL_H_)
29#define _SPANDSP_PRIVATE_T38_TERMINAL_H_
30
31 typedef struct
32{
33 /*! \brief Internet Aware FAX mode bit mask. */
34 int iaf;
35 /*! \brief Required time between T.38 transmissions, in microseconds. */
36 int us_per_tx_chunk;
37 /*! \brief Bit fields controlling the way data is packed into chunked for transmission. */
38 int chunking_modes;
39
40 /*! \brief Core T.38 IFP support */
41 t38_core_state_t t38;
42
43 /*! \brief The current transmit step being timed */
44 int timed_step;
45
46 /*! \brief The timed step to go to when we reach idle from the current timed step */
47 int queued_timed_step;
48
49 /*! \brief TRUE is there has been some T.38 data missed (i.e. lost packets) in the current
50 reception period. */
51 int rx_data_missing;
52
53 /*! \brief The number of octets to send in each image packet (non-ECM or ECM) at the current
54 rate and the current specified packet interval. */
55 int octets_per_data_packet;
56
57 struct
58 {
59 /*! \brief HDLC receive buffer */
60 uint8_t buf[T38_MAX_HDLC_LEN];
61 /*! \brief The length of the contents of the HDLC receive buffer */
62 int len;
63 } hdlc_rx;
64
65 struct
66 {
67 /*! \brief HDLC transmit buffer */
68 uint8_t buf[T38_MAX_HDLC_LEN];
69 /*! \brief The length of the contents of the HDLC transmit buffer */
70 int len;
71 /*! \brief Current pointer within the contents of the HDLC transmit buffer */
72 int ptr;
73 /*! \brief The number of extra bits in a fully stuffed version of the
74 contents of the HDLC transmit buffer. This is needed to accurately
75 estimate the playout time for this frame, through an analogue modem. */
76 int extra_bits;
77 } hdlc_tx;
78
79 /*! \brief Counter for trailing non-ECM bytes, used to flush out the far end's modem. */
80 int non_ecm_trailer_bytes;
81
82 /*! \brief The next T.38 indicator queued for transmission. */
83 int next_tx_indicator;
84 /*! \brief The current T.38 data type being transmitted. */
85 int current_tx_data_type;
86
87 /*! \brief TRUE if a carrier is present. Otherwise FALSE. */
88 int rx_signal_present;
89
90 /*! \brief The current operating mode of the receiver. */
91 int current_rx_type;
92 /*! \brief The current operating mode of the transmitter. */
93 int current_tx_type;
94
95 /*! \brief Current transmission bit rate. */
96 int tx_bit_rate;
97 /*! \brief A "sample" count, used to time events. */
98 int32_t samples;
99 /*! \brief The value for samples at the next transmission point. */
100 int32_t next_tx_samples;
101 /*! \brief The current transmit timeout. */
102 int32_t timeout_tx_samples;
103 /*! \brief The current receive timeout. */
104 int32_t timeout_rx_samples;
105} t38_terminal_front_end_state_t;
106
107/*!
108 T.38 terminal state.
109*/
110 struct t38_terminal_state_s
111{
112 /*! \brief The T.30 back-end */
113 t30_state_t t30;
114
115 /*! \brief The T.38 front-end */
116 t38_terminal_front_end_state_t t38_fe;
117
118 /*! \brief Error and flow logging control */
119 logging_state_t logging;
120};
121
122#endif
123/*- End of file ------------------------------------------------------------*/
logging_state_t
struct logging_state_s logging_state_t
Definition logging.h:75
t38_terminal_front_end_state_t
Definition private/t38_terminal.h:32
t38_terminal_front_end_state_t::us_per_tx_chunk
int us_per_tx_chunk
Required time between T.38 transmissions, in microseconds.
Definition private/t38_terminal.h:36
t38_terminal_front_end_state_t::ptr
int ptr
Current pointer within the contents of the HDLC transmit buffer.
Definition private/t38_terminal.h:72
t38_terminal_front_end_state_t::samples
int32_t samples
A "sample" count, used to time events.
Definition private/t38_terminal.h:98
t38_terminal_front_end_state_t::non_ecm_trailer_bytes
int non_ecm_trailer_bytes
Counter for trailing non-ECM bytes, used to flush out the far end's modem.
Definition private/t38_terminal.h:80
t38_terminal_front_end_state_t::rx_signal_present
int rx_signal_present
TRUE if a carrier is present. Otherwise FALSE.
Definition private/t38_terminal.h:88
t38_terminal_front_end_state_t::next_tx_samples
int32_t next_tx_samples
The value for samples at the next transmission point.
Definition private/t38_terminal.h:100
t38_terminal_front_end_state_t::iaf
int iaf
Internet Aware FAX mode bit mask.
Definition private/t38_terminal.h:34
t38_terminal_front_end_state_t::buf
uint8_t buf[T38_MAX_HDLC_LEN]
HDLC receive buffer.
Definition private/t38_terminal.h:60
t38_terminal_front_end_state_t::chunking_modes
int chunking_modes
Bit fields controlling the way data is packed into chunked for transmission.
Definition private/t38_terminal.h:38
t38_terminal_front_end_state_t::rx_data_missing
int rx_data_missing
TRUE is there has been some T.38 data missed (i.e. lost packets) in the current reception period.
Definition private/t38_terminal.h:51
t38_terminal_front_end_state_t::timeout_rx_samples
int32_t timeout_rx_samples
The current receive timeout.
Definition private/t38_terminal.h:104
t38_terminal_front_end_state_t::t38
t38_core_state_t t38
Core T.38 IFP support.
Definition private/t38_terminal.h:41
t38_terminal_front_end_state_t::next_tx_indicator
int next_tx_indicator
The next T.38 indicator queued for transmission.
Definition private/t38_terminal.h:83
t38_terminal_front_end_state_t::octets_per_data_packet
int octets_per_data_packet
The number of octets to send in each image packet (non-ECM or ECM) at the current rate and the curren...
Definition private/t38_terminal.h:55
t38_terminal_front_end_state_t::timeout_tx_samples
int32_t timeout_tx_samples
The current transmit timeout.
Definition private/t38_terminal.h:102
t38_terminal_front_end_state_t::len
int len
The length of the contents of the HDLC receive buffer.
Definition private/t38_terminal.h:62
t38_terminal_front_end_state_t::queued_timed_step
int queued_timed_step
The timed step to go to when we reach idle from the current timed step.
Definition private/t38_terminal.h:47
t38_terminal_front_end_state_t::current_tx_type
int current_tx_type
The current operating mode of the transmitter.
Definition private/t38_terminal.h:93
t38_terminal_front_end_state_t::tx_bit_rate
int tx_bit_rate
Current transmission bit rate.
Definition private/t38_terminal.h:96
t38_terminal_front_end_state_t::current_tx_data_type
int current_tx_data_type
The current T.38 data type being transmitted.
Definition private/t38_terminal.h:85
t38_terminal_front_end_state_t::current_rx_type
int current_rx_type
The current operating mode of the receiver.
Definition private/t38_terminal.h:91
t38_terminal_front_end_state_t::extra_bits
int extra_bits
The number of extra bits in a fully stuffed version of the contents of the HDLC transmit buffer....
Definition private/t38_terminal.h:76
t38_terminal_front_end_state_t::timed_step
int timed_step
The current transmit step being timed.
Definition private/t38_terminal.h:44
t38_terminal_state_s
Definition private/t38_terminal.h:111
t38_terminal_state_s::logging
logging_state_t logging
Error and flow logging control.
Definition private/t38_terminal.h:119
t38_terminal_state_s::t38_fe
t38_terminal_front_end_state_t t38_fe
The T.38 front-end.
Definition private/t38_terminal.h:116
t38_terminal_state_s::t30
t30_state_t t30
The T.30 back-end.
Definition private/t38_terminal.h:113
t38_core_state_t
struct t38_core_state_s t38_core_state_t
Definition t38_core.h:202
T38_MAX_HDLC_LEN
#define T38_MAX_HDLC_LEN
Definition t38_gateway.h:46