comparison src/g23m-aci/aci/cmh_t30r.c @ 162:53929b40109c

src/g23m-aci: initial import from TCS3.2/LoCosto
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 11 Oct 2016 02:02:43 +0000
parents
children
comparison
equal deleted inserted replaced
161:4557e2a9c18e 162:53929b40109c
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : CMH_T30R
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : This module defines the functions which are responsible
18 | for the responses of the protocol stack adapter for
19 | T 30.
20 +-----------------------------------------------------------------------------
21 */
22
23 #if defined (DTI) || defined (FF_FAX)
24
25 #ifndef CMH_T30R_C
26 #define CMH_T30R_C
27 #endif
28
29 #include "aci_all.h"
30 /*==== INCLUDES ===================================================*/
31 #include "dti.h" /* functionality of the dti library */
32 #include "aci_cmh.h"
33 #include "ati_cmd.h"
34 #include "aci_cmd.h"
35 #include "aci_io.h"
36
37 #include "aci_lst.h"
38
39 #ifdef FAX_AND_DATA
40 #include "aci_fd.h"
41 #endif
42
43 #include "dti_conn_mng.h"
44 #include "dti_cntrl_mng.h"
45
46 #include "aci.h"
47 #include "psa.h"
48 #include "psa_t30.h"
49 #include "psa_cc.h"
50 #include "cmh.h"
51 #include "cmh_t30.h"
52 #include "cmh_cc.h"
53
54 #include "p_gsmcom.val" /* error cause originating entities */
55 #include "p_fad.val" /* causes values */
56
57 #include "cmh_ra.h"
58
59 #ifdef UART
60 #include "psa_uart.h"
61 #include "cmh_uart.h"
62 #endif
63 #ifdef FF_PSI
64 #include "psa_psi.h"
65 #include "cmh_psi.h"
66 #endif /*FF_PSI*/
67 /*==== CONSTANTS ==================================================*/
68
69 /*==== TYPES ======================================================*/
70
71 /*==== EXPORT =====================================================*/
72
73 #ifdef _SIMULATE_FAX_DATA_
74 EXTERN void TST_rstSimData( void );
75 #endif /*_SIMULATE_FAX_DATA_*/
76
77 /*==== VARIABLES ==================================================*/
78
79 LOCAL BOOL HDLCfst = TRUE; /* flags first occurence of HDLC frame */
80
81 /*==== FUNCTIONS ==================================================*/
82 /*
83 +-------------------------------------------------------------------+
84 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
85 | ROUTINE : cmhT30_Activated |
86 +-------------------------------------------------------------------+
87
88 PURPOSE : T30 entity activated, connection established
89
90 */
91
92 GLOBAL void cmhT30_Activated ( void )
93 {
94 #ifdef FF_PSI
95 T_ACI_DTI_PRC_PSI *src_infos = find_element (psi_src_params,
96 (UBYTE)t30EntStat.entOwn, cmhPSItest_srcId);
97 #endif /*FF_PSI*/
98 TRACE_FUNCTION ("cmhT30_Activated()");
99
100 io_setDCD (t30EntStat.entOwn, IO_DCD_ON);
101 #ifdef FF_PSI
102 if (src_infos NEQ NULL)
103 psaPSI_ESCAPEreq( (UBYTE)t30EntStat.entOwn, ESC_DETECTION_OFF);
104 else
105 #endif /*FF_PSI*/
106
107 #ifdef UART
108 psaUART_ESCAPEreq( (UBYTE)t30EntStat.entOwn, UART_ESC_DETECTION_OFF );
109 #endif
110 /* inform call control about successful operation */
111
112 #ifdef _SIMULATE_FAX_DATA_
113 TST_rstSimData();
114 #endif /*_SIMULATE_FAX_DATA_*/
115
116 psaT30_Config( );
117
118 cmhCC_T30_Activated();
119
120 t30ShrdPrm.faxStat = FS_IDL;
121 }
122 /*
123 +-------------------------------------------------------------------+
124 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
125 | ROUTINE : cmhT30_CapRmtSite |
126 +-------------------------------------------------------------------+
127
128 PURPOSE : Capabilities recieved from remote site.
129
130 */
131
132 GLOBAL void cmhT30_CapRmtSite ( void )
133 {
134 UBYTE strBuf[CSI_LEN]; /* string buffer */
135 UBYTE cmdBuf; /* buffers current command */
136
137 TRACE_FUNCTION ("cmhT30_CapRmtSite()");
138 /*
139 *-------------------------------------------------------------------
140 * determine call type
141 *-------------------------------------------------------------------
142 */
143 switch( psaCC_ctb(t30ShrdPrm.cId)->calType )
144 {
145 case( CT_MOC ):
146 /*
147 *---------------------------------------------------------------
148 * check for DCS frame
149 *---------------------------------------------------------------
150 */
151 if( t30ShrdPrm.hdlc_rcv.v_dcs EQ TRUE )
152 {
153 /*--- send non-standard set-up information ---*/
154 if( t30ShrdPrm.hdlc_rcv.c_nss NEQ 0 )
155 {
156 R_AT( RAT_FNS, t30EntStat.entOwn )
157 ( t30ShrdPrm.hdlc_rcv.c_nss, t30ShrdPrm.hdlc_rcv.nss );
158 }
159 /*--- send password information ---*/
160 if( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FAPpwd EQ
161 FAP_VAL_Enabled AND
162 t30ShrdPrm.hdlc_rcv.c_pwd NEQ 0 )
163 {
164 memcpy
165 (
166 (char *) strBuf,
167 (char *) t30ShrdPrm.hdlc_rcv.pwd,
168 t30ShrdPrm.hdlc_rcv.c_pwd
169 );
170
171 strBuf[t30ShrdPrm.hdlc_rcv.c_pwd] = '\0';
172
173 R_AT( RAT_FPW, t30EntStat.entOwn )
174 ( strBuf );
175 }
176
177 /*--- send subaddress information ---*/
178 if( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FAPsub EQ
179 FAP_VAL_Enabled AND
180 t30ShrdPrm.hdlc_rcv.c_sub NEQ 0 )
181 {
182 memcpy
183 (
184 (char *) strBuf,
185 (char *) t30ShrdPrm.hdlc_rcv.sub,
186 t30ShrdPrm.hdlc_rcv.c_sub
187 );
188
189 strBuf[t30ShrdPrm.hdlc_rcv.c_sub] = '\0';
190
191 R_AT( RAT_FSA, t30EntStat.entOwn )
192 ( strBuf );
193 }
194
195 /*--- send transmitting subscriber information ---*/
196 if( t30ShrdPrm.hdlc_rcv.c_tsi NEQ 0 )
197 {
198 memcpy
199 (
200 (char *) strBuf,
201 (char *) t30ShrdPrm.hdlc_rcv.tsi,
202 t30ShrdPrm.hdlc_rcv.c_tsi
203 );
204
205 strBuf[t30ShrdPrm.hdlc_rcv.c_tsi] = '\0';
206
207 R_AT( RAT_FTI, t30EntStat.entOwn )
208 ( strBuf );
209 }
210
211 /*--- send DCS frame information ---*/
212 R_AT( RAT_FCS, t30EntStat.entOwn )
213 ( t30NgtPrms.FCSvr = cmhT30_GetResolution
214 ( &t30ShrdPrm.hdlc_rcv.dcs, FRT_DCS),
215 t30NgtPrms.FCSbr = cmhT30_GetBitRate
216 ( &t30ShrdPrm.hdlc_rcv.dcs, FRT_DCS),
217 t30NgtPrms.FCSwd = cmhT30_GetPageWidth
218 ( &t30ShrdPrm.hdlc_rcv.dcs),
219 t30NgtPrms.FCSln = cmhT30_GetPageLength
220 ( &t30ShrdPrm.hdlc_rcv.dcs),
221 t30NgtPrms.FCSdf = cmhT30_GetDataComp
222 ( &t30ShrdPrm.hdlc_rcv.dcs),
223 t30NgtPrms.FCSec = cmhT30_GetErrCorr
224 ( &t30ShrdPrm.hdlc_rcv.dcs),
225 t30NgtPrms.FCSbf = cmhT30_GetFileTrnsfr
226 ( &t30ShrdPrm.hdlc_rcv.dcs),
227 t30NgtPrms.FCSst = cmhT30_GetScanTime
228 ( &t30ShrdPrm.hdlc_rcv.dcs),
229 t30NgtPrms.FCSjp = cmhT30_GetJPEG
230 ( &t30ShrdPrm.hdlc_rcv.dcs) );
231
232 /*--- check for T30 modification ---*/
233 if( cmhT30_Chk4TCHAdpt() )
234 {
235 ccShrdPrm.datStat = DS_TCH_MDF; /* wait for TCH change */
236 }
237 else
238 {
239 if( cmhT30_Modify() NEQ AT_EXCT )
240 {
241 ccShrdPrm.datStat = DS_DSC_REQ;
242 cmhT30_Deactivate();
243 }
244 }
245 }
246
247 /*
248 *---------------------------------------------------------------
249 * check for DIS frame
250 *---------------------------------------------------------------
251 */
252 if( t30ShrdPrm.hdlc_rcv.v_dis EQ TRUE )
253 {
254 /*--- a DIS frame which is in context with the
255 FDT command, forces a DCS retransmission and quit ---*/
256 if( t30EntStat.curCmd EQ AT_CMD_FDT )
257 {
258 cmhT30_SendCaps ( t30EntStat.entOwn, FRT_DCS );
259 break;
260 }
261
262 /*--- send non-standard facility information ---*/
263 if( t30ShrdPrm.hdlc_rcv.c_nsf NEQ 0 )
264 {
265 R_AT( RAT_FNF, t30EntStat.entOwn )
266 ( t30ShrdPrm.hdlc_rcv.c_nsf, t30ShrdPrm.hdlc_rcv.nsf );
267 }
268
269 /*--- send calling subscriber information ---*/
270 if( t30ShrdPrm.hdlc_rcv.c_csi NEQ 0 )
271 {
272 memcpy
273 (
274 (char *) strBuf,
275 (char *) t30ShrdPrm.hdlc_rcv.csi,
276 t30ShrdPrm.hdlc_rcv.c_csi
277 );
278
279 strBuf[t30ShrdPrm.hdlc_rcv.c_csi] = '\0';
280
281 R_AT( RAT_FCI, t30EntStat.entOwn )
282 ( strBuf );
283 }
284
285 /*--- send DIS frame information ---*/
286 R_AT( RAT_FIS, t30EntStat.entOwn )
287 ( cmhT30_GetResolution( &t30ShrdPrm.hdlc_rcv.dis, FRT_DIS ),
288 cmhT30_GetBitRate ( &t30ShrdPrm.hdlc_rcv.dis, FRT_DIS ),
289 cmhT30_GetPageWidth ( &t30ShrdPrm.hdlc_rcv.dis),
290 cmhT30_GetPageLength( &t30ShrdPrm.hdlc_rcv.dis),
291 cmhT30_GetDataComp ( &t30ShrdPrm.hdlc_rcv.dis),
292 cmhT30_GetErrCorr ( &t30ShrdPrm.hdlc_rcv.dis),
293 cmhT30_GetFileTrnsfr( &t30ShrdPrm.hdlc_rcv.dis),
294 cmhT30_GetScanTime ( &t30ShrdPrm.hdlc_rcv.dis),
295 cmhT30_GetJPEG ( &t30ShrdPrm.hdlc_rcv.dis) );
296
297 /*--- send polling capability information ---*/
298 if( t30ShrdPrm.hdlc_rcv.dis.ready_tx_fax EQ 1 AND
299 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FSPval EQ
300 FSP_VAL_PollEnable AND
301 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCRval EQ
302 FCR_VAL_RcvCap )
303 {
304 R_AT( RAT_FPO, t30EntStat.entOwn )();
305 }
306
307 /*--- release command state ---*/
308 switch( t30EntStat.curCmd )
309 {
310 case( AT_CMD_D ):
311
312 t30EntStat.curCmd = AT_CMD_NONE;
313 break;
314 }
315 }
316 break;
317
318 case( CT_MTC ):
319
320 /*
321 *---------------------------------------------------------------
322 * check for DCS frame
323 *---------------------------------------------------------------
324 */
325 if( t30ShrdPrm.hdlc_rcv.v_dcs EQ TRUE )
326 {
327 /*--- send non-standard set-up information ---*/
328 if( t30ShrdPrm.hdlc_rcv.c_nss NEQ 0 )
329 {
330 R_AT( RAT_FNS, t30EntStat.entOwn )
331 ( t30ShrdPrm.hdlc_rcv.c_nss, t30ShrdPrm.hdlc_rcv.nss );
332 }
333
334 /*--- send password information ---*/
335 if( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FAPpwd EQ
336 FAP_VAL_Enabled AND
337 t30ShrdPrm.hdlc_rcv.c_pwd NEQ 0 )
338 {
339 memcpy
340 (
341 (char *) strBuf,
342 (char *) t30ShrdPrm.hdlc_rcv.pwd,
343 t30ShrdPrm.hdlc_rcv.c_pwd
344 );
345
346 strBuf[t30ShrdPrm.hdlc_rcv.c_pwd] = '\0';
347
348 R_AT( RAT_FPW, t30EntStat.entOwn )
349 ( strBuf );
350 }
351
352 /*--- send subaddress information ---*/
353 if( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FAPsub EQ
354 FAP_VAL_Enabled AND
355 t30ShrdPrm.hdlc_rcv.c_sub NEQ 0 )
356 {
357 memcpy
358 (
359 (char *) strBuf,
360 (char *) t30ShrdPrm.hdlc_rcv.sub,
361 t30ShrdPrm.hdlc_rcv.c_sub
362 );
363
364 strBuf[t30ShrdPrm.hdlc_rcv.c_sub] = '\0';
365
366 R_AT( RAT_FSA, t30EntStat.entOwn )
367 ( strBuf );
368 }
369
370 /*--- send transmitting subscriber information ---*/
371 if( t30ShrdPrm.hdlc_rcv.c_tsi NEQ 0 )
372 {
373 memcpy
374 (
375 (char *) strBuf,
376 (char *) t30ShrdPrm.hdlc_rcv.tsi,
377 t30ShrdPrm.hdlc_rcv.c_tsi
378 );
379
380 strBuf[t30ShrdPrm.hdlc_rcv.c_tsi] = '\0';
381
382 R_AT( RAT_FTI, t30EntStat.entOwn )
383 ( strBuf );
384 }
385
386 /*--- send DCS frame information ---*/
387 R_AT( RAT_FCS, t30EntStat.entOwn )
388 ( t30NgtPrms.FCSvr = cmhT30_GetResolution
389 ( &t30ShrdPrm.hdlc_rcv.dcs, FRT_DCS),
390 t30NgtPrms.FCSbr = cmhT30_GetBitRate
391 ( &t30ShrdPrm.hdlc_rcv.dcs, FRT_DCS),
392 t30NgtPrms.FCSwd = cmhT30_GetPageWidth
393 ( &t30ShrdPrm.hdlc_rcv.dcs),
394 t30NgtPrms.FCSln = cmhT30_GetPageLength
395 ( &t30ShrdPrm.hdlc_rcv.dcs),
396 t30NgtPrms.FCSdf = cmhT30_GetDataComp
397 ( &t30ShrdPrm.hdlc_rcv.dcs),
398 t30NgtPrms.FCSec = cmhT30_GetErrCorr
399 ( &t30ShrdPrm.hdlc_rcv.dcs),
400 t30NgtPrms.FCSbf = cmhT30_GetFileTrnsfr
401 ( &t30ShrdPrm.hdlc_rcv.dcs),
402 t30NgtPrms.FCSst = cmhT30_GetScanTime
403 ( &t30ShrdPrm.hdlc_rcv.dcs),
404 t30NgtPrms.FCSjp = cmhT30_GetJPEG
405 ( &t30ShrdPrm.hdlc_rcv.dcs) );
406
407 /*--- check for T30 modification ---*/
408 if( cmhT30_Chk4TCHAdpt() )
409 {
410 ccShrdPrm.datStat = DS_TCH_MDF; /* wait for TCH change */
411 }
412 else
413 {
414 if( cmhT30_Modify() NEQ AT_EXCT )
415 {
416 ccShrdPrm.datStat = DS_DSC_REQ;
417 cmhT30_Deactivate();
418 }
419 }
420 }
421
422 /*
423 *---------------------------------------------------------------
424 * check for DTC frame
425 *---------------------------------------------------------------
426 */
427 else if( t30ShrdPrm.hdlc_rcv.v_dtc EQ TRUE )
428 {
429 /*--- DTC received but no polling document available ---*/
430 if( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FLPval EQ
431 FLP_VAL_NoPollDoc )
432 {
433 R_AT( RAT_FHS, t30EntStat.entOwn )
434 ( FHSstat = FHS_STAT_InvComrecCmd );
435
436 cmdBuf = t30EntStat.curCmd;
437 t30EntStat.curCmd = AT_CMD_NONE;
438
439 R_AT( RAT_OK, t30EntStat.entOwn )( cmdBuf );
440
441 cmhCC_T30_Failed();
442 return;
443 }
444
445 /*--- send non-standard facilities command ---*/
446 if( t30ShrdPrm.hdlc_rcv.c_nsc NEQ 0 )
447 {
448 R_AT( RAT_FNC, t30EntStat.entOwn )
449 ( t30ShrdPrm.hdlc_rcv.c_nsc, t30ShrdPrm.hdlc_rcv.nsc );
450 }
451
452 /*--- send password information ---*/
453 if( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FAPpwd EQ
454 FAP_VAL_Enabled AND
455 t30ShrdPrm.hdlc_rcv.c_pwd NEQ 0)
456 {
457 memcpy
458 (
459 (char *) strBuf,
460 (char *) t30ShrdPrm.hdlc_rcv.pwd,
461 t30ShrdPrm.hdlc_rcv.c_pwd
462 );
463
464 strBuf[t30ShrdPrm.hdlc_rcv.c_pwd] = '\0';
465
466 R_AT( RAT_FPW, t30EntStat.entOwn )
467 ( strBuf );
468 }
469
470 /*--- send selective polling information ---*/
471 if( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FAPsep EQ
472 FAP_VAL_Enabled AND
473 t30ShrdPrm.hdlc_rcv.c_sep NEQ 0)
474 {
475 memcpy
476 (
477 (char *) strBuf,
478 (char *) t30ShrdPrm.hdlc_rcv.sep,
479 t30ShrdPrm.hdlc_rcv.c_sep
480 );
481
482 strBuf[t30ShrdPrm.hdlc_rcv.c_sep] = '\0';
483
484 R_AT( RAT_FPA, t30EntStat.entOwn )
485 ( strBuf );
486 }
487
488 /*--- send calling subscriber information ---*/
489 if( t30ShrdPrm.hdlc_rcv.c_cig NEQ 0 )
490 {
491 memcpy
492 (
493 (char *) strBuf,
494 (char *) t30ShrdPrm.hdlc_rcv.cig,
495 t30ShrdPrm.hdlc_rcv.c_cig
496 );
497
498 strBuf[t30ShrdPrm.hdlc_rcv.c_cig] = '\0';
499
500 R_AT( RAT_FPI, t30EntStat.entOwn )
501 ( strBuf );
502 }
503
504 /*--- send DTC frame information ---*/
505 R_AT( RAT_FTC, t30EntStat.entOwn )
506 ( cmhT30_GetResolution( &t30ShrdPrm.hdlc_rcv.dtc, FRT_DTC),
507 cmhT30_GetBitRate ( &t30ShrdPrm.hdlc_rcv.dtc, FRT_DTC),
508 cmhT30_GetPageWidth ( &t30ShrdPrm.hdlc_rcv.dtc),
509 cmhT30_GetPageLength( &t30ShrdPrm.hdlc_rcv.dtc),
510 cmhT30_GetDataComp ( &t30ShrdPrm.hdlc_rcv.dtc),
511 cmhT30_GetErrCorr ( &t30ShrdPrm.hdlc_rcv.dtc),
512 cmhT30_GetFileTrnsfr( &t30ShrdPrm.hdlc_rcv.dtc),
513 cmhT30_GetScanTime ( &t30ShrdPrm.hdlc_rcv.dtc),
514 cmhT30_GetJPEG ( &t30ShrdPrm.hdlc_rcv.dtc) );
515 }
516
517 /*--- release command state ---*/
518 switch( t30EntStat.curCmd )
519 {
520 case( AT_CMD_A ):
521
522 t30EntStat.curCmd = AT_CMD_NONE;
523 break;
524
525 case( AT_CMD_FDR ):
526
527 cmhT30_StartFIT();
528 t30EntStat.curCmd = AT_CMD_NONE;
529 R_AT( RAT_OK, t30EntStat.entOwn )( AT_CMD_FDR );
530 return;
531 }
532 break;
533 }
534
535 /*
536 *-------------------------------------------------------------------
537 * inform call control about received capability parameter
538 *-------------------------------------------------------------------
539 */
540 if( t30ShrdPrm.faxStat EQ FS_IDL )
541 {
542 cmhCC_T30_RmtCaps();
543 }
544 return;
545 }
546
547 /*
548 +-------------------------------------------------------------------+
549 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
550 | ROUTINE : cmhL2R_Deactivated |
551 +-------------------------------------------------------------------+
552
553 PURPOSE : T30 entity deactivated, connection disconnected
554
555 */
556
557 GLOBAL void cmhT30_Deactivated ( void )
558 {
559 #ifdef FF_PSI
560 T_ACI_DTI_PRC_PSI *src_infos = find_element (psi_src_params,
561 (UBYTE)t30EntStat.entOwn, cmhPSItest_srcId);
562 #endif /*FF_PSI*/
563 TRACE_FUNCTION ("cmhT30_Deactivated()");
564 io_setDCD (t30EntStat.entOwn, IO_DCD_OFF);
565 #ifdef FF_PSI
566 if (src_infos NEQ NULL)
567 psaPSI_ESCAPEreq( (UBYTE)t30EntStat.entOwn, ESC_DETECTION_ON);
568 else
569 #endif /*FF_PSI*/
570 #ifdef UART
571 psaUART_ESCAPEreq( (UBYTE)t30EntStat.entOwn, UART_ESC_DETECTION_ON );
572 #endif
573 /* inform call control about disconnection */
574 HDLCfst = TRUE;
575
576 cmhCC_T30_Deactivated();
577
578 t30ShrdPrm.faxStat = NO_VLD_FS;
579 t30ShrdPrm.cId = NO_ENTRY;
580 t30EntStat.curCmd = AT_CMD_NONE;
581
582 pageSentFlg = TRUE;
583 DTCSentFlg = FALSE;
584 PRIRcvdFlg = FALSE;
585
586 cmhT30_StopFIT();
587 }
588
589 /*
590 +-------------------------------------------------------------------+
591 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
592 | ROUTINE : cmhT30_Disconnect |
593 +-------------------------------------------------------------------+
594
595 PURPOSE : request to disconnect
596
597 */
598
599 GLOBAL void cmhT30_Disconnect ( void )
600 {
601
602 TRACE_FUNCTION ("cmhT30_Disconnect()");
603
604 /* clear FAX call */
605 t30EntStat.curCmd = AT_CMD_NONE;
606
607 R_AT( RAT_FHS, t30EntStat.entOwn )( FHSstat = FHS_STAT_NormEnd );
608
609 /* pretends an orderly FAX abort */
610 psaCC_ctb(t30ShrdPrm.cId)->curCmd = AT_CMD_FKS;
611 psaCC_ctb(t30ShrdPrm.cId)->curSrc = t30EntStat.entOwn;
612
613 cmhT30_Deactivate();
614 }
615
616 /*
617 +-------------------------------------------------------------------+
618 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
619 | ROUTINE : cmhT30_Disconnected |
620 +-------------------------------------------------------------------+
621
622 PURPOSE : T30 entity deactivated
623
624 */
625
626 GLOBAL void cmhT30_Disconnected ( void )
627 {
628 TRACE_FUNCTION ("cmhT30_Disconnected()");
629
630 /* clear FAX call */
631 switch( t30EntStat.curCmd )
632 {
633 case( AT_CMD_FKS ):
634
635 t30EntStat.curCmd = AT_CMD_NONE;
636 break;
637 }
638
639 R_AT( RAT_FHS, t30EntStat.entOwn )( FHSstat = FHS_STAT_NormEnd );
640
641 psaCC_ctb(t30ShrdPrm.cId)->curCmd = AT_CMD_FKS;
642 psaCC_ctb(t30ShrdPrm.cId)->curSrc = t30EntStat.entOwn;
643
644 cmhT30_Deactivate();
645 }
646
647 /*
648 +-------------------------------------------------------------------+
649 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
650 | ROUTINE : cmhT30_Failure |
651 +-------------------------------------------------------------------+
652
653 PURPOSE : T30 entity failure, connection will be disconnected
654
655 */
656
657 GLOBAL void cmhT30_Failure ( void )
658 {
659 TRACE_FUNCTION ("cmhT30_Failure()");
660
661 /*
662 *-------------------------------------------------------------------
663 * general failure indication
664 *-------------------------------------------------------------------
665 */
666 TRACE_EVENT_P1("T30/FAD ERROR: 0x%04x", t30ShrdPrm.err_cause);
667
668 switch (GET_CAUSE_ORIGIN_ENTITY(t30ShrdPrm.err_cause))
669 {
670 case (FAD_ORIGINATING_ENTITY): /* FAD error cause */
671
672 if ( ERR_REM_FAD < t30ShrdPrm.err_cause AND t30ShrdPrm.err_cause < ERR_LOCAL_FAD)
673 {
674 FHSstat = FHS_STAT_FADRmtStnErr;
675 }
676 else if (ERR_LOCAL_FAD < t30ShrdPrm.err_cause AND t30ShrdPrm.err_cause < ERR_OWN_FAD)
677 {
678 switch (t30ShrdPrm.err_cause)
679 {
680 case ERR_LOCAL_DATA_MSG_UFL:
681 FHSstat = FHS_STAT_DteDceDataUndrflw;
682 break;
683 default:
684 FHSstat = FHS_STAT_FADLclStnErr;
685 break;
686 }
687 }
688 else if (ERR_OWN_FAD < t30ShrdPrm.err_cause AND t30ShrdPrm.err_cause < ERR_GENERAL_FAD)
689 {
690 FHSstat = FHS_STAT_FADOwnErr;
691 }
692 else
693 FHSstat = FHS_STAT_FADGnrlErr;
694 break;
695
696 case (T30_ORIGINATING_ENTITY): /* T30 error cause */
697
698 FHSstat = (T_ACI_FHS_STAT)GET_CAUSE_VALUE(t30ShrdPrm.err_cause);
699 break;
700 }
701
702 /*
703 *-------------------------------------------------------------------
704 * indicate a hang-up status code if a FAX transaction is active and
705 * it is in context with the +FDR or +FDT command
706 *-------------------------------------------------------------------
707 */
708 if( ccShrdPrm.datStat EQ DS_ACT)
709 /*
710 AND
711 (t30EntStat.curCmd EQ AT_CMD_FDR OR
712 t30EntStat.curCmd EQ AT_CMD_FDT ))
713 */ {
714 TRACE_EVENT ("STOP FAX DATA PHASE");
715
716 R_AT( RAT_FHS, t30EntStat.entOwn )( FHSstat );
717
718 cmhCC_flagCall( t30ShrdPrm.cId, &((&cmhPrm[t30EntStat.entOwn].ccCmdPrm) -> mltyDscFlg));
719
720 /* pretend an orderly abort */
721 psaCC_ctb(t30ShrdPrm.cId)->curCmd = t30EntStat.curCmd;
722 psaCC_ctb(t30ShrdPrm.cId)->curSrc = t30EntStat.entOwn;
723 }
724 /*
725 *-------------------------------------------------------------------
726 * notify CC about the failure to release the call
727 *-------------------------------------------------------------------
728 */
729 t30ShrdPrm.faxStat = FS_IDL;
730 t30EntStat.curCmd = AT_CMD_NONE;
731
732 cmhCC_T30_Failed();
733 }
734
735 /*
736 +-------------------------------------------------------------------+
737 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
738 | ROUTINE : cmhT30_HDLCRpt |
739 +-------------------------------------------------------------------+
740
741 PURPOSE : HDLC reporting
742
743 */
744
745 GLOBAL void cmhT30_HDLCRpt ( void )
746 {
747 TRACE_FUNCTION ("cmhT30_HDLCRpt()");
748
749 /* HDLC report indication */
750 if( t30ShrdPrm.report.l_buf NEQ 0 )
751 {
752 switch( t30ShrdPrm.report.dir )
753 {
754 case( DIR_SND ):
755
756 R_AT( RAT_FHT, t30EntStat.entOwn )
757 ((t30ShrdPrm.report.l_buf>>3), &t30ShrdPrm.report.buf );
758 break;
759
760 case( DIR_RCV ):
761
762 R_AT( RAT_FHR, t30EntStat.entOwn )
763 ((t30ShrdPrm.report.l_buf>>3), &t30ShrdPrm.report.buf );
764 break;
765 }
766 }
767 }
768
769 /*
770 +-------------------------------------------------------------------+
771 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
772 | ROUTINE : cmhT30_PreambleRcvd |
773 +-------------------------------------------------------------------+
774
775 PURPOSE : Preamble received
776
777 */
778
779 GLOBAL void cmhT30_PreambleRcvd ( void )
780 {
781 TRACE_FUNCTION ("cmhT30_PreambleRcvd()");
782
783 /* indicate first received preamble */
784 if( HDLCfst EQ TRUE )
785 {
786 R_AT( RAT_FCO, t30EntStat.entOwn )();
787 HDLCfst = FALSE;
788 }
789 }
790
791
792 /*
793 +-------------------------------------------------------------------+
794 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
795 | ROUTINE : cmhT30_TransCmpl |
796 +-------------------------------------------------------------------+
797
798 PURPOSE : transmission completed
799
800 */
801
802 GLOBAL void cmhT30_TransCmpl ( void )
803 {
804 TRACE_FUNCTION ("cmhT30_TransCmpl()");
805
806 /* terminate FAX call */
807 t30ShrdPrm.faxStat = FS_IDL;
808 DTCSentFlg = TRUE;
809
810 psaCC_ctb(t30ShrdPrm.cId)->curCmd = t30EntStat.curCmd;
811 psaCC_ctb(t30ShrdPrm.cId)->curSrc = t30EntStat.entOwn;
812 t30EntStat.curCmd = AT_CMD_NONE;
813
814 TRACE_EVENT ("STOP FAX DATA PHASE");
815
816 R_AT( RAT_FHS, t30EntStat.entOwn )( FHSstat = FHS_STAT_NormEnd );
817
818 cmhCC_flagCall( t30ShrdPrm.cId, &((&cmhPrm[t30EntStat.entOwn].ccCmdPrm) -> mltyDscFlg));
819
820 ccShrdPrm.datStat = DS_DSC_REQ;
821 cmhT30_Deactivate ();
822 }
823
824 /*
825 +-------------------------------------------------------------------+
826 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
827 | ROUTINE : cmhT30_NextPage |
828 +-------------------------------------------------------------------+
829
830 PURPOSE : next page requested
831
832 */
833
834 GLOBAL void cmhT30_NextPage ( void )
835 {
836 UBYTE cmdBuf; /* buffers current command */
837
838 TRACE_FUNCTION ("cmhT30_NextPage()");
839
840 /* terminate command and store result to FPS( FAX send ) */
841 if (ccShrdPrm.ctb[t30ShrdPrm.cId] NEQ NULL AND
842 psaCC_ctb(t30ShrdPrm.cId)->calType EQ CT_MOC )
843 {
844 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FPSppr = FPS_PPR_Mcf;
845
846 cmdBuf = t30EntStat.curCmd;
847 t30EntStat.curCmd = AT_CMD_NONE;
848
849 TRACE_EVENT ("STOP FAX DATA PHASE");
850
851 cmhT30_StartFIT();
852
853 R_AT( RAT_OK, t30EntStat.entOwn )( cmdBuf );
854 }
855 }
856
857 /*
858 +-------------------------------------------------------------------+
859 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
860 | ROUTINE : cmhT30_NextDoc |
861 +-------------------------------------------------------------------+
862
863 PURPOSE : next document requested
864
865 */
866
867 GLOBAL void cmhT30_NextDoc ( void )
868 {
869 UBYTE cmdBuf; /* buffers current command */
870
871 TRACE_FUNCTION ("cmhT30_NextDoc()");
872
873 /* send capabilities for next document ( FAX receive ) */
874 if (psaCC_ctb(t30ShrdPrm.cId)->calType EQ CT_MTC)
875 {
876 cmhT30_SendCaps ( t30EntStat.entOwn, FRT_DIS );
877 }
878
879 /* terminate command and store result to FPS( FAX send ) */
880 else if (psaCC_ctb(t30ShrdPrm.cId)->calType EQ CT_MOC )
881 {
882 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FPSppr = FPS_PPR_Mcf;
883
884 cmdBuf = t30EntStat.curCmd;
885 t30EntStat.curCmd = AT_CMD_NONE;
886
887 TRACE_EVENT ("STOP FAX DATA PHASE");
888 cmhT30_StartFIT();
889
890 R_AT( RAT_OK, t30EntStat.entOwn )( cmdBuf );
891 }
892 }
893
894 /*
895 +-------------------------------------------------------------------+
896 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
897 | ROUTINE : cmhT30_RTN |
898 +-------------------------------------------------------------------+
899
900 PURPOSE: Retrain Negative (RTN)
901 To indicate that the previous message has not been satisfactorily received.
902 However, further receptions may be possible,
903 provided training is retransmitted.
904 */
905
906 GLOBAL void cmhT30_RTN ( void )
907 {
908 TRACE_FUNCTION ("cmhT30_RTN()");
909
910 psaT30_Capabilities();
911 }
912
913 /*
914 +-------------------------------------------------------------------+
915 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
916 | ROUTINE : cmhT30_RTP |
917 +-------------------------------------------------------------------+
918
919 PURPOSE: Retrain Positive (RTP)
920 To indicate that a complete message has been received
921 and that additional messages may follow
922 after retransmission of training and CFR.
923 */
924
925 GLOBAL void cmhT30_RTP ( void )
926 {
927 TRACE_FUNCTION ("cmhT30_RTP()");
928
929 psaT30_Capabilities();
930 }
931
932 /*
933 +-------------------------------------------------------------------+
934 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
935 | ROUTINE : cmhT30_FTT |
936 +-------------------------------------------------------------------+
937
938 PURPOSE : failure to train
939
940 */
941
942 GLOBAL void cmhT30_FTT ( void )
943 {
944 TRACE_FUNCTION ("cmhT30_FTT()");
945
946 /* re-negotiate bit rate and send new DCS */
947
948 /* check for minimum speed condition */
949 if( t30NgtPrms.FCSbr EQ F_BR_2400 OR
950 t30NgtPrms.FCSbr -1 < fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FMSbr )
951 {
952 t30ShrdPrm.faxStat = FS_IDL;
953 t30EntStat.curCmd = AT_CMD_NONE;
954 /* pretend an orderly abort */
955 psaCC_ctb(t30ShrdPrm.cId)->curCmd = AT_CMD_FKS;
956 psaCC_ctb(t30ShrdPrm.cId)->curSrc = t30EntStat.entOwn;
957 ccShrdPrm.datStat = DS_DSC_REQ;
958 cmhT30_Deactivate ();
959
960 R_AT( RAT_FHS, t30EntStat.entOwn )( FHSstat = FHS_STAT_TrainFail );
961 }
962 else
963 {
964 t30NgtPrms.FCSbr--;
965 cmhT30_SendCaps ( t30EntStat.entOwn, FRT_DCS );
966 }
967 }
968
969 /*
970 +-------------------------------------------------------------------+
971 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
972 | ROUTINE : cmhT30_PageReceived |
973 +-------------------------------------------------------------------+
974
975 PURPOSE : FAX page was received
976
977 */
978
979 GLOBAL void cmhT30_PageReceived ( void )
980 {
981 TRACE_FUNCTION ("cmhT30_PageReceived()");
982
983 /* indicate page status */
984 t30ShrdPrm.faxStat = FS_RCV_DOC;
985 t30EntStat.curCmd = AT_CMD_NONE;
986
987 TRACE_EVENT ("STOP FAX DATA PHASE");
988 cmhT30_StartFIT();
989
990 /* FCQ controls output of FPS */
991
992 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCDisabled)
993 {
994 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Mcf,t30ShrdPrm.eol,0,0,0 );
995 }
996 else
997 {
998 R_AT( RAT_FPS, t30EntStat.entOwn )( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FPSppr,t30ShrdPrm.eol,0,0,0 );
999 }
1000
1001 R_AT( RAT_FET, t30EntStat.entOwn )( FET_PPM_Mps );
1002 R_AT( RAT_OK, t30EntStat.entOwn ) ( AT_CMD_FDR );
1003 }
1004
1005 /*
1006 +-------------------------------------------------------------------+
1007 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1008 | ROUTINE : cmhT30_DocReceived |
1009 +-------------------------------------------------------------------+
1010
1011 PURPOSE : FAX document was received
1012
1013 */
1014
1015 GLOBAL void cmhT30_DocReceived ( void )
1016 {
1017 TRACE_FUNCTION ("cmhT30_DocReceived()");
1018
1019 /* reset polling mode if received doc was polled */
1020 if (psaCC_ctb(t30ShrdPrm.cId)->calType EQ CT_MOC)
1021 {
1022 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FSPval = FSP_VAL_PollDisabled;
1023 }
1024
1025 /* indicate page status */
1026 t30ShrdPrm.faxStat = FS_DOC_TRF;
1027 t30EntStat.curCmd = AT_CMD_NONE;
1028
1029 TRACE_EVENT ("STOP FAX DATA PHASE");
1030 cmhT30_StartFIT();
1031
1032 /* FCQ controls output of FPS */
1033 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCDisabled)
1034 {
1035 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Mcf,t30ShrdPrm.eol,0,0,0 );
1036 }
1037 else
1038 {
1039 R_AT( RAT_FPS, t30EntStat.entOwn )( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FPSppr,t30ShrdPrm.eol,0,0,0 );
1040 }
1041
1042 R_AT( RAT_FET, t30EntStat.entOwn )( FET_PPM_Eom );
1043 R_AT( RAT_OK, t30EntStat.entOwn ) ( AT_CMD_FDR );
1044 }
1045
1046 /*
1047 +-------------------------------------------------------------------+
1048 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1049 | ROUTINE : cmhT30_ProcEnd |
1050 +-------------------------------------------------------------------+
1051
1052 PURPOSE : FAX document was received
1053
1054 */
1055
1056 GLOBAL void cmhT30_ProcEnd ( void )
1057 {
1058 TRACE_FUNCTION ("cmhT30_ProcEnd()");
1059
1060 /* indicate page status */
1061 t30ShrdPrm.faxStat = FS_RCV_DOC;
1062 t30EntStat.curCmd = AT_CMD_NONE;
1063
1064 TRACE_EVENT ("STOP FAX DATA PHASE");
1065 cmhT30_StartFIT();
1066
1067 /* FCQ controls output of FPS */
1068 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCDisabled)
1069 {
1070 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Mcf,t30ShrdPrm.eol,0,0,0 );
1071 }
1072 else
1073 {
1074 R_AT( RAT_FPS, t30EntStat.entOwn )( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FPSppr,t30ShrdPrm.eol,0,0,0 );
1075 }
1076
1077 R_AT( RAT_FET, t30EntStat.entOwn )( FET_PPM_Eop );
1078 R_AT( RAT_OK, t30EntStat.entOwn )( AT_CMD_FDR );
1079 }
1080
1081 /*
1082 +-------------------------------------------------------------------+
1083 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1084 | ROUTINE : cmhT30_ProcInt |
1085 +-------------------------------------------------------------------+
1086
1087 PURPOSE : Procedural Interrupt
1088 */
1089
1090 GLOBAL void cmhT30_ProcInt ( void )
1091 {
1092 TRACE_FUNCTION ("cmhT30_ProcInt()");
1093
1094 /* resend PPM to T.30 */
1095 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FIEval EQ FIE_VAL_AcceptPRI)
1096 {
1097 t30ShrdPrm.sgn_snd |= PRI_MRK;
1098 }
1099
1100 if( pageSentFlg EQ TRUE )
1101 {
1102 if( psaT30_Ppm( ) < 0 ) /* T30 PPM request */
1103 {
1104 TRACE_EVENT( "FATAL RETURN psaT30 in cmhT30_ProcInt" );
1105 }
1106 }
1107 else
1108 {
1109 ppmPendFlg = TRUE;
1110 }
1111 }
1112
1113 /*
1114 +-------------------------------------------------------------------+
1115 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1116 | ROUTINE : cmhT30_ProcIntInst |
1117 +-------------------------------------------------------------------+
1118
1119 PURPOSE : Procedural Interrupt Installed
1120
1121 */
1122
1123 GLOBAL void cmhT30_ProcIntInst ( void )
1124 {
1125
1126 TRACE_FUNCTION ("cmhT30_ProcIntInst()");
1127
1128 /* send notification and wait for call modification */
1129 t30EntStat.curCmd = AT_CMD_NONE;
1130
1131 TRACE_EVENT ("STOP FAX DATA PHASE");
1132
1133 R_AT( RAT_FVO, t30EntStat.entOwn )();
1134 }
1135
1136 /*
1137 +-------------------------------------------------------------------+
1138 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1139 | ROUTINE : cmhT30_PageReceivedPRI |
1140 +-------------------------------------------------------------------+
1141
1142 PURPOSE : FAX page was received, procedural interupt request
1143
1144 */
1145
1146 GLOBAL void cmhT30_PageReceivedPRI ( void )
1147 {
1148 TRACE_FUNCTION ("cmhT30_PageReceivedPRI()");
1149
1150 /* indicate page status */
1151 t30ShrdPrm.faxStat = FS_RCV_DOC;
1152 t30EntStat.curCmd = AT_CMD_NONE;
1153
1154 TRACE_EVENT ("STOP FAX DATA PHASE");
1155 cmhT30_StartFIT();
1156
1157 /* FCQ controls output of FPS */
1158 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCEnabled)
1159 {
1160 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Pip,t30ShrdPrm.eol,0,0,0 );
1161 }
1162 else if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCDisabled)
1163 {
1164 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Mcf,t30ShrdPrm.eol,0,0,0 );
1165 }
1166
1167 R_AT( RAT_FET, t30EntStat.entOwn )( FET_PPM_PriMps );
1168 R_AT( RAT_OK, t30EntStat.entOwn ) ( AT_CMD_FDR );
1169 }
1170
1171 /*
1172 +-------------------------------------------------------------------+
1173 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1174 | ROUTINE : cmhT30_DocReceivedPRI |
1175 +-------------------------------------------------------------------+
1176
1177 PURPOSE : FAX document was received, procedural interrupt request
1178
1179 */
1180
1181 GLOBAL void cmhT30_DocReceivedPRI ( void )
1182 {
1183
1184 TRACE_FUNCTION ("cmhT30_DocReceivedPRI()");
1185
1186 /* reset polling mode if received doc was polled */
1187 if(psaCC_ctb(t30ShrdPrm.cId)->calType EQ CT_MOC)
1188 {
1189 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FSPval = FSP_VAL_PollDisabled;
1190 }
1191
1192 /* indicate page status */
1193 t30ShrdPrm.faxStat = FS_DOC_TRF;
1194 t30EntStat.curCmd = AT_CMD_NONE;
1195
1196
1197 TRACE_EVENT ("STOP FAX DATA PHASE");
1198 cmhT30_StartFIT();
1199
1200 /* FCQ controls output of FPS */
1201 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCEnabled)
1202 {
1203 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Pin,t30ShrdPrm.eol,0,0,0 );
1204 }
1205 else if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCDisabled)
1206 {
1207 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Mcf,t30ShrdPrm.eol,0,0,0 );
1208 }
1209
1210 R_AT( RAT_FET, t30EntStat.entOwn )( FET_PPM_PriEom );
1211 R_AT( RAT_OK, t30EntStat.entOwn ) ( AT_CMD_FDR );
1212 }
1213
1214 /*
1215 +-------------------------------------------------------------------+
1216 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1217 | ROUTINE : cmhT30_ProcEndPRI |
1218 +-------------------------------------------------------------------+
1219
1220 PURPOSE : FAX document was received, procedural interrupt request
1221
1222 */
1223
1224 GLOBAL void cmhT30_ProcEndPRI ( void )
1225 {
1226
1227 TRACE_FUNCTION ("cmhT30_ProcEndPRI()");
1228
1229 /* indicate page status */
1230 t30ShrdPrm.faxStat = FS_RCV_DOC;
1231 t30EntStat.curCmd = AT_CMD_NONE;
1232
1233 TRACE_EVENT ("STOP FAX DATA PHASE");
1234 cmhT30_StartFIT();
1235
1236 /* FCQ controls output of FPS */
1237 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCEnabled)
1238 {
1239 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Pin,t30ShrdPrm.eol,0,0,0 );
1240 }
1241 else if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCDisabled)
1242 {
1243 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Mcf,t30ShrdPrm.eol,0,0,0 );
1244 }
1245
1246 R_AT( RAT_FET, t30EntStat.entOwn )( FET_PPM_PriEop );
1247 R_AT( RAT_OK, t30EntStat.entOwn ) ( AT_CMD_FDR );
1248 }
1249
1250 //#ifdef DTI
1251 /*
1252 +--------------------------------------------------------------------+
1253 | PROJECT : GSM-F&D (8411) MODULE : CMH_T30R |
1254 | STATE : code ROUTINE : T30_connect_dti_cb |
1255 +--------------------------------------------------------------------+
1256
1257 PURPOSE : Callback for connection between T30 and UART.
1258
1259 */
1260
1261 GLOBAL BOOL T30_connect_dti_cb(UBYTE dti_id, T_DTI_CONN_STATE result_type)
1262 {
1263 T_ACI_DTI_PRC *srcInfos;
1264 T_DTI_CNTRL info;
1265
1266 TRACE_FUNCTION("T30_connect_dti_cb");
1267
1268
1269 if (dti_cntrl_get_info_from_dti_id( dti_id, &info) EQ FALSE)
1270 {
1271 TRACE_EVENT_P1("cannot find info for dti_id=%d", dti_id);
1272 return FALSE;
1273 }
1274
1275 srcInfos = find_element (uart_src_params, info.src_id, cmhUARTtest_srcId);
1276 if (srcInfos EQ NULL)
1277 {
1278 TRACE_EVENT_P1 ("[ERR] T30_connect_dti_cb: srcId=%d not found", info.src_id);
1279 return FALSE;
1280 }
1281
1282 switch( result_type)
1283 {
1284 case(DTI_CONN_STATE_DISCONNECTED):
1285
1286 dti_cntrl_clear_conn_parms( dti_id );
1287
1288 if (t30EntStat.isTempDisconnected)
1289 {
1290 BITFIELD_SET (srcInfos->data_cntr, UART_DTI_SB_BIT);
1291 t30EntStat.isTempDisconnected = FALSE;
1292 }
1293 else
1294 {
1295 BITFIELD_CLEAR (srcInfos->data_cntr, UART_DTI_SB_BIT);
1296 cmhT30_Deactivate();
1297 }
1298 break;
1299
1300 case(DTI_CONN_STATE_CONNECTED):
1301 case(DTI_CONN_STATE_CONNECTING):
1302 case(DTI_CONN_STATE_DISCONNECTING):
1303 break;
1304 case(DTI_CONN_STATE_ERROR):
1305 dti_cntrl_close_dpath_from_dti_id( dti_id );
1306 break;
1307
1308 default:
1309 TRACE_EVENT("T30_connect_dti_cb call with not awaited value");
1310 break;
1311 }
1312 return TRUE;
1313 }
1314 #endif /* DTI OR FF_FAX*/
1315 /*==== EOF ========================================================*/