spandsp 3.0.0
v150_1.h
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * v150_1.h - An implementation of V.150.1.
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2022 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 General Public License version 2, as
14 * 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 General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * 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_V150_1_H_)
27#define _SPANDSP_V150_1_H_
28
29/* Structure passed with status reports */
30typedef struct
31{
32 int reason;
33 union
34 {
35 struct
36 {
37 int local_state;
38 int remote_state;
39 } media_state_change;
40 struct
41 {
42 int state;
43 int cleardown_reason;
44 } connection_state_change;
45 struct
46 {
47 int bits;
48 int parity_code;
49 int stop_bits;
50 } data_format_change;
51 struct
52 {
53 int source;
54 int type;
55 int duration; /* In ms */
56 } break_received;
57 struct
58 {
59 bool local_busy;
60 bool far_busy;
61 } busy_change;
62 struct
63 {
64 int selmod;
65 int tdsr;
66 int rdsr;
67 bool txsen;
68 int txsr;
69 bool rxsen;
70 int rxsr;
71 } physup_parameters;
72 struct
73 {
74 int selmod;
75 int tdsr;
76 int rdsr;
77
78 int selected_compression_direction;
79 int selected_compression;
80 int selected_error_correction;
81
82 int compression_tx_dictionary_size;
83 int compression_rx_dictionary_size;
84 int compression_tx_string_length;
85 int compression_rx_string_length;
86 int compression_tx_history_size;
87 int compression_rx_history_size;
88
89 bool i_raw_octet_available;
90 bool i_raw_bit_available;
91 bool i_frame_available;
92 bool i_octet_with_dlci_available;
93 bool i_octet_without_dlci_available;
94 bool i_char_stat_available;
95 bool i_char_dyn_available;
96 bool i_octet_cs_available;
97 bool i_char_stat_cs_available;
98 bool i_char_dyn_cs_available;
99 } connect_parameters;
100 } types;
102
103typedef int (*v150_1_spe_signal_handler_t) (void *user_data, int signal);
104
105typedef int (*v150_1_tx_packet_handler_t) (void *user_data, int channel, const uint8_t msg[], int len);
106
107typedef int (*v150_1_rx_data_handler_t) (void *user_data, const uint8_t msg[], int len, int fill);
108
109typedef int (*v150_1_rx_status_report_handler_t) (void *user_data, v150_1_status_t *report);
110
111typedef int (*v150_1_sse_tx_packet_handler_t) (void *user_data, bool repeat, const uint8_t pkt[], int len);
112
113typedef int (*v150_1_sse_status_handler_t) (void *user_data, int status);
114
115typedef span_timestamp_t (*v150_1_timer_handler_t) (void *user_data, span_timestamp_t timeout);
116
117typedef struct v150_1_state_s v150_1_state_t;
118
119/* The information packet types are:
120
121 V150_1_MSGID_I_RAW_OCTET (mandatory)
122 V150_1_MSGID_I_RAW_BIT (optional)
123
124 These messages allow for the transport of synchronous data streams. _RAW_OCTET is for data which is
125 a whole number of octets in length. _RAW_BIT is for an arbitrary number of bits. _RAW_BIT should not
126 be used when there is a whole number of octets in the data blocks.
127
128 V150_1_MSGID_I_OCTET (mandatory)
129 V150_1_MSGID_I_OCTET_CS (optional)
130
131 These messages allow for the transport of error corrected data. The version with _CS include a character
132 sequence number, so data gaps can be detected when using an unreliable channel. The version without _CS
133 has no sequence number field, but can optionally contain a DLCI field.
134
135 V150_1_MSGID_I_CHAR_STAT (optional)
136 V150_1_MSGID_I_CHAR_DYN (optional)
137 V150_1_MSGID_I_CHAR_STAT_CS (optional)
138 V150_1_MSGID_I_CHAR_DYN_CS (optional)
139
140 These messages allow for the transport of start-stop (i.e. start bit and stop bit framed) characters, with
141 different formats. The _STAT versions are for data which does not change format during a session (even though
142 the format is explicit in each packet). The _DYN versions have exactly the same format as the _STAT versions,
143 but the format fields can vary from packet to packet. The versions with _CS include a character sequence
144 number, so data gaps can be detected when using an unreliable channel. Otherwise they are similar to the
145 versions without _CS.
146
147 V150_1_MSGID_I_FRAME (optional)
148
149 This message is used to send data for a framed protocol, like HDLC, preserving the frame boundaries as the
150 data passes through the V.150.1 link. This assumes that the original frames are never bigger than the current
151 maximum allowed for a V.150.1 packet.
152 */
153
154#define V150_1_CALL_DISCRIMINATION_DEFAULT_TIMEOUT 60000000
155
156/* Indeterminate is the initial state before the correct value has been determined. The other values are from
157 Table 32/V.150.1 and E.1.5, although the names don't quite match. VBD_SELECT seems to equate to VBD_PREFERRED. */
158typedef enum v150_1_cdscselect_e
159{
160 V150_1_CDSCSELECT_INDETERMINATE = 0,
161 V150_1_CDSCSELECT_AUDIO_RFC4733 = 1,
162 V150_1_CDSCSELECT_VBD_PREFERRED = 2,
163 V150_1_CDSCSELECT_MIXED = 3
164} v150_1_cdscselect_t;
165
166typedef enum v150_1_modem_relay_gateway_type_e
167{
168 V150_1_MODEM_RELAY_GATEWAY_V8 = 0, /* V-MR */
169 V150_1_MODEM_RELAY_GATEWAY_UNIVERSAL = 1 /* U-MR */
170} v150_1_modem_relay_gateway_type_t;
171
172enum v150_1_msgid_e
173{
174 V150_1_MSGID_NULL = 0, /* Transport channel N/A */
175 V150_1_MSGID_INIT = 1, /* Transport channel 2 */
176 V150_1_MSGID_XID_XCHG = 2, /* Transport channel 2 */
177 V150_1_MSGID_JM_INFO = 3, /* Transport channel 2 */
178 V150_1_MSGID_START_JM = 4, /* Transport channel 2 */
179 V150_1_MSGID_CONNECT = 5, /* Transport channel 2 */
180 V150_1_MSGID_BREAK = 6, /* Transport channel N/A */
181 V150_1_MSGID_BREAKACK = 7, /* Transport channel N/A */
182 V150_1_MSGID_MR_EVENT = 8, /* Transport channel 2 */
183 V150_1_MSGID_CLEARDOWN = 9, /* Transport channel 2 */
184 V150_1_MSGID_PROF_XCHG = 10, /* Transport channel 2 */
185 /* Reserved 11-15 */
186 V150_1_MSGID_I_RAW_OCTET = 16, /* Transport channel 1 or 3 */
187 V150_1_MSGID_I_RAW_BIT = 17, /* Transport channel 1 or 3 */
188 V150_1_MSGID_I_OCTET = 18, /* Transport channel 1 or 3 */
189 V150_1_MSGID_I_CHAR_STAT = 19, /* Transport channel 1 or 3 */
190 V150_1_MSGID_I_CHAR_DYN = 20, /* Transport channel 1 or 3 */
191 V150_1_MSGID_I_FRAME = 21, /* Transport channel 1 or 3 */
192 V150_1_MSGID_I_OCTET_CS = 22, /* Transport channel 1 or 3 (only makes sense for 3) */
193 V150_1_MSGID_I_CHAR_STAT_CS = 23, /* Transport channel 1 or 3 (only makes sense for 3) */
194 V150_1_MSGID_I_CHAR_DYN_CS = 24, /* Transport channel 1 or 3 (only makes sense for 3) */
195 /* Reserved 25-99 */
196 V150_1_MSGID_VENDOR_MIN = 100, /* N/A */
197 V150_1_MSGID_VENDOR_MAX = 127 /* N/A */
198};
199
200enum v150_1_support_e
201{
202 V150_1_SUPPORT_I_RAW_BIT = 0x0800,
203 V150_1_SUPPORT_I_FRAME = 0x0400,
204 V150_1_SUPPORT_I_CHAR_STAT = 0x0200,
205 V150_1_SUPPORT_I_CHAR_DYN = 0x0100,
206 V150_1_SUPPORT_I_OCTET_CS = 0x0080, /* See V.150.1 Amendment 2 */
207 V150_1_SUPPORT_I_CHAR_STAT_CS = 0x0040, /* See V.150.1 Amendment 2 */
208 V150_1_SUPPORT_I_CHAR_DYN_CS = 0x0020 /* See V.150.1 Amendment 2 */
209};
210
211enum v150_1_jm_category_id_e
212{
213 V150_1_JM_CATEGORY_ID_PROTOCOLS = 0x5,
214 V150_1_JM_CATEGORY_ID_CALL_FUNCTION_1 = 0x8,
215 V150_1_JM_CATEGORY_ID_MODULATION_MODES = 0xA,
216 V150_1_JM_CATEGORY_ID_PSTN_ACCESS = 0xB,
217 V150_1_JM_CATEGORY_ID_PCM_MODEM_AVAILABILITY = 0xE,
218 V150_1_JM_CATEGORY_ID_EXTENSION = 0x0
219};
220
221enum v150_1_jm_call_function_e
222{
223 V150_1_JM_CALL_FUNCTION_T30_TX = (0x1 << 9),
224 V150_1_JM_CALL_FUNCTION_V18 = (0x2 << 9),
225 V150_1_JM_CALL_FUNCTION_V_SERIES = (0x3 << 9),
226 V150_1_JM_CALL_FUNCTION_H324 = (0x4 << 9),
227 V150_1_JM_CALL_FUNCTION_T30_RX = (0x5 << 9),
228 V150_1_JM_CALL_FUNCTION_T101 = (0x6 << 9)
229};
230
231enum v150_1_jm_modulation_mode_e
232{
233 V150_1_JM_MODULATION_MODE_V34_AVAILABLE = 0x800,
234 V150_1_JM_MODULATION_MODE_V34_HALF_DUPLEX_AVAILABLE = 0x400,
235 V150_1_JM_MODULATION_MODE_V32_V32bis_AVAILABLE = 0x200,
236 V150_1_JM_MODULATION_MODE_V22_V22bis_AVAILABLE = 0x100,
237 V150_1_JM_MODULATION_MODE_V17_AVAILABLE = 0x080,
238 V150_1_JM_MODULATION_MODE_V29_AVAILABLE = 0x040,
239 V150_1_JM_MODULATION_MODE_V27ter_AVAILABLE = 0x020,
240 V150_1_JM_MODULATION_MODE_V26ter_AVAILABLE = 0x010,
241 V150_1_JM_MODULATION_MODE_V26bis_AVAILABLE = 0x008,
242 V150_1_JM_MODULATION_MODE_V23_AVAILABLE = 0x004,
243 V150_1_JM_MODULATION_MODE_V23_HALF_DUPLEX_AVAILABLE = 0x002,
244 V150_1_JM_MODULATION_MODE_V21_AVAILABLE = 0x001
245};
246
247enum v150_1_jm_protocol_e
248{
249 V150_1_JM_PROTOCOL_V42_LAPM = (0x4 << 9)
250};
251
252enum v150_1_jm_access_e
253{
254 V150_1_JM_ACCESS_CALL_DCE_CELLULAR = (0x4 << 9),
255 V150_1_JM_ACCESS_ANSWER_DCE_CELLULAR = (0x2 << 9),
256 V150_1_JM_ACCESS_DCE_DIGITAL_NETWORK = (0x1 << 9)
257};
258
259enum v150_1_jm_pcm_mode_e
260{
261 V150_1_JM_PCM_V90_V92_ANALOGUE_MODEM_AVAILABLE = (0x4 << 9),
262 V150_1_JM_PCM_V90_V92_DIGITAL_MODEM_AVAILABLE = (0x2 << 9),
263 V150_1_JM_PCM_V91_MODEM_AVAILABLE = (0x1 << 9)
264};
265
266enum v150_1_selmod_e
267{
268 V150_1_SELMOD_NULL = 0,
269 V150_1_SELMOD_V92 = 1,
270 V150_1_SELMOD_V91 = 2,
271 V150_1_SELMOD_V90 = 3,
272 V150_1_SELMOD_V34 = 4,
273 V150_1_SELMOD_V32bis = 5,
274 V150_1_SELMOD_V32 = 6,
275 V150_1_SELMOD_V22bis = 7,
276 V150_1_SELMOD_V22 = 8,
277 V150_1_SELMOD_V17 = 9,
278 V150_1_SELMOD_V29 = 10,
279 V150_1_SELMOD_V27ter = 11,
280 V150_1_SELMOD_V26ter = 12,
281 V150_1_SELMOD_V26bis = 13,
282 V150_1_SELMOD_V23 = 14,
283 V150_1_SELMOD_V21 = 15,
284 V150_1_SELMOD_BELL212 = 16,
285 V150_1_SELMOD_BELL103 = 17,
286 V150_1_SELMOD_VENDOR_MIN = 18,
287 V150_1_SELMOD_VENDOR_MAX = 30
288};
289
290enum v150_1_symbol_rate_e
291{
292 V150_1_SYMBOL_RATE_NULL = 0,
293 V150_1_SYMBOL_RATE_600 = 1,
294 V150_1_SYMBOL_RATE_1200 = 2,
295 V150_1_SYMBOL_RATE_1600 = 3,
296 V150_1_SYMBOL_RATE_2400 = 4,
297 V150_1_SYMBOL_RATE_2743 = 5,
298 V150_1_SYMBOL_RATE_3000 = 6,
299 V150_1_SYMBOL_RATE_3200 = 7,
300 V150_1_SYMBOL_RATE_3429 = 8,
301 V150_1_SYMBOL_RATE_8000 = 9
302};
303
304enum v150_1_compress_e
305{
306 V150_1_COMPRESS_NEITHER_WAY = 0,
307 V150_1_COMPRESS_TX_ONLY = 1,
308 V150_1_COMPRESS_RX_ONLY = 2,
309 V150_1_COMPRESS_BIDIRECTIONAL = 3
310};
311
312enum v150_1_compression_e
313{
314 V150_1_COMPRESSION_NONE = 0,
315 V150_1_COMPRESSION_V42BIS = 1,
316 V150_1_COMPRESSION_V44 = 2,
317 V150_1_COMPRESSION_MNP5 = 3
318};
319
320enum v150_1_error_correction_e
321{
322 V150_1_ERROR_CORRECTION_NONE = 0,
323 V150_1_ERROR_CORRECTION_V42_LAPM = 1,
324 V150_1_ERROR_CORRECTION_V42_ANNEX_A = 2 /* Annex A is no longer in V.42, so this should be obsolete */
325};
326
327enum v150_1_break_source_e
328{
329 V150_1_BREAK_SOURCE_V42_LAPM = 0,
330 V150_1_BREAK_SOURCE_V42_ANNEX_A = 1, /* Annex A is no longer in V.42, so this should be obsolete */
331 V150_1_BREAK_SOURCE_V14 = 2
332};
333
334enum v150_1_break_type_e
335{
336 V150_1_BREAK_TYPE_NOT_APPLICABLE = 0,
337 V150_1_BREAK_TYPE_DESTRUCTIVE_EXPEDITED = 1,
338 V150_1_BREAK_TYPE_NON_DESTRUCTIVE_EXPEDITED = 2,
339 V150_1_BREAK_TYPE_NON_DESTRUCTIVE_NON_EXPEDITED = 3
340};
341
342enum v150_1_mr_event_id_e
343{
344 V150_1_MR_EVENT_ID_NULL = 0,
345 V150_1_MR_EVENT_ID_RATE_RENEGOTIATION = 1,
346 V150_1_MR_EVENT_ID_RETRAIN = 2,
347 V150_1_MR_EVENT_ID_PHYSUP = 3
348};
349
350enum v150_1_mr_event_reason_e
351{
352 V150_1_MR_EVENT_REASON_NULL = 0,
353 V150_1_MR_EVENT_REASON_INITIATION = 1,
354 V150_1_MR_EVENT_REASON_RESPONDING = 2
355};
356
357/* The cleardown reasons here should match the ones for SSE */
358enum v150_1_cleardown_reason_e
359{
360 V150_1_CLEARDOWN_REASON_UNKNOWN = 0,
361 V150_1_CLEARDOWN_REASON_PHYSICAL_LAYER_RELEASE = 1, /* Data pump release */
362 V150_1_CLEARDOWN_REASON_LINK_LAYER_DISCONNECT = 2, /* Receiving a V.42 DISC */
363 V150_1_CLEARDOWN_REASON_DATA_COMPRESSION_DISCONNECT = 3,
364 V150_1_CLEARDOWN_REASON_ABORT = 4, /* As specified in SDL */
365 V150_1_CLEARDOWN_REASON_ON_HOOK = 5, /* Gateway receives on-hook from an end-point */
366 V150_1_CLEARDOWN_REASON_NETWORK_LAYER_TERMINATION = 6,
367 V150_1_CLEARDOWN_REASON_ADMINISTRATIVE = 7 /* Operator action at gateway */
368};
369
370enum v150_1_data_bits_e
371{
372 V150_1_DATA_BITS_5 = 0,
373 V150_1_DATA_BITS_6 = 1,
374 V150_1_DATA_BITS_7 = 2,
375 V150_1_DATA_BITS_8 = 3
376};
377
378enum v150_1_parity_e
379{
380 V150_1_PARITY_UNKNOWN = 0,
381 V150_1_PARITY_NONE = 1,
382 V150_1_PARITY_EVEN = 2,
383 V150_1_PARITY_ODD = 3,
384 V150_1_PARITY_SPACE = 4,
385 V150_1_PARITY_MARK = 5
386 /* Values 6 and 7 are reserved */
387};
388
389enum v150_1_stop_bits_e
390{
391 V150_1_STOP_BITS_1 = 0,
392 V150_1_STOP_BITS_2 = 1
393 /* Values 2 and 3 are reserved */
394};
395
396enum v150_1_state_e
397{
398 V150_1_STATE_IDLE = 0,
399 V150_1_STATE_INITED = 1,
400 /* RETRAIN means the modem has detected a poor quality connection and is retraining. */
401 V150_1_STATE_RETRAIN = 2,
402 /* RATE_RENEGOTIATION means the modem is trying to reneogiate the physical layer. */
403 V150_1_STATE_RATE_RENEGOTIATION = 3,
404 /* PHYSUP means the modem-to-modem link has been established. It does NOT mean
405 an end to end connection has been established, as this state occurs before any
406 error correction or compression has been negotiated. */
407 V150_1_STATE_PHYSUP = 4,
408 /* CONNECTED means a full end to end link has been established, and data may be sent
409 and received. */
410 V150_1_STATE_CONNECTED = 5
411};
412
413/* Table C.1/V.150.1 plus amendments */
414enum v150_1_media_states_e
415{
416 V150_1_MEDIA_STATE_ITU_RESERVED_0 = 0, /* Reserved for future use by ITU-T */
417 V150_1_MEDIA_STATE_INITIAL_AUDIO = 1, /* Initial Audio */
418 V150_1_MEDIA_STATE_VOICE_BAND_DATA = 2, /* Voice Band Data (VBD) */
419 V150_1_MEDIA_STATE_MODEM_RELAY = 3, /* Modem Relay */
420 V150_1_MEDIA_STATE_FAX_RELAY = 4, /* Fax Relay */
421 V150_1_MEDIA_STATE_TEXT_RELAY = 5, /* Text Relay */
422 V150_1_MEDIA_STATE_TEXT_PROBE = 6, /* Text Probe (Amendment 2) */
423 V150_1_MEDIA_STATE_ITU_RESERVED_MIN = 7, /* Start of ITU reserved range */
424 V150_1_MEDIA_STATE_ITU_RESERVED_MAX = 31, /* End of ITU reserved range */
425 V150_1_MEDIA_STATE_RESERVED_MIN = 32, /* Start of vendor defined reserved range */
426 V150_1_MEDIA_STATE_RESERVED_MAX = 63, /* End of vendor defined reserved range */
427 V150_1_MEDIA_STATE_INDETERMINATE = 64 /* Indeterminate */
428};
429
430/* Definitions for the mrmods field used in the SDP which controls V.150.1 */
431enum v150_1_mrmods_e
432{
433 V150_1_MRMODS_V34 = 1,
434 V150_1_MRMODS_V34_HALF_DUPLEX = 2,
435 V150_1_MRMODS_V32BIS = 3,
436 V150_1_MRMODS_V22BIS = 4,
437 V150_1_MRMODS_V17 = 5,
438 V150_1_MRMODS_V29_HALF_DUPLEX = 6,
439 V150_1_MRMODS_V27TER = 7,
440 V150_1_MRMODS_V26TER = 8,
441 V150_1_MRMODS_V26BIS = 9,
442 V150_1_MRMODS_V23_DUPLEX = 10,
443 V150_1_MRMODS_V23_HALF_DUPLEX = 11,
444 V150_1_MRMODS_V21 = 12,
445 V150_1_MRMODS_V90_ANALOGUE = 13,
446 V150_1_MRMODS_V90_DIGITAL = 14,
447 V150_1_MRMODS_V91 = 15,
448 V150_1_MRMODS_V92_ANALOGUE = 16,
449 V150_1_MRMODS_V92_DIGITAL = 17
450};
451
452enum v150_1_status_reason_e
453{
454 V150_1_STATUS_REASON_NULL = 0,
455 V150_1_STATUS_REASON_MEDIA_STATE_CHANGED = 1,
456 V150_1_STATUS_REASON_CONNECTION_STATE_CHANGED = 2,
457 V150_1_STATUS_REASON_DATA_FORMAT_CHANGED = 3,
458 V150_1_STATUS_REASON_BREAK_RECEIVED = 4,
459 V150_1_STATUS_REASON_RATE_RETRAIN_RECEIVED = 5,
460 V150_1_STATUS_REASON_RATE_RENEGOTIATION_RECEIVED = 6,
461 V150_1_STATUS_REASON_BUSY_CHANGED = 7,
462 V150_1_STATUS_REASON_CONNECTION_STATE_PHYSUP = 8,
463 V150_1_STATUS_REASON_CONNECTION_STATE_CONNECTED = 9
464};
465
466#if defined(__cplusplus)
467extern "C" {
468#endif
469
470SPAN_DECLARE(int) v150_1_state_machine(v150_1_state_t *s, int signal, const uint8_t *msg, int len);
471
472SPAN_DECLARE(const char *) v150_1_msg_id_to_str(int msg_id);
473
474SPAN_DECLARE(const char *) v150_1_data_bits_to_str(int code);
475
476SPAN_DECLARE(const char *) v150_1_parity_to_str(int code);
477
478SPAN_DECLARE(const char *) v150_1_stop_bits_to_str(int code);
479
480SPAN_DECLARE(const char *) v150_1_mr_event_type_to_str(int type);
481
482SPAN_DECLARE(const char *) v150_1_cleardown_reason_to_str(int type);
483
484SPAN_DECLARE(const char *) v150_1_symbol_rate_to_str(int code);
485
486SPAN_DECLARE(const char *) v150_1_modulation_to_str(int modulation);
487
488SPAN_DECLARE(const char *) v150_1_compression_to_str(int compression);
489
490SPAN_DECLARE(const char *) v150_1_compression_direction_to_str(int direction);
491
492SPAN_DECLARE(const char *) v150_1_error_correction_to_str(int correction);
493
494SPAN_DECLARE(const char *) v150_1_break_source_to_str(int source);
495
496SPAN_DECLARE(const char *) v150_1_break_type_to_str(int type);
497
498SPAN_DECLARE(const char *) v150_1_state_to_str(int state);
499
500SPAN_DECLARE(const char *) v150_1_status_reason_to_str(int status);
501
502SPAN_DECLARE(const char *) v150_1_jm_category_to_str(int category);
503
504SPAN_DECLARE(const char *) v150_1_jm_info_modulation_to_str(int modulation);
505
506SPAN_DECLARE(const char *) v150_1_signal_to_str(int modulation);
507
508SPAN_DECLARE(const char *) v150_1_media_state_to_str(int modulation);
509
510SPAN_DECLARE(int) v150_1_set_parity(v150_1_state_t *s, int mode);
511
512SPAN_DECLARE(int) v150_1_set_stop_bits(v150_1_state_t *s, int bits);
513
514SPAN_DECLARE(int) v150_1_set_bits_per_character(v150_1_state_t *s, int bits);
515
516SPAN_DECLARE(int) v150_1_tx_null(v150_1_state_t *s);
517
518SPAN_DECLARE(int) v150_1_tx_init(v150_1_state_t *s);
519
520SPAN_DECLARE(int) v150_1_tx_xid_xchg(v150_1_state_t *s);
521
522SPAN_DECLARE(int) v150_1_tx_jm_info(v150_1_state_t *s);
523
524SPAN_DECLARE(int) v150_1_tx_start_jm(v150_1_state_t *s);
525
526SPAN_DECLARE(int) v150_1_tx_connect(v150_1_state_t *s);
527
528SPAN_DECLARE(int) v150_1_tx_break(v150_1_state_t *s, int source, int type, int duration);
529
530SPAN_DECLARE(int) v150_1_tx_break_ack(v150_1_state_t *s);
531
532SPAN_DECLARE(int) v150_1_tx_mr_event(v150_1_state_t *s, int event_id);
533
534SPAN_DECLARE(int) v150_1_tx_cleardown(v150_1_state_t *s, int reason);
535
536SPAN_DECLARE(int) v150_1_tx_prof_xchg(v150_1_state_t *s);
537
538SPAN_DECLARE(int) v150_1_tx_info_stream(v150_1_state_t *s, const uint8_t buf[], int len);
539
540SPAN_DECLARE(int) v150_1_process_rx_msg(v150_1_state_t *s, int chan, int seq_no, const uint8_t buf[], int len);
541
542SPAN_DECLARE(int) v150_1_set_local_tc_payload_bytes(v150_1_state_t *s, int channel, int max_len);
543
544SPAN_DECLARE(int) v150_1_get_local_tc_payload_bytes(v150_1_state_t *s, int channel);
545
546SPAN_DECLARE(int) v150_1_set_info_stream_tx_mode(v150_1_state_t *s, int channel, int msg_id);
547
548SPAN_DECLARE(int) v150_1_set_info_stream_msg_priorities(v150_1_state_t *s, int msg_ids[]);
549
550SPAN_DECLARE(int) v150_1_set_local_busy(v150_1_state_t *s, bool busy);
551
552SPAN_DECLARE(bool) v150_1_get_far_busy_status(v150_1_state_t *s);
553
554SPAN_DECLARE(int) v150_1_set_modulation(v150_1_state_t *s, int modulation);
555
556SPAN_DECLARE(int) v150_1_set_compression_direction(v150_1_state_t *s, int compression_direction);
557
558SPAN_DECLARE(int) v150_1_set_compression(v150_1_state_t *s, int compression);
559
560SPAN_DECLARE(int) v150_1_set_compression_parameters(v150_1_state_t *s,
561 int tx_dictionary_size,
562 int rx_dictionary_size,
563 int tx_string_length,
564 int rx_string_length,
565 int tx_history_size,
566 int rx_history_size);
567
568SPAN_DECLARE(int) v150_1_set_error_correction(v150_1_state_t *s, int error_correction);
569
570SPAN_DECLARE(int) v150_1_set_tx_symbol_rate(v150_1_state_t *s, bool enable, int rate);
571
572SPAN_DECLARE(int) v150_1_set_rx_symbol_rate(v150_1_state_t *s, bool enable, int rate);
573
574SPAN_DECLARE(int) v150_1_set_tx_data_signalling_rate(v150_1_state_t *s, int rate);
575
576SPAN_DECLARE(int) v150_1_set_rx_data_signalling_rate(v150_1_state_t *s, int rate);
577
578SPAN_DECLARE(void) v150_1_set_near_cdscselect(v150_1_state_t *s, v150_1_cdscselect_t select);
579
580SPAN_DECLARE(void) v150_1_set_far_cdscselect(v150_1_state_t *s, v150_1_cdscselect_t select);
581
582SPAN_DECLARE(void) v150_1_set_near_modem_relay_gateway_type(v150_1_state_t *s, v150_1_modem_relay_gateway_type_t type);
583
584SPAN_DECLARE(void) v150_1_set_far_modem_relay_gateway_type(v150_1_state_t *s, v150_1_modem_relay_gateway_type_t type);
585
586SPAN_DECLARE(void) v150_1_set_rfc4733_mode(v150_1_state_t *s, bool rfc4733_preferred);
587
588SPAN_DECLARE(void) v150_1_set_call_discrimination_timeout(v150_1_state_t *s, int timeout);
589
590SPAN_DECLARE(int) v150_1_timer_expired(v150_1_state_t *s, span_timestamp_t now);
591
592SPAN_DECLARE(logging_state_t *) v150_1_get_logging_state(v150_1_state_t *s);
593
594SPAN_DECLARE(int) v150_1_test_rx_sprt_msg(v150_1_state_t *s, int chan, int seq_no, const uint8_t buf[], int len);
595
596/*! Initialise a V.150.1 context. This must be called before the first use of the context, to
597 initialise its contents.
598 \brief Initialise a V.150.1 context.
599 \param s The V.150.1 context.
600 \param sprt_tx_packet_handler Callback routine to handle the transmission of SPRT packets.
601 \param sprt_tx_packet_handler_user_data An opaque pointer, passed in calls to the SPRT packet tx handler
602 \param sprt_tx_payload_type The payload type for transmitted SPRT packets.
603 \param sprt_rx_payload_type The payload type expected in received SPRT packets.
604 \param sse_tx_packet_handler Callback routine to handle the transmission of SSE packets.
605 \param sse_tx_packet_user_data An opaque pointer, passed in calls to the SSE tx packet handler
606 \param v150_1_timer_handler Callback routine to control SPRT, SSE and overall V.150.1 timers.
607 \param v150_1_timer_user_data An opaque pointer, passed in calls to the timer handler
608 \param rx_data_handler Callback routine to handle the octet stream from an SPRT interaction
609 \param rx_data_handler_user_data An opaque pointer, passed in calls to the rx octet handler.
610 \param rx_status_report_handler Callback routine for V.150.1 protocol status reports
611 \param rx_status_report_user_data An opaque pointer, passed in calls to the rx status report handler
612 \param spe_signal_handler
613 \param spe_signal_handler_user_data
614 \return A pointer to the V.150.1 context, or NULL if there was a problem. */
615SPAN_DECLARE(v150_1_state_t *) v150_1_init(v150_1_state_t *s,
616 sprt_tx_packet_handler_t sprt_tx_packet_handler,
617 void *sprt_tx_packet_handler_user_data,
618 uint8_t sprt_tx_payload_type,
619 uint8_t sprt_rx_payload_type,
620 v150_1_sse_tx_packet_handler_t sse_tx_packet_handler,
621 void *sse_tx_packet_user_data,
622 v150_1_timer_handler_t v150_1_timer_handler,
623 void *v150_1_timer_user_data,
624 v150_1_rx_data_handler_t rx_data_handler,
625 void *rx_data_handler_user_data,
626 v150_1_rx_status_report_handler_t rx_status_report_handler,
627 void *rx_status_report_user_data,
628 v150_1_spe_signal_handler_t spe_signal_handler,
629 void *spe_signal_handler_user_data);
630
631SPAN_DECLARE(int) v150_1_release(v150_1_state_t *s);
632
633SPAN_DECLARE(int) v150_1_free(v150_1_state_t *s);
634
635#if defined(__cplusplus)
636}
637#endif
638#endif
639/*- End of file ------------------------------------------------------------*/
struct logging_state_s logging_state_t
Definition logging.h:72
Definition private/v150_1.h:301
Definition v150_1.h:31