comparison g23m/condat/ms/src/aci/cmh_ssq.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_SSS
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 query functions related to the
18 | protocol stack adapter for SS.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef CMH_SSQ_C
23 #define CMH_SSQ_C
24 #endif
25
26 #include "aci_all.h"
27 /*==== INCLUDES ===================================================*/
28 #include "aci.h"
29 #include "aci_cmh.h"
30 #include "ati_cmd.h"
31 #include "aci_cmd.h"
32
33 #include "aci_ext_pers.h" /* we are using personalisation extensions */
34 #include "aci_slock.h" /* in order to asure interfaces */
35
36 #ifdef FAX_AND_DATA
37 #include "aci_fd.h"
38 #endif /* of #ifdef FAX_AND_DATA */
39
40 #ifdef UART
41 #include "dti.h"
42 #include "dti_conn_mng.h"
43 #endif
44
45 #include "ksd.h"
46 #include "psa.h"
47 #include "psa_ss.h"
48 #include "psa_sim.h"
49 #include "cmh.h"
50 #include "cmh_ss.h"
51 #include "cmh_sim.h"
52
53 #include "aci_ext_pers.h"
54 #include "aci_slock.h"
55
56 /*==== CONSTANTS ==================================================*/
57
58 /*==== EXPORT =====================================================*/
59
60 /*==== VARIABLES ==================================================*/
61
62 /*==== FUNCTIONS ==================================================*/
63
64 /*
65 +--------------------------------------------------------------------+
66 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
67 | STATE : code ROUTINE : qAT_PlusCCFC |
68 +--------------------------------------------------------------------+
69
70 PURPOSE : This is the functional counterpart to the +CCFC AT command
71 which is responsible to query the parameters for call
72 forwarding supplementary services.
73
74 <reason> : reason for CF.
75 <class> : class of basic service.
76 */
77
78 GLOBAL T_ACI_RETURN qAT_PlusCCFC ( T_ACI_CMD_SRC srcId,
79 T_ACI_CCFC_RSN reason,
80 T_ACI_CLASS class_type )
81 {
82 SHORT sId; /* holds service id */
83 UBYTE ssCd; /* holds ss code */
84
85 T_ACI_RETURN retVal;
86
87
88 TRACE_FUNCTION ("qAT_PlusCCFC");
89
90 /*
91 *-------------------------------------------------------------------
92 * check command source
93 *-------------------------------------------------------------------
94 */
95 if(!cmh_IsVldCmdSrc (srcId))
96 {
97 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
98 return( AT_FAIL );
99 }
100
101 if( cmhPrm[srcId].ssCmdPrm.mltyTrnFlg NEQ 0 )
102
103 return( AT_BUSY );
104
105 /*
106 *-------------------------------------------------------------------
107 * check parameter <reason>
108 *-------------------------------------------------------------------
109 */
110 switch( reason )
111 {
112 case( CCFC_RSN_Uncond ): ssCd = SS_CD_CFU; break;
113 case( CCFC_RSN_Busy ): ssCd = SS_CD_CFB; break;
114 case( CCFC_RSN_NoReply ): ssCd = SS_CD_CFNRY; break;
115 case( CCFC_RSN_NotReach ): ssCd = SS_CD_CFNRC; break;
116 case( CCFC_RSN_Forward ): ssCd = SS_CD_ALL_FWSS; break;
117 case( CCFC_RSN_CondForward ): ssCd = SS_CD_ALL_CFWSS; break;
118 case( CCFC_RSN_NotPresent ):
119 default:
120 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
121 return( AT_FAIL );
122 }
123
124 /*
125 *-------------------------------------------------------------------
126 * check parameter <class>
127 *-------------------------------------------------------------------
128 */
129 if( !cmhSS_CheckClassInterr(class_type) )
130 {
131 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
132 return( AT_FAIL );
133 }
134
135 /* SIM TOOLKIT & FDN HANDLING */
136
137 retVal = cmhSS_CF_SAT_Handle( srcId, reason, CCFC_MOD_Query, NULL, NULL, class_type, NULL, NULL, 0);
138
139 if( retVal NEQ AT_CMPL )
140 return( retVal );
141
142 /*
143 *-------------------------------------------------------------------
144 * get a new service table entry to interrogate SS
145 *-------------------------------------------------------------------
146 */
147 sId = psaSS_stbNewEntry();
148
149 if( sId EQ NO_ENTRY )
150 {
151 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
152 return( AT_FAIL );
153 }
154
155 /*
156 *-------------------------------------------------------------------
157 * start first transaction
158 *-------------------------------------------------------------------
159 */
160 CCD_START;
161
162 psaSS_asmInterrogateSS( ssCd, SS_NO_PRM, SS_NO_PRM );
163
164 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
165 ssShrdPrm.stb[sId].ssCode = ssCd;
166 ssShrdPrm.stb[sId].srvOwn = srcId;
167 ssShrdPrm.stb[sId].ClassType = class_type;
168
169 ssShrdPrm.stb[sId].curCmd = AT_CMD_CCFC;
170 cmhSS_flagTrn( sId, &(cmhPrm[srcId].ssCmdPrm.mltyTrnFlg));
171 psaSS_NewTrns(sId);
172
173 CCD_END;
174
175 /*
176 *-------------------------------------------------------------------
177 * log command execution
178 *-------------------------------------------------------------------
179 */
180 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
181 {
182 T_ACI_CLOG cmdLog; /* holds logging info */
183
184 cmdLog.atCmd = AT_CMD_CCFC;
185 cmdLog.cmdType = CLOG_TYPE_Query;
186 cmdLog.retCode = AT_EXCT;
187 cmdLog.cId = ACI_NumParmNotPresent;
188 cmdLog.sId = sId+1;
189 cmdLog.cmdPrm.qCCFC.srcId = srcId;
190 cmdLog.cmdPrm.qCCFC.reason = reason;
191 cmdLog.cmdPrm.qCCFC.class_type = class_type;
192
193 rAT_PercentCLOG( &cmdLog );
194 }
195 #endif
196
197 return( AT_EXCT );
198 }
199
200 /*
201 +--------------------------------------------------------------------+
202 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
203 | STATE : code ROUTINE : qAT_PlusCLCK |
204 +--------------------------------------------------------------------+
205
206 PURPOSE : This is the functional counterpart to the +CLCK AT command
207 which is responsible to query the parameters for call
208 barring supplementary services.
209
210 <fac> : CB facility.
211 <class>: class of basic service.
212 */
213
214 GLOBAL T_ACI_RETURN qAT_PlusCLCK ( T_ACI_CMD_SRC srcId,
215 T_ACI_CLCK_FAC fac,
216 T_ACI_CLASS class_type,
217 T_ACI_CLSSTAT *clsStat)
218 {
219 UBYTE dummy_slockStat;
220 TRACE_FUNCTION ("qAT_PlusCLCK");
221 return qAT_PercentCLCK(srcId,fac,class_type, clsStat,&dummy_slockStat);
222 }
223
224 /*QAT_PERCENTCLCK add for Simlock in Riviear MFW
225
226 Added by Shen,Chao April 16th, 2003
227 */
228
229 GLOBAL T_ACI_RETURN qAT_PercentCLCK ( T_ACI_CMD_SRC srcId,
230 T_ACI_CLCK_FAC fac,
231 T_ACI_CLASS class_type,
232 T_ACI_CLSSTAT *clsStat,
233 UBYTE *simClockStat)
234 {
235 SHORT sId; /* holds service id */
236 UBYTE ssCd; /* holds ss code */
237 T_ACI_RETURN retVal;
238 #ifdef SIM_PERS
239 T_SIMLOCK_TYPE slocktype;
240 T_SIMLOCK_STATUS rlockstatus;
241 #endif
242
243
244 TRACE_FUNCTION ("qAT_PercentCLCK");
245
246 /*
247 *-------------------------------------------------------------------
248 * check command source
249 *-------------------------------------------------------------------
250 */
251 if(!cmh_IsVldCmdSrc (srcId))
252 {
253 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
254 return( AT_FAIL );
255 }
256
257 if( cmhPrm[srcId].ssCmdPrm.mltyTrnFlg NEQ 0 )
258 return( AT_BUSY );
259
260 /*
261 *-------------------------------------------------------------------
262 * check parameter <fac>
263 *-------------------------------------------------------------------
264 */
265 switch( fac )
266 {
267 case( CLCK_FAC_Ao ): ssCd = SS_CD_BAOC; break;
268 case( CLCK_FAC_Oi ): ssCd = SS_CD_BOIC; break;
269 case( CLCK_FAC_Ox ): ssCd = SS_CD_BOICXH; break;
270 case( CLCK_FAC_Ai ): ssCd = SS_CD_BAIC; break;
271 case( CLCK_FAC_Ir ): ssCd = SS_CD_BICRM; break;
272 case( CLCK_FAC_Ab ): ssCd = SS_CD_ALL_CBSS; break;
273 case( CLCK_FAC_Ag ): ssCd = SS_CD_BOC; break;
274 case( CLCK_FAC_Ac ): ssCd = SS_CD_BIC; break;
275
276 case( CLCK_FAC_Sc ):
277 case( CLCK_FAC_Fd ):
278 case( CLCK_FAC_Al ):
279 case( CLCK_FAC_Pn ):
280 case( CLCK_FAC_Pu ):
281 case( CLCK_FAC_Pc ):
282 case( CLCK_FAC_Pp ):
283 case( CLCK_FAC_Ps ):
284 case( CLCK_FAC_Pf ): ssCd = NOT_PRESENT_8BIT; break;
285
286 case( CLCK_FAC_NotPresent ):
287 default:
288
289 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
290 return( AT_FAIL );
291 }
292
293 /*
294 *-------------------------------------------------------------------
295 * if action is related to SS
296 *-------------------------------------------------------------------
297 */
298 if( ssCd NEQ NOT_PRESENT_8BIT )
299 {
300 /*
301 *-------------------------------------------------------------------
302 * check parameter <class>
303 *-------------------------------------------------------------------
304 */
305 if( !cmhSS_CheckCbClassInterr(class_type))
306 {
307 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_OpNotAllow );
308 return( AT_FAIL );
309 }
310
311 if( cmhPrm[srcId].ssCmdPrm.mltyTrnFlg NEQ 0 )
312
313 return( AT_BUSY );
314 /*
315 *-------------------------------------------------------------------
316 * check not allowed <fac> (only possible with mode=0 i.e unlock)
317 *-------------------------------------------------------------------
318 */
319 if(fac EQ CLCK_FAC_Ab OR fac EQ CLCK_FAC_Ag OR fac EQ CLCK_FAC_Ac)
320 {
321 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_OpNotAllow );
322 return( AT_FAIL );
323 }
324
325 /* SIM TOOLKIT & FDN HANDLING */
326
327 retVal = cmhSS_Call_Barr_SAT_Handle( srcId, CLCK_MODE_QUERY, fac, NULL, class_type);
328
329 if( retVal NEQ AT_CMPL )
330 return( retVal );
331
332
333 /*
334 *-------------------------------------------------------------------
335 * get a new service table entry to interrogate SS
336 *-------------------------------------------------------------------
337 */
338 sId = psaSS_stbNewEntry();
339
340 if( sId EQ NO_ENTRY )
341 {
342 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
343 return( AT_FAIL );
344 }
345
346 /*
347 *-------------------------------------------------------------------
348 * start first transaction
349 *-------------------------------------------------------------------
350 */
351 CCD_START;
352
353 psaSS_asmInterrogateSS( ssCd, SS_NO_PRM, SS_NO_PRM );
354
355 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
356 ssShrdPrm.stb[sId].ssCode = ssCd;
357 ssShrdPrm.stb[sId].srvOwn = srcId;
358 ssShrdPrm.stb[sId].ClassType = class_type;
359
360 ssShrdPrm.stb[sId].curCmd = AT_CMD_CLCK;
361 cmhSS_flagTrn( sId, &(cmhPrm[srcId].ssCmdPrm.mltyTrnFlg));
362 psaSS_NewTrns(sId);
363
364 CCD_END;
365 }
366
367 /*
368 *-------------------------------------------------------------------
369 * if action is related to SIM
370 *-------------------------------------------------------------------
371 */
372 else
373 {
374 switch (fac)
375 {
376 /*
377 *---------------------------------------------------------------
378 * access PIN 1 status
379 *---------------------------------------------------------------
380 */
381 case CLCK_FAC_Sc:
382 clsStat -> class_type = CLASS_NotPresent;
383 clsStat -> status = STATUS_NotPresent;
384
385 switch( simShrdPrm.PEDStat )
386 {
387 case( PEDS_ENA ): clsStat -> status = STATUS_Active;
388 return( AT_CMPL );
389 case( PEDS_DIS ): clsStat -> status = STATUS_NotActive;
390 return( AT_CMPL );
391 default:
392
393 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_SimFail );
394 return( AT_FAIL );
395 }
396 break;
397
398 /*
399 *---------------------------------------------------------------
400 * access fixed dialling feature
401 *---------------------------------------------------------------
402 */
403 case ( CLCK_FAC_Fd ):
404 clsStat -> class_type = CLASS_NotPresent;
405 clsStat -> status = STATUS_NotPresent;
406
407 if( simShrdPrm.SIMStat EQ SS_OK )
408 {
409 switch( simShrdPrm.crdFun )
410 {
411 case( SIM_ADN_ENABLED ):
412 case( SIM_ADN_BDN_ENABLED ): clsStat -> status = STATUS_NotActive;
413 return( AT_CMPL );
414 case( SIM_FDN_ENABLED ):
415 case( SIM_FDN_BDN_ENABLED ): clsStat -> status = STATUS_Active;
416 return( AT_CMPL );
417 case( SIM_NO_OPERATION ):
418 default:
419
420 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_SimFail );
421 return( AT_FAIL );
422 }
423 }
424 else
425 {
426 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_SimFail );
427 return( AT_FAIL );
428 }
429 break;
430
431 /*
432 *---------------------------------------------------------------
433 * lock ALS setting with PIN2
434 *---------------------------------------------------------------
435 */
436 case CLCK_FAC_Al:
437 clsStat -> class_type = CLASS_NotPresent;
438 clsStat -> status = STATUS_NotPresent;
439
440 switch( ALSlock )
441 {
442 case( ALS_MOD_SPEECH ):
443 case( ALS_MOD_AUX_SPEECH ):
444 clsStat -> status = STATUS_Active;
445 return( AT_CMPL );
446
447 case( ALS_MOD_NOTPRESENT ):
448 clsStat -> status = STATUS_NotActive;
449 return( AT_CMPL );
450
451 default:
452 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_OpNotSupp );
453 return( AT_FAIL );
454 }
455 break;
456
457 #ifdef SIM_PERS
458 /*
459 *---------------------------------------------------------------
460 * ME Personalisation
461 *---------------------------------------------------------------
462 */
463
464 case CLCK_FAC_Pn:
465 case CLCK_FAC_Pu:
466 case CLCK_FAC_Pp:
467 case CLCK_FAC_Pc:
468 case CLCK_FAC_Ps:
469 case CLCK_FAC_Pf:
470 clsStat -> class_type = CLASS_NotPresent;
471 clsStat -> status = STATUS_NotPresent;
472 switch (fac)
473 {
474 case CLCK_FAC_Pn: slocktype = SIMLOCK_NETWORK; break;
475 case CLCK_FAC_Pu: slocktype = SIMLOCK_NETWORK_SUBSET; break;
476 case CLCK_FAC_Pp: slocktype = SIMLOCK_SERVICE_PROVIDER; break;
477 case CLCK_FAC_Pc: slocktype = SIMLOCK_CORPORATE; break;
478 case CLCK_FAC_Ps: slocktype = SIMLOCK_SIM; break;
479 case CLCK_FAC_Pf: slocktype = SIMLOCK_FIRST_SIM; break;
480 default: slocktype = SIMLOCK_NETWORK;
481 }
482 aci_ext_personalisation_init();
483 rlockstatus = aci_personalisation_get_status(slocktype); /* Changed to aci_personalisatio_get_status
484 from aci_ext_personalisatio_get_status on 11/03/2005 */
485 aci_ext_personalisation_free();
486 if (rlockstatus EQ SIMLOCK_ENABLED)
487 {
488 clsStat -> status = STATUS_Active;
489 return( AT_CMPL );
490 }
491 else if (rlockstatus EQ SIMLOCK_DISABLED)
492 {
493 clsStat -> status = STATUS_NotActive;
494 return( AT_CMPL );
495 }
496 else
497 {
498 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_Unknown );
499 return( AT_FAIL );
500 }
501
502 #endif
503
504 /*
505 *---------------------------------------------------------------
506 * Error handling
507 *---------------------------------------------------------------
508 */
509 default:
510 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_Unknown );
511 return( AT_FAIL );
512 }
513 }
514
515 /*
516 *-------------------------------------------------------------------
517 * log command execution
518 *-------------------------------------------------------------------
519 */
520 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
521 {
522 T_ACI_CLOG cmdLog; /* holds logging info */
523
524 cmdLog.atCmd = AT_CMD_CLCK;
525 cmdLog.cmdType = CLOG_TYPE_Query;
526 cmdLog.retCode = AT_EXCT;
527 cmdLog.cId = ACI_NumParmNotPresent;
528 cmdLog.sId = sId+1;
529 cmdLog.cmdPrm.qCLCK.srcId = srcId;
530 cmdLog.cmdPrm.qCLCK.fac = fac;
531 cmdLog.cmdPrm.qCLCK.class_type = class_type;
532
533 rAT_PercentCLOG( &cmdLog );
534 }
535 #endif
536
537 return( AT_EXCT );
538 }
539
540 /*
541 +--------------------------------------------------------------------+
542 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
543 | STATE : code ROUTINE : qAT_PlusCCWA |
544 +--------------------------------------------------------------------+
545
546 PURPOSE : This is the functional counterpart to the +CCWA AT command
547 which is responsible to query the parameters for call
548 waiting supplementary services.
549
550 <class> : class of basic service.
551 */
552
553 GLOBAL T_ACI_RETURN qAT_PlusCCWA (T_ACI_CMD_SRC srcId,
554 T_ACI_CLASS class_type)
555 {
556 SHORT sId; /* holds service id */
557
558 T_ACI_RETURN retVal;
559
560 TRACE_FUNCTION ("qAT_PlusCCWA ()");
561
562 /*
563 *-------------------------------------------------------------------
564 * check command source
565 *-------------------------------------------------------------------
566 */
567 if(!cmh_IsVldCmdSrc (srcId))
568 {
569 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
570 return( AT_FAIL );
571 }
572
573 if( cmhPrm[srcId].ssCmdPrm.mltyTrnFlg NEQ 0 )
574
575 return( AT_BUSY );
576
577 /*
578 *-------------------------------------------------------------------
579 * check parameter <class>
580 *-------------------------------------------------------------------
581 */
582 if( !cmhSS_CheckClassInterr(class_type) )
583 {
584 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
585 return( AT_FAIL );
586 }
587
588 /* SIM TOOLKIT & FDN HANDLING */
589 retVal = cmhSS_CW_SAT_Handle( srcId, CCWA_MOD_Query, class_type);
590
591 if( retVal NEQ AT_CMPL )
592 return( retVal );
593
594 /*
595 *-------------------------------------------------------------------
596 * get a new service table entry to interrogate SS
597 *-------------------------------------------------------------------
598 */
599 sId = psaSS_stbNewEntry();
600
601 if( sId EQ NO_ENTRY )
602 {
603 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
604 return( AT_FAIL );
605 }
606
607 /*
608 *-------------------------------------------------------------------
609 * start first transaction
610 *-------------------------------------------------------------------
611 */
612 CCD_START;
613
614 psaSS_asmInterrogateSS( SS_CD_CW, SS_NO_PRM, SS_NO_PRM );
615
616 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
617 ssShrdPrm.stb[sId].ssCode = SS_CD_CW;
618 ssShrdPrm.stb[sId].srvOwn = srcId;
619 ssShrdPrm.stb[sId].ClassType = class_type;
620
621 ssShrdPrm.stb[sId].curCmd = AT_CMD_CCWA;
622 cmhSS_flagTrn( sId, &(cmhPrm[srcId].ssCmdPrm.mltyTrnFlg));
623 psaSS_NewTrns(sId);
624
625 CCD_END;
626
627 /*
628 *-------------------------------------------------------------------
629 * log command execution
630 *-------------------------------------------------------------------
631 */
632 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
633 {
634 T_ACI_CLOG cmdLog; /* holds logging info */
635
636 cmdLog.atCmd = AT_CMD_CCWA;
637 cmdLog.cmdType = CLOG_TYPE_Query;
638 cmdLog.retCode = AT_EXCT;
639 cmdLog.cId = ACI_NumParmNotPresent;
640 cmdLog.sId = sId+1;
641 cmdLog.cmdPrm.qCCWA.srcId = srcId;
642 cmdLog.cmdPrm.qCCWA.class_type = class_type;
643
644 rAT_PercentCLOG( &cmdLog );
645 }
646 #endif
647
648 return( AT_EXCT );
649 }
650
651 /*
652 +--------------------------------------------------------------------+
653 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
654 | STATE : code ROUTINE : qAT_PlusCLIP |
655 +--------------------------------------------------------------------+
656
657 PURPOSE : This is the functional counterpart to the +CLIP AT command
658 which is responsible to query the setting for calling
659 line indication supplementary services.
660
661 <stat> : CLIP status.
662 */
663
664 GLOBAL T_ACI_RETURN qAT_PlusCLIP ( T_ACI_CMD_SRC srcId,
665 T_ACI_CLIP_STAT * stat)
666 {
667 SHORT sId; /* holds service id */
668
669 T_ACI_RETURN retVal;
670
671 TRACE_FUNCTION ("qAT_PlusCLIP ()");
672
673 /*
674 *-------------------------------------------------------------------
675 * check command source
676 *-------------------------------------------------------------------
677 */
678 if(!cmh_IsVldCmdSrc (srcId))
679 {
680 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
681 return( AT_FAIL );
682 }
683
684 /* SIM TOOLKIT & FDN HANDLING */
685 retVal = cmhSS_CLIP_SAT_Handle( srcId);
686
687 if( retVal NEQ AT_CMPL )
688 return( retVal );
689 /*
690 *-------------------------------------------------------------------
691 * get a new service table entry to interrogate SS
692 *-------------------------------------------------------------------
693 */
694 sId = psaSS_stbNewEntry();
695
696 if( sId EQ NO_ENTRY )
697 {
698 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
699 return( AT_FAIL );
700 }
701
702 /*
703 *-------------------------------------------------------------------
704 * set up facility information element
705 *-------------------------------------------------------------------
706 */
707 CCD_START;
708
709 psaSS_asmInterrogateSS( SS_CD_CLIP, SS_NO_PRM, SS_NO_PRM );
710 /*
711 *-----------------------------------------------------------------
712 * declare service table entry as used and the owner of the service
713 *-----------------------------------------------------------------
714 */
715 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
716 ssShrdPrm.stb[sId].srvOwn = srcId;
717
718 /*
719 *-------------------------------------------------------------------
720 * start a new transaction
721 *-------------------------------------------------------------------
722 */
723 ssShrdPrm.stb[sId].curCmd = AT_CMD_CLIP;
724 psaSS_NewTrns(sId);
725
726 CCD_END;
727
728 /*
729 *-------------------------------------------------------------------
730 * log command execution
731 *-------------------------------------------------------------------
732 */
733 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
734 {
735 T_ACI_CLOG cmdLog; /* holds logging info */
736
737 cmdLog.atCmd = AT_CMD_CLIP;
738 cmdLog.cmdType = CLOG_TYPE_Query;
739 cmdLog.retCode = AT_EXCT;
740 cmdLog.cId = ACI_NumParmNotPresent;
741 cmdLog.sId = sId+1;
742 cmdLog.cmdPrm.qCLIP.srcId = srcId;
743 cmdLog.cmdPrm.qCLIP.stat = stat;
744
745 rAT_PercentCLOG( &cmdLog );
746 }
747 #endif
748
749 return( AT_EXCT );
750 }
751
752 /*
753 +--------------------------------------------------------------------+
754 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
755 | STATE : code ROUTINE : qAT_PlusCLIR |
756 +--------------------------------------------------------------------+
757
758 PURPOSE : This is the functional counterpart to the +CLIR AT command
759 which is responsible to query the setting for calling
760 line restriction supplementary services.
761
762 <mode> : CLIR mode.
763 <stat> : CLIR status.
764 */
765
766 GLOBAL T_ACI_RETURN qAT_PlusCLIR ( T_ACI_CMD_SRC srcId,
767 T_ACI_CLIR_MOD * mode,
768 T_ACI_CLIR_STAT * stat)
769 {
770 SHORT sId; /* holds service id */
771
772 T_ACI_RETURN retVal;
773
774 TRACE_FUNCTION ("qAT_PlusCLIR ()");
775
776 /*
777 *-------------------------------------------------------------------
778 * check command source
779 *-------------------------------------------------------------------
780 */
781 if(!cmh_IsVldCmdSrc (srcId))
782 {
783 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
784 return( AT_FAIL );
785 }
786
787 /* SIM TOOLKIT & FDN HANDLING */
788 retVal = cmhSS_CLIR_SAT_Handle( srcId);
789
790 if( retVal NEQ AT_CMPL )
791 return( retVal );
792
793
794 /*
795 *-------------------------------------------------------------------
796 * get a new service table entry to interrogate SS
797 *-------------------------------------------------------------------
798 */
799 sId = psaSS_stbNewEntry();
800
801 if( sId EQ NO_ENTRY )
802 {
803 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
804 return( AT_FAIL );
805 }
806
807 /*
808 *-------------------------------------------------------------------
809 * set up facility information element
810 *-------------------------------------------------------------------
811 */
812 CCD_START;
813
814 psaSS_asmInterrogateSS( SS_CD_CLIR, SS_NO_PRM, SS_NO_PRM );
815 /*
816 *-----------------------------------------------------------------
817 * declare service table entry as used and the owner of the service
818 *-----------------------------------------------------------------
819 */
820 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
821 ssShrdPrm.stb[sId].srvOwn = srcId;
822
823 /*
824 *-------------------------------------------------------------------
825 * start a new transaction
826 *-------------------------------------------------------------------
827 */
828 ssShrdPrm.stb[sId].curCmd = AT_CMD_CLIR;
829 psaSS_NewTrns(sId);
830
831 CCD_END;
832
833 /*
834 *-------------------------------------------------------------------
835 * log command execution
836 *-------------------------------------------------------------------
837 */
838 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
839 {
840 T_ACI_CLOG cmdLog; /* holds logging info */
841
842 cmdLog.atCmd = AT_CMD_CLIR;
843 cmdLog.cmdType = CLOG_TYPE_Query;
844 cmdLog.retCode = AT_EXCT;
845 cmdLog.cId = ACI_NumParmNotPresent;
846 cmdLog.sId = sId+1;
847 cmdLog.cmdPrm.qCLIR.srcId = srcId;
848 cmdLog.cmdPrm.qCLIR.stat = stat;
849 cmdLog.cmdPrm.qCLIR.mode = mode;
850
851 rAT_PercentCLOG( &cmdLog );
852 }
853 #endif
854
855 return( AT_EXCT );
856 }
857
858
859 GLOBAL T_ACI_RETURN qAT_PercentCLIR ( T_ACI_CMD_SRC srcId,
860 T_ACI_CLIR_MOD * mode)
861 {
862 T_CC_CMD_PRM *pCCCmdPrm; /* points to CC command parameters */
863 TRACE_FUNCTION ("qAT_PercentCLIR ()");
864
865 /*
866 *-------------------------------------------------------------------
867 * check command source
868 *-------------------------------------------------------------------
869 */
870 if(!cmh_IsVldCmdSrc (srcId))
871 {
872 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
873 return( AT_FAIL );
874 }
875
876 pCCCmdPrm = &cmhPrm[srcId].ccCmdPrm;
877 *mode = pCCCmdPrm->CLIRmode;
878
879 return AT_CMPL;
880 }
881
882 /*
883 +--------------------------------------------------------------------+
884 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
885 | STATE : code ROUTINE : qAT_PlusCOLP |
886 +--------------------------------------------------------------------+
887
888 PURPOSE : This is the functional counterpart to the +COLP AT command
889 which is responsible to query the setting for connected
890 line presentation supplementary services.
891
892 <stat> : COLP status.
893 */
894
895 GLOBAL T_ACI_RETURN qAT_PlusCOLP ( T_ACI_CMD_SRC srcId,
896 T_ACI_COLP_STAT * stat)
897 {
898 SHORT sId; /* holds service id */
899
900 T_ACI_RETURN retVal;
901
902 TRACE_FUNCTION ("qAT_PlusCOLP ()");
903
904 /*
905 *-------------------------------------------------------------------
906 * check command source
907 *-------------------------------------------------------------------
908 */
909 if(!cmh_IsVldCmdSrc (srcId))
910 {
911 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
912 return( AT_FAIL );
913 }
914
915 /* SIM TOOLKIT & FDN HANDLING */
916 retVal = cmhSS_COLP_SAT_Handle( srcId);
917
918 if( retVal NEQ AT_CMPL )
919 return( retVal );
920
921
922 /*
923 *-------------------------------------------------------------------
924 * get a new service table entry to interrogate SS
925 *-------------------------------------------------------------------
926 */
927 sId = psaSS_stbNewEntry();
928
929 if( sId EQ NO_ENTRY )
930 {
931 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
932 return( AT_FAIL );
933 }
934
935 /*
936 *-------------------------------------------------------------------
937 * set up facility information element
938 *-------------------------------------------------------------------
939 */
940 CCD_START;
941
942 psaSS_asmInterrogateSS( SS_CD_COLP, SS_NO_PRM, SS_NO_PRM );
943 /*
944 *-----------------------------------------------------------------
945 * declare service table entry as used and the owner of the service
946 *-----------------------------------------------------------------
947 */
948 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
949 ssShrdPrm.stb[sId].srvOwn = srcId;
950
951 /*
952 *-------------------------------------------------------------------
953 * start a new transaction
954 *-------------------------------------------------------------------
955 */
956 ssShrdPrm.stb[sId].curCmd = AT_CMD_COLP;
957 psaSS_NewTrns(sId);
958
959 CCD_END;
960
961 /*
962 *-------------------------------------------------------------------
963 * log command execution
964 *-------------------------------------------------------------------
965 */
966 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
967 {
968 T_ACI_CLOG cmdLog; /* holds logging info */
969
970 cmdLog.atCmd = AT_CMD_COLP;
971 cmdLog.cmdType = CLOG_TYPE_Query;
972 cmdLog.retCode = AT_EXCT;
973 cmdLog.cId = ACI_NumParmNotPresent;
974 cmdLog.sId = sId+1;
975 cmdLog.cmdPrm.qCOLP.srcId = srcId;
976 cmdLog.cmdPrm.qCOLP.stat = stat;
977
978 rAT_PercentCLOG( &cmdLog );
979 }
980 #endif
981
982 return( AT_EXCT );
983 }
984
985 /*
986 +--------------------------------------------------------------------+
987 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
988 | STATE : code ROUTINE : qAT_PercentCOLR |
989 +--------------------------------------------------------------------+
990
991 PURPOSE : This is the functional counterpart to the %COLR AT command
992 which is responsible to query the setting for connected
993 line restriction supplementary services.
994
995 <stat> : COLR status.
996 */
997
998 GLOBAL T_ACI_RETURN qAT_PercentCOLR ( T_ACI_CMD_SRC srcId )
999 {
1000 SHORT sId; /* holds service id */
1001
1002 T_ACI_RETURN retVal;
1003
1004 TRACE_FUNCTION ("qAT_PercentCOLR ()");
1005
1006 /*
1007 *-------------------------------------------------------------------
1008 * check command source
1009 *-------------------------------------------------------------------
1010 */
1011 if(!cmh_IsVldCmdSrc (srcId))
1012 {
1013 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
1014 return( AT_FAIL );
1015 }
1016
1017 /* SIM TOOLKIT & FDN HANDLING */
1018 retVal = cmhSS_COLR_SAT_Handle( srcId);
1019
1020 if( retVal NEQ AT_CMPL )
1021 return( retVal );
1022 /*
1023 *-------------------------------------------------------------------
1024 * get a new service table entry to interrogate SS
1025 *-------------------------------------------------------------------
1026 */
1027 sId = psaSS_stbNewEntry();
1028
1029 if( sId EQ NO_ENTRY )
1030 {
1031 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
1032 return( AT_FAIL );
1033 }
1034
1035 /*
1036 *-------------------------------------------------------------------
1037 * set up facility information element
1038 *-------------------------------------------------------------------
1039 */
1040 CCD_START;
1041
1042 psaSS_asmInterrogateSS( SS_CD_COLR, SS_NO_PRM, SS_NO_PRM );
1043 /*
1044 *-----------------------------------------------------------------
1045 * declare service table entry as used and the owner of the service
1046 *-----------------------------------------------------------------
1047 */
1048 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
1049 ssShrdPrm.stb[sId].srvOwn = srcId;
1050
1051 /*
1052 *-------------------------------------------------------------------
1053 * start a new transaction
1054 *-------------------------------------------------------------------
1055 */
1056 ssShrdPrm.stb[sId].curCmd = AT_CMD_COLR;
1057 psaSS_NewTrns(sId);
1058
1059 CCD_END;
1060
1061 /*
1062 *-------------------------------------------------------------------
1063 * log command execution
1064 *-------------------------------------------------------------------
1065 */
1066 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
1067 {
1068 T_ACI_CLOG cmdLog; /* holds logging info */
1069
1070 cmdLog.atCmd = AT_CMD_COLR;
1071 cmdLog.cmdType = CLOG_TYPE_Query;
1072 cmdLog.retCode = AT_EXCT;
1073 cmdLog.cId = ACI_NumParmNotPresent;
1074 cmdLog.sId = sId+1;
1075 cmdLog.cmdPrm.qCOLR.srcId = srcId;
1076
1077 rAT_PercentCLOG( &cmdLog );
1078 }
1079 #endif
1080
1081 return( AT_EXCT );
1082 }
1083
1084 /*
1085 +--------------------------------------------------------------------+
1086 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
1087 | STATE : code ROUTINE : qAT_PercentCCBS |
1088 +--------------------------------------------------------------------+
1089
1090 PURPOSE : This is the functional counterpart to the %CCBS AT command
1091 which is responsible to query the setting for connected
1092 line restriction supplementary services.
1093
1094 */
1095
1096 GLOBAL T_ACI_RETURN qAT_PercentCCBS ( T_ACI_CMD_SRC srcId )
1097 {
1098 SHORT sId; /* holds service id */
1099
1100 T_ACI_RETURN retVal;
1101
1102
1103 TRACE_FUNCTION ("qAT_PercentCCBS ()");
1104
1105 /*
1106 *-------------------------------------------------------------------
1107 * check command source
1108 *-------------------------------------------------------------------
1109 */
1110 if(!cmh_IsVldCmdSrc (srcId))
1111 {
1112 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
1113 return( AT_FAIL );
1114 }
1115
1116 /* SIM TOOLKIT & FDN HANDLING */
1117 retVal = cmhSS_CCBS_SAT_Handle( srcId, CCFC_MOD_Query, -1);
1118
1119 if( retVal NEQ AT_CMPL )
1120 return( retVal );
1121
1122
1123
1124 /*
1125 *-------------------------------------------------------------------
1126 * get a new service table entry to interrogate SS
1127 *-------------------------------------------------------------------
1128 */
1129 sId = psaSS_stbNewEntry();
1130
1131 if( sId EQ NO_ENTRY )
1132 {
1133 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
1134 return( AT_FAIL );
1135 }
1136
1137 /*
1138 *-------------------------------------------------------------------
1139 * set up facility information element
1140 *-------------------------------------------------------------------
1141 */
1142 CCD_START;
1143
1144 psaSS_asmInterrogateSS( SS_CD_CCBS, SS_NO_PRM, SS_NO_PRM );
1145 /*
1146 *-----------------------------------------------------------------
1147 * declare service table entry as used and the owner of the service
1148 *-----------------------------------------------------------------
1149 */
1150 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
1151 ssShrdPrm.stb[sId].srvOwn = srcId;
1152
1153 /*
1154 *-------------------------------------------------------------------
1155 * start a new transaction
1156 *-------------------------------------------------------------------
1157 */
1158 ssShrdPrm.stb[sId].curCmd = AT_CMD_CCBS;
1159 psaSS_NewTrns(sId);
1160
1161 CCD_END;
1162
1163 /*
1164 *-------------------------------------------------------------------
1165 * log command execution
1166 *-------------------------------------------------------------------
1167 */
1168 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
1169 {
1170 T_ACI_CLOG cmdLog; /* holds logging info */
1171
1172 cmdLog.atCmd = AT_CMD_CCBS;
1173 cmdLog.cmdType = CLOG_TYPE_Query;
1174 cmdLog.retCode = AT_EXCT;
1175 cmdLog.cId = ACI_NumParmNotPresent;
1176 cmdLog.sId = sId+1;
1177 cmdLog.cmdPrm.qCCBS.srcId = srcId;
1178
1179 rAT_PercentCLOG( &cmdLog );
1180 }
1181 #endif
1182
1183 return( AT_EXCT );
1184 }
1185
1186 /*
1187 +--------------------------------------------------------------------+
1188 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
1189 | STATE : code ROUTINE : qAT_PercentCNAP |
1190 +--------------------------------------------------------------------+
1191
1192 PURPOSE : This is the functional counterpart to the %CNAP AT command
1193 which is responsible to query the setting for calling
1194 name presentation supplementary services.
1195
1196 */
1197
1198 GLOBAL T_ACI_RETURN qAT_PercentCNAP ( T_ACI_CMD_SRC srcId )
1199 {
1200 SHORT sId; /* holds service id */
1201
1202 T_ACI_RETURN retVal;
1203
1204 TRACE_FUNCTION ("qAT_PercentCNAP ()");
1205
1206 /*
1207 *-------------------------------------------------------------------
1208 * check command source
1209 *-------------------------------------------------------------------
1210 */
1211 if(!cmh_IsVldCmdSrc (srcId))
1212 {
1213 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
1214 return( AT_FAIL );
1215 }
1216
1217 /* SIM TOOLKIT & FDN HANDLING */
1218 retVal = cmhSS_CNAP_SAT_Handle( srcId);
1219
1220 if( retVal NEQ AT_CMPL )
1221 return( retVal );
1222
1223 /*
1224 *-------------------------------------------------------------------
1225 * get a new service table entry to interrogate SS
1226 *-------------------------------------------------------------------
1227 */
1228 sId = psaSS_stbNewEntry();
1229
1230 if( sId EQ NO_ENTRY )
1231 {
1232 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
1233 return( AT_FAIL );
1234 }
1235
1236 /*
1237 *-------------------------------------------------------------------
1238 * set up facility information element
1239 *-------------------------------------------------------------------
1240 */
1241 CCD_START;
1242
1243 psaSS_asmInterrogateSS( SS_CD_CNAP, SS_NO_PRM, SS_NO_PRM );
1244
1245
1246 /*
1247 *-----------------------------------------------------------------
1248 * declare service table entry as used and the owner of the service
1249 *-----------------------------------------------------------------
1250 */
1251 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
1252 ssShrdPrm.stb[sId].srvOwn = srcId;
1253
1254 /*
1255 *-------------------------------------------------------------------
1256 * start a new transaction
1257 *-------------------------------------------------------------------
1258 */
1259 ssShrdPrm.stb[sId].curCmd = AT_CMD_CNAP;
1260 psaSS_NewTrns(sId);
1261
1262 CCD_END;
1263
1264 /*
1265 *-------------------------------------------------------------------
1266 * log command execution
1267 *-------------------------------------------------------------------
1268 */
1269 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
1270 {
1271 T_ACI_CLOG cmdLog; /* holds logging info */
1272
1273 cmdLog.atCmd = AT_CMD_CNAP;
1274 cmdLog.cmdType = CLOG_TYPE_Query;
1275 cmdLog.retCode = AT_EXCT;
1276 cmdLog.cId = ACI_NumParmNotPresent;
1277 cmdLog.sId = sId+1;
1278 cmdLog.cmdPrm.qCCBS.srcId = srcId;
1279
1280 rAT_PercentCLOG( &cmdLog );
1281 }
1282 #endif
1283
1284 return( AT_EXCT );
1285 }
1286
1287
1288 /*
1289 +--------------------------------------------------------------------+
1290 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
1291 | STATE : code ROUTINE : qAT_PercentCSCN |
1292 +--------------------------------------------------------------------+
1293
1294 PURPOSE : This is the functional counterpart to the %CSCN AT command
1295 which is responsible to query the settings.
1296
1297 */
1298 GLOBAL T_ACI_RETURN qAT_PercentCSCN ( T_ACI_CMD_SRC srcId,
1299 T_ACI_SS_CSCN_MOD_STATE *ss_switch,
1300 T_ACI_SS_CSCN_MOD_DIRECTION *ss_direction,
1301 T_ACI_CC_CSCN_MOD_STATE *cc_switch,
1302 T_ACI_CC_CSCN_MOD_DIRECTION *cc_direction )
1303 {
1304 TRACE_FUNCTION ("qAT_PercentCSCN ()");
1305
1306 if(!cmh_IsVldCmdSrc (srcId))
1307 { /* check command source */
1308 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
1309 return( AT_FAIL );
1310 }
1311
1312 *ss_switch = cmhPrm[srcId].ssCmdPrm.CSCNss_mode.SsCSCNModeState;
1313 *ss_direction = cmhPrm[srcId].ssCmdPrm.CSCNss_mode.SsCSCNModeDirection;
1314 *cc_switch = cmhPrm[srcId].ccCmdPrm.CSCNcc_mode.CcCSCNModeState;
1315 *cc_direction = cmhPrm[srcId].ccCmdPrm.CSCNcc_mode.CcCSCNModeDirection;
1316
1317 return( AT_CMPL);
1318 }
1319
1320 #ifdef SIM_PERS
1321 /*
1322 +===========================================================+
1323 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
1324 | STATE : code ROUTINE : qAT_PercentMEPD |
1325 | |
1326 |This is the functional counterpart to the %MEPD AT command |
1327 |which is responsible to query MEPD Configuration Data. |
1328 +===========================================================+
1329 */
1330
1331
1332
1333 GLOBAL T_ACI_RETURN qAT_PercentMEPD( T_ACI_CMD_SRC srcId, T_SUP_INFO *sup_info)
1334 {
1335 T_OPER_RET_STATUS rlockstatus;
1336
1337 TRACE_FUNCTION ("qAT_ PercentMEPD()");
1338
1339 /*
1340 *-------------------------------------------------------------------
1341 * check command source
1342 *-------------------------------------------------------------------
1343 */
1344 if(!cmh_IsVldCmdSrc (srcId))
1345 {
1346 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
1347 return( AT_FAIL );
1348 }
1349 rlockstatus=aci_slock_sup_info(sup_info);
1350
1351 if (rlockstatus EQ OPER_SUCCESS)
1352 {
1353 return (AT_CMPL);
1354 }
1355 else if (rlockstatus EQ OPER_FAIL)
1356 {
1357 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_Unknown);
1358 return( AT_FAIL );
1359 }
1360 return( AT_EXCT );
1361 }
1362 #endif //SIM_PERS
1363 /*==== EOF ========================================================*/