FreeCalypso > hg > tcs211-l1-reconst
comparison g23m/condat/ms/src/aci/cmh_t30s.c @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-PS (6147) | |
4 | Modul : CMH_T30S | |
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 provides the set functions related to the | |
18 | protocol stack adapter for T30. | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #if defined (DTI) || defined (FF_FAX) | |
23 | |
24 #ifndef CMH_T30S_C | |
25 #define CMH_T30S_C | |
26 #endif | |
27 | |
28 #include "aci_all.h" | |
29 /*==== INCLUDES ===================================================*/ | |
30 #include "aci_cmh.h" | |
31 #include "ati_cmd.h" | |
32 #include "aci_cmd.h" | |
33 #include "dti.h" /* functionality of the dti library */ | |
34 | |
35 #include "dti_conn_mng.h" | |
36 #include "dti_cntrl_mng.h" | |
37 | |
38 #include "aci_fd.h" | |
39 #include "aci_io.h" | |
40 #include "psa.h" | |
41 #include "psa_t30.h" | |
42 #include "psa_cc.h" | |
43 #include "cmh.h" | |
44 #include "cmh_t30.h" | |
45 #include "cmh_cc.h" | |
46 | |
47 | |
48 #include "cmh_ra.h" | |
49 | |
50 #include "psa_uart.h" | |
51 #include "cmh_uart.h" | |
52 #ifdef FF_PSI | |
53 #include "psa_psi.h" | |
54 #include "cmh_psi.h" | |
55 #include "ati_src_psi.h" | |
56 #endif /*FF_PSI*/ | |
57 | |
58 /*==== CONSTANTS ==================================================*/ | |
59 | |
60 #define T30_DEF_THLD (90) /* good page threshold in percent */ | |
61 | |
62 #ifdef _SIMULATION_ | |
63 #define T30_DEF_FRMPRIM (3) /* no. frames per primitive */ | |
64 #else | |
65 #define T30_DEF_FRMPRIM (42) /* no. frames per primitive */ | |
66 #endif | |
67 | |
68 /*==== EXPORT =====================================================*/ | |
69 | |
70 /* remove after testing ??? */ | |
71 /* EXTERN void TST_getSimData(UBYTE *data, USHORT nomLen, | |
72 USHORT *actLen, UBYTE *final); */ | |
73 | |
74 /*==== VARIABLES ==================================================*/ | |
75 | |
76 /*==== FUNCTIONS ==================================================*/ | |
77 | |
78 /* | |
79 +--------------------------------------------------------------------+ | |
80 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
81 | STATE : code ROUTINE : sAT_PlusFCLASS | | |
82 +--------------------------------------------------------------------+ | |
83 | |
84 PURPOSE : This is the functional counterpart to the +FCLASS AT | |
85 command which is responsible to set the class mode. | |
86 | |
87 <class_type>: class mode. | |
88 */ | |
89 | |
90 GLOBAL T_ACI_RETURN sAT_PlusFCLASS ( T_ACI_CMD_SRC srcId, | |
91 T_ACI_FCLASS_CLASS class_type ) | |
92 { | |
93 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
94 | |
95 TRACE_FUNCTION ("sAT_PlusFCLASS()"); | |
96 | |
97 /* | |
98 *------------------------------------------------------------------- | |
99 * check command source | |
100 *------------------------------------------------------------------- | |
101 */ | |
102 if(!cmh_IsVldCmdSrc (srcId)) | |
103 { | |
104 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
105 return( AT_FAIL ); | |
106 } | |
107 | |
108 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
109 | |
110 /* | |
111 *------------------------------------------------------------------- | |
112 * stop FIT timer | |
113 *------------------------------------------------------------------- | |
114 */ | |
115 cmhT30_StopFIT(); | |
116 | |
117 /* | |
118 *------------------------------------------------------------------- | |
119 * process the class_type parameter | |
120 *------------------------------------------------------------------- | |
121 */ | |
122 switch( class_type ) | |
123 { | |
124 case( FCLASS_CLASS_NotPresent ): | |
125 break; | |
126 | |
127 case( FCLASS_CLASS_Voice ): | |
128 case( FCLASS_CLASS_Data ): | |
129 case( FCLASS_CLASS_Fax20 ): | |
130 pT30CmdPrm -> FCLASSclass = class_type; | |
131 break; | |
132 | |
133 case( FCLASS_CLASS_Fax2 ): /* not implemented */ | |
134 default: | |
135 | |
136 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
137 return( AT_FAIL ); | |
138 } | |
139 | |
140 /* | |
141 *------------------------------------------------------------------- | |
142 * start FIT timer | |
143 *------------------------------------------------------------------- | |
144 */ | |
145 cmhT30_StartFIT(); | |
146 | |
147 return( AT_CMPL ); | |
148 } | |
149 | |
150 /* | |
151 +--------------------------------------------------------------------+ | |
152 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
153 | STATE : code ROUTINE : sAT_PlusFCR | | |
154 +--------------------------------------------------------------------+ | |
155 | |
156 PURPOSE : This is the functional counterpart to the +FCR AT | |
157 command which is responsible to set the receive | |
158 capability. | |
159 | |
160 <value>: receive capability. | |
161 */ | |
162 | |
163 GLOBAL T_ACI_RETURN sAT_PlusFCR ( T_ACI_CMD_SRC srcId, | |
164 T_ACI_FCR_VAL value ) | |
165 { | |
166 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
167 | |
168 TRACE_FUNCTION ("sAT_PlusFCR()"); | |
169 | |
170 /* | |
171 *------------------------------------------------------------------- | |
172 * check command source | |
173 *------------------------------------------------------------------- | |
174 */ | |
175 if(!cmh_IsVldCmdSrc (srcId)) | |
176 { | |
177 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
178 return( AT_FAIL ); | |
179 } | |
180 | |
181 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
182 | |
183 /* | |
184 *------------------------------------------------------------------- | |
185 * stop FIT timer | |
186 *------------------------------------------------------------------- | |
187 */ | |
188 cmhT30_StopFIT(); | |
189 | |
190 /* | |
191 *------------------------------------------------------------------- | |
192 * process the value parameter | |
193 *------------------------------------------------------------------- | |
194 */ | |
195 switch( value ) | |
196 { | |
197 case( FCR_VAL_NotPresent ): | |
198 break; | |
199 | |
200 case( FCR_VAL_NoRcvCap ): | |
201 case( FCR_VAL_RcvCap ): | |
202 pT30CmdPrm -> FCRval = value; | |
203 break; | |
204 | |
205 default: | |
206 | |
207 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
208 return( AT_FAIL ); | |
209 } | |
210 | |
211 /* | |
212 *------------------------------------------------------------------- | |
213 * start FIT timer | |
214 *------------------------------------------------------------------- | |
215 */ | |
216 cmhT30_StartFIT(); | |
217 | |
218 return( AT_CMPL ); | |
219 } | |
220 | |
221 /* | |
222 +--------------------------------------------------------------------+ | |
223 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
224 | STATE : code ROUTINE : sAT_PlusFLI | | |
225 +--------------------------------------------------------------------+ | |
226 | |
227 PURPOSE : This is the functional counterpart to the +FLI AT | |
228 command which is responsible to set the local id string | |
229 (CSI/TSI). | |
230 | |
231 <idStr>: local id string(0 terminated). | |
232 */ | |
233 | |
234 GLOBAL T_ACI_RETURN sAT_PlusFLI ( T_ACI_CMD_SRC srcId, | |
235 CHAR * idStr ) | |
236 { | |
237 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
238 | |
239 TRACE_FUNCTION ("sAT_PlusFLI()"); | |
240 | |
241 /* | |
242 *------------------------------------------------------------------- | |
243 * check command source | |
244 *------------------------------------------------------------------- | |
245 */ | |
246 if(!cmh_IsVldCmdSrc (srcId)) | |
247 { | |
248 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
249 return( AT_FAIL ); | |
250 } | |
251 | |
252 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
253 | |
254 /* | |
255 *------------------------------------------------------------------- | |
256 * stop FIT timer | |
257 *------------------------------------------------------------------- | |
258 */ | |
259 cmhT30_StopFIT(); | |
260 | |
261 /* | |
262 *------------------------------------------------------------------- | |
263 * process the idStr parameter | |
264 *------------------------------------------------------------------- | |
265 */ | |
266 if( ! idStr ) | |
267 { | |
268 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
269 return( AT_FAIL ); | |
270 } | |
271 | |
272 strncpy( pT30CmdPrm -> FLIstr, idStr, MAX_ID_CHAR-1 ); | |
273 pT30CmdPrm -> FLIstr[MAX_ID_CHAR-1] = 0; | |
274 | |
275 /* | |
276 *------------------------------------------------------------------- | |
277 * start FIT timer | |
278 *------------------------------------------------------------------- | |
279 */ | |
280 cmhT30_StartFIT(); | |
281 | |
282 return( AT_CMPL ); | |
283 } | |
284 | |
285 /* | |
286 +--------------------------------------------------------------------+ | |
287 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
288 | STATE : code ROUTINE : sAT_PlusFPI | | |
289 +--------------------------------------------------------------------+ | |
290 | |
291 PURPOSE : This is the functional counterpart to the +FPI AT | |
292 command which is responsible to set the local id string | |
293 (CGI). | |
294 | |
295 <idStr>: local id string(0 terminated). | |
296 */ | |
297 | |
298 GLOBAL T_ACI_RETURN sAT_PlusFPI ( T_ACI_CMD_SRC srcId, | |
299 CHAR * idStr ) | |
300 { | |
301 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
302 | |
303 TRACE_FUNCTION ("sAT_PlusFPI()"); | |
304 | |
305 /* | |
306 *------------------------------------------------------------------- | |
307 * check command source | |
308 *------------------------------------------------------------------- | |
309 */ | |
310 if(!cmh_IsVldCmdSrc (srcId)) | |
311 { | |
312 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
313 return( AT_FAIL ); | |
314 } | |
315 | |
316 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
317 | |
318 /* | |
319 *------------------------------------------------------------------- | |
320 * stop FIT timer | |
321 *------------------------------------------------------------------- | |
322 */ | |
323 cmhT30_StopFIT(); | |
324 | |
325 /* | |
326 *------------------------------------------------------------------- | |
327 * process the idStr parameter | |
328 *------------------------------------------------------------------- | |
329 */ | |
330 if( ! idStr ) | |
331 { | |
332 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
333 return( AT_FAIL ); | |
334 } | |
335 | |
336 strncpy( pT30CmdPrm -> FPIstr, idStr, MAX_ID_CHAR-1 ); | |
337 pT30CmdPrm -> FPIstr[MAX_ID_CHAR-1] = 0; | |
338 | |
339 /* | |
340 *------------------------------------------------------------------- | |
341 * start FIT timer | |
342 *------------------------------------------------------------------- | |
343 */ | |
344 cmhT30_StartFIT(); | |
345 | |
346 return( AT_CMPL ); | |
347 } | |
348 | |
349 /* | |
350 +--------------------------------------------------------------------+ | |
351 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
352 | STATE : code ROUTINE : sAT_PlusFSA | | |
353 +--------------------------------------------------------------------+ | |
354 | |
355 PURPOSE : This is the functional counterpart to the +FSA AT | |
356 command which is responsible to set the destination | |
357 subaddress string | |
358 | |
359 <subStr>: destination subaddress string(0 terminated). | |
360 */ | |
361 | |
362 GLOBAL T_ACI_RETURN sAT_PlusFSA ( T_ACI_CMD_SRC srcId, | |
363 CHAR * subStr ) | |
364 { | |
365 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
366 | |
367 TRACE_FUNCTION ("sAT_PlusFSA()"); | |
368 | |
369 /* | |
370 *------------------------------------------------------------------- | |
371 * check command source | |
372 *------------------------------------------------------------------- | |
373 */ | |
374 if(!cmh_IsVldCmdSrc (srcId)) | |
375 { | |
376 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
377 return( AT_FAIL ); | |
378 } | |
379 | |
380 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
381 | |
382 /* | |
383 *------------------------------------------------------------------- | |
384 * stop FIT timer | |
385 *------------------------------------------------------------------- | |
386 */ | |
387 cmhT30_StopFIT(); | |
388 | |
389 /* | |
390 *------------------------------------------------------------------- | |
391 * process the idStr parameter | |
392 *------------------------------------------------------------------- | |
393 */ | |
394 if( ! subStr ) | |
395 { | |
396 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
397 return( AT_FAIL ); | |
398 } | |
399 | |
400 strncpy( pT30CmdPrm -> FSAsub, subStr, MAX_ID_CHAR-1 ); | |
401 pT30CmdPrm -> FSAsub[MAX_ID_CHAR-1] = 0; | |
402 | |
403 /* | |
404 *------------------------------------------------------------------- | |
405 * start FIT timer | |
406 *------------------------------------------------------------------- | |
407 */ | |
408 cmhT30_StartFIT(); | |
409 | |
410 return( AT_CMPL ); | |
411 } | |
412 | |
413 /* | |
414 +--------------------------------------------------------------------+ | |
415 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
416 | STATE : code ROUTINE : sAT_PlusFPA | | |
417 +--------------------------------------------------------------------+ | |
418 | |
419 PURPOSE : This is the functional counterpart to the +FPA AT | |
420 command which is responsible to set the selective polling | |
421 address string. | |
422 | |
423 <sepStr>: selective polling address string(0 terminated). | |
424 */ | |
425 | |
426 GLOBAL T_ACI_RETURN sAT_PlusFPA ( T_ACI_CMD_SRC srcId, | |
427 CHAR * sepStr ) | |
428 { | |
429 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
430 | |
431 TRACE_FUNCTION ("sAT_PlusFPA()"); | |
432 | |
433 /* | |
434 *------------------------------------------------------------------- | |
435 * check command source | |
436 *------------------------------------------------------------------- | |
437 */ | |
438 if(!cmh_IsVldCmdSrc (srcId)) | |
439 { | |
440 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
441 return( AT_FAIL ); | |
442 } | |
443 | |
444 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
445 | |
446 /* | |
447 *------------------------------------------------------------------- | |
448 * stop FIT timer | |
449 *------------------------------------------------------------------- | |
450 */ | |
451 cmhT30_StopFIT(); | |
452 | |
453 /* | |
454 *------------------------------------------------------------------- | |
455 * process the idStr parameter | |
456 *------------------------------------------------------------------- | |
457 */ | |
458 if( ! sepStr ) | |
459 { | |
460 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
461 return( AT_FAIL ); | |
462 } | |
463 | |
464 strncpy( pT30CmdPrm -> FPAsep, sepStr, MAX_ID_CHAR-1 ); | |
465 pT30CmdPrm -> FPAsep[MAX_ID_CHAR-1] = 0; | |
466 | |
467 /* | |
468 *------------------------------------------------------------------- | |
469 * start FIT timer | |
470 *------------------------------------------------------------------- | |
471 */ | |
472 cmhT30_StartFIT(); | |
473 | |
474 return( AT_CMPL ); | |
475 } | |
476 | |
477 /* | |
478 +--------------------------------------------------------------------+ | |
479 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
480 | STATE : code ROUTINE : sAT_PlusFPW | | |
481 +--------------------------------------------------------------------+ | |
482 | |
483 PURPOSE : This is the functional counterpart to the +FPW AT | |
484 command which is responsible to set the password string. | |
485 | |
486 <pwdStr>: password string(0 terminated). | |
487 */ | |
488 | |
489 GLOBAL T_ACI_RETURN sAT_PlusFPW ( T_ACI_CMD_SRC srcId, | |
490 CHAR * pwdStr ) | |
491 { | |
492 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
493 | |
494 TRACE_FUNCTION ("sAT_PlusFPW()"); | |
495 | |
496 /* | |
497 *------------------------------------------------------------------- | |
498 * check command source | |
499 *------------------------------------------------------------------- | |
500 */ | |
501 if(!cmh_IsVldCmdSrc (srcId)) | |
502 { | |
503 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
504 return( AT_FAIL ); | |
505 } | |
506 | |
507 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
508 | |
509 /* | |
510 *------------------------------------------------------------------- | |
511 * stop FIT timer | |
512 *------------------------------------------------------------------- | |
513 */ | |
514 cmhT30_StopFIT(); | |
515 | |
516 /* | |
517 *------------------------------------------------------------------- | |
518 * process the idStr parameter | |
519 *------------------------------------------------------------------- | |
520 */ | |
521 if( ! pwdStr ) | |
522 { | |
523 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
524 return( AT_FAIL ); | |
525 } | |
526 | |
527 strncpy( pT30CmdPrm -> FPWpwd, pwdStr, MAX_ID_CHAR-1 ); | |
528 pT30CmdPrm -> FPWpwd[MAX_ID_CHAR-1] = 0; | |
529 | |
530 /* | |
531 *------------------------------------------------------------------- | |
532 * start FIT timer | |
533 *------------------------------------------------------------------- | |
534 */ | |
535 cmhT30_StartFIT(); | |
536 | |
537 return( AT_CMPL ); | |
538 } | |
539 | |
540 /* | |
541 +--------------------------------------------------------------------+ | |
542 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
543 | STATE : code ROUTINE : sAT_PlusFCC | | |
544 +--------------------------------------------------------------------+ | |
545 | |
546 PURPOSE : This is the functional counterpart to the +FCC AT | |
547 command which is responsible to set the DCE capabilities. | |
548 | |
549 <vr>: resolution. | |
550 <br>: bit rate. | |
551 <wd>: page width. | |
552 <ln>: page length. | |
553 <df>: data compression. | |
554 <ec>: error correction. | |
555 <bt>: file transer. | |
556 <st>: scan time. | |
557 <jp>: JPEG mode. | |
558 */ | |
559 | |
560 GLOBAL T_ACI_RETURN sAT_PlusFCC ( T_ACI_CMD_SRC srcId, T_ACI_F_VR vr, | |
561 T_ACI_F_BR br, T_ACI_F_WD wd, | |
562 T_ACI_F_LN ln, T_ACI_F_DF df, | |
563 T_ACI_F_EC ec, T_ACI_F_BF bf, | |
564 T_ACI_F_ST st, T_ACI_F_JP jp ) | |
565 { | |
566 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
567 | |
568 TRACE_FUNCTION ("sAT_PlusFCC()"); | |
569 | |
570 /* | |
571 *------------------------------------------------------------------- | |
572 * check command source | |
573 *------------------------------------------------------------------- | |
574 */ | |
575 if(!cmh_IsVldCmdSrc (srcId)) | |
576 { | |
577 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
578 return( AT_FAIL ); | |
579 } | |
580 | |
581 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
582 | |
583 /* | |
584 *------------------------------------------------------------------- | |
585 * stop FIT timer | |
586 *------------------------------------------------------------------- | |
587 */ | |
588 cmhT30_StopFIT(); | |
589 | |
590 /* | |
591 *------------------------------------------------------------------- | |
592 * process the vr parameter | |
593 *------------------------------------------------------------------- | |
594 */ | |
595 switch (vr) | |
596 { | |
597 case F_VR_NotPresent: | |
598 vr = pT30CmdPrm -> FCCvr; | |
599 break; | |
600 | |
601 case F_VR_R8X3_85: | |
602 case F_VR_R8X7_7: | |
603 case F_VR_R8X15_4: | |
604 case F_VR_R16X15_4: | |
605 case F_VR_200X100: | |
606 case F_VR_200X200: | |
607 case F_VR_200X400: | |
608 case F_VR_300X300: | |
609 break; | |
610 | |
611 default: | |
612 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
613 return AT_FAIL; | |
614 } | |
615 | |
616 /* | |
617 *------------------------------------------------------------------- | |
618 * process the br parameter | |
619 *------------------------------------------------------------------- | |
620 */ | |
621 switch( br ) | |
622 { | |
623 case( F_BR_NotPresent ): | |
624 | |
625 br = pT30CmdPrm -> FCCbr; | |
626 break; | |
627 | |
628 case( F_BR_2400 ): | |
629 case( F_BR_4800 ): | |
630 case( F_BR_7200 ): | |
631 case( F_BR_9600 ): | |
632 case( F_BR_12000 ): | |
633 case( F_BR_14400 ): | |
634 | |
635 break; | |
636 | |
637 default: | |
638 | |
639 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
640 return( AT_FAIL ); | |
641 } | |
642 | |
643 /* | |
644 *------------------------------------------------------------------- | |
645 * process the wd parameter | |
646 *------------------------------------------------------------------- | |
647 */ | |
648 switch( wd ) | |
649 { | |
650 case( F_WD_NotPresent ): | |
651 | |
652 wd = pT30CmdPrm -> FCCwd; | |
653 break; | |
654 | |
655 case( F_WD_1728 ): | |
656 case( F_WD_2048 ): | |
657 case( F_WD_2432 ): | |
658 case( F_WD_1216 ): | |
659 case( F_WD_864 ): | |
660 | |
661 break; | |
662 | |
663 default: | |
664 | |
665 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
666 return( AT_FAIL ); | |
667 } | |
668 | |
669 /* | |
670 *------------------------------------------------------------------- | |
671 * process the ln parameter | |
672 *------------------------------------------------------------------- | |
673 */ | |
674 switch( ln ) | |
675 { | |
676 case( F_LN_NotPresent ): | |
677 | |
678 ln = pT30CmdPrm -> FCCln; | |
679 break; | |
680 | |
681 case( F_LN_A4 ): | |
682 case( F_LN_B4 ): | |
683 case( F_LN_Unlimited ): | |
684 | |
685 break; | |
686 | |
687 default: | |
688 | |
689 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
690 return( AT_FAIL ); | |
691 } | |
692 | |
693 /* | |
694 *------------------------------------------------------------------- | |
695 * process the df parameter | |
696 *------------------------------------------------------------------- | |
697 */ | |
698 switch( df ) | |
699 { | |
700 case( F_DF_NotPresent ): | |
701 | |
702 df = pT30CmdPrm -> FCCdf; | |
703 break; | |
704 | |
705 case( F_DF_1D_MdfHuff ): | |
706 | |
707 break; | |
708 | |
709 case( F_DF_2D_MdfRd_T4 ): /* not implemented */ | |
710 case( F_DF_2D_Uncomp ): /* not implemented */ | |
711 case( F_DF_2D_MdfRd_T6 ): /* not implemented */ | |
712 default: | |
713 | |
714 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
715 return( AT_FAIL ); | |
716 } | |
717 | |
718 /* | |
719 *------------------------------------------------------------------- | |
720 * process the ec parameter | |
721 *------------------------------------------------------------------- | |
722 */ | |
723 switch( ec ) | |
724 { | |
725 case( F_EC_NotPresent ): | |
726 | |
727 ec = pT30CmdPrm -> FCCec; | |
728 break; | |
729 | |
730 case( F_EC_DisableECM ): | |
731 | |
732 break; | |
733 | |
734 case( F_EC_EnableECM ): /* not implemented */ | |
735 case( F_EC_EnableHalfDup ): /* not implemented */ | |
736 case( F_EC_EnableFullDup ): /* not implemented */ | |
737 default: | |
738 | |
739 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
740 return( AT_FAIL ); | |
741 } | |
742 | |
743 /* | |
744 *------------------------------------------------------------------- | |
745 * process the bf parameter | |
746 *------------------------------------------------------------------- | |
747 */ | |
748 if( bf NEQ F_BF_NotPresent ) | |
749 { | |
750 if( bf > F_BF_DisableFileTrnsf ) /* others are not implemented */ | |
751 { | |
752 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
753 return( AT_FAIL ); | |
754 } | |
755 } | |
756 else | |
757 | |
758 bf = pT30CmdPrm -> FCCbf; | |
759 | |
760 /* | |
761 *------------------------------------------------------------------- | |
762 * process the st parameter | |
763 *------------------------------------------------------------------- | |
764 */ | |
765 switch( st ) | |
766 { | |
767 case( F_ST_NotPresent ): | |
768 | |
769 st = pT30CmdPrm -> FCCst; | |
770 break; | |
771 | |
772 case( F_ST_0_0 ): | |
773 case( F_ST_5_5 ): | |
774 case( F_ST_10_5 ): | |
775 case( F_ST_10_10 ): | |
776 case( F_ST_20_10 ): | |
777 case( F_ST_20_20 ): | |
778 case( F_ST_40_20 ): | |
779 case( F_ST_40_40 ): | |
780 | |
781 break; | |
782 | |
783 default: | |
784 | |
785 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
786 return( AT_FAIL ); | |
787 } | |
788 | |
789 /* | |
790 *------------------------------------------------------------------- | |
791 * process the jp parameter | |
792 *------------------------------------------------------------------- | |
793 */ | |
794 if( jp NEQ F_JP_NotPresent ) | |
795 { | |
796 if( jp > F_JP_DisableJPEG ) /* others are not implemented */ | |
797 { | |
798 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
799 return( AT_FAIL ); | |
800 } | |
801 } | |
802 else | |
803 | |
804 jp = pT30CmdPrm -> FCCjp; | |
805 | |
806 | |
807 /* | |
808 *------------------------------------------------------------------- | |
809 * assign the parameters | |
810 *------------------------------------------------------------------- | |
811 */ | |
812 pT30CmdPrm -> FCCvr = pT30CmdPrm -> FISvr = vr; | |
813 pT30CmdPrm -> FCCbr = pT30CmdPrm -> FISbr = br; | |
814 pT30CmdPrm -> FCCwd = pT30CmdPrm -> FISwd = wd; | |
815 pT30CmdPrm -> FCCln = pT30CmdPrm -> FISln = ln; | |
816 pT30CmdPrm -> FCCdf = pT30CmdPrm -> FISdf = df; | |
817 pT30CmdPrm -> FCCec = pT30CmdPrm -> FISec = ec; | |
818 pT30CmdPrm -> FCCbf = pT30CmdPrm -> FISbf = bf; | |
819 pT30CmdPrm -> FCCst = pT30CmdPrm -> FISst = st; | |
820 pT30CmdPrm -> FCCjp = pT30CmdPrm -> FISjp = jp; | |
821 | |
822 | |
823 /* | |
824 *------------------------------------------------------------------- | |
825 * start FIT timer | |
826 *------------------------------------------------------------------- | |
827 */ | |
828 cmhT30_StartFIT(); | |
829 | |
830 return( AT_CMPL ); | |
831 } | |
832 | |
833 /* | |
834 +--------------------------------------------------------------------+ | |
835 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
836 | STATE : code ROUTINE : sAT_PlusFIS | | |
837 +--------------------------------------------------------------------+ | |
838 | |
839 PURPOSE : This is the functional counterpart to the +FIS AT | |
840 command which is responsible to set the current session | |
841 capabilities. | |
842 | |
843 <vr>: resolution. | |
844 <br>: bit rate. | |
845 <wd>: page width. | |
846 <ln>: page length. | |
847 <df>: data compression. | |
848 <ec>: error correction. | |
849 <bt>: file transer. | |
850 <st>: scan time. | |
851 <jp>: JPEG mode. | |
852 */ | |
853 | |
854 GLOBAL T_ACI_RETURN sAT_PlusFIS ( T_ACI_CMD_SRC srcId, T_ACI_F_VR vr, | |
855 T_ACI_F_BR br, T_ACI_F_WD wd, | |
856 T_ACI_F_LN ln, T_ACI_F_DF df, | |
857 T_ACI_F_EC ec, T_ACI_F_BF bf, | |
858 T_ACI_F_ST st, T_ACI_F_JP jp ) | |
859 { | |
860 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
861 | |
862 TRACE_FUNCTION ("sAT_PlusFIS()"); | |
863 | |
864 /* | |
865 *------------------------------------------------------------------- | |
866 * check command source | |
867 *------------------------------------------------------------------- | |
868 */ | |
869 if(!cmh_IsVldCmdSrc (srcId)) | |
870 { | |
871 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
872 return( AT_FAIL ); | |
873 } | |
874 | |
875 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
876 | |
877 /* | |
878 *------------------------------------------------------------------- | |
879 * stop FIT timer | |
880 *------------------------------------------------------------------- | |
881 */ | |
882 cmhT30_StopFIT(); | |
883 | |
884 /* | |
885 *------------------------------------------------------------------- | |
886 * process the vr parameter | |
887 *------------------------------------------------------------------- | |
888 */ | |
889 switch (vr) | |
890 { | |
891 case F_VR_NotPresent: | |
892 vr = pT30CmdPrm -> FISvr; | |
893 break; | |
894 | |
895 case F_VR_R8X3_85: | |
896 case F_VR_R8X7_7: | |
897 case F_VR_R8X15_4: | |
898 case F_VR_R16X15_4: | |
899 case F_VR_200X100: | |
900 case F_VR_200X200: | |
901 case F_VR_200X400: | |
902 case F_VR_300X300: | |
903 break; | |
904 | |
905 default: | |
906 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
907 return AT_FAIL; | |
908 } | |
909 | |
910 /* | |
911 *------------------------------------------------------------------- | |
912 * process the br parameter | |
913 *------------------------------------------------------------------- | |
914 */ | |
915 switch( br ) | |
916 { | |
917 case( F_BR_NotPresent ): | |
918 | |
919 br = pT30CmdPrm -> FISbr; | |
920 break; | |
921 | |
922 case( F_BR_2400 ): | |
923 case( F_BR_4800 ): | |
924 case( F_BR_7200 ): | |
925 case( F_BR_9600 ): | |
926 case( F_BR_12000 ): | |
927 case( F_BR_14400 ): | |
928 | |
929 break; | |
930 | |
931 default: | |
932 | |
933 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
934 return( AT_FAIL ); | |
935 } | |
936 | |
937 /* | |
938 *------------------------------------------------------------------- | |
939 * process the wd parameter | |
940 *------------------------------------------------------------------- | |
941 */ | |
942 switch( wd ) | |
943 { | |
944 case( F_WD_NotPresent ): | |
945 | |
946 wd = pT30CmdPrm -> FISwd; | |
947 break; | |
948 | |
949 case( F_WD_1728 ): | |
950 case( F_WD_2048 ): | |
951 case( F_WD_2432 ): | |
952 case( F_WD_1216 ): | |
953 case( F_WD_864 ): | |
954 | |
955 break; | |
956 | |
957 default: | |
958 | |
959 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
960 return( AT_FAIL ); | |
961 } | |
962 | |
963 /* | |
964 *------------------------------------------------------------------- | |
965 * process the ln parameter | |
966 *------------------------------------------------------------------- | |
967 */ | |
968 switch( ln ) | |
969 { | |
970 case( F_LN_NotPresent ): | |
971 | |
972 ln = pT30CmdPrm -> FISln; | |
973 break; | |
974 | |
975 case( F_LN_A4 ): | |
976 case( F_LN_B4 ): | |
977 case( F_LN_Unlimited ): | |
978 | |
979 break; | |
980 | |
981 default: | |
982 | |
983 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
984 return( AT_FAIL ); | |
985 } | |
986 | |
987 /* | |
988 *------------------------------------------------------------------- | |
989 * process the df parameter | |
990 *------------------------------------------------------------------- | |
991 */ | |
992 switch( df ) | |
993 { | |
994 case( F_DF_NotPresent ): | |
995 | |
996 df = pT30CmdPrm -> FISdf; | |
997 break; | |
998 | |
999 case( F_DF_1D_MdfHuff ): | |
1000 | |
1001 break; | |
1002 | |
1003 case( F_DF_2D_MdfRd_T4 ): /* not implemented */ | |
1004 case( F_DF_2D_Uncomp ): /* not implemented */ | |
1005 case( F_DF_2D_MdfRd_T6 ): /* not implemented */ | |
1006 default: | |
1007 | |
1008 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1009 return( AT_FAIL ); | |
1010 } | |
1011 | |
1012 /* | |
1013 *------------------------------------------------------------------- | |
1014 * process the ec parameter | |
1015 *------------------------------------------------------------------- | |
1016 */ | |
1017 switch( ec ) | |
1018 { | |
1019 case( F_EC_NotPresent ): | |
1020 | |
1021 ec = pT30CmdPrm -> FISec; | |
1022 break; | |
1023 | |
1024 case( F_EC_DisableECM ): | |
1025 | |
1026 break; | |
1027 | |
1028 case( F_EC_EnableECM ): /* not implemented */ | |
1029 case( F_EC_EnableHalfDup ): /* not implemented */ | |
1030 case( F_EC_EnableFullDup ): /* not implemented */ | |
1031 default: | |
1032 | |
1033 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1034 return( AT_FAIL ); | |
1035 } | |
1036 | |
1037 /* | |
1038 *------------------------------------------------------------------- | |
1039 * process the bf parameter | |
1040 *------------------------------------------------------------------- | |
1041 */ | |
1042 if( bf NEQ F_BF_NotPresent ) | |
1043 { | |
1044 if( bf > F_BF_DisableFileTrnsf ) /* others are not implemented */ | |
1045 { | |
1046 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1047 return( AT_FAIL ); | |
1048 } | |
1049 } | |
1050 else | |
1051 | |
1052 bf = pT30CmdPrm -> FISbf; | |
1053 | |
1054 /* | |
1055 *------------------------------------------------------------------- | |
1056 * process the st parameter | |
1057 *------------------------------------------------------------------- | |
1058 */ | |
1059 switch( st ) | |
1060 { | |
1061 case( F_ST_NotPresent ): | |
1062 | |
1063 st = pT30CmdPrm -> FISst; | |
1064 break; | |
1065 | |
1066 case( F_ST_0_0 ): | |
1067 case( F_ST_5_5 ): | |
1068 case( F_ST_10_5 ): | |
1069 case( F_ST_10_10 ): | |
1070 case( F_ST_20_10 ): | |
1071 case( F_ST_20_20 ): | |
1072 case( F_ST_40_20 ): | |
1073 case( F_ST_40_40 ): | |
1074 | |
1075 break; | |
1076 | |
1077 default: | |
1078 | |
1079 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1080 return( AT_FAIL ); | |
1081 } | |
1082 | |
1083 /* | |
1084 *------------------------------------------------------------------- | |
1085 * process the jp parameter | |
1086 *------------------------------------------------------------------- | |
1087 */ | |
1088 if( jp NEQ F_JP_NotPresent ) | |
1089 { | |
1090 if( jp > F_JP_DisableJPEG ) /* others are not implemented */ | |
1091 { | |
1092 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1093 return( AT_FAIL ); | |
1094 } | |
1095 } | |
1096 else | |
1097 | |
1098 jp = pT30CmdPrm -> FISjp; | |
1099 | |
1100 /* | |
1101 *------------------------------------------------------------------- | |
1102 * assign the parameters | |
1103 *------------------------------------------------------------------- | |
1104 */ | |
1105 pT30CmdPrm -> FISvr = vr; | |
1106 pT30CmdPrm -> FISbr = br; | |
1107 pT30CmdPrm -> FISwd = wd; | |
1108 pT30CmdPrm -> FISln = ln; | |
1109 pT30CmdPrm -> FISdf = df; | |
1110 pT30CmdPrm -> FISec = ec; | |
1111 pT30CmdPrm -> FISbf = bf; | |
1112 pT30CmdPrm -> FISst = st; | |
1113 pT30CmdPrm -> FISjp = jp; | |
1114 | |
1115 /* | |
1116 *------------------------------------------------------------------- | |
1117 * start FIT timer | |
1118 *------------------------------------------------------------------- | |
1119 */ | |
1120 cmhT30_StartFIT(); | |
1121 | |
1122 return( AT_CMPL ); | |
1123 } | |
1124 | |
1125 /* | |
1126 +--------------------------------------------------------------------+ | |
1127 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
1128 | STATE : code ROUTINE : sAT_PlusFNS | | |
1129 +--------------------------------------------------------------------+ | |
1130 | |
1131 PURPOSE : This is the functional counterpart to the +FNS AT | |
1132 command which is responsible to set the string for | |
1133 non-standard facilities. | |
1134 | |
1135 <len>: length of nsf string. | |
1136 <nsf>: nsf octed string. | |
1137 */ | |
1138 | |
1139 GLOBAL T_ACI_RETURN sAT_PlusFNS ( T_ACI_CMD_SRC srcId, | |
1140 UBYTE len, | |
1141 UBYTE * nsf ) | |
1142 { | |
1143 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
1144 | |
1145 TRACE_FUNCTION ("sAT_PlusFNS()"); | |
1146 | |
1147 /* | |
1148 *------------------------------------------------------------------- | |
1149 * check command source | |
1150 *------------------------------------------------------------------- | |
1151 */ | |
1152 if(!cmh_IsVldCmdSrc (srcId)) | |
1153 { | |
1154 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1155 return( AT_FAIL ); | |
1156 } | |
1157 | |
1158 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
1159 | |
1160 /* | |
1161 *------------------------------------------------------------------- | |
1162 * stop FIT timer | |
1163 *------------------------------------------------------------------- | |
1164 */ | |
1165 cmhT30_StopFIT(); | |
1166 | |
1167 /* | |
1168 *------------------------------------------------------------------- | |
1169 * process the len and nsf parameter | |
1170 *------------------------------------------------------------------- | |
1171 */ | |
1172 if((len > 0 AND ! nsf) OR len > MAX_NSF_BYTE ) | |
1173 { | |
1174 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1175 return( AT_FAIL ); | |
1176 } | |
1177 | |
1178 if( len EQ 0 ) | |
1179 { | |
1180 pT30CmdPrm -> FNSlen = 0; | |
1181 } | |
1182 else | |
1183 { | |
1184 if (MINIMUM(MAX_NSF_BYTE - pT30CmdPrm -> FNSlen, len)) | |
1185 { | |
1186 memcpy( &pT30CmdPrm -> FNSoct[pT30CmdPrm -> FNSlen], nsf, | |
1187 MINIMUM(MAX_NSF_BYTE - pT30CmdPrm -> FNSlen, len) ); | |
1188 } | |
1189 | |
1190 pT30CmdPrm -> FNSlen += | |
1191 MINIMUM(MAX_NSF_BYTE - pT30CmdPrm -> FNSlen, len); | |
1192 } | |
1193 | |
1194 /* | |
1195 *------------------------------------------------------------------- | |
1196 * start FIT timer | |
1197 *------------------------------------------------------------------- | |
1198 */ | |
1199 cmhT30_StartFIT(); | |
1200 | |
1201 return( AT_CMPL ); | |
1202 } | |
1203 | |
1204 /* | |
1205 +--------------------------------------------------------------------+ | |
1206 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
1207 | STATE : code ROUTINE : sAT_PlusFLP | | |
1208 +--------------------------------------------------------------------+ | |
1209 | |
1210 PURPOSE : This is the functional counterpart to the +FLP AT | |
1211 command which is responsible to indicate a document for | |
1212 polling. | |
1213 | |
1214 <value>: polling indication. | |
1215 */ | |
1216 | |
1217 GLOBAL T_ACI_RETURN sAT_PlusFLP (T_ACI_CMD_SRC srcId, | |
1218 T_ACI_FLP_VAL value ) | |
1219 { | |
1220 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
1221 | |
1222 TRACE_FUNCTION ("sAT_PlusFLP()"); | |
1223 | |
1224 /* | |
1225 *------------------------------------------------------------------- | |
1226 * check command source | |
1227 *------------------------------------------------------------------- | |
1228 */ | |
1229 if(!cmh_IsVldCmdSrc (srcId)) | |
1230 { | |
1231 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1232 return( AT_FAIL ); | |
1233 } | |
1234 | |
1235 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
1236 | |
1237 /* | |
1238 *------------------------------------------------------------------- | |
1239 * stop FIT timer | |
1240 *------------------------------------------------------------------- | |
1241 */ | |
1242 cmhT30_StopFIT(); | |
1243 | |
1244 /* | |
1245 *------------------------------------------------------------------- | |
1246 * process the value parameter | |
1247 *------------------------------------------------------------------- | |
1248 */ | |
1249 switch( value ) | |
1250 { | |
1251 case( FLP_VAL_NotPresent ): | |
1252 | |
1253 break; | |
1254 | |
1255 case( FLP_VAL_NoPollDoc ): | |
1256 case( FLP_VAL_PollDoc ): | |
1257 | |
1258 pT30CmdPrm -> FLPval = value; | |
1259 break; | |
1260 | |
1261 default: | |
1262 | |
1263 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1264 return( AT_FAIL ); | |
1265 } | |
1266 | |
1267 /* | |
1268 *------------------------------------------------------------------- | |
1269 * start FIT timer | |
1270 *------------------------------------------------------------------- | |
1271 */ | |
1272 cmhT30_StartFIT(); | |
1273 | |
1274 return( AT_CMPL ); | |
1275 } | |
1276 | |
1277 /* | |
1278 +--------------------------------------------------------------------+ | |
1279 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
1280 | STATE : code ROUTINE : sAT_PlusFIE | | |
1281 +--------------------------------------------------------------------+ | |
1282 | |
1283 PURPOSE : This is the functional counterpart to the +FIE AT | |
1284 command which is responsible to enable procedure interrupts. | |
1285 | |
1286 <value>: PI mode. | |
1287 */ | |
1288 | |
1289 GLOBAL T_ACI_RETURN sAT_PlusFIE (T_ACI_CMD_SRC srcId, | |
1290 T_ACI_FIE_VAL value ) | |
1291 { | |
1292 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
1293 | |
1294 TRACE_FUNCTION ("sAT_PlusFIE()"); | |
1295 | |
1296 /* | |
1297 *------------------------------------------------------------------- | |
1298 * check command source | |
1299 *------------------------------------------------------------------- | |
1300 */ | |
1301 if(!cmh_IsVldCmdSrc (srcId)) | |
1302 { | |
1303 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1304 return( AT_FAIL ); | |
1305 } | |
1306 | |
1307 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
1308 | |
1309 /* | |
1310 *------------------------------------------------------------------- | |
1311 * stop FIT timer | |
1312 *------------------------------------------------------------------- | |
1313 */ | |
1314 cmhT30_StopFIT(); | |
1315 | |
1316 /* | |
1317 *------------------------------------------------------------------- | |
1318 * process the value parameter | |
1319 *------------------------------------------------------------------- | |
1320 */ | |
1321 switch( value ) | |
1322 { | |
1323 case( FIE_VAL_NotPresent ): | |
1324 | |
1325 break; | |
1326 | |
1327 case( FIE_VAL_IgnorePRI ): | |
1328 case( FIE_VAL_AcceptPRI ): | |
1329 | |
1330 pT30CmdPrm -> FIEval = value; | |
1331 break; | |
1332 | |
1333 default: | |
1334 | |
1335 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1336 return( AT_FAIL ); | |
1337 } | |
1338 | |
1339 /* | |
1340 *------------------------------------------------------------------- | |
1341 * start FIT timer | |
1342 *------------------------------------------------------------------- | |
1343 */ | |
1344 cmhT30_StartFIT(); | |
1345 | |
1346 return( AT_CMPL ); | |
1347 } | |
1348 | |
1349 /* | |
1350 +--------------------------------------------------------------------+ | |
1351 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
1352 | STATE : code ROUTINE : sAT_PlusFCQ | | |
1353 +--------------------------------------------------------------------+ | |
1354 | |
1355 PURPOSE : This is the functional counterpart to the +FCQ AT | |
1356 command which is responsible to set the copy quality | |
1357 checking. | |
1358 | |
1359 <rq>: receive quality. | |
1360 <tq>: transmit quality. | |
1361 */ | |
1362 | |
1363 GLOBAL T_ACI_RETURN sAT_PlusFCQ (T_ACI_CMD_SRC srcId, | |
1364 T_ACI_FCQ_RQ rq, | |
1365 T_ACI_FCQ_TQ tq ) | |
1366 { | |
1367 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
1368 | |
1369 TRACE_FUNCTION ("sAT_PlusFCQ()"); | |
1370 | |
1371 /* | |
1372 *------------------------------------------------------------------- | |
1373 * check command source | |
1374 *------------------------------------------------------------------- | |
1375 */ | |
1376 if(!cmh_IsVldCmdSrc (srcId)) | |
1377 { | |
1378 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1379 return( AT_FAIL ); | |
1380 } | |
1381 | |
1382 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
1383 | |
1384 /* | |
1385 *------------------------------------------------------------------- | |
1386 * stop FIT timer | |
1387 *------------------------------------------------------------------- | |
1388 */ | |
1389 cmhT30_StopFIT(); | |
1390 | |
1391 /* | |
1392 *------------------------------------------------------------------- | |
1393 * process the rq parameter | |
1394 *------------------------------------------------------------------- | |
1395 */ | |
1396 switch( rq ) | |
1397 { | |
1398 case( FCQ_RQ_NotPresent ): | |
1399 | |
1400 rq = pT30CmdPrm -> FCQrq; | |
1401 break; | |
1402 | |
1403 case( FCQ_RQ_CQCDisabled ): | |
1404 case( FCQ_RQ_CQCEnabled ): | |
1405 | |
1406 break; | |
1407 | |
1408 case( FCQ_RQ_CQCandCorrection ): | |
1409 default: | |
1410 | |
1411 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1412 return( AT_FAIL ); | |
1413 } | |
1414 | |
1415 /* | |
1416 *------------------------------------------------------------------- | |
1417 * process the tq parameter | |
1418 *------------------------------------------------------------------- | |
1419 */ | |
1420 switch( tq ) | |
1421 { | |
1422 case( FCQ_TQ_NotPresent ): | |
1423 case( FCQ_TQ_CQCDisabled ): | |
1424 | |
1425 break; | |
1426 | |
1427 case( FCQ_TQ_CQCEnabled ): | |
1428 case( FCQ_TQ_CQCandCorrection ): | |
1429 default: | |
1430 | |
1431 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1432 return( AT_FAIL ); | |
1433 } | |
1434 | |
1435 /* | |
1436 *------------------------------------------------------------------- | |
1437 * assign the parameters | |
1438 *------------------------------------------------------------------- | |
1439 */ | |
1440 pT30CmdPrm -> FCQrq = rq; | |
1441 | |
1442 /* | |
1443 *------------------------------------------------------------------- | |
1444 * start FIT timer | |
1445 *------------------------------------------------------------------- | |
1446 */ | |
1447 cmhT30_StartFIT(); | |
1448 | |
1449 return( AT_CMPL ); | |
1450 } | |
1451 | |
1452 /* | |
1453 +--------------------------------------------------------------------+ | |
1454 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
1455 | STATE : code ROUTINE : sAT_PlusFIT | | |
1456 +--------------------------------------------------------------------+ | |
1457 | |
1458 PURPOSE : This is the functional counterpart to the +FIT AT | |
1459 command which is responsible to set the inactivity timeout. | |
1460 | |
1461 <time>: inactivity timeout. | |
1462 <act> : action. | |
1463 */ | |
1464 | |
1465 GLOBAL T_ACI_RETURN sAT_PlusFIT (T_ACI_CMD_SRC srcId, | |
1466 SHORT time, | |
1467 T_ACI_FIT_ACT act ) | |
1468 { | |
1469 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
1470 | |
1471 TRACE_FUNCTION ("sAT_PlusFIT()"); | |
1472 | |
1473 /* | |
1474 *------------------------------------------------------------------- | |
1475 * check command source | |
1476 *------------------------------------------------------------------- | |
1477 */ | |
1478 if(!cmh_IsVldCmdSrc (srcId)) | |
1479 { | |
1480 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1481 return( AT_FAIL ); | |
1482 } | |
1483 | |
1484 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
1485 | |
1486 /* | |
1487 *------------------------------------------------------------------- | |
1488 * stop FIT timer | |
1489 *------------------------------------------------------------------- | |
1490 */ | |
1491 cmhT30_StopFIT(); | |
1492 | |
1493 /* | |
1494 *------------------------------------------------------------------- | |
1495 * process the act parameter | |
1496 *------------------------------------------------------------------- | |
1497 */ | |
1498 switch( act ) | |
1499 { | |
1500 case( FIT_ACT_NotPresent ): | |
1501 | |
1502 act = pT30CmdPrm -> FITact; | |
1503 break; | |
1504 | |
1505 case( FIT_ACT_OnHookRst ): | |
1506 case( FIT_ACT_OnHook ): | |
1507 | |
1508 break; | |
1509 | |
1510 default: | |
1511 | |
1512 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1513 return( AT_FAIL ); | |
1514 } | |
1515 | |
1516 /* | |
1517 *------------------------------------------------------------------- | |
1518 * process the time parameter | |
1519 *------------------------------------------------------------------- | |
1520 */ | |
1521 if( time > 255 ) | |
1522 { | |
1523 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1524 return( AT_FAIL ); | |
1525 } | |
1526 | |
1527 /* | |
1528 *------------------------------------------------------------------- | |
1529 * assign the parameters | |
1530 *------------------------------------------------------------------- | |
1531 */ | |
1532 pT30CmdPrm -> FITact = act; | |
1533 | |
1534 if( time NEQ ACI_NumParmNotPresent ) | |
1535 { | |
1536 pT30CmdPrm -> FITtime = time * 1000; | |
1537 } | |
1538 | |
1539 /* | |
1540 *------------------------------------------------------------------- | |
1541 * start FIT timer | |
1542 *------------------------------------------------------------------- | |
1543 */ | |
1544 cmhT30_StartFIT(); | |
1545 | |
1546 return( AT_CMPL ); | |
1547 } | |
1548 | |
1549 /* | |
1550 +--------------------------------------------------------------------+ | |
1551 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
1552 | STATE : code ROUTINE : sAT_PlusFBO | | |
1553 +--------------------------------------------------------------------+ | |
1554 | |
1555 PURPOSE : This is the functional counterpart to the +FBO AT | |
1556 command which is responsible to set data bit order. | |
1557 | |
1558 <value>: data bit order. | |
1559 */ | |
1560 | |
1561 GLOBAL T_ACI_RETURN sAT_PlusFBO (T_ACI_CMD_SRC srcId, | |
1562 T_ACI_FBO_VAL value ) | |
1563 { | |
1564 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
1565 | |
1566 TRACE_FUNCTION ("sAT_PlusFBO()"); | |
1567 | |
1568 /* | |
1569 *------------------------------------------------------------------- | |
1570 * check command source | |
1571 *------------------------------------------------------------------- | |
1572 */ | |
1573 if(!cmh_IsVldCmdSrc (srcId)) | |
1574 { | |
1575 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1576 return( AT_FAIL ); | |
1577 } | |
1578 | |
1579 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
1580 | |
1581 /* | |
1582 *------------------------------------------------------------------- | |
1583 * stop FIT timer | |
1584 *------------------------------------------------------------------- | |
1585 */ | |
1586 cmhT30_StopFIT(); | |
1587 | |
1588 /* | |
1589 *------------------------------------------------------------------- | |
1590 * process the value parameter | |
1591 *------------------------------------------------------------------- | |
1592 */ | |
1593 switch( value ) | |
1594 { | |
1595 case( FBO_VAL_NotPresent ): | |
1596 | |
1597 value = pT30CmdPrm -> FBOval; | |
1598 break; | |
1599 | |
1600 case( FBO_VAL_DirCDirBD ): | |
1601 case( FBO_VAL_RvrCDirBD ): | |
1602 case( FBO_VAL_DirCRvrBD ): | |
1603 case( FBO_VAL_RvrCRvrBD ): | |
1604 | |
1605 break; | |
1606 | |
1607 default: | |
1608 | |
1609 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1610 return( AT_FAIL ); | |
1611 } | |
1612 | |
1613 /* | |
1614 *------------------------------------------------------------------- | |
1615 * assign the parameters | |
1616 *------------------------------------------------------------------- | |
1617 */ | |
1618 pT30CmdPrm -> FBOval = value; | |
1619 | |
1620 /* | |
1621 *------------------------------------------------------------------- | |
1622 * start FIT timer | |
1623 *------------------------------------------------------------------- | |
1624 */ | |
1625 cmhT30_StartFIT(); | |
1626 | |
1627 return( AT_CMPL ); | |
1628 } | |
1629 | |
1630 /* | |
1631 +--------------------------------------------------------------------+ | |
1632 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
1633 | STATE : code ROUTINE : sAT_PlusFRQ | | |
1634 +--------------------------------------------------------------------+ | |
1635 | |
1636 PURPOSE : This is the functional counterpart to the +FRQ AT | |
1637 command which is responsible to set the receive quality | |
1638 thresholds. | |
1639 | |
1640 <pgl>: percentage of good lines. | |
1641 <cbl>: consecutive bad lines. | |
1642 */ | |
1643 | |
1644 GLOBAL T_ACI_RETURN sAT_PlusFRQ (T_ACI_CMD_SRC srcId, | |
1645 SHORT pgl, | |
1646 SHORT cbl ) | |
1647 { | |
1648 TRACE_FUNCTION ("sAT_PlusFRQ()"); | |
1649 | |
1650 /* process the pgl parameter */ | |
1651 if( pgl NEQ 0 ) | |
1652 { | |
1653 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1654 return( AT_FAIL ); | |
1655 } | |
1656 | |
1657 /* process the cbl parameter */ | |
1658 if( cbl NEQ 0 ) | |
1659 { | |
1660 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1661 return( AT_FAIL ); | |
1662 } | |
1663 | |
1664 /* start FIT timer */ | |
1665 cmhT30_StartFIT(); | |
1666 | |
1667 return( AT_CMPL ); | |
1668 } | |
1669 | |
1670 /* | |
1671 +--------------------------------------------------------------------+ | |
1672 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
1673 | STATE : code ROUTINE : sAT_PlusFEA | | |
1674 +--------------------------------------------------------------------+ | |
1675 | |
1676 PURPOSE : This is the functional counterpart to the +FEA AT | |
1677 command which is responsible to set phase C EOL alignment. | |
1678 | |
1679 <value>: alignment. | |
1680 */ | |
1681 | |
1682 GLOBAL T_ACI_RETURN sAT_PlusFEA (T_ACI_CMD_SRC srcId, | |
1683 SHORT value ) | |
1684 { | |
1685 | |
1686 TRACE_FUNCTION ("sAT_PlusFEA()"); | |
1687 | |
1688 /* | |
1689 *------------------------------------------------------------------- | |
1690 * process the value parameter | |
1691 *------------------------------------------------------------------- | |
1692 */ | |
1693 if( value NEQ ACI_NumParmNotPresent ) | |
1694 { | |
1695 if( value NEQ 0 ) | |
1696 { | |
1697 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1698 return( AT_FAIL ); | |
1699 } | |
1700 } | |
1701 | |
1702 /* | |
1703 *------------------------------------------------------------------- | |
1704 * start FIT timer | |
1705 *------------------------------------------------------------------- | |
1706 */ | |
1707 cmhT30_StartFIT(); | |
1708 | |
1709 return( AT_CMPL ); | |
1710 } | |
1711 | |
1712 /* | |
1713 +--------------------------------------------------------------------+ | |
1714 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
1715 | STATE : code ROUTINE : sAT_PlusFCT | | |
1716 +--------------------------------------------------------------------+ | |
1717 | |
1718 PURPOSE : This is the functional counterpart to the +FCT AT | |
1719 command which is responsible to set phase C response | |
1720 timeout. | |
1721 | |
1722 <value>: timeout. | |
1723 */ | |
1724 | |
1725 GLOBAL T_ACI_RETURN sAT_PlusFCT (T_ACI_CMD_SRC srcId, | |
1726 SHORT value ) | |
1727 { | |
1728 | |
1729 TRACE_FUNCTION ("sAT_PlusFCT()"); | |
1730 | |
1731 /* | |
1732 *------------------------------------------------------------------- | |
1733 * process the value parameter | |
1734 *------------------------------------------------------------------- | |
1735 */ | |
1736 if( value NEQ ACI_NumParmNotPresent ) | |
1737 { | |
1738 if( value NEQ 30 ) | |
1739 { | |
1740 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1741 return( AT_FAIL ); | |
1742 } | |
1743 } | |
1744 | |
1745 /* | |
1746 *------------------------------------------------------------------- | |
1747 * start FIT timer | |
1748 *------------------------------------------------------------------- | |
1749 */ | |
1750 cmhT30_StartFIT(); | |
1751 | |
1752 return( AT_CMPL ); | |
1753 } | |
1754 | |
1755 /* | |
1756 +--------------------------------------------------------------------+ | |
1757 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
1758 | STATE : code ROUTINE : sAT_PlusFMS | | |
1759 +--------------------------------------------------------------------+ | |
1760 | |
1761 PURPOSE : This is the functional counterpart to the +FMS AT | |
1762 command which is responsible to set the minimum phase C | |
1763 speed. | |
1764 | |
1765 <br>: minimum phase C baud rate. | |
1766 */ | |
1767 | |
1768 GLOBAL T_ACI_RETURN sAT_PlusFMS (T_ACI_CMD_SRC srcId, | |
1769 T_ACI_F_BR br) | |
1770 { | |
1771 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
1772 | |
1773 TRACE_FUNCTION ("sAT_PlusFMS()"); | |
1774 | |
1775 /* | |
1776 *------------------------------------------------------------------- | |
1777 * check command source | |
1778 *------------------------------------------------------------------- | |
1779 */ | |
1780 if(!cmh_IsVldCmdSrc (srcId)) | |
1781 { | |
1782 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1783 return( AT_FAIL ); | |
1784 } | |
1785 | |
1786 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
1787 | |
1788 /* | |
1789 *------------------------------------------------------------------- | |
1790 * stop FIT timer | |
1791 *------------------------------------------------------------------- | |
1792 */ | |
1793 cmhT30_StopFIT(); | |
1794 | |
1795 /* | |
1796 *------------------------------------------------------------------- | |
1797 * process the br parameter | |
1798 *------------------------------------------------------------------- | |
1799 */ | |
1800 switch( br ) | |
1801 { | |
1802 case( F_BR_NotPresent ): | |
1803 | |
1804 break; | |
1805 | |
1806 case( F_BR_2400 ): | |
1807 case( F_BR_4800 ): | |
1808 case( F_BR_7200 ): | |
1809 case( F_BR_9600 ): | |
1810 case( F_BR_12000 ): | |
1811 case( F_BR_14400 ): | |
1812 | |
1813 pT30CmdPrm -> FMSbr = br; | |
1814 break; | |
1815 | |
1816 default: | |
1817 | |
1818 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1819 return( AT_FAIL ); | |
1820 } | |
1821 | |
1822 /* | |
1823 *------------------------------------------------------------------- | |
1824 * start FIT timer | |
1825 *------------------------------------------------------------------- | |
1826 */ | |
1827 cmhT30_StartFIT(); | |
1828 | |
1829 return( AT_CMPL ); | |
1830 } | |
1831 | |
1832 /* | |
1833 +--------------------------------------------------------------------+ | |
1834 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
1835 | STATE : code ROUTINE : sAT_PlusFFC | | |
1836 +--------------------------------------------------------------------+ | |
1837 | |
1838 PURPOSE : This is the functional counterpart to the +FFC AT | |
1839 command which is responsible to set the format conversion | |
1840 parameters. | |
1841 | |
1842 <vrc>: vertical resolution format. | |
1843 <dfc>: data format. | |
1844 <lnc>: page length format. | |
1845 <wdc>: page width format. | |
1846 */ | |
1847 | |
1848 GLOBAL T_ACI_RETURN sAT_PlusFFC (T_ACI_CMD_SRC srcId, | |
1849 T_ACI_FFC_VRC vrc, | |
1850 T_ACI_FFC_DFC dfc, | |
1851 T_ACI_FFC_LNC lnc, | |
1852 T_ACI_FFC_WDC wdc) | |
1853 { | |
1854 | |
1855 TRACE_FUNCTION ("sAT_PlusFFC()"); | |
1856 | |
1857 /* | |
1858 *------------------------------------------------------------------- | |
1859 * process the vrc parameter | |
1860 *------------------------------------------------------------------- | |
1861 */ | |
1862 if( vrc NEQ FFC_VRC_NotPresent ) | |
1863 { | |
1864 if( vrc NEQ FFC_VRC_Ignored ) | |
1865 { | |
1866 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1867 return( AT_FAIL ); | |
1868 } | |
1869 } | |
1870 | |
1871 /* | |
1872 *------------------------------------------------------------------- | |
1873 * process the dfc parameter | |
1874 *------------------------------------------------------------------- | |
1875 */ | |
1876 if( dfc NEQ FFC_DFC_NotPresent ) | |
1877 { | |
1878 if( dfc NEQ FFC_DFC_Ignored ) | |
1879 { | |
1880 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1881 return( AT_FAIL ); | |
1882 } | |
1883 } | |
1884 | |
1885 /* | |
1886 *------------------------------------------------------------------- | |
1887 * process the lnc parameter | |
1888 *------------------------------------------------------------------- | |
1889 */ | |
1890 if( lnc NEQ FFC_LNC_NotPresent ) | |
1891 { | |
1892 if( lnc NEQ FFC_LNC_Ignored ) | |
1893 { | |
1894 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1895 return( AT_FAIL ); | |
1896 } | |
1897 } | |
1898 | |
1899 /* | |
1900 *------------------------------------------------------------------- | |
1901 * process the wdc parameter | |
1902 *------------------------------------------------------------------- | |
1903 */ | |
1904 if( wdc NEQ FFC_WDC_NotPresent ) | |
1905 { | |
1906 if( wdc NEQ FFC_WDC_Ignored ) | |
1907 { | |
1908 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1909 return( AT_FAIL ); | |
1910 } | |
1911 } | |
1912 | |
1913 /* | |
1914 *------------------------------------------------------------------- | |
1915 * start FIT timer | |
1916 *------------------------------------------------------------------- | |
1917 */ | |
1918 cmhT30_StartFIT(); | |
1919 | |
1920 return( AT_CMPL ); | |
1921 } | |
1922 | |
1923 /* | |
1924 +--------------------------------------------------------------------+ | |
1925 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
1926 | STATE : code ROUTINE : sAT_PlusFIP | | |
1927 +--------------------------------------------------------------------+ | |
1928 | |
1929 PURPOSE : This is the functional counterpart to the +FIP AT | |
1930 command which is responsible to reset the FAX parameter to | |
1931 their initial value. | |
1932 | |
1933 */ | |
1934 | |
1935 GLOBAL T_ACI_RETURN sAT_PlusFIP (T_ACI_CMD_SRC srcId) | |
1936 { | |
1937 | |
1938 TRACE_FUNCTION ("sAT_PlusFIP()"); | |
1939 | |
1940 /* | |
1941 *------------------------------------------------------------------- | |
1942 * check command source and reset parameters | |
1943 *------------------------------------------------------------------- | |
1944 */ | |
1945 if(!cmh_IsVldCmdSrc (srcId)) | |
1946 { | |
1947 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1948 return( AT_FAIL ); | |
1949 } | |
1950 | |
1951 cmhT30_StopFIT(); | |
1952 | |
1953 cmhT30_InitFAXPrms( srcId ); | |
1954 | |
1955 cmhT30_RstNgtPrms(); | |
1956 | |
1957 /* | |
1958 *------------------------------------------------------------------- | |
1959 * start FIT timer | |
1960 *------------------------------------------------------------------- | |
1961 */ | |
1962 cmhT30_StartFIT(); | |
1963 | |
1964 return( AT_CMPL ); | |
1965 } | |
1966 | |
1967 /* | |
1968 +--------------------------------------------------------------------+ | |
1969 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
1970 | STATE : code ROUTINE : sAT_PlusFPS | | |
1971 +--------------------------------------------------------------------+ | |
1972 | |
1973 PURPOSE : This is the functional counterpart to the +FPS AT command | |
1974 which is responsible to set the post page response. | |
1975 | |
1976 <ppr>: post page response. | |
1977 */ | |
1978 | |
1979 GLOBAL T_ACI_RETURN sAT_PlusFPS (T_ACI_CMD_SRC srcId, | |
1980 T_ACI_FPS_PPR ppr ) | |
1981 { | |
1982 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
1983 | |
1984 TRACE_FUNCTION ("sAT_PlusFPS()"); | |
1985 | |
1986 /* | |
1987 *------------------------------------------------------------------- | |
1988 * check command source | |
1989 *------------------------------------------------------------------- | |
1990 */ | |
1991 if(!cmh_IsVldCmdSrc (srcId)) | |
1992 { | |
1993 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
1994 return( AT_FAIL ); | |
1995 } | |
1996 | |
1997 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
1998 | |
1999 /* | |
2000 *------------------------------------------------------------------- | |
2001 * stop FIT timer | |
2002 *------------------------------------------------------------------- | |
2003 */ | |
2004 cmhT30_StopFIT(); | |
2005 | |
2006 /* | |
2007 *------------------------------------------------------------------- | |
2008 * process the ppr parameter | |
2009 *------------------------------------------------------------------- | |
2010 */ | |
2011 switch( ppr ) | |
2012 { | |
2013 case( FPS_PPR_NotPresent ): | |
2014 break; | |
2015 | |
2016 case( FPS_PPR_Mcf ): | |
2017 case( FPS_PPR_Rtn ): | |
2018 case( FPS_PPR_Rtp ): | |
2019 case( FPS_PPR_Pip ): | |
2020 case( FPS_PPR_Pin ): | |
2021 | |
2022 pT30CmdPrm -> FPSppr = ppr; | |
2023 break; | |
2024 | |
2025 default: | |
2026 | |
2027 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
2028 return( AT_FAIL ); | |
2029 } | |
2030 | |
2031 /* | |
2032 *------------------------------------------------------------------- | |
2033 * start FIT timer | |
2034 *------------------------------------------------------------------- | |
2035 */ | |
2036 cmhT30_StartFIT(); | |
2037 | |
2038 return( AT_CMPL ); | |
2039 } | |
2040 | |
2041 /* | |
2042 +--------------------------------------------------------------------+ | |
2043 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
2044 | STATE : code ROUTINE : sAT_PlusFSP | | |
2045 +--------------------------------------------------------------------+ | |
2046 | |
2047 PURPOSE : This is the functional counterpart to the +FSP AT command | |
2048 which is responsible to set the possibility of polling. | |
2049 | |
2050 <value>: polling mode. | |
2051 */ | |
2052 | |
2053 GLOBAL T_ACI_RETURN sAT_PlusFSP (T_ACI_CMD_SRC srcId, | |
2054 T_ACI_FSP_VAL value ) | |
2055 { | |
2056 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
2057 | |
2058 TRACE_FUNCTION ("sAT_PlusFSP()"); | |
2059 | |
2060 /* | |
2061 *------------------------------------------------------------------- | |
2062 * check command source | |
2063 *------------------------------------------------------------------- | |
2064 */ | |
2065 if(!cmh_IsVldCmdSrc (srcId)) | |
2066 { | |
2067 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
2068 return( AT_FAIL ); | |
2069 } | |
2070 | |
2071 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
2072 | |
2073 /* | |
2074 *------------------------------------------------------------------- | |
2075 * stop FIT timer | |
2076 *------------------------------------------------------------------- | |
2077 */ | |
2078 cmhT30_StopFIT(); | |
2079 | |
2080 /* | |
2081 *------------------------------------------------------------------- | |
2082 * process the value parameter | |
2083 *------------------------------------------------------------------- | |
2084 */ | |
2085 switch( value ) | |
2086 { | |
2087 case( FSP_VAL_NotPresent ): | |
2088 break; | |
2089 | |
2090 case( FSP_VAL_PollDisabled ): | |
2091 case( FSP_VAL_PollEnable ): | |
2092 | |
2093 pT30CmdPrm -> FSPval = value; | |
2094 break; | |
2095 | |
2096 default: | |
2097 | |
2098 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
2099 return( AT_FAIL ); | |
2100 } | |
2101 | |
2102 /* | |
2103 *------------------------------------------------------------------- | |
2104 * start FIT timer | |
2105 *------------------------------------------------------------------- | |
2106 */ | |
2107 cmhT30_StartFIT(); | |
2108 | |
2109 return( AT_CMPL ); | |
2110 } | |
2111 | |
2112 /* | |
2113 +--------------------------------------------------------------------+ | |
2114 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
2115 | STATE : code ROUTINE : sAT_PlusFAP | | |
2116 +--------------------------------------------------------------------+ | |
2117 | |
2118 PURPOSE : This is the functional counterpart to the +FAP AT | |
2119 command which is responsible to set the address and | |
2120 polling capabilities. | |
2121 | |
2122 <sub>: destination subaddressing. | |
2123 <sep>: selective polling. | |
2124 <pwd>: password. | |
2125 */ | |
2126 | |
2127 GLOBAL T_ACI_RETURN sAT_PlusFAP (T_ACI_CMD_SRC srcId, | |
2128 T_ACI_FAP_VAL sub, | |
2129 T_ACI_FAP_VAL sep, | |
2130 T_ACI_FAP_VAL pwd ) | |
2131 { | |
2132 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
2133 | |
2134 TRACE_FUNCTION ("sAT_PlusFAP()"); | |
2135 | |
2136 /* | |
2137 *------------------------------------------------------------------- | |
2138 * check command source | |
2139 *------------------------------------------------------------------- | |
2140 */ | |
2141 if(!cmh_IsVldCmdSrc (srcId)) | |
2142 { | |
2143 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
2144 return( AT_FAIL ); | |
2145 } | |
2146 | |
2147 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
2148 | |
2149 /* | |
2150 *------------------------------------------------------------------- | |
2151 * stop FIT timer | |
2152 *------------------------------------------------------------------- | |
2153 */ | |
2154 cmhT30_StopFIT(); | |
2155 | |
2156 /* | |
2157 *------------------------------------------------------------------- | |
2158 * process the sub parameter | |
2159 *------------------------------------------------------------------- | |
2160 */ | |
2161 switch( sub ) | |
2162 { | |
2163 case( FAP_VAL_NotPresent ): | |
2164 | |
2165 sub = pT30CmdPrm -> FAPsub; | |
2166 break; | |
2167 | |
2168 case( FAP_VAL_Disabled ): | |
2169 case( FAP_VAL_Enabled ): | |
2170 | |
2171 break; | |
2172 | |
2173 default: | |
2174 | |
2175 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
2176 return( AT_FAIL ); | |
2177 } | |
2178 | |
2179 /* | |
2180 *------------------------------------------------------------------- | |
2181 * process the sub parameter | |
2182 *------------------------------------------------------------------- | |
2183 */ | |
2184 switch( sep ) | |
2185 { | |
2186 case( FAP_VAL_NotPresent ): | |
2187 | |
2188 sep = pT30CmdPrm -> FAPsep; | |
2189 break; | |
2190 | |
2191 case( FAP_VAL_Disabled ): | |
2192 case( FAP_VAL_Enabled ): | |
2193 | |
2194 break; | |
2195 | |
2196 default: | |
2197 | |
2198 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
2199 return( AT_FAIL ); | |
2200 } | |
2201 | |
2202 /* | |
2203 *------------------------------------------------------------------- | |
2204 * process the sub parameter | |
2205 *------------------------------------------------------------------- | |
2206 */ | |
2207 switch( pwd ) | |
2208 { | |
2209 case( FAP_VAL_NotPresent ): | |
2210 | |
2211 pwd = pT30CmdPrm -> FAPpwd; | |
2212 break; | |
2213 | |
2214 case( FAP_VAL_Disabled ): | |
2215 case( FAP_VAL_Enabled ): | |
2216 | |
2217 break; | |
2218 | |
2219 default: | |
2220 | |
2221 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
2222 return( AT_FAIL ); | |
2223 } | |
2224 | |
2225 /* | |
2226 *------------------------------------------------------------------- | |
2227 * assign the parameters | |
2228 *------------------------------------------------------------------- | |
2229 */ | |
2230 pT30CmdPrm -> FAPsub = sub; | |
2231 pT30CmdPrm -> FAPsep = sep; | |
2232 pT30CmdPrm -> FAPpwd = pwd; | |
2233 | |
2234 /* | |
2235 *------------------------------------------------------------------- | |
2236 * start FIT timer | |
2237 *------------------------------------------------------------------- | |
2238 */ | |
2239 cmhT30_StartFIT(); | |
2240 | |
2241 return( AT_CMPL ); | |
2242 } | |
2243 | |
2244 | |
2245 /* | |
2246 +--------------------------------------------------------------------+ | |
2247 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
2248 | STATE : code ROUTINE : sAT_PlusFDT | | |
2249 +--------------------------------------------------------------------+ | |
2250 | |
2251 PURPOSE : This is the functional counterpart to the +FDT AT | |
2252 command which is responsible to transmit FAX data. | |
2253 | |
2254 */ | |
2255 | |
2256 GLOBAL T_ACI_RETURN sAT_PlusFDT (T_ACI_CMD_SRC srcId) | |
2257 { | |
2258 | |
2259 TRACE_FUNCTION ("sAT_PlusFDT()"); | |
2260 | |
2261 /* | |
2262 *------------------------------------------------------------------- | |
2263 * check command source | |
2264 *------------------------------------------------------------------- | |
2265 */ | |
2266 if(!cmh_IsVldCmdSrc (srcId) OR | |
2267 !psaCC_ctbIsValid (t30ShrdPrm.cId) OR | |
2268 (t30ShrdPrm.faxStat NEQ FS_IDL AND t30ShrdPrm.faxStat NEQ FS_SND_DOC)) | |
2269 { | |
2270 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
2271 return( AT_FAIL ); | |
2272 } | |
2273 | |
2274 /* | |
2275 *------------------------------------------------------------------- | |
2276 * stop FIT timer | |
2277 *------------------------------------------------------------------- | |
2278 */ | |
2279 cmhT30_StopFIT(); | |
2280 | |
2281 /* | |
2282 *------------------------------------------------------------------- | |
2283 * check entity status | |
2284 *------------------------------------------------------------------- | |
2285 */ | |
2286 if( t30EntStat.curCmd NEQ AT_CMD_NONE ) | |
2287 | |
2288 return( AT_BUSY ); | |
2289 | |
2290 t30EntStat.curCmd = AT_CMD_FDT; | |
2291 t30EntStat.entOwn = srcId; | |
2292 | |
2293 /* | |
2294 *------------------------------------------------------------------- | |
2295 * negotiate transmission parameters and send DCS | |
2296 *------------------------------------------------------------------- | |
2297 */ | |
2298 if( t30ShrdPrm.faxStat EQ FS_IDL OR | |
2299 t30ShrdPrm.faxStat EQ FS_DOC_TRF ) | |
2300 { | |
2301 cmhT30_NgtDCEPrms( srcId ); | |
2302 | |
2303 /* check for minimum speed condition */ | |
2304 if( t30NgtPrms.FCSbr < fnd_cmhPrm[srcId].t30CmdPrm.FMSbr ) | |
2305 { | |
2306 TRACE_EVENT("DISCONNECT CALL DUE TO FALL BELOW MINIMUM SPEED CONDITION"); | |
2307 t30ShrdPrm.faxStat = FS_IDL; | |
2308 t30EntStat.curCmd = AT_CMD_NONE; | |
2309 ccShrdPrm.datStat = DS_DSC_REQ; | |
2310 cmhT30_Deactivate (); | |
2311 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_FaxMinSpeedCond ); | |
2312 return( AT_FAIL ); | |
2313 } | |
2314 cmhT30_SendCaps ( srcId, FRT_DCS ); | |
2315 } | |
2316 | |
2317 /* | |
2318 *------------------------------------------------------------------- | |
2319 * check for connect message | |
2320 *------------------------------------------------------------------- | |
2321 */ | |
2322 if( t30ShrdPrm.faxStat EQ FS_IDL OR t30ShrdPrm.faxStat EQ FS_DOC_TRF ) | |
2323 { | |
2324 R_AT( RAT_FCS, t30EntStat.entOwn ) | |
2325 ( t30NgtPrms.FCSvr, | |
2326 t30NgtPrms.FCSbr, | |
2327 t30NgtPrms.FCSwd, | |
2328 t30NgtPrms.FCSln, | |
2329 t30NgtPrms.FCSdf, | |
2330 t30NgtPrms.FCSec, | |
2331 t30NgtPrms.FCSbf, | |
2332 t30NgtPrms.FCSst, | |
2333 t30NgtPrms.FCSjp); | |
2334 } | |
2335 t30ShrdPrm.faxStat = FS_SND_DOC; | |
2336 pageSentFlg = FALSE; | |
2337 ppmPendFlg = FALSE; | |
2338 cmhT30_StartFIT(); | |
2339 TRACE_EVENT ("START DTE->DCE FAX DATA PHASE"); | |
2340 /* | |
2341 R_AT( RAT_CONNECT, t30EntStat.entOwn ) | |
2342 ( t30EntStat.curCmd, cmhT30_GetDataRate(), t30ShrdPrm.cId+1, FALSE ); | |
2343 */ | |
2344 return( AT_EXCT ); | |
2345 } | |
2346 | |
2347 /* | |
2348 +--------------------------------------------------------------------+ | |
2349 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
2350 | STATE : code ROUTINE : sAT_PlusFDR | | |
2351 +--------------------------------------------------------------------+ | |
2352 | |
2353 PURPOSE : This is the functional counterpart to the +FDR AT | |
2354 command which is responsible to receive FAX data. | |
2355 | |
2356 */ | |
2357 | |
2358 GLOBAL T_ACI_RETURN sAT_PlusFDR (T_ACI_CMD_SRC srcId) | |
2359 { | |
2360 TRACE_FUNCTION ("sAT_PlusFDR()"); | |
2361 /* | |
2362 *------------------------------------------------------------------- | |
2363 * check command source | |
2364 *------------------------------------------------------------------- | |
2365 */ | |
2366 if(!cmh_IsVldCmdSrc (srcId) OR | |
2367 !psaCC_ctbIsValid (t30ShrdPrm.cId) OR | |
2368 fnd_cmhPrm[srcId].t30CmdPrm.FCRval EQ FCR_VAL_NoRcvCap OR | |
2369 (t30ShrdPrm.faxStat NEQ FS_IDL AND t30ShrdPrm.faxStat NEQ FS_RCV_DOC)) | |
2370 { | |
2371 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
2372 return( AT_FAIL ); | |
2373 } | |
2374 cmhT30_StopFIT(); | |
2375 | |
2376 /* | |
2377 *------------------------------------------------------------------- | |
2378 * check entity status | |
2379 *------------------------------------------------------------------- | |
2380 */ | |
2381 if( t30EntStat.curCmd NEQ AT_CMD_NONE ) | |
2382 return( AT_BUSY ); | |
2383 | |
2384 t30EntStat.curCmd = AT_CMD_FDR; | |
2385 t30EntStat.entOwn = srcId; | |
2386 | |
2387 /* | |
2388 *------------------------------------------------------------------- | |
2389 * check to send a DTC frame | |
2390 *------------------------------------------------------------------- | |
2391 */ | |
2392 if( DTCSentFlg EQ FALSE AND | |
2393 (t30ShrdPrm.faxStat EQ FS_IDL OR | |
2394 t30ShrdPrm.faxStat EQ FS_DOC_TRF) AND | |
2395 psaCC_ctb(t30ShrdPrm.cId)->calType EQ CT_MOC AND | |
2396 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FSPval EQ FSP_VAL_PollEnable ) | |
2397 { | |
2398 DTCSentFlg = TRUE; | |
2399 cmhT30_SendCaps ( srcId, FRT_DTC ); | |
2400 } | |
2401 | |
2402 /* | |
2403 *------------------------------------------------------------------- | |
2404 * check to send a post page response | |
2405 *------------------------------------------------------------------- | |
2406 */ | |
2407 else if (t30ShrdPrm.faxStat EQ FS_RCV_DOC OR t30ShrdPrm.faxStat EQ FS_DOC_TRF) | |
2408 { | |
2409 t30ShrdPrm.sgn_snd = cmhT30_GetPpr(fnd_cmhPrm[srcId].t30CmdPrm.FPSppr); | |
2410 if( psaT30_Ppm( ) < 0 ) /* send ppm */ | |
2411 { | |
2412 TRACE_EVENT( "FATAL RETURN psaT30 in sAT_PlusFDR" ); | |
2413 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Internal ); | |
2414 return( AT_FAIL ); | |
2415 } | |
2416 } | |
2417 | |
2418 /* | |
2419 *------------------------------------------------------------------- | |
2420 * check for connect message | |
2421 *------------------------------------------------------------------- | |
2422 */ | |
2423 t30ShrdPrm.faxStat = FS_RCV_DOC; | |
2424 return( AT_EXCT ); | |
2425 } | |
2426 | |
2427 /* | |
2428 +--------------------------------------------------------------------+ | |
2429 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
2430 | STATE : code ROUTINE : sAT_PlusFKS | | |
2431 +--------------------------------------------------------------------+ | |
2432 | |
2433 PURPOSE : This is the functional counterpart to the +FKS AT | |
2434 command which is responsible to terminate a FAX session. | |
2435 | |
2436 */ | |
2437 | |
2438 GLOBAL T_ACI_RETURN sAT_PlusFKS (T_ACI_CMD_SRC srcId) | |
2439 { | |
2440 TRACE_FUNCTION ("sAT_PlusFKS()"); | |
2441 | |
2442 /* check command source */ | |
2443 if(!cmh_IsVldCmdSrc (srcId) ) | |
2444 { | |
2445 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter ); | |
2446 return( AT_FAIL ); | |
2447 } | |
2448 cmhT30_StopFIT(); | |
2449 | |
2450 /* check entity status */ | |
2451 if( t30EntStat.curCmd NEQ AT_CMD_NONE ) | |
2452 return( AT_BUSY ); | |
2453 | |
2454 /* check for active call */ | |
2455 if (!psaCC_ctbIsValid (t30ShrdPrm.cId)) | |
2456 return( AT_CMPL ); | |
2457 | |
2458 t30EntStat.curCmd = AT_CMD_FKS; | |
2459 t30EntStat.entOwn = srcId; | |
2460 | |
2461 /* disconnect T30 */ | |
2462 psaT30_Disconnect( ); | |
2463 | |
2464 return( AT_EXCT ); | |
2465 } | |
2466 | |
2467 /* | |
2468 +-------------------------------------------------------------------+ | |
2469 | PROJECT : GSM-PS (6147) MODULE : CMH_T30 | | |
2470 | ROUTINE : cmhT30_Activate | | |
2471 +-------------------------------------------------------------------+ | |
2472 | |
2473 PURPOSE : set all nescessary parameters and activate T30 | |
2474 | |
2475 */ | |
2476 | |
2477 GLOBAL T_ACI_RETURN cmhT30_Activate ( T_ACI_CMD_SRC srcId, | |
2478 T_ACI_AT_CMD cmdId, | |
2479 SHORT cId ) | |
2480 { | |
2481 TRACE_FUNCTION ("cmhT30_Activate()"); | |
2482 | |
2483 /* check command source */ | |
2484 if(!cmh_IsVldCmdSrc (srcId)) | |
2485 return( AT_FAIL ); | |
2486 | |
2487 /* check entity status */ | |
2488 if( t30EntStat.curCmd NEQ AT_CMD_NONE ) | |
2489 | |
2490 return( AT_BUSY ); | |
2491 | |
2492 /* fill in activate parameters */ | |
2493 t30ShrdPrm.trans_rate = cmhT30_SelChnRate(); | |
2494 if( t30ShrdPrm.trans_rate EQ NOT_PRESENT_16BIT ) | |
2495 return( AT_FAIL ); | |
2496 | |
2497 t30ShrdPrm.bitord = cmhT30_SelBitOrder( srcId ); | |
2498 if( t30ShrdPrm.bitord EQ NOT_PRESENT_8BIT ) | |
2499 return( AT_FAIL ); | |
2500 | |
2501 t30ShrdPrm.half_rate = cmhT30_SelHlfRate(); | |
2502 t30ShrdPrm.threshold = T30_DEF_THLD; | |
2503 t30ShrdPrm.frames_per_prim = T30_DEF_FRMPRIM; | |
2504 t30ShrdPrm.hdlc_report = TRUE; | |
2505 t30ShrdPrm.test_mode = 0; /* needed for simulation */ | |
2506 | |
2507 t30ShrdPrm.cId = cId; | |
2508 t30EntStat.curCmd = cmdId; | |
2509 t30EntStat.entOwn = srcId; | |
2510 | |
2511 FHSstat = FHS_STAT_NormEnd; /* reset call termination status */ | |
2512 | |
2513 psaT30_Activate( ); | |
2514 return( AT_EXCT ); | |
2515 } | |
2516 | |
2517 /* | |
2518 +-------------------------------------------------------------------+ | |
2519 | PROJECT : GSM-PS (6147) MODULE : CMH_T30 | | |
2520 | ROUTINE : cmhT30_Deactivate | | |
2521 +-------------------------------------------------------------------+ | |
2522 | |
2523 PURPOSE : set all nescessary parameters and deactivate T30 | |
2524 | |
2525 */ | |
2526 | |
2527 GLOBAL T_ACI_RETURN cmhT30_Deactivate ( void ) | |
2528 { | |
2529 UBYTE src_id = t30EntStat.entOwn; | |
2530 #ifdef FF_PSI | |
2531 T_ACI_DTI_PRC_PSI *src_infos = find_element (psi_src_params, | |
2532 src_id, cmhPSItest_srcId); | |
2533 #endif /*FF_PSI*/ | |
2534 T_DTI_CNTRL info; | |
2535 | |
2536 TRACE_FUNCTION ("cmht30_Deactivate()"); | |
2537 | |
2538 | |
2539 if (dti_cntrl_get_info_from_src_id( src_id, &info) EQ FALSE) | |
2540 { | |
2541 TRACE_EVENT_P1("cannot find info for src_id=%d", src_id); | |
2542 return( AT_FAIL ); | |
2543 } | |
2544 | |
2545 if (dti_cntrl_is_dti_channel_connected(DTI_ENTITY_T30, info.dti_id)) | |
2546 { | |
2547 T_DTI_ENTITY_ID entity_list[] = {DTI_ENTITY_ACI}; | |
2548 #ifdef FF_PSI | |
2549 if (src_infos NEQ NULL) | |
2550 dti_cntrl_est_dpath_indirect ( src_id, | |
2551 entity_list, | |
2552 1, | |
2553 SPLIT, | |
2554 atiPSI_dti_cb, | |
2555 DTI_CPBLTY_CMD, | |
2556 DTI_CID_NOTPRESENT); | |
2557 else | |
2558 #endif | |
2559 dti_cntrl_est_dpath_indirect ( src_id, | |
2560 entity_list, | |
2561 1, | |
2562 SPLIT, | |
2563 atiUART_dti_cb, | |
2564 DTI_CPBLTY_CMD, | |
2565 DTI_CID_NOTPRESENT); | |
2566 | |
2567 return( AT_EXCT ); | |
2568 } | |
2569 | |
2570 /* reset parameters to initial value */ | |
2571 cmhT30_RstNgtPrms(); /* reset negotiation parameter */ | |
2572 | |
2573 /* deactivate */ | |
2574 psaT30_Deactivate( ); | |
2575 return( AT_EXCT ); | |
2576 } | |
2577 | |
2578 /* | |
2579 +-------------------------------------------------------------------+ | |
2580 | PROJECT : GSM-PS (6147) MODULE : CMH_T30 | | |
2581 | ROUTINE : cmhT30_Modify | | |
2582 +-------------------------------------------------------------------+ | |
2583 | |
2584 PURPOSE : set all nescessary parameters and modify T30 | |
2585 | |
2586 */ | |
2587 | |
2588 GLOBAL T_ACI_RETURN cmhT30_Modify (void) | |
2589 { | |
2590 TRACE_FUNCTION ("cmhT30_Modify()"); | |
2591 | |
2592 /* fill in modify parameters */ | |
2593 t30ShrdPrm.trans_rate = cmhT30_SelUsrRate(); | |
2594 if (t30ShrdPrm.trans_rate EQ NOT_PRESENT_16BIT) | |
2595 { | |
2596 t30ShrdPrm.trans_rate = cmhT30_SelChnRate(); | |
2597 } | |
2598 if (t30ShrdPrm.trans_rate EQ NOT_PRESENT_16BIT) | |
2599 return (AT_FAIL); | |
2600 | |
2601 t30ShrdPrm.half_rate = cmhT30_SelHlfRate(); | |
2602 | |
2603 psaT30_Modify( ); | |
2604 return( AT_EXCT ); | |
2605 } | |
2606 | |
2607 /* | |
2608 +-------------------------------------------------------------------+ | |
2609 | PROJECT : GSM-PS (6147) MODULE : CMH_T30 | | |
2610 | ROUTINE : cmhT30_SendCaps | | |
2611 +-------------------------------------------------------------------+ | |
2612 | |
2613 PURPOSE : Send local DCE capability parameters | |
2614 | |
2615 */ | |
2616 | |
2617 GLOBAL T_ACI_RETURN cmhT30_SendCaps ( T_ACI_CMD_SRC srcId, | |
2618 T_T30_FRTP frmTyp ) | |
2619 { | |
2620 T_T30_CMD_PRM * pT30CmdPrm; /* points to T30 command parameters */ | |
2621 | |
2622 TRACE_FUNCTION ("cmhT30_SendCaps()"); | |
2623 | |
2624 /* | |
2625 *------------------------------------------------------------------- | |
2626 * check command source | |
2627 *------------------------------------------------------------------- | |
2628 */ | |
2629 if(!cmh_IsVldCmdSrc (srcId)) | |
2630 | |
2631 return( AT_FAIL ); | |
2632 | |
2633 pT30CmdPrm = &fnd_cmhPrm[srcId].t30CmdPrm; | |
2634 | |
2635 /* | |
2636 *------------------------------------------------------------------- | |
2637 * build capability parameter | |
2638 *------------------------------------------------------------------- | |
2639 */ | |
2640 t30ShrdPrm.hdlc_snd.crp = FALSE; | |
2641 cmhT30_BuildSndFrm( srcId, frmTyp ); | |
2642 | |
2643 switch( frmTyp ) | |
2644 { | |
2645 /* | |
2646 *--------------------------------------------------------------- | |
2647 * for a DIS frame | |
2648 *--------------------------------------------------------------- | |
2649 */ | |
2650 case( FRT_DIS ): | |
2651 | |
2652 t30ShrdPrm.hdlc_snd.v_dcs = t30ShrdPrm.hdlc_snd.v_dtc = FALSE; | |
2653 t30ShrdPrm.hdlc_snd.c_nsc = t30ShrdPrm.hdlc_snd.c_nss = 0; | |
2654 t30ShrdPrm.hdlc_snd.c_tsi = t30ShrdPrm.hdlc_snd.c_cig = 0; | |
2655 | |
2656 /* non-standard facility */ | |
2657 t30ShrdPrm.hdlc_snd.c_nsf = pT30CmdPrm -> FNSlen; | |
2658 | |
2659 if (pT30CmdPrm -> FNSlen) | |
2660 { | |
2661 memcpy( t30ShrdPrm.hdlc_snd.nsf, pT30CmdPrm -> FNSoct, | |
2662 pT30CmdPrm -> FNSlen); | |
2663 } | |
2664 | |
2665 if( pT30CmdPrm -> FLIstr[0] NEQ 0 ) /* calling subscr. id */ | |
2666 { | |
2667 t30ShrdPrm.hdlc_snd.c_csi = strlen( pT30CmdPrm -> FLIstr ); | |
2668 strncpy( (char *) t30ShrdPrm.hdlc_snd.csi, | |
2669 (char *) pT30CmdPrm -> FLIstr, | |
2670 t30ShrdPrm.hdlc_snd.c_csi ); | |
2671 } | |
2672 else | |
2673 { | |
2674 t30ShrdPrm.hdlc_snd.c_csi = 0; | |
2675 } | |
2676 break; | |
2677 | |
2678 /* | |
2679 *--------------------------------------------------------------- | |
2680 * for a DTC frame | |
2681 *--------------------------------------------------------------- | |
2682 */ | |
2683 case( FRT_DTC ): | |
2684 | |
2685 t30ShrdPrm.hdlc_snd.v_dcs = t30ShrdPrm.hdlc_snd.v_dis = FALSE; | |
2686 t30ShrdPrm.hdlc_snd.c_nsf = t30ShrdPrm.hdlc_snd.c_nss = 0; | |
2687 t30ShrdPrm.hdlc_snd.c_tsi = t30ShrdPrm.hdlc_snd.c_csi = 0; | |
2688 | |
2689 /* non-standard facility */ | |
2690 t30ShrdPrm.hdlc_snd.c_nsc = pT30CmdPrm -> FNSlen; | |
2691 | |
2692 if (pT30CmdPrm -> FNSlen) | |
2693 { | |
2694 memcpy( t30ShrdPrm.hdlc_snd.nsc, pT30CmdPrm -> FNSoct, | |
2695 pT30CmdPrm -> FNSlen); | |
2696 } | |
2697 | |
2698 if( pT30CmdPrm -> FPWpwd[0] NEQ 0 ) /* password string */ | |
2699 { | |
2700 t30ShrdPrm.hdlc_snd.c_pwd = strlen( pT30CmdPrm -> FPWpwd ); | |
2701 strncpy( (char *) t30ShrdPrm.hdlc_snd.pwd, | |
2702 (char *) pT30CmdPrm -> FPWpwd, | |
2703 t30ShrdPrm.hdlc_snd.c_pwd ); | |
2704 } | |
2705 else | |
2706 { | |
2707 t30ShrdPrm.hdlc_snd.c_pwd = 0; | |
2708 } | |
2709 | |
2710 if( pT30CmdPrm -> FPAsep[0] NEQ 0 ) /* selective polling string */ | |
2711 { | |
2712 t30ShrdPrm.hdlc_snd.c_sep = strlen( pT30CmdPrm -> FPAsep ); | |
2713 strncpy( (char *) t30ShrdPrm.hdlc_snd.sep, | |
2714 (char *) pT30CmdPrm -> FPAsep, | |
2715 t30ShrdPrm.hdlc_snd.c_sep ); | |
2716 } | |
2717 else | |
2718 { | |
2719 t30ShrdPrm.hdlc_snd.c_sep = 0; | |
2720 } | |
2721 | |
2722 if( pT30CmdPrm -> FPIstr[0] NEQ 0 ) /* calling subscr. id */ | |
2723 { | |
2724 t30ShrdPrm.hdlc_snd.c_cig = strlen( pT30CmdPrm -> FPIstr ); | |
2725 strncpy( (char *) t30ShrdPrm.hdlc_snd.cig, | |
2726 (char *) pT30CmdPrm -> FPIstr, | |
2727 t30ShrdPrm.hdlc_snd.c_cig ); | |
2728 } | |
2729 else | |
2730 { | |
2731 t30ShrdPrm.hdlc_snd.c_cig = 0; | |
2732 } | |
2733 break; | |
2734 | |
2735 /* | |
2736 *--------------------------------------------------------------- | |
2737 * for a DCS frame | |
2738 *--------------------------------------------------------------- | |
2739 */ | |
2740 case( FRT_DCS ): | |
2741 | |
2742 t30ShrdPrm.hdlc_snd.v_dis = t30ShrdPrm.hdlc_snd.v_dtc = FALSE; | |
2743 t30ShrdPrm.hdlc_snd.c_nsc = t30ShrdPrm.hdlc_snd.c_nsf = 0; | |
2744 t30ShrdPrm.hdlc_snd.c_csi = t30ShrdPrm.hdlc_snd.c_cig = 0; | |
2745 | |
2746 /* non-standard facility */ | |
2747 t30ShrdPrm.hdlc_snd.c_nss = pT30CmdPrm -> FNSlen; | |
2748 | |
2749 if (pT30CmdPrm -> FNSlen) | |
2750 { | |
2751 memcpy( t30ShrdPrm.hdlc_snd.nss, pT30CmdPrm -> FNSoct, | |
2752 pT30CmdPrm -> FNSlen); | |
2753 } | |
2754 | |
2755 if( pT30CmdPrm -> FPWpwd[0] NEQ 0 ) /* password string */ | |
2756 { | |
2757 t30ShrdPrm.hdlc_snd.c_pwd = strlen( pT30CmdPrm -> FPWpwd ); | |
2758 strncpy( (char *) t30ShrdPrm.hdlc_snd.pwd, | |
2759 (char *) pT30CmdPrm -> FPWpwd, | |
2760 t30ShrdPrm.hdlc_snd.c_pwd ); | |
2761 } | |
2762 else | |
2763 { | |
2764 t30ShrdPrm.hdlc_snd.c_pwd = 0; | |
2765 } | |
2766 | |
2767 if( pT30CmdPrm -> FSAsub[0] NEQ 0 ) /* subaddress string */ | |
2768 { | |
2769 t30ShrdPrm.hdlc_snd.c_sub = strlen( pT30CmdPrm -> FSAsub ); | |
2770 strncpy( (char *) t30ShrdPrm.hdlc_snd.sub, | |
2771 (char *) pT30CmdPrm -> FSAsub, | |
2772 t30ShrdPrm.hdlc_snd.c_sub ); | |
2773 } | |
2774 else | |
2775 { | |
2776 t30ShrdPrm.hdlc_snd.c_sub = 0; | |
2777 } | |
2778 | |
2779 if( pT30CmdPrm -> FLIstr[0] NEQ 0 ) /* transmitting subscr. id */ | |
2780 { | |
2781 t30ShrdPrm.hdlc_snd.c_tsi = strlen( pT30CmdPrm -> FLIstr ); | |
2782 strncpy( (char *) t30ShrdPrm.hdlc_snd.tsi, | |
2783 (char *) pT30CmdPrm -> FLIstr, | |
2784 t30ShrdPrm.hdlc_snd.c_tsi ); | |
2785 } | |
2786 else | |
2787 { | |
2788 t30ShrdPrm.hdlc_snd.c_tsi = 0; | |
2789 } | |
2790 break; | |
2791 } | |
2792 | |
2793 /* | |
2794 *------------------------------------------------------------------- | |
2795 * send capability parameter | |
2796 *------------------------------------------------------------------- | |
2797 */ | |
2798 psaT30_Capabilities( ); | |
2799 | |
2800 /* | |
2801 *------------------------------------------------------------------- | |
2802 * check for T30 modification | |
2803 *------------------------------------------------------------------- | |
2804 */ | |
2805 if( frmTyp EQ FRT_DCS ) | |
2806 { | |
2807 if( cmhT30_Chk4TCHAdpt() ) | |
2808 { | |
2809 ccShrdPrm.datStat = DS_TCH_MDF; /* wait for TCH change */ | |
2810 } | |
2811 else | |
2812 { | |
2813 if( cmhT30_Modify() NEQ AT_EXCT ) | |
2814 { | |
2815 ccShrdPrm.datStat = DS_DSC_REQ; | |
2816 cmhT30_Deactivate(); | |
2817 } | |
2818 } | |
2819 } | |
2820 return( AT_EXCT ); | |
2821 } | |
2822 | |
2823 | |
2824 /* | |
2825 +-------------------------------------------------------------------+ | |
2826 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
2827 | ROUTINE : cmhT30_PPMRcvd | | |
2828 +-------------------------------------------------------------------+ | |
2829 | |
2830 PURPOSE : post page message was received | |
2831 | |
2832 */ | |
2833 /* does not seem to be called */ | |
2834 #if 0 | |
2835 GLOBAL void cmhT30_PPMRcvd ( UBYTE ppm ) | |
2836 { | |
2837 TRACE_FUNCTION ("cmhT30_PPMRcvd()"); | |
2838 | |
2839 /* determine type of post page message */ | |
2840 switch( ppm ) | |
2841 { | |
2842 case( SGN_MPS ): /* multi-page signal */ | |
2843 case( SGN_EOP ): /* end of procedure */ | |
2844 | |
2845 t30ShrdPrm.faxStat = FS_SND_DOC; /* stay in send document */ | |
2846 break; | |
2847 | |
2848 case( SGN_EOM ): | |
2849 | |
2850 /*--- no more doc available for polling if polled ---*/ | |
2851 if( ccShrdPrm.ctb[t30ShrdPrm.cId].calType EQ CT_MTC ) | |
2852 { | |
2853 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FLPval = FLP_VAL_NoPollDoc; | |
2854 } | |
2855 | |
2856 t30ShrdPrm.faxStat = FS_DOC_TRF; /* switch to document transfered */ | |
2857 break; | |
2858 | |
2859 default: | |
2860 | |
2861 return; | |
2862 } | |
2863 | |
2864 /* send PPM to T.30 */ | |
2865 t30ShrdPrm.sgn_snd = ppm; | |
2866 | |
2867 if( PRIRcvdFlg AND | |
2868 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FIEval EQ FIE_VAL_AcceptPRI) | |
2869 | |
2870 t30ShrdPrm.sgn_snd |= PRI_MRK; | |
2871 | |
2872 if( pageSentFlg EQ TRUE ) | |
2873 { | |
2874 if( psaT30_Ppm( ) < 0 ) /* T30 PPM request */ | |
2875 { | |
2876 TRACE_EVENT( "FATAL RETURN psaT30 in cmhT30_PPMRcvd" ); | |
2877 } | |
2878 } | |
2879 else | |
2880 | |
2881 ppmPendFlg = TRUE; | |
2882 } | |
2883 #endif /* 0 */ | |
2884 | |
2885 /* | |
2886 +-------------------------------------------------------------------+ | |
2887 | PROJECT : GSM-PS (6147) MODULE : CMH_T30S | | |
2888 | ROUTINE : cmhT30_PRIRcvd | | |
2889 +-------------------------------------------------------------------+ | |
2890 | |
2891 PURPOSE : procedure interrupt message was received | |
2892 | |
2893 */ | |
2894 | |
2895 GLOBAL void cmhT30_PRIRcvd ( void ) | |
2896 { | |
2897 TRACE_FUNCTION ("cmhT30_PRIRcvd()"); | |
2898 | |
2899 PRIRcvdFlg = TRUE; | |
2900 } | |
2901 | |
2902 /* | |
2903 +-------------------------------------------------------------------+ | |
2904 | PROJECT : GSM-PS (6147) MODULE : CMH_T30 | | |
2905 | ROUTINE : cmhT30_FITTimeout | | |
2906 +-------------------------------------------------------------------+ | |
2907 | |
2908 PURPOSE : handle FAX inactivity timeout | |
2909 | |
2910 */ | |
2911 | |
2912 GLOBAL void cmhT30_FITTimeout ( void ) | |
2913 { | |
2914 TRACE_FUNCTION( "cmhT30_FITTimeout()" ); | |
2915 | |
2916 if (!psaCC_ctbIsValid (t30ShrdPrm.cId)) | |
2917 { | |
2918 TRACE_ERROR ("t30ShrdPrm.cId invalid"); | |
2919 return; | |
2920 } | |
2921 | |
2922 /* | |
2923 *------------------------------------------------------------------- | |
2924 * notify CC to release the call | |
2925 *------------------------------------------------------------------- | |
2926 */ | |
2927 t30ShrdPrm.faxStat = FS_IDL; | |
2928 t30EntStat.curCmd = AT_CMD_NONE; | |
2929 | |
2930 cmhCC_T30_Failed(); | |
2931 | |
2932 if( fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FITact EQ FIT_ACT_OnHookRst ) | |
2933 | |
2934 fnd_cmhPrm[t30EntStat.entOwn].t30CmdPrm.FCLASSclass = FCLASS_CLASS_Data; | |
2935 } | |
2936 #endif /* DTI OR FF_FAX*/ | |
2937 /*==== EOF ========================================================*/ |