spandsp  0.0.6
private/t31.h
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * private/t31.h - A T.31 compatible class 1 FAX modem interface.
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_T31_H_)
27 #define _SPANDSP_PRIVATE_T31_H_
28 
29 /*!
30  Analogue FAX front end channel descriptor. This defines the state of a single working
31  instance of an analogue line FAX front end.
32 */
33 typedef struct
34 {
35  fax_modems_state_t modems;
36  //v8_state_t v8;
37 
38  /*! The transmit signal handler to be used when the current one has finished sending. */
39  span_tx_handler_t *next_tx_handler;
40  void *next_tx_user_data;
41 
42  /*! \brief No of data bits in current_byte. */
43  int bit_no;
44  /*! \brief The current data byte in progress. */
46 
47  /*! \brief Rx power meter, used to detect silence. */
49  /*! \brief Last sample, used for an elementary HPF for the power meter. */
50  int16_t last_sample;
51  /*! \brief The current silence threshold. */
53 
54  /*! \brief Samples of silence heard */
57 
58 /*!
59  Analogue FAX front end channel descriptor. This defines the state of a single working
60  instance of an analogue line FAX front end.
61 */
62 typedef struct
63 {
64  /*! \brief Internet Aware FAX mode bit mask. */
65  int iaf;
66  /*! \brief Required time between T.38 transmissions, in ms. */
68  /*! \brief Bit fields controlling the way data is packed into chunked for transmission. */
70 
71  /*! \brief Core T.38 IFP support */
73 
74  /*! \brief The current transmit step being timed */
76 
77  /*! \brief TRUE is there has been some T.38 data missed */
79 
80  /*! \brief The number of octets to send in each image packet (non-ECM or ECM) at the current
81  rate and the current specified packet interval. */
83 
84  /*! \brief An HDLC context used when sending HDLC messages to the terminal port
85  (ECM mode support). */
87  /*! \brief An HDLC context used when receiving HDLC messages from the terminal port.
88  (ECM mode support). */
90 
91  struct
92  {
93  uint8_t buf[T31_T38_MAX_HDLC_LEN];
94  int len;
95  } hdlc_rx;
96 
97  struct
98  {
99  /*! \brief The number of extra bits in a fully stuffed version of the
100  contents of the HDLC transmit buffer. This is needed to accurately
101  estimate the playout time for this frame, through an analogue modem. */
103  } hdlc_tx;
104 
105  /*! \brief TRUE if we are using ECM mode. This is used to select HDLC faking, necessary
106  with clunky class 1 modems. */
107  int ecm_mode;
108 
109  /*! \brief Counter for trailing non-ECM bytes, used to flush out the far end's modem. */
111 
112  /*! \brief The next queued tramsit indicator */
114  /*! \brief The current T.38 data type being transmitted */
116 
117  /*! \brief The current operating mode of the receiver. */
119  /*! \brief The current operating mode of the transmitter. */
121 
122  /*! \brief Current transmission bit rate. */
124  /*! \brief A "sample" count, used to time events. */
125  int32_t samples;
126  /*! \brief The value for samples at the next transmission point. */
128  /*! \brief The current receive timeout. */
131 
132 /*!
133  T.31 descriptor. This defines the working state for a single instance of
134  a T.31 FAX modem.
135 */
137 {
138  at_state_t at_state;
139  t31_modem_control_handler_t *modem_control_handler;
140  void *modem_control_user_data;
141 
144  /*! TRUE if working in T.38 mode. */
145  int t38_mode;
146 
147  /*! HDLC buffer, for composing an HDLC frame from the computer to the channel. */
148  struct
149  {
150  uint8_t buf[T31_MAX_HDLC_LEN];
151  int len;
152  int ptr;
153  /*! \brief TRUE when the end of HDLC data from the computer has been detected. */
154  int final;
155  } hdlc_tx;
156  /*! Buffer for data from the computer to the channel. */
157  struct
158  {
159  uint8_t data[T31_TX_BUF_LEN];
160  /*! \brief The number of bytes stored in transmit buffer. */
161  int in_bytes;
162  /*! \brief The number of bytes sent from the transmit buffer. */
164  /*! \brief TRUE if the flow of real data has started. */
166  /*! \brief TRUE if holding up further data into the buffer, for flow control. */
167  int holding;
168  /*! \brief TRUE when the end of non-ECM data from the computer has been detected. */
169  int final;
170  } tx;
171 
172  /*! TRUE if DLE prefix just used */
173  int dled;
174 
175  /*! \brief Samples of silence awaited, as specified in a "wait for silence" command */
177 
178  /*! \brief The current bit rate for the FAX fast message transfer modem. */
179  int bit_rate;
180  /*! \brief TRUE if a valid HDLC frame has been received in the current reception period. */
182 
183  /*! \brief Samples elapsed in the current call */
184  int64_t call_samples;
185  int64_t dte_data_timeout;
186 
187  /*! \brief The currently queued modem type. */
188  int modem;
189  /*! \brief TRUE when short training mode has been selected by the computer. */
191  queue_state_t *rx_queue;
192 
193  /*! \brief Error and flow logging control */
195 };
196 
197 #endif
198 /*- End of file ------------------------------------------------------------*/
t38_data_field_t::field_type
int field_type
Definition: t38_core.h:192
t38_cm_profile_to_str
const char * t38_cm_profile_to_str(int profile)
Convert the code for a CM profile code to text description.
Definition: t38_core.c:220
MODEM_CONNECT_TONES_ANSAM_PR
@ MODEM_CONNECT_TONES_ANSAM_PR
The ANSam with phase reversals tone is a version of ANS_PR with 20% of 15Hz+-0.1Hz AM modulation,...
Definition: modem_connect_tones.h:72
v29_rx_signal_power
float v29_rx_signal_power(v29_rx_state_t *s)
Definition: v29rx.c:165
t31_release
int t31_release(t31_state_t *s)
Release a T.31 context.
Definition: t31.c:2693
t38_core_state_s::fastest_image_data_rate
int fastest_image_data_rate
The fastest data rate supported by the T.38 channel.
Definition: private/t38_core.h:96
T30_DCS
@ T30_DCS
Definition: t30_fcf.h:54
t31_state_s::silence_awaited
int silence_awaited
Samples of silence awaited, as specified in a "wait for silence" command.
Definition: private/t31.h:176
t4_tx.h
t31_t38_front_end_state_t::tx_bit_rate
int tx_bit_rate
Current transmission bit rate.
Definition: private/t31.h:123
tone_generate.h
MODEM_CONNECT_TONES_FAX_CNG
@ MODEM_CONNECT_TONES_FAX_CNG
CNG tone is a pure 1100Hz tone, in 0.5s bursts, with 3s silences in between. The bursts repeat for as...
Definition: modem_connect_tones.h:62
at_state_s::rx_signal_present
int rx_signal_present
TRUE if a carrier is presnt. Otherwise FALSE.
Definition: private/at_interpreter.h:108
queue_state_s
Definition: private/queue.h:33
t38_core_state_s::v34_rate
int v34_rate
The bit rate for V.34 operation.
Definition: private/t38_core.h:125
at_interpreter.h
modem_connect_tones.h
AT_MODEM_CONTROL_ANSWER
@ AT_MODEM_CONTROL_ANSWER
Definition: at_interpreter.h:65
t38_core_state_s::current_rx_field_type
int current_rx_field_type
The current receive field type - i.e. the last field_type received.
Definition: private/t38_core.h:121
t31_t38_front_end_state_t::timeout_rx_samples
int32_t timeout_rx_samples
The current receive timeout.
Definition: private/t31.h:129
T30_FRONT_END_RECEIVE_COMPLETE
@ T30_FRONT_END_RECEIVE_COMPLETE
Definition: t30.h:332
QUEUE_WRITE_ATOMIC
#define QUEUE_WRITE_ATOMIC
Definition: queue.h:48
t31_t38_front_end_state_t::iaf
int iaf
Internet Aware FAX mode bit mask.
Definition: private/t31.h:65
t30_logging.h
t31_t38_front_end_state_t::ms_per_tx_chunk
int ms_per_tx_chunk
Required time between T.38 transmissions, in ms.
Definition: private/t31.h:67
t31_state_s::dled
int dled
Definition: private/t31.h:173
t31_get_logging_state
logging_state_t * t31_get_logging_state(t31_state_t *s)
Get a pointer to the logging context associated with a T.31 context.
Definition: t31.c:2560
t38_core_send_data_multi_field
int t38_core_send_data_multi_field(t38_core_state_t *s, int data_type, const t38_data_field_t field[], int fields, int category)
Send a data packet.
Definition: t38_core.c:972
SIG_STATUS_ABORT
@ SIG_STATUS_ABORT
An abort signal (e.g. an HDLC abort) has been received.
Definition: async.h:73
hdlc_tx_init
hdlc_tx_state_t * hdlc_tx_init(hdlc_tx_state_t *s, int crc32, int inter_frame_flags, int progressive, hdlc_underflow_handler_t handler, void *user_data)
Initialise an HDLC transmitter context.
Definition: hdlc.c:626
fax_modems_state_s::logging
logging_state_t logging
Error and flow logging control.
Definition: private/fax_modems.h:124
t31_audio_front_end_state_t::rx_power
power_meter_t rx_power
Rx power meter, used to detect silence.
Definition: private/t31.h:48
SIG_STATUS_CARRIER_UP
@ SIG_STATUS_CARRIER_UP
The carrier signal is up. This merely indicates that carrier energy has been seen....
Definition: async.h:58
t31_t38_front_end_state_t::t38
t38_core_state_t t38
Core T.38 IFP support.
Definition: private/t31.h:72
DATA_END_TX_COUNT
#define DATA_END_TX_COUNT
Definition: t31.c:121
fsk_rx_signal_power
float fsk_rx_signal_power(fsk_rx_state_t *s)
Definition: fsk.c:246
t38_set_redundancy_control
void t38_set_redundancy_control(t38_core_state_t *s, int category, int setting)
Send a data packet.
Definition: t38_core.c:1058
async.h
hdlc.h
t31_t38_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/t31.h:102
t31_t38_front_end_state_t::current_tx_data_type
int current_tx_data_type
The current T.38 data type being transmitted.
Definition: private/t31.h:115
SIG_STATUS_TRAINING_IN_PROGRESS
@ SIG_STATUS_TRAINING_IN_PROGRESS
The modem is training. This is an early indication that the signal seems to be of the right type....
Definition: async.h:63
t30.h
fax_modems_state_s::v27ter_rx
v27ter_rx_state_t v27ter_rx
A V.27ter modem context used when receiving FAXes at 2400bps or 4800bps.
Definition: private/fax_modems.h:74
t38_v34rate_to_bps
int t38_v34rate_to_bps(const uint8_t *data, int len)
Convert a V34rate message to an actual bit rate.
Definition: t38_core.c:272
t31_state_s::t38_mode
int t38_mode
Definition: private/t31.h:145
crc.h
crc_itu16_append
int crc_itu16_append(uint8_t *buf, int len)
Append an ITU/CCITT CRC-16 value to a frame.
Definition: crc.c:179
t31_state_s::out_bytes
int out_bytes
The number of bytes sent from the transmit buffer.
Definition: private/t31.h:163
t31.h
at_init
at_state_t * at_init(at_state_t *s, at_tx_handler_t *at_tx_handler, void *at_tx_user_data, at_modem_control_handler_t *modem_control_handler, void *modem_control_user_data)
Initialise an AT interpreter context.
Definition: at_interpreter.c:5503
t4_rx.h
t38_core_state_s
Definition: private/t38_core.h:32
t31_state_s::data_started
int data_started
TRUE if the flow of real data has started.
Definition: private/t31.h:165
t31_t38_front_end_state_t::samples
int32_t samples
A "sample" count, used to time events.
Definition: private/t31.h:125
v17_tx_restart
int v17_tx_restart(v17_tx_state_t *s, int bit_rate, int tep, int short_train)
Reinitialise an existing V.17 modem transmit context.
Definition: v17tx.c:380
AT_MODEM_CONTROL_CALL
@ AT_MODEM_CONTROL_CALL
Definition: at_interpreter.h:63
t31_t38_front_end_state_t::hdlc_tx_term
hdlc_tx_state_t hdlc_tx_term
An HDLC context used when sending HDLC messages to the terminal port (ECM mode support).
Definition: private/t31.h:86
T38_PACKET_CATEGORY_CONTROL_DATA
@ T38_PACKET_CATEGORY_CONTROL_DATA
Control data packet.
Definition: t38_core.h:176
put_bit_func_t
void(* put_bit_func_t)(void *user_data, int bit)
Definition: async.h:105
t30_frametype
const char * t30_frametype(uint8_t x)
Return a text name for a T.30 frame type.
Definition: t30_logging.c:241
t31_state_s::hdlc_tx
struct t31_state_s::@60 hdlc_tx
t31_t38_front_end_state_t::rx_data_missing
int rx_data_missing
TRUE is there has been some T.38 data missed.
Definition: private/t31.h:78
power_meter_update
int32_t power_meter_update(power_meter_t *s, int16_t amp)
Update a power meter.
Definition: power_meter.c:84
v27ter_tx.h
fax_modems_state_s::rx_fillin_handler
span_rx_fillin_handler_t * rx_fillin_handler
The current receive missing signal fill-in handler.
Definition: private/fax_modems.h:100
MODEM_CONNECT_TONES_FAX_CED
#define MODEM_CONNECT_TONES_FAX_CED
FAX CED tone is the same as ANS tone.
Definition: modem_connect_tones.h:87
T38_PACKET_CATEGORY_INDICATOR
@ T38_PACKET_CATEGORY_INDICATOR
Indicator packet.
Definition: t38_core.h:174
at_interpreter.h
t38_data_field_t
Definition: t38_core.h:189
fax_modems_state_s::v29_tx
v29_tx_state_t v29_tx
A V.29 modem context used when sending FAXes at 7200bps or 9600bps.
Definition: private/fax_modems.h:65
SIG_STATUS_FRAMING_OK
@ SIG_STATUS_FRAMING_OK
Packet framing (e.g. HDLC framing) is OK.
Definition: async.h:69
fax_modems_state_s::v27ter_tx
v27ter_tx_state_t v27ter_tx
A V.27ter modem context used when sending FAXes at 2400bps or 4800bps.
Definition: private/fax_modems.h:71
SPAN_DECLARE_NONSTD
SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data)
Get the next bit of a transmitted serial bit stream.
t31_audio_front_end_state_t
Definition: private/t31.h:33
DATA_TX_COUNT
#define DATA_TX_COUNT
Definition: t31.c:119
t31_state_s::call_samples
int64_t call_samples
Samples elapsed in the current call.
Definition: private/t31.h:184
queue_write_msg
int queue_write_msg(queue_state_t *s, const uint8_t *buf, int len)
Write a message to a queue.
Definition: queue.c:335
fax_modems_state_s::v17_tx
v17_tx_state_t v17_tx
A V.17 modem context used when sending FAXes at 7200bps, 9600bps 12000bps or 14400bps.
Definition: private/fax_modems.h:59
timezone.h
v17rx.h
v27ter_rx_restart
int v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, int old_train)
Reinitialise an existing V.27ter modem receive context.
Definition: v27ter_rx.c:1036
power_meter_t
Definition: power_meter.h:48
complex.h
t31_audio_front_end_state_t::last_sample
int16_t last_sample
Last sample, used for an elementary HPF for the power meter.
Definition: private/t31.h:50
fax_modems_state_s::silence_gen
silence_gen_state_t silence_gen
Used to insert timed silences.
Definition: private/fax_modems.h:77
t31_t38_front_end_state_t::ecm_mode
int ecm_mode
TRUE if we are using ECM mode. This is used to select HDLC faking, necessary with clunky class 1 mode...
Definition: private/t31.h:107
t38_core_state_s::current_tx_indicator
int current_tx_indicator
The current transmit indicator - i.e. the last indicator transmitted.
Definition: private/t38_core.h:123
T38_PACKET_CATEGORY_IMAGE_DATA
@ T38_PACKET_CATEGORY_IMAGE_DATA
Image data packet.
Definition: t38_core.h:180
fax_modems_state_s::transmit_on_idle
int transmit_on_idle
Definition: private/fax_modems.h:43
t31_t38_front_end_state_t::hdlc_rx_term
hdlc_rx_state_t hdlc_rx_term
An HDLC context used when receiving HDLC messages from the terminal port. (ECM mode support).
Definition: private/t31.h:89
t31_t38_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/t31.h:82
t31_free
int t31_free(t31_state_t *s)
Release a T.31 context.
Definition: t31.c:2700
t31_audio_front_end_state_t::next_tx_handler
span_tx_handler_t * next_tx_handler
Definition: private/t31.h:39
at_state_s::rx_trained
int rx_trained
TRUE if a modem has trained, Otherwise FALSE.
Definition: private/at_interpreter.h:110
fax_modems_state_s::v29_rx
v29_rx_state_t v29_rx
A V.29 modem context used when receiving FAXes at 7200bps or 9600bps.
Definition: private/fax_modems.h:68
t31_audio_front_end_state_t::silence_threshold_power
int32_t silence_threshold_power
The current silence threshold.
Definition: private/t31.h:52
t31_t38_front_end_state_t
Definition: private/t31.h:62
t38_core_state_s::current_rx_data_type
int current_rx_data_type
The current receive data type - i.e. the last data type received.
Definition: private/t38_core.h:119
fax_modems_state_s
Definition: private/fax_modems.h:34
t31_state_s
Definition: private/t31.h:136
v27ter_rx.h
SIG_STATUS_TRAINING_FAILED
@ SIG_STATUS_TRAINING_FAILED
The modem has failed to train.
Definition: async.h:67
get_bit_func_t
int(* get_bit_func_t)(void *user_data)
Definition: async.h:108
queue_init
queue_state_t * queue_init(queue_state_t *s, int len, int flags)
Initialise a queue.
Definition: queue.c:394
fax_modems_state_s::rx_handler
span_rx_handler_t * rx_handler
The current receive signal handler.
Definition: private/fax_modems.h:98
t31_t38_front_end_state_t::current_tx_type
int current_tx_type
The current operating mode of the transmitter.
Definition: private/t31.h:120
t31_state_s::tx
struct t31_state_s::@61 tx
fax_modems_state_s::next_tx_handler
span_tx_handler_t * next_tx_handler
The next transmit signal handler, for two stage transmit operations. E.g. a short silence followed by...
Definition: private/fax_modems.h:109
SIG_STATUS_CARRIER_DOWN
@ SIG_STATUS_CARRIER_DOWN
The carrier signal has dropped.
Definition: async.h:54
silence_gen_set
void silence_gen_set(silence_gen_state_t *s, int silent_samples)
Set a silence generator context to output a specified period of silence.
Definition: silence_gen.c:79
t38_core_send_flags_delay
int t38_core_send_flags_delay(t38_core_state_t *s, int indicator)
Find the delay to allow for HDLC flags after sending an indicator.
Definition: t38_core.c:932
t31_audio_front_end_state_t::current_byte
int current_byte
The current data byte in progress.
Definition: private/t31.h:45
v17tx.h
v17_rx_restart
int v17_rx_restart(v17_rx_state_t *s, int bit_rate, int short_train)
Reinitialise an existing V.17 modem receive context.
Definition: v17rx.c:1380
bit_operations.h
t31_t38_front_end_state_t::next_tx_samples
int32_t next_tx_samples
The value for samples at the next transmission point.
Definition: private/t31.h:127
t38_core_state_s::current_rx_indicator
int current_rx_indicator
The current receive indicator - i.e. the last indicator received.
Definition: private/t38_core.h:117
hdlc_rx_state_s
Definition: private/hdlc.h:32
t31_t38_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/t31.h:110
queue.h
at_profile_t::adaptive_receive
int adaptive_receive
Definition: at_interpreter.h:129
t31_audio_front_end_state_t::silence_heard
int silence_heard
Samples of silence heard.
Definition: private/t31.h:55
t38_core_send_data
int t38_core_send_data(t38_core_state_t *s, int data_type, int field_type, const uint8_t field[], int field_len, int category)
Send a data packet.
Definition: t38_core.c:948
fax_modems_state_s::hdlc_rx
hdlc_rx_state_t hdlc_rx
An HDLC context used when receiving HDLC messages.
Definition: private/fax_modems.h:48
T38_PACKET_CATEGORY_CONTROL_DATA_END
@ T38_PACKET_CATEGORY_CONTROL_DATA_END
Terminating control data packet.
Definition: t38_core.h:178
HDLC_FRAMING_OK_THRESHOLD
#define HDLC_FRAMING_OK_THRESHOLD
Definition: t38_gateway.c:175
span_log
int span_log(logging_state_t *s, int level, const char *format,...)
Generate a log entry.
Definition: logging.c:84
queue_empty
int queue_empty(queue_state_t *s)
Check if a queue is empty.
Definition: queue.c:46
AT_MODEM_CONTROL_ONHOOK
@ AT_MODEM_CONTROL_ONHOOK
Definition: at_interpreter.h:71
v29rx.h
dc_restore.h
t31_state_s::short_train
int short_train
TRUE when short training mode has been selected by the computer.
Definition: private/t31.h:190
t38_jm_to_str
const char * t38_jm_to_str(const uint8_t *data, int len)
Convert a JM message code to text description.
Definition: t38_core.c:241
modem_connect_tones_tx_init
modem_connect_tones_tx_state_t * modem_connect_tones_tx_init(modem_connect_tones_tx_state_t *s, int tone_type)
Initialise an instance of the modem connect tones generator.
Definition: modem_connect_tones.c:253
hdlc_rx_init
hdlc_rx_state_t * hdlc_rx_init(hdlc_rx_state_t *s, int crc32, int report_bad_frames, int framing_ok_threshold, hdlc_frame_handler_t handler, void *user_data)
Initialise an HDLC receiver context.
Definition: hdlc.c:327
silence_gen_alter
void silence_gen_alter(silence_gen_state_t *s, int silent_samples)
Alter the period of a silence generator context by a specified amount.
Definition: silence_gen.c:86
t38_core.h
T38_PACKET_CATEGORY_IMAGE_DATA_END
@ T38_PACKET_CATEGORY_IMAGE_DATA_END
Terminating image data packet.
Definition: t38_core.h:182
AT_MODEM_CONTROL_HANGUP
@ AT_MODEM_CONTROL_HANGUP
Definition: at_interpreter.h:67
fsk_rx_init
fsk_rx_state_t * fsk_rx_init(fsk_rx_state_t *s, const fsk_spec_t *spec, int framing_mode, put_bit_func_t put_bit, void *user_data)
Initialise an FSK modem receive context.
Definition: fsk.c:314
t31_set_tep_mode
void t31_set_tep_mode(t31_state_t *s, int use_tep)
Select whether TEP mode will be used.
Definition: t31.c:2520
t31_t38_front_end_state_t::timed_step
int timed_step
The current transmit step being timed.
Definition: private/t31.h:75
v29_rx_restart
int v29_rx_restart(v29_rx_state_t *s, int bit_rate, int old_train)
Reinitialise an existing V.29 modem receive context.
Definition: v29rx.c:1072
v17tx.h
fsk_tx_init
fsk_tx_state_t * fsk_tx_init(fsk_tx_state_t *s, const fsk_spec_t *spec, get_bit_func_t get_bit, void *user_data)
Initialise an FSK modem transmit context.
Definition: fsk.c:153
t38_core_send_indicator
int t38_core_send_indicator(t38_core_state_t *s, int indicator)
Send an indicator packet.
Definition: t38_core.c:889
t31_state_s::bit_rate
int bit_rate
The current bit rate for the FAX fast message transfer modem.
Definition: private/t31.h:179
queue_read_msg
int queue_read_msg(queue_state_t *s, uint8_t *buf, int len)
Read a message from a queue.
Definition: queue.c:309
v27ter_tx_restart
int v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, int tep)
Reinitialise an existing V.27ter modem transmit context.
Definition: v27ter_tx.c:390
bitstream.h
power_meter_level_dbm0
int32_t power_meter_level_dbm0(float level)
Get the current power meter reading, in dBm0.
Definition: power_meter.c:91
fsk.h
QUEUE_READ_ATOMIC
#define QUEUE_READ_ATOMIC
Definition: queue.h:45
fsk_rx_signal_cutoff
void fsk_rx_signal_cutoff(fsk_rx_state_t *s, float cutoff)
Adjust an FSK modem receive context's carrier detect power threshold.
Definition: fsk.c:238
logging.h
DEFAULT_DTE_TIMEOUT
#define DEFAULT_DTE_TIMEOUT
Definition: t31.c:123
t31_t38_front_end_state_t::chunking_modes
int chunking_modes
Bit fields controlling the way data is packed into chunked for transmission.
Definition: private/t31.h:69
t31_state_s::logging
logging_state_t logging
Error and flow logging control.
Definition: private/t31.h:194
queue_flush
void queue_flush(queue_state_t *s)
Flush the contents of a queue.
Definition: queue.c:74
v8.h
t31_t38_front_end_state_t::current_rx_type
int current_rx_type
The current operating mode of the receiver.
Definition: private/t31.h:118
v29tx.h
fax_modems_state_s::v21_rx
fsk_rx_state_t v21_rx
A V.21 FSK modem context used when receiving HDLC over V.21 messages.
Definition: private/fax_modems.h:54
bit_reverse
void bit_reverse(uint8_t to[], const uint8_t from[], int len)
Bit reverse each byte in a buffer.
Definition: bit_operations.c:79
fax_modems_state_s::use_tep
int use_tep
Definition: private/fax_modems.h:37
t31_state_s::final
int final
TRUE when the end of HDLC data from the computer has been detected.
Definition: private/t31.h:154
fax_modems_state_s::tx_handler
span_tx_handler_t * tx_handler
The current transmit signal handler.
Definition: private/fax_modems.h:104
hdlc_tx_state_s
Definition: private/hdlc.h:91
at_profile_t::s_regs
uint8_t s_regs[100]
Definition: at_interpreter.h:131
fax_modems.h
t38_core_init
t38_core_state_t * t38_core_init(t38_core_state_t *s, t38_rx_indicator_handler_t *rx_indicator_handler, t38_rx_data_handler_t *rx_data_handler, t38_rx_missing_handler_t *rx_missing_handler, void *rx_user_data, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data)
Initialise a T.38 core context.
Definition: t38_core.c:1102
fax_modems_state_s::hdlc_tx
hdlc_tx_state_t hdlc_tx
An HDLC context used when transmitting HDLC messages.
Definition: private/fax_modems.h:46
t38_data_field_t::field
const uint8_t * field
Definition: t38_core.h:194
fax_modems_state_s::v17_rx
v17_rx_state_t v17_rx
A V.29 modem context used when receiving FAXes at 7200bps, 9600bps 12000bps or 14400bps.
Definition: private/fax_modems.h:62
t31_audio_front_end_state_t::bit_no
int bit_no
No of data bits in current_byte.
Definition: private/t31.h:43
at_profile_t::result_code_format
int result_code_format
Definition: at_interpreter.h:123
t38_data_field_t::field_len
int field_len
Definition: t38_core.h:196
t31_state_s::in_bytes
int in_bytes
The number of bytes stored in transmit buffer.
Definition: private/t31.h:161
t30_fcf.h
INDICATOR_TX_COUNT
#define INDICATOR_TX_COUNT
Definition: t31.c:117
t31_state_s::holding
int holding
TRUE if holding up further data into the buffer, for flow control.
Definition: private/t31.h:167
power_meter_init
power_meter_t * power_meter_init(power_meter_t *s, int shift)
Initialise a power meter context.
Definition: power_meter.c:50
at_state_s
Definition: private/at_interpreter.h:44
SIG_STATUS_TRAINING_SUCCEEDED
@ SIG_STATUS_TRAINING_SUCCEEDED
The modem has trained, and is ready for data exchange.
Definition: async.h:65
t31_state_s::modem
int modem
The currently queued modem type.
Definition: private/t31.h:188
t31_set_t38_config
void t31_set_t38_config(t31_state_t *s, int without_pacing)
Select whether T.38 data will be paced.
Definition: t31.c:2526
t31_set_transmit_on_idle
void t31_set_transmit_on_idle(t31_state_t *s, int transmit_on_idle)
Select whether silent audio will be sent when transmit is idle.
Definition: t31.c:2514
v27ter_rx_signal_power
float v27ter_rx_signal_power(v27ter_rx_state_t *s)
Definition: v27ter_rx.c:152
MS_PER_TX_CHUNK
#define MS_PER_TX_CHUNK
Definition: t31.c:115
logging_state_s
Definition: private/logging.h:33
modem_connect_tones.h
v8_init
v8_state_t * v8_init(v8_state_t *s, int calling_party, v8_parms_t *parms, v8_result_handler_t result_handler, void *user_data)
Initialise a V.8 context.
Definition: v8.c:1073
hdlc_tx_frame
int hdlc_tx_frame(hdlc_tx_state_t *s, const uint8_t *frame, size_t len)
Transmit a frame.
Definition: hdlc.c:389
v8_parms_s
Definition: v8.h:117
fax_modems_state_s::connect_tx
modem_connect_tones_tx_state_t connect_tx
CED or CNG generator.
Definition: private/fax_modems.h:79
t31_t38_front_end_state_t::next_tx_indicator
int next_tx_indicator
The next queued tramsit indicator.
Definition: private/t31.h:113
fax_modems_state_s::v21_tx
fsk_tx_state_t v21_tx
A V.21 FSK modem context used when transmitting HDLC over V.21 messages.
Definition: private/fax_modems.h:51
fax_modems.h
SIG_STATUS_END_OF_DATA
@ SIG_STATUS_END_OF_DATA
The data stream has ended.
Definition: async.h:71
v29_tx_restart
int v29_tx_restart(v29_tx_state_t *s, int bit_rate, int tep)
Reinitialise an existing V.29 modem transmit context.
Definition: v29tx.c:332
hdlc_tx_flags
int hdlc_tx_flags(hdlc_tx_state_t *s, int len)
Transmit a specified quantity of flag octets, typically as a preamble.
Definition: hdlc.c:424
AT_MODEM_CONTROL_CTS
@ AT_MODEM_CONTROL_CTS
Definition: at_interpreter.h:77
t31_init
t31_state_t * t31_init(t31_state_t *s, at_tx_handler_t *at_tx_handler, void *at_tx_user_data, t31_modem_control_handler_t *modem_control_handler, void *modem_control_user_data, t38_tx_packet_handler_t *tx_t38_packet_handler, void *tx_t38_packet_user_data)
Initialise a T.31 context.
Definition: t31.c:2605
v17_rx_signal_power
float v17_rx_signal_power(v17_rx_state_t *s)
Definition: v17rx.c:182
t31_state_s::rx_frame_received
int rx_frame_received
TRUE if a valid HDLC frame has been received in the current reception period.
Definition: private/t31.h:181