comparison src/aci2/aci/cmh_t30r.c @ 3:93999a60b835

src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 26 Sep 2016 00:29:36 +0000
parents
children
comparison
equal deleted inserted replaced
2:c41a534f33c6 3:93999a60b835
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 UBYTE cmdBuf;
602
603 TRACE_FUNCTION ("cmhT30_Disconnect()");
604
605 /* clear FAX call */
606 cmdBuf = t30EntStat.curCmd;
607 t30EntStat.curCmd = AT_CMD_NONE;
608
609 R_AT( RAT_FHS, t30EntStat.entOwn )( FHSstat = FHS_STAT_NormEnd );
610
611 /* pretends an orderly FAX abort */
612 psaCC_ctb(t30ShrdPrm.cId)->curCmd = AT_CMD_FKS;
613 psaCC_ctb(t30ShrdPrm.cId)->curSrc = t30EntStat.entOwn;
614
615 cmhT30_Deactivate();
616 }
617
618 /*
619 +-------------------------------------------------------------------+
620 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
621 | ROUTINE : cmhT30_Disconnected |
622 +-------------------------------------------------------------------+
623
624 PURPOSE : T30 entity deactivated
625
626 */
627
628 GLOBAL void cmhT30_Disconnected ( void )
629 {
630 TRACE_FUNCTION ("cmhT30_Disconnected()");
631
632 /* clear FAX call */
633 switch( t30EntStat.curCmd )
634 {
635 case( AT_CMD_FKS ):
636
637 t30EntStat.curCmd = AT_CMD_NONE;
638 break;
639 }
640
641 R_AT( RAT_FHS, t30EntStat.entOwn )( FHSstat = FHS_STAT_NormEnd );
642
643 psaCC_ctb(t30ShrdPrm.cId)->curCmd = AT_CMD_FKS;
644 psaCC_ctb(t30ShrdPrm.cId)->curSrc = t30EntStat.entOwn;
645
646 cmhT30_Deactivate();
647 }
648
649 /*
650 +-------------------------------------------------------------------+
651 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
652 | ROUTINE : cmhT30_Failure |
653 +-------------------------------------------------------------------+
654
655 PURPOSE : T30 entity failure, connection will be disconnected
656
657 */
658
659 GLOBAL void cmhT30_Failure ( void )
660 {
661 TRACE_FUNCTION ("cmhT30_Failure()");
662
663 /*
664 *-------------------------------------------------------------------
665 * general failure indication
666 *-------------------------------------------------------------------
667 */
668 TRACE_EVENT_P1("T30/FAD ERROR: 0x%04x", t30ShrdPrm.err_cause);
669
670 switch (GET_CAUSE_ORIGIN_ENTITY(t30ShrdPrm.err_cause))
671 {
672 case (FAD_ORIGINATING_ENTITY): /* FAD error cause */
673
674 if ( ERR_REM_FAD < t30ShrdPrm.err_cause AND t30ShrdPrm.err_cause < ERR_LOCAL_FAD)
675 {
676 FHSstat = FHS_STAT_FADRmtStnErr;
677 }
678 else if (ERR_LOCAL_FAD < t30ShrdPrm.err_cause AND t30ShrdPrm.err_cause < ERR_OWN_FAD)
679 {
680 switch (t30ShrdPrm.err_cause)
681 {
682 case ERR_LOCAL_DATA_MSG_UFL:
683 FHSstat = FHS_STAT_DteDceDataUndrflw;
684 break;
685 default:
686 FHSstat = FHS_STAT_FADLclStnErr;
687 break;
688 }
689 }
690 else if (ERR_OWN_FAD < t30ShrdPrm.err_cause AND t30ShrdPrm.err_cause < ERR_GENERAL_FAD)
691 {
692 FHSstat = FHS_STAT_FADOwnErr;
693 }
694 else
695 FHSstat = FHS_STAT_FADGnrlErr;
696 break;
697
698 case (T30_ORIGINATING_ENTITY): /* T30 error cause */
699
700 FHSstat = GET_CAUSE_VALUE(t30ShrdPrm.err_cause);
701 break;
702 }
703
704 /*
705 *-------------------------------------------------------------------
706 * indicate a hang-up status code if a FAX transaction is active and
707 * it is in context with the +FDR or +FDT command
708 *-------------------------------------------------------------------
709 */
710 if( ccShrdPrm.datStat EQ DS_ACT)
711 /*
712 AND
713 (t30EntStat.curCmd EQ AT_CMD_FDR OR
714 t30EntStat.curCmd EQ AT_CMD_FDT ))
715 */ {
716 TRACE_EVENT ("STOP FAX DATA PHASE");
717
718 R_AT( RAT_FHS, t30EntStat.entOwn )( FHSstat );
719
720 cmhCC_flagCall( t30ShrdPrm.cId, &((&cmhPrm[t30EntStat.entOwn].ccCmdPrm) -> mltyDscFlg));
721
722 /* pretend an orderly abort */
723 psaCC_ctb(t30ShrdPrm.cId)->curCmd = t30EntStat.curCmd;
724 psaCC_ctb(t30ShrdPrm.cId)->curSrc = t30EntStat.entOwn;
725 }
726 /*
727 *-------------------------------------------------------------------
728 * notify CC about the failure to release the call
729 *-------------------------------------------------------------------
730 */
731 t30ShrdPrm.faxStat = FS_IDL;
732 t30EntStat.curCmd = AT_CMD_NONE;
733
734 cmhCC_T30_Failed();
735 }
736
737 /*
738 +-------------------------------------------------------------------+
739 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
740 | ROUTINE : cmhT30_HDLCRpt |
741 +-------------------------------------------------------------------+
742
743 PURPOSE : HDLC reporting
744
745 */
746
747 GLOBAL void cmhT30_HDLCRpt ( void )
748 {
749 TRACE_FUNCTION ("cmhT30_HDLCRpt()");
750
751 /* HDLC report indication */
752 if( t30ShrdPrm.report.l_buf NEQ 0 )
753 {
754 switch( t30ShrdPrm.report.dir )
755 {
756 case( DIR_SND ):
757
758 R_AT( RAT_FHT, t30EntStat.entOwn )
759 ((t30ShrdPrm.report.l_buf>>3), &t30ShrdPrm.report.buf );
760 break;
761
762 case( DIR_RCV ):
763
764 R_AT( RAT_FHR, t30EntStat.entOwn )
765 ((t30ShrdPrm.report.l_buf>>3), &t30ShrdPrm.report.buf );
766 break;
767 }
768 }
769 }
770
771 /*
772 +-------------------------------------------------------------------+
773 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
774 | ROUTINE : cmhT30_PreambleRcvd |
775 +-------------------------------------------------------------------+
776
777 PURPOSE : Preamble received
778
779 */
780
781 GLOBAL void cmhT30_PreambleRcvd ( void )
782 {
783 TRACE_FUNCTION ("cmhT30_PreambleRcvd()");
784
785 /* indicate first received preamble */
786 if( HDLCfst EQ TRUE )
787 {
788 R_AT( RAT_FCO, t30EntStat.entOwn )();
789 HDLCfst = FALSE;
790 }
791 }
792
793
794 /*
795 +-------------------------------------------------------------------+
796 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
797 | ROUTINE : cmhT30_TransCmpl |
798 +-------------------------------------------------------------------+
799
800 PURPOSE : transmission completed
801
802 */
803
804 GLOBAL void cmhT30_TransCmpl ( void )
805 {
806 TRACE_FUNCTION ("cmhT30_TransCmpl()");
807
808 /* terminate FAX call */
809 t30ShrdPrm.faxStat = FS_IDL;
810 DTCSentFlg = TRUE;
811
812 psaCC_ctb(t30ShrdPrm.cId)->curCmd = t30EntStat.curCmd;
813 psaCC_ctb(t30ShrdPrm.cId)->curSrc = t30EntStat.entOwn;
814 t30EntStat.curCmd = AT_CMD_NONE;
815
816 TRACE_EVENT ("STOP FAX DATA PHASE");
817
818 R_AT( RAT_FHS, t30EntStat.entOwn )( FHSstat = FHS_STAT_NormEnd );
819
820 cmhCC_flagCall( t30ShrdPrm.cId, &((&cmhPrm[t30EntStat.entOwn].ccCmdPrm) -> mltyDscFlg));
821
822 ccShrdPrm.datStat = DS_DSC_REQ;
823 cmhT30_Deactivate ();
824 }
825
826 /*
827 +-------------------------------------------------------------------+
828 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
829 | ROUTINE : cmhT30_NextPage |
830 +-------------------------------------------------------------------+
831
832 PURPOSE : next page requested
833
834 */
835
836 GLOBAL void cmhT30_NextPage ( void )
837 {
838 UBYTE cmdBuf; /* buffers current command */
839
840 TRACE_FUNCTION ("cmhT30_NextPage()");
841
842 /* terminate command and store result to FPS( FAX send ) */
843 if (ccShrdPrm.ctb[t30ShrdPrm.cId] NEQ NULL AND
844 psaCC_ctb(t30ShrdPrm.cId)->calType EQ CT_MOC )
845 {
846 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FPSppr = FPS_PPR_Mcf;
847
848 cmdBuf = t30EntStat.curCmd;
849 t30EntStat.curCmd = AT_CMD_NONE;
850
851 TRACE_EVENT ("STOP FAX DATA PHASE");
852
853 cmhT30_StartFIT();
854
855 R_AT( RAT_OK, t30EntStat.entOwn )( cmdBuf );
856 }
857 }
858
859 /*
860 +-------------------------------------------------------------------+
861 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
862 | ROUTINE : cmhT30_NextDoc |
863 +-------------------------------------------------------------------+
864
865 PURPOSE : next document requested
866
867 */
868
869 GLOBAL void cmhT30_NextDoc ( void )
870 {
871 UBYTE cmdBuf; /* buffers current command */
872
873 TRACE_FUNCTION ("cmhT30_NextDoc()");
874
875 /* send capabilities for next document ( FAX receive ) */
876 if (psaCC_ctb(t30ShrdPrm.cId)->calType EQ CT_MTC)
877 {
878 cmhT30_SendCaps ( t30EntStat.entOwn, FRT_DIS );
879 }
880
881 /* terminate command and store result to FPS( FAX send ) */
882 else if (psaCC_ctb(t30ShrdPrm.cId)->calType EQ CT_MOC )
883 {
884 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FPSppr = FPS_PPR_Mcf;
885
886 cmdBuf = t30EntStat.curCmd;
887 t30EntStat.curCmd = AT_CMD_NONE;
888
889 TRACE_EVENT ("STOP FAX DATA PHASE");
890 cmhT30_StartFIT();
891
892 R_AT( RAT_OK, t30EntStat.entOwn )( cmdBuf );
893 }
894 }
895
896 /*
897 +-------------------------------------------------------------------+
898 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
899 | ROUTINE : cmhT30_RTN |
900 +-------------------------------------------------------------------+
901
902 PURPOSE: Retrain Negative (RTN)
903 To indicate that the previous message has not been satisfactorily received.
904 However, further receptions may be possible,
905 provided training is retransmitted.
906 */
907
908 GLOBAL void cmhT30_RTN ( void )
909 {
910 TRACE_FUNCTION ("cmhT30_RTN()");
911
912 psaT30_Capabilities();
913 }
914
915 /*
916 +-------------------------------------------------------------------+
917 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
918 | ROUTINE : cmhT30_RTP |
919 +-------------------------------------------------------------------+
920
921 PURPOSE: Retrain Positive (RTP)
922 To indicate that a complete message has been received
923 and that additional messages may follow
924 after retransmission of training and CFR.
925 */
926
927 GLOBAL void cmhT30_RTP ( void )
928 {
929 TRACE_FUNCTION ("cmhT30_RTP()");
930
931 psaT30_Capabilities();
932 }
933
934 /*
935 +-------------------------------------------------------------------+
936 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
937 | ROUTINE : cmhT30_FTT |
938 +-------------------------------------------------------------------+
939
940 PURPOSE : failure to train
941
942 */
943
944 GLOBAL void cmhT30_FTT ( void )
945 {
946 TRACE_FUNCTION ("cmhT30_FTT()");
947
948 /* re-negotiate bit rate and send new DCS */
949
950 /* check for minimum speed condition */
951 if( t30NgtPrms.FCSbr EQ F_BR_2400 OR
952 t30NgtPrms.FCSbr -1 < fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FMSbr )
953 {
954 t30ShrdPrm.faxStat = FS_IDL;
955 t30EntStat.curCmd = AT_CMD_NONE;
956 /* pretend an orderly abort */
957 psaCC_ctb(t30ShrdPrm.cId)->curCmd = AT_CMD_FKS;
958 psaCC_ctb(t30ShrdPrm.cId)->curSrc = t30EntStat.entOwn;
959 ccShrdPrm.datStat = DS_DSC_REQ;
960 cmhT30_Deactivate ();
961
962 R_AT( RAT_FHS, t30EntStat.entOwn )( FHSstat = FHS_STAT_TrainFail );
963 }
964 else
965 {
966 t30NgtPrms.FCSbr--;
967 cmhT30_SendCaps ( t30EntStat.entOwn, FRT_DCS );
968 }
969 }
970
971 /*
972 +-------------------------------------------------------------------+
973 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
974 | ROUTINE : cmhT30_PageReceived |
975 +-------------------------------------------------------------------+
976
977 PURPOSE : FAX page was received
978
979 */
980
981 GLOBAL void cmhT30_PageReceived ( void )
982 {
983 TRACE_FUNCTION ("cmhT30_PageReceived()");
984
985 /* indicate page status */
986 t30ShrdPrm.faxStat = FS_RCV_DOC;
987 t30EntStat.curCmd = AT_CMD_NONE;
988
989 TRACE_EVENT ("STOP FAX DATA PHASE");
990 cmhT30_StartFIT();
991
992 /* FCQ controls output of FPS */
993
994 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCDisabled)
995 {
996 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Mcf,t30ShrdPrm.eol,0,0,0 );
997 }
998 else
999 {
1000 R_AT( RAT_FPS, t30EntStat.entOwn )( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FPSppr,t30ShrdPrm.eol,0,0,0 );
1001 }
1002
1003 R_AT( RAT_FET, t30EntStat.entOwn )( FET_PPM_Mps );
1004 R_AT( RAT_OK, t30EntStat.entOwn ) ( AT_CMD_FDR );
1005 }
1006
1007 /*
1008 +-------------------------------------------------------------------+
1009 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1010 | ROUTINE : cmhT30_DocReceived |
1011 +-------------------------------------------------------------------+
1012
1013 PURPOSE : FAX document was received
1014
1015 */
1016
1017 GLOBAL void cmhT30_DocReceived ( void )
1018 {
1019 TRACE_FUNCTION ("cmhT30_DocReceived()");
1020
1021 /* reset polling mode if received doc was polled */
1022 if (psaCC_ctb(t30ShrdPrm.cId)->calType EQ CT_MOC)
1023 {
1024 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FSPval = FSP_VAL_PollDisabled;
1025 }
1026
1027 /* indicate page status */
1028 t30ShrdPrm.faxStat = FS_DOC_TRF;
1029 t30EntStat.curCmd = AT_CMD_NONE;
1030
1031 TRACE_EVENT ("STOP FAX DATA PHASE");
1032 cmhT30_StartFIT();
1033
1034 /* FCQ controls output of FPS */
1035 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCDisabled)
1036 {
1037 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Mcf,t30ShrdPrm.eol,0,0,0 );
1038 }
1039 else
1040 {
1041 R_AT( RAT_FPS, t30EntStat.entOwn )( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FPSppr,t30ShrdPrm.eol,0,0,0 );
1042 }
1043
1044 R_AT( RAT_FET, t30EntStat.entOwn )( FET_PPM_Eom );
1045 R_AT( RAT_OK, t30EntStat.entOwn ) ( AT_CMD_FDR );
1046 }
1047
1048 /*
1049 +-------------------------------------------------------------------+
1050 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1051 | ROUTINE : cmhT30_ProcEnd |
1052 +-------------------------------------------------------------------+
1053
1054 PURPOSE : FAX document was received
1055
1056 */
1057
1058 GLOBAL void cmhT30_ProcEnd ( void )
1059 {
1060 TRACE_FUNCTION ("cmhT30_ProcEnd()");
1061
1062 /* indicate page status */
1063 t30ShrdPrm.faxStat = FS_RCV_DOC;
1064 t30EntStat.curCmd = AT_CMD_NONE;
1065
1066 TRACE_EVENT ("STOP FAX DATA PHASE");
1067 cmhT30_StartFIT();
1068
1069 /* FCQ controls output of FPS */
1070 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCDisabled)
1071 {
1072 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Mcf,t30ShrdPrm.eol,0,0,0 );
1073 }
1074 else
1075 {
1076 R_AT( RAT_FPS, t30EntStat.entOwn )( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FPSppr,t30ShrdPrm.eol,0,0,0 );
1077 }
1078
1079 R_AT( RAT_FET, t30EntStat.entOwn )( FET_PPM_Eop );
1080 R_AT( RAT_OK, t30EntStat.entOwn )( AT_CMD_FDR );
1081 }
1082
1083 /*
1084 +-------------------------------------------------------------------+
1085 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1086 | ROUTINE : cmhT30_ProcInt |
1087 +-------------------------------------------------------------------+
1088
1089 PURPOSE : Procedural Interrupt
1090 */
1091
1092 GLOBAL void cmhT30_ProcInt ( void )
1093 {
1094 TRACE_FUNCTION ("cmhT30_ProcInt()");
1095
1096 /* resend PPM to T.30 */
1097 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FIEval EQ FIE_VAL_AcceptPRI)
1098 {
1099 t30ShrdPrm.sgn_snd |= PRI_MRK;
1100 }
1101
1102 if( pageSentFlg EQ TRUE )
1103 {
1104 if( psaT30_Ppm( ) < 0 ) /* T30 PPM request */
1105 {
1106 TRACE_EVENT( "FATAL RETURN psaT30 in cmhT30_ProcInt" );
1107 }
1108 }
1109 else
1110 {
1111 ppmPendFlg = TRUE;
1112 }
1113 }
1114
1115 /*
1116 +-------------------------------------------------------------------+
1117 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1118 | ROUTINE : cmhT30_ProcIntInst |
1119 +-------------------------------------------------------------------+
1120
1121 PURPOSE : Procedural Interrupt Installed
1122
1123 */
1124
1125 GLOBAL void cmhT30_ProcIntInst ( void )
1126 {
1127 UBYTE cmdBuf;
1128
1129 TRACE_FUNCTION ("cmhT30_ProcIntInst()");
1130
1131 /* send notification and wait for call modification */
1132 cmdBuf = t30EntStat.curCmd;
1133 t30EntStat.curCmd = AT_CMD_NONE;
1134
1135 TRACE_EVENT ("STOP FAX DATA PHASE");
1136
1137 R_AT( RAT_FVO, t30EntStat.entOwn )();
1138 }
1139
1140 /*
1141 +-------------------------------------------------------------------+
1142 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1143 | ROUTINE : cmhT30_PageReceivedPRI |
1144 +-------------------------------------------------------------------+
1145
1146 PURPOSE : FAX page was received, procedural interupt request
1147
1148 */
1149
1150 GLOBAL void cmhT30_PageReceivedPRI ( void )
1151 {
1152 TRACE_FUNCTION ("cmhT30_PageReceivedPRI()");
1153
1154 /* indicate page status */
1155 t30ShrdPrm.faxStat = FS_RCV_DOC;
1156 t30EntStat.curCmd = AT_CMD_NONE;
1157
1158 TRACE_EVENT ("STOP FAX DATA PHASE");
1159 cmhT30_StartFIT();
1160
1161 /* FCQ controls output of FPS */
1162 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCEnabled)
1163 {
1164 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Pip,t30ShrdPrm.eol,0,0,0 );
1165 }
1166 else if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCDisabled)
1167 {
1168 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Mcf,t30ShrdPrm.eol,0,0,0 );
1169 }
1170
1171 R_AT( RAT_FET, t30EntStat.entOwn )( FET_PPM_PriMps );
1172 R_AT( RAT_OK, t30EntStat.entOwn ) ( AT_CMD_FDR );
1173 }
1174
1175 /*
1176 +-------------------------------------------------------------------+
1177 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1178 | ROUTINE : cmhT30_DocReceivedPRI |
1179 +-------------------------------------------------------------------+
1180
1181 PURPOSE : FAX document was received, procedural interrupt request
1182
1183 */
1184
1185 GLOBAL void cmhT30_DocReceivedPRI ( void )
1186 {
1187
1188 TRACE_FUNCTION ("cmhT30_DocReceivedPRI()");
1189
1190 /* reset polling mode if received doc was polled */
1191 if(psaCC_ctb(t30ShrdPrm.cId)->calType EQ CT_MOC)
1192 {
1193 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FSPval = FSP_VAL_PollDisabled;
1194 }
1195
1196 /* indicate page status */
1197 t30ShrdPrm.faxStat = FS_DOC_TRF;
1198 t30EntStat.curCmd = AT_CMD_NONE;
1199
1200
1201 TRACE_EVENT ("STOP FAX DATA PHASE");
1202 cmhT30_StartFIT();
1203
1204 /* FCQ controls output of FPS */
1205 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCEnabled)
1206 {
1207 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Pin,t30ShrdPrm.eol,0,0,0 );
1208 }
1209 else if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCDisabled)
1210 {
1211 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Mcf,t30ShrdPrm.eol,0,0,0 );
1212 }
1213
1214 R_AT( RAT_FET, t30EntStat.entOwn )( FET_PPM_PriEom );
1215 R_AT( RAT_OK, t30EntStat.entOwn ) ( AT_CMD_FDR );
1216 }
1217
1218 /*
1219 +-------------------------------------------------------------------+
1220 | PROJECT : GSM-PS (6147) MODULE : CMH_T30R |
1221 | ROUTINE : cmhT30_ProcEndPRI |
1222 +-------------------------------------------------------------------+
1223
1224 PURPOSE : FAX document was received, procedural interrupt request
1225
1226 */
1227
1228 GLOBAL void cmhT30_ProcEndPRI ( void )
1229 {
1230
1231 TRACE_FUNCTION ("cmhT30_ProcEndPRI()");
1232
1233 /* indicate page status */
1234 t30ShrdPrm.faxStat = FS_RCV_DOC;
1235 t30EntStat.curCmd = AT_CMD_NONE;
1236
1237 TRACE_EVENT ("STOP FAX DATA PHASE");
1238 cmhT30_StartFIT();
1239
1240 /* FCQ controls output of FPS */
1241 if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCEnabled)
1242 {
1243 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Pin,t30ShrdPrm.eol,0,0,0 );
1244 }
1245 else if(fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCQrq EQ FCQ_RQ_CQCDisabled)
1246 {
1247 R_AT( RAT_FPS, t30EntStat.entOwn )( FPS_PPR_Mcf,t30ShrdPrm.eol,0,0,0 );
1248 }
1249
1250 R_AT( RAT_FET, t30EntStat.entOwn )( FET_PPM_PriEop );
1251 R_AT( RAT_OK, t30EntStat.entOwn ) ( AT_CMD_FDR );
1252 }
1253
1254 //#ifdef DTI
1255 /*
1256 +--------------------------------------------------------------------+
1257 | PROJECT : GSM-F&D (8411) MODULE : CMH_T30R |
1258 | STATE : code ROUTINE : T30_connect_dti_cb |
1259 +--------------------------------------------------------------------+
1260
1261 PURPOSE : Callback for connection between T30 and UART.
1262
1263 */
1264
1265 GLOBAL BOOL T30_connect_dti_cb(UBYTE dti_id, T_DTI_CONN_STATE result_type)
1266 {
1267 T_ACI_DTI_PRC *srcInfos;
1268 T_DTI_CNTRL info;
1269
1270 TRACE_FUNCTION("T30_connect_dti_cb");
1271
1272
1273 if (dti_cntrl_get_info_from_dti_id( dti_id, &info) EQ FALSE)
1274 {
1275 TRACE_EVENT_P1("cannot find info for dti_id=%d", dti_id);
1276 return FALSE;
1277 }
1278
1279 srcInfos = find_element (uart_src_params, info.src_id, cmhUARTtest_srcId);
1280 if (srcInfos EQ NULL)
1281 {
1282 TRACE_EVENT_P1 ("[ERR] T30_connect_dti_cb: srcId=%d not found", info.src_id);
1283 return FALSE;
1284 }
1285
1286 switch( result_type)
1287 {
1288 case(DTI_CONN_STATE_DISCONNECTED):
1289
1290 dti_cntrl_clear_conn_parms( dti_id );
1291
1292 if (t30EntStat.isTempDisconnected)
1293 {
1294 BITFIELD_SET (srcInfos->data_cntr, UART_DTI_SB_BIT);
1295 t30EntStat.isTempDisconnected = FALSE;
1296 }
1297 else
1298 {
1299 BITFIELD_CLEAR (srcInfos->data_cntr, UART_DTI_SB_BIT);
1300 cmhT30_Deactivate();
1301 }
1302 break;
1303
1304 case(DTI_CONN_STATE_CONNECTED):
1305 case(DTI_CONN_STATE_CONNECTING):
1306 case(DTI_CONN_STATE_DISCONNECTING):
1307 break;
1308 case(DTI_CONN_STATE_ERROR):
1309 dti_cntrl_close_dpath_from_dti_id( dti_id );
1310 break;
1311
1312 default:
1313 TRACE_EVENT("T30_connect_dti_cb call with not awaited value");
1314 break;
1315 }
1316 return TRUE;
1317 }
1318 #endif /* DTI OR FF_FAX*/
1319 /*==== EOF ========================================================*/