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

src/g23m-aci: initial import from TCS3.2/LoCosto
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 11 Oct 2016 02:02:43 +0000
parents
children
comparison
equal deleted inserted replaced
161:4557e2a9c18e 162:53929b40109c
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : CMH_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 #ifdef FF_PHONE_LOCK
57 #include "sec_drv.h"
58 #endif
59
60 /*==== CONSTANTS ==================================================*/
61
62 /*==== EXPORT =====================================================*/
63
64 /*==== VARIABLES ==================================================*/
65
66 /*==== PROTOTYPES==================================================*/
67 /* Implements Measure 193 */
68 LOCAL T_ACI_RETURN cmhSS_queryHandler (T_ACI_CMD_SRC srcId,
69 void *stat,
70 T_ACI_AT_CMD atCmd,
71 UBYTE ssCode);
72 EXTERN T_ACI_RETURN cmhSS_check_oper_result(T_OPER_RET_STATUS result);
73
74 #ifdef FF_PHONE_LOCK
75 EXTERN T_OPER_RET_STATUS aci_ext_get_phone_lock_satus(T_SEC_DRV_EXT_PHONE_LOCK_TYPE type,T_SEC_DRV_EXT_PHONE_LOCK_STATUS *status);
76 #endif
77 /*==== FUNCTIONS ==================================================*/
78
79 /*
80 +--------------------------------------------------------------------+
81 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
82 | STATE : code ROUTINE : qAT_PlusCCFC |
83 +--------------------------------------------------------------------+
84
85 PURPOSE : This is the functional counterpart to the +CCFC AT command
86 which is responsible to query the parameters for call
87 forwarding supplementary services.
88
89 <reason> : reason for CF.
90 <class> : class of basic service.
91 */
92
93 GLOBAL T_ACI_RETURN qAT_PlusCCFC ( T_ACI_CMD_SRC srcId,
94 T_ACI_CCFC_RSN reason,
95 T_ACI_CLASS class_type )
96 {
97 SHORT sId; /* holds service id */
98 UBYTE ssCd; /* holds ss code */
99
100 T_ACI_RETURN retVal;
101
102
103 TRACE_FUNCTION ("qAT_PlusCCFC");
104
105 /*
106 *-------------------------------------------------------------------
107 * check command source
108 *-------------------------------------------------------------------
109 */
110 if(!cmh_IsVldCmdSrc (srcId))
111 {
112 return( AT_FAIL );
113 }
114
115 if( cmhPrm[srcId].ssCmdPrm.mltyTrnFlg NEQ 0 )
116
117 return( AT_BUSY );
118
119 /* Implements Measure # 85 */
120 if(!cmhSS_checkCCFC_RSN(reason, &ssCd))
121 {
122 return( AT_FAIL );
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 = (T_OWN)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 rAT_PercentCLOG( &cmdLog );
193 }
194 #endif
195 return( AT_EXCT );
196 }
197
198 /*
199 +--------------------------------------------------------------------+
200 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
201 | STATE : code ROUTINE : qAT_PlusCLCK |
202 +--------------------------------------------------------------------+
203
204 PURPOSE : This is the functional counterpart to the +CLCK AT command
205 which is responsible to query the parameters for call
206 barring supplementary services.
207
208 <fac> : CB facility.
209 <class>: class of basic service.
210 */
211
212 GLOBAL T_ACI_RETURN qAT_PlusCLCK ( T_ACI_CMD_SRC srcId,
213 T_ACI_FAC fac,
214 T_ACI_CLASS class_type,
215 T_ACI_CLSSTAT *clsStat)
216 {
217 UBYTE dummy_slockStat;
218 TRACE_FUNCTION ("qAT_PlusCLCK");
219 return qAT_PercentCLCK(srcId,fac,class_type, clsStat,&dummy_slockStat);
220 }
221
222 /*QAT_PERCENTCLCK add for Simlock in Riviear MFW
223
224 Added by Shen,Chao April 16th, 2003
225 */
226
227 GLOBAL T_ACI_RETURN qAT_PercentCLCK ( T_ACI_CMD_SRC srcId,
228 T_ACI_FAC fac,
229 T_ACI_CLASS class_type,
230 T_ACI_CLSSTAT *clsStat,
231 UBYTE *simClockStat)
232 {
233 SHORT sId; /* holds service id */
234 UBYTE ssCd; /* holds ss code */
235 T_ACI_RETURN retVal;
236 #ifdef SIM_PERS
237 T_SIMLOCK_TYPE slocktype;
238 T_SIMLOCK_STATUS rlockstatus;
239 T_OPER_RET_STATUS ret;
240 #endif
241
242
243 TRACE_FUNCTION ("qAT_PercentCLCK");
244
245 /*
246 *-------------------------------------------------------------------
247 * check command source
248 *-------------------------------------------------------------------
249 */
250 if(!cmh_IsVldCmdSrc (srcId))
251 {
252 return( AT_FAIL );
253 }
254
255 if( cmhPrm[srcId].ssCmdPrm.mltyTrnFlg NEQ 0 )
256 return( AT_BUSY );
257
258 /*
259 *-------------------------------------------------------------------
260 * check parameter <fac>
261 *-------------------------------------------------------------------
262 */
263 /* Implements Measure # 166 */
264 if( !cmhSS_getSSCd(fac, &ssCd) )
265 {
266 return( AT_FAIL );
267 }
268
269 /*
270 *-------------------------------------------------------------------
271 * if action is related to SS
272 *-------------------------------------------------------------------
273 */
274 if( ssCd NEQ NOT_PRESENT_8BIT )
275 {
276 /*
277 *-------------------------------------------------------------------
278 * check parameter <class>
279 *-------------------------------------------------------------------
280 */
281 if( !cmhSS_CheckCbClassInterr(class_type))
282 {
283 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_OpNotAllow );
284 return( AT_FAIL );
285 }
286
287 if( cmhPrm[srcId].ssCmdPrm.mltyTrnFlg NEQ 0 )
288
289 return( AT_BUSY );
290 /*
291 *-------------------------------------------------------------------
292 * check not allowed <fac> (only possible with mode=0 i.e unlock)
293 *-------------------------------------------------------------------
294 */
295 if(fac EQ FAC_Ab OR fac EQ FAC_Ag OR fac EQ FAC_Ac)
296 {
297 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_OpNotAllow );
298 return( AT_FAIL );
299 }
300
301 /* SIM TOOLKIT & FDN HANDLING */
302
303 retVal = cmhSS_Call_Barr_SAT_Handle( srcId, CLCK_MODE_QUERY, fac, NULL, class_type);
304
305 if( retVal NEQ AT_CMPL )
306 return( retVal );
307
308
309 /*
310 *-------------------------------------------------------------------
311 * get a new service table entry to interrogate SS
312 *-------------------------------------------------------------------
313 */
314 sId = psaSS_stbNewEntry();
315
316 if( sId EQ NO_ENTRY )
317 {
318 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
319 return( AT_FAIL );
320 }
321
322 /*
323 *-------------------------------------------------------------------
324 * start first transaction
325 *-------------------------------------------------------------------
326 */
327 CCD_START;
328
329 psaSS_asmInterrogateSS( ssCd, SS_NO_PRM, SS_NO_PRM );
330
331 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
332 ssShrdPrm.stb[sId].ssCode = ssCd;
333 ssShrdPrm.stb[sId].srvOwn = (T_OWN)srcId;
334 ssShrdPrm.stb[sId].ClassType = class_type;
335
336 ssShrdPrm.stb[sId].curCmd = AT_CMD_CLCK;
337 cmhSS_flagTrn( sId, &(cmhPrm[srcId].ssCmdPrm.mltyTrnFlg));
338 psaSS_NewTrns(sId);
339
340 CCD_END;
341 }
342
343 /*
344 *-------------------------------------------------------------------
345 * if action is related to SIM
346 *-------------------------------------------------------------------
347 */
348 else
349 {
350 switch (fac)
351 {
352 /*
353 *---------------------------------------------------------------
354 * access PIN 1 status
355 *---------------------------------------------------------------
356 */
357 case FAC_Sc:
358 clsStat -> class_type = CLASS_NotPresent;
359 clsStat -> status = STATUS_NotPresent;
360
361 switch( simShrdPrm.PEDStat )
362 {
363 case( PEDS_ENA ): clsStat -> status = STATUS_Active;
364 return( AT_CMPL );
365 case( PEDS_DIS ): clsStat -> status = STATUS_NotActive;
366 return( AT_CMPL );
367 default:
368 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_SimFail );
369 return( AT_FAIL );
370 }
371 /* break is removed ,as case is returning before break so it is not needed */
372 /*
373 *---------------------------------------------------------------
374 * access fixed dialling feature
375 *---------------------------------------------------------------
376 */
377 case ( FAC_Fd ):
378 clsStat -> class_type = CLASS_NotPresent;
379 clsStat -> status = STATUS_NotPresent;
380
381 if( simShrdPrm.SIMStat EQ SS_OK )
382 {
383 switch( simShrdPrm.crdFun )
384 {
385 case( SIM_ADN_ENABLED ):
386 case( SIM_ADN_BDN_ENABLED ): clsStat -> status = STATUS_NotActive;
387 return( AT_CMPL );
388 case( SIM_FDN_ENABLED ):
389 case( SIM_FDN_BDN_ENABLED ): clsStat -> status = STATUS_Active;
390 return( AT_CMPL );
391 case( SIM_NO_OPERATION ):
392 default:
393
394 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_SimFail );
395 return( AT_FAIL );
396 }
397 }
398 else
399 {
400 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_SimFail );
401 return( AT_FAIL );
402 }
403 /* break is removed ,as case is returning before break so it is not needed */
404 /*
405 *---------------------------------------------------------------
406 * lock ALS setting with PIN2
407 *---------------------------------------------------------------
408 */
409 case FAC_Al:
410 clsStat -> class_type = CLASS_NotPresent;
411 clsStat -> status = STATUS_NotPresent;
412
413 switch( ALSlock )
414 {
415 case( ALS_MOD_SPEECH ):
416 case( ALS_MOD_AUX_SPEECH ):
417 clsStat -> status = STATUS_Active;
418 return( AT_CMPL );
419
420 case( ALS_MOD_NOTPRESENT ):
421 clsStat -> status = STATUS_NotActive;
422 return( AT_CMPL );
423
424 default:
425 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_OpNotSupp );
426 return( AT_FAIL );
427 }
428 /* break is removed ,as case is returning before break so it is not needed */
429 #ifdef SIM_PERS
430 /*
431 *---------------------------------------------------------------
432 * ME Personalisation
433 *---------------------------------------------------------------
434 */
435
436 case FAC_Pn:
437 case FAC_Pu:
438 case FAC_Pp:
439 case FAC_Pc:
440 case FAC_Ps:
441 case FAC_Pf:
442 case FAC_Bl:
443
444 clsStat -> class_type = CLASS_NotPresent;
445 clsStat -> status = STATUS_NotPresent;
446
447 switch (fac)
448 {
449 case FAC_Pn: slocktype = SIMLOCK_NETWORK; break;
450 case FAC_Pu: slocktype = SIMLOCK_NETWORK_SUBSET; break;
451 case FAC_Pp: slocktype = SIMLOCK_SERVICE_PROVIDER; break;
452 case FAC_Pc: slocktype = SIMLOCK_CORPORATE; break;
453 case FAC_Ps: slocktype = SIMLOCK_SIM; break;
454 case FAC_Pf: slocktype = SIMLOCK_FIRST_SIM; break;
455 case FAC_Bl: slocktype = SIMLOCK_BLOCKED_NETWORK; break;
456 default: slocktype = SIMLOCK_NETWORK;
457 }
458 aci_ext_personalisation_init();
459 rlockstatus = aci_personalisation_get_status(slocktype); /* Changed to aci_personalisatio_get_status
460 from aci_ext_personalisatio_get_status on 11/03/2005 */
461 aci_ext_personalisation_free();
462 if (rlockstatus EQ SIMLOCK_ENABLED)
463 {
464 clsStat -> status = STATUS_Active;
465 return( AT_CMPL );
466 }
467 else if (rlockstatus EQ SIMLOCK_DISABLED)
468 {
469 clsStat -> status = STATUS_NotActive;
470 return( AT_CMPL );
471 }
472 else
473 {
474 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_Unknown );
475 return( AT_FAIL );
476 }
477
478 case( FAC_Mu ) :
479 case( FAC_Mum ) :
480 {
481 clsStat->class_type = CLASS_NotPresent;
482 clsStat->status = STATUS_NotPresent;
483 ret = aci_slock_master_unlock( NULL );
484 switch (ret)
485 {
486 case OPER_SUCCESS:
487 case OPER_WRONG_PASSWORD:
488 clsStat->status = STATUS_Active;
489 return( AT_CMPL );
490 case OPER_NOT_ALLOWED:
491 clsStat->status = STATUS_NotActive;
492 return( AT_CMPL );
493 case OPER_FAIL:
494 ACI_ERR_DESC( ACI_ERR_CLASS_Cme,CME_ERR_Unknown );
495 return( AT_FAIL );
496 default:
497 ACI_ERR_DESC( ACI_ERR_CLASS_Cme,CME_ERR_Unknown );
498 return( AT_FAIL );
499 }
500 }
501 #endif
502
503 #ifdef FF_PHONE_LOCK
504 case(FAC_Pl) :
505 {
506 clsStat->class_type = CLASS_NotPresent;
507 clsStat->status = STATUS_NotPresent;
508 ret = aci_ext_get_phone_lock_satus(PHONE_LOCK,(T_SEC_DRV_EXT_PHONE_LOCK_STATUS *)&clsStat->status);
509 return(cmhSS_check_oper_result(ret));
510 }
511 case(FAC_Apl) :
512 {
513 clsStat->class_type = CLASS_NotPresent;
514 clsStat->status = STATUS_NotPresent;
515 ret = aci_ext_get_phone_lock_satus(AUTO_LOCK,(T_SEC_DRV_EXT_PHONE_LOCK_STATUS *)&clsStat->status);
516 return(cmhSS_check_oper_result(ret));
517 }
518 #endif
519
520 /*
521 *---------------------------------------------------------------
522 * Error handling
523 *---------------------------------------------------------------
524 */
525 default:
526 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_Unknown );
527 return( AT_FAIL );
528 }
529 }
530
531 /*
532 *-------------------------------------------------------------------
533 * log command execution
534 *-------------------------------------------------------------------
535 */
536 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
537 {
538 T_ACI_CLOG cmdLog; /* holds logging info */
539
540 cmdLog.atCmd = AT_CMD_CLCK;
541 cmdLog.cmdType = CLOG_TYPE_Query;
542 cmdLog.retCode = AT_EXCT;
543 cmdLog.cId = ACI_NumParmNotPresent;
544 cmdLog.sId = sId+1;
545 cmdLog.cmdPrm.qCLCK.srcId = srcId;
546 cmdLog.cmdPrm.qCLCK.fac = fac;
547 cmdLog.cmdPrm.qCLCK.class_type = class_type;
548
549 rAT_PercentCLOG( &cmdLog );
550 }
551 #endif
552
553 return( AT_EXCT );
554 }
555
556 /*
557 +--------------------------------------------------------------------+
558 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
559 | STATE : code ROUTINE : qAT_PlusCCWA |
560 +--------------------------------------------------------------------+
561
562 PURPOSE : This is the functional counterpart to the +CCWA AT command
563 which is responsible to query the parameters for call
564 waiting supplementary services.
565
566 <class> : class of basic service.
567 */
568
569 GLOBAL T_ACI_RETURN qAT_PlusCCWA (T_ACI_CMD_SRC srcId,
570 T_ACI_CLASS class_type)
571 {
572 SHORT sId; /* holds service id */
573
574 T_ACI_RETURN retVal;
575
576 TRACE_FUNCTION ("qAT_PlusCCWA ()");
577
578 /*
579 *-------------------------------------------------------------------
580 * check command source
581 *-------------------------------------------------------------------
582 */
583 if(!cmh_IsVldCmdSrc (srcId))
584 {
585 return( AT_FAIL );
586 }
587
588 if( cmhPrm[srcId].ssCmdPrm.mltyTrnFlg NEQ 0 )
589
590 return( AT_BUSY );
591
592 /*
593 *-------------------------------------------------------------------
594 * check parameter <class>
595 *-------------------------------------------------------------------
596 */
597 if( !cmhSS_CheckClassInterr(class_type) )
598 {
599 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_Parameter );
600 return( AT_FAIL );
601 }
602
603 /* SIM TOOLKIT & FDN HANDLING */
604 retVal = cmhSS_CW_SAT_Handle( srcId, CCFC_MOD_Query, class_type);
605
606 if( retVal NEQ AT_CMPL )
607 return( retVal );
608
609 /*
610 *-------------------------------------------------------------------
611 * get a new service table entry to interrogate SS
612 *-------------------------------------------------------------------
613 */
614 sId = psaSS_stbNewEntry();
615
616 if( sId EQ NO_ENTRY )
617 {
618 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
619 return( AT_FAIL );
620 }
621
622 /*
623 *-------------------------------------------------------------------
624 * start first transaction
625 *-------------------------------------------------------------------
626 */
627 CCD_START;
628
629 psaSS_asmInterrogateSS( SS_CD_CW, SS_NO_PRM, SS_NO_PRM );
630
631 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
632 ssShrdPrm.stb[sId].ssCode = SS_CD_CW;
633 ssShrdPrm.stb[sId].srvOwn = (T_OWN)srcId;
634 ssShrdPrm.stb[sId].ClassType = class_type;
635
636 ssShrdPrm.stb[sId].curCmd = AT_CMD_CCWA;
637 cmhSS_flagTrn( sId, &(cmhPrm[srcId].ssCmdPrm.mltyTrnFlg));
638 psaSS_NewTrns(sId);
639
640 CCD_END;
641
642 /*
643 *-------------------------------------------------------------------
644 * log command execution
645 *-------------------------------------------------------------------
646 */
647 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
648 {
649 T_ACI_CLOG cmdLog; /* holds logging info */
650
651 cmdLog.atCmd = AT_CMD_CCWA;
652 cmdLog.cmdType = CLOG_TYPE_Query;
653 cmdLog.retCode = AT_EXCT;
654 cmdLog.cId = ACI_NumParmNotPresent;
655 cmdLog.sId = sId+1;
656 cmdLog.cmdPrm.qCCWA.srcId = srcId;
657 cmdLog.cmdPrm.qCCWA.class_type = class_type;
658
659 rAT_PercentCLOG( &cmdLog );
660 }
661 #endif
662
663 return( AT_EXCT );
664 }
665
666 /*
667 +--------------------------------------------------------------------+
668 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
669 | STATE : code ROUTINE : qAT_PlusCLIP |
670 +--------------------------------------------------------------------+
671
672 PURPOSE : This is the functional counterpart to the +CLIP AT command
673 which is responsible to query the setting for calling
674 line indication supplementary services.
675
676 <stat> : CLIP status.
677 */
678
679 GLOBAL T_ACI_RETURN qAT_PlusCLIP ( T_ACI_CMD_SRC srcId,
680 T_ACI_CLIP_STAT * stat)
681 {
682 /* Implements Measure 193 */
683 TRACE_FUNCTION ("qAT_PlusCLIP ()");
684 return (cmhSS_queryHandler (srcId,
685 (void*)stat,
686 AT_CMD_CLIP,
687 SS_CD_CLIP) );
688 }
689
690 /*
691 +--------------------------------------------------------------------+
692 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
693 | STATE : code ROUTINE : qAT_PlusCLIR |
694 +--------------------------------------------------------------------+
695
696 PURPOSE : This is the functional counterpart to the +CLIR AT command
697 which is responsible to query the setting for calling
698 line restriction supplementary services.
699
700 <mode> : CLIR mode.
701 <stat> : CLIR status.
702 */
703
704 GLOBAL T_ACI_RETURN qAT_PlusCLIR ( T_ACI_CMD_SRC srcId,
705 T_ACI_CLIR_MOD * mode,
706 T_ACI_CLIR_STAT * stat)
707 {
708 SHORT sId; /* holds service id */
709
710 T_ACI_RETURN retVal;
711
712 TRACE_FUNCTION ("qAT_PlusCLIR ()");
713
714 /*
715 *-------------------------------------------------------------------
716 * check command source
717 *-------------------------------------------------------------------
718 */
719 if(!cmh_IsVldCmdSrc (srcId))
720 {
721 return( AT_FAIL );
722 }
723
724 /* SIM TOOLKIT & FDN HANDLING */
725 retVal = cmhSS_CLIR_SAT_Handle( srcId);
726
727 if( retVal NEQ AT_CMPL )
728 return( retVal );
729
730
731 /*
732 *-------------------------------------------------------------------
733 * get a new service table entry to interrogate SS
734 *-------------------------------------------------------------------
735 */
736 sId = psaSS_stbNewEntry();
737
738 if( sId EQ NO_ENTRY )
739 {
740 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
741 return( AT_FAIL );
742 }
743
744 /*
745 *-------------------------------------------------------------------
746 * set up facility information element
747 *-------------------------------------------------------------------
748 */
749 CCD_START;
750
751 psaSS_asmInterrogateSS( SS_CD_CLIR, SS_NO_PRM, SS_NO_PRM );
752 /*
753 *-----------------------------------------------------------------
754 * declare service table entry as used and the owner of the service
755 *-----------------------------------------------------------------
756 */
757 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
758 ssShrdPrm.stb[sId].srvOwn = (T_OWN)srcId;
759
760 /*
761 *-------------------------------------------------------------------
762 * start a new transaction
763 *-------------------------------------------------------------------
764 */
765 ssShrdPrm.stb[sId].curCmd = AT_CMD_CLIR;
766 psaSS_NewTrns(sId);
767
768 CCD_END;
769
770 /*
771 *-------------------------------------------------------------------
772 * log command execution
773 *-------------------------------------------------------------------
774 */
775 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
776 {
777 T_ACI_CLOG cmdLog; /* holds logging info */
778
779 cmdLog.atCmd = AT_CMD_CLIR;
780 cmdLog.cmdType = CLOG_TYPE_Query;
781 cmdLog.retCode = AT_EXCT;
782 cmdLog.cId = ACI_NumParmNotPresent;
783 cmdLog.sId = sId+1;
784 cmdLog.cmdPrm.qCLIR.srcId = srcId;
785 cmdLog.cmdPrm.qCLIR.stat = stat;
786 cmdLog.cmdPrm.qCLIR.mode = mode;
787 rAT_PercentCLOG( &cmdLog );
788 }
789 #endif
790
791 return( AT_EXCT );
792 }
793
794
795 GLOBAL T_ACI_RETURN qAT_PercentCLIR ( T_ACI_CMD_SRC srcId,
796 T_ACI_CLIR_MOD * mode)
797 {
798 T_CC_CMD_PRM *pCCCmdPrm; /* points to CC command parameters */
799 TRACE_FUNCTION ("qAT_PercentCLIR ()");
800
801 /*
802 *-------------------------------------------------------------------
803 * check command source
804 *-------------------------------------------------------------------
805 */
806 if(!cmh_IsVldCmdSrc (srcId))
807 {
808 return( AT_FAIL );
809 }
810
811 pCCCmdPrm = &cmhPrm[srcId].ccCmdPrm;
812 *mode = pCCCmdPrm->CLIRmode;
813
814 return AT_CMPL;
815 }
816
817 /*
818 +--------------------------------------------------------------------+
819 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
820 | STATE : code ROUTINE : qAT_PlusCOLP |
821 +--------------------------------------------------------------------+
822
823 PURPOSE : This is the functional counterpart to the +COLP AT command
824 which is responsible to query the setting for connected
825 line presentation supplementary services.
826
827 <stat> : COLP status.
828 */
829
830 GLOBAL T_ACI_RETURN qAT_PlusCOLP ( T_ACI_CMD_SRC srcId,
831 T_ACI_COLP_STAT * stat)
832 {
833 /* Implements Measure 193 */
834 TRACE_FUNCTION ("qAT_PercentCOLP ()");
835 return (cmhSS_queryHandler (srcId,
836 (void*)stat,
837 AT_CMD_COLP,
838 SS_CD_COLP) );
839 }
840
841 /*
842 +--------------------------------------------------------------------+
843 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
844 | STATE : code ROUTINE : qAT_PercentCOLR |
845 +--------------------------------------------------------------------+
846
847 PURPOSE : This is the functional counterpart to the %COLR AT command
848 which is responsible to query the setting for connected
849 line restriction supplementary services.
850
851 <stat> : COLR status.
852 */
853
854 GLOBAL T_ACI_RETURN qAT_PercentCOLR ( T_ACI_CMD_SRC srcId )
855 {
856 /* Implements Measure 193 */
857 TRACE_FUNCTION ("qAT_PercentCOLR ()");
858 return (cmhSS_queryHandler (srcId,
859 NULL,
860 AT_CMD_COLR,
861 SS_CD_COLR));
862 }
863
864 /*
865 +--------------------------------------------------------------------+
866 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
867 | STATE : code ROUTINE : qAT_PercentCCBS |
868 +--------------------------------------------------------------------+
869
870 PURPOSE : This is the functional counterpart to the %CCBS AT command
871 which is responsible to query the setting for connected
872 line restriction supplementary services.
873
874 */
875
876 GLOBAL T_ACI_RETURN qAT_PercentCCBS ( T_ACI_CMD_SRC srcId )
877 {
878 SHORT sId; /* holds service id */
879
880 T_ACI_RETURN retVal;
881
882
883 TRACE_FUNCTION ("qAT_PercentCCBS ()");
884
885 /*
886 *-------------------------------------------------------------------
887 * check command source
888 *-------------------------------------------------------------------
889 */
890 if(!cmh_IsVldCmdSrc (srcId))
891 {
892 return( AT_FAIL );
893 }
894
895 /* SIM TOOLKIT & FDN HANDLING */
896 retVal = cmhSS_CCBS_SAT_Handle( srcId, CCBS_MOD_Query, -1);
897
898 if( retVal NEQ AT_CMPL )
899 return( retVal );
900
901
902
903 /*
904 *-------------------------------------------------------------------
905 * get a new service table entry to interrogate SS
906 *-------------------------------------------------------------------
907 */
908 sId = psaSS_stbNewEntry();
909
910 if( sId EQ NO_ENTRY )
911 {
912 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
913 return( AT_FAIL );
914 }
915
916 /*
917 *-------------------------------------------------------------------
918 * set up facility information element
919 *-------------------------------------------------------------------
920 */
921 CCD_START;
922
923 psaSS_asmInterrogateSS( SS_CD_CCBS, SS_NO_PRM, SS_NO_PRM );
924 /*
925 *-----------------------------------------------------------------
926 * declare service table entry as used and the owner of the service
927 *-----------------------------------------------------------------
928 */
929 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
930 ssShrdPrm.stb[sId].srvOwn = (T_OWN)srcId;
931
932 /*
933 *-------------------------------------------------------------------
934 * start a new transaction
935 *-------------------------------------------------------------------
936 */
937 ssShrdPrm.stb[sId].curCmd = AT_CMD_CCBS;
938 psaSS_NewTrns(sId);
939
940 CCD_END;
941
942 /*
943 *-------------------------------------------------------------------
944 * log command execution
945 *-------------------------------------------------------------------
946 */
947 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
948 {
949 T_ACI_CLOG cmdLog; /* holds logging info */
950
951 cmdLog.atCmd = AT_CMD_CCBS;
952 cmdLog.cmdType = CLOG_TYPE_Query;
953 cmdLog.retCode = AT_EXCT;
954 cmdLog.cId = ACI_NumParmNotPresent;
955 cmdLog.sId = sId+1;
956 cmdLog.cmdPrm.qCCBS.srcId = srcId;
957
958 rAT_PercentCLOG( &cmdLog );
959 }
960 #endif
961
962 return( AT_EXCT );
963 }
964
965 /*
966 +--------------------------------------------------------------------+
967 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
968 | STATE : code ROUTINE : qAT_PercentCNAP |
969 +--------------------------------------------------------------------+
970
971 PURPOSE : This is the functional counterpart to the %CNAP AT command
972 which is responsible to query the setting for calling
973 name presentation supplementary services.
974
975 */
976
977 GLOBAL T_ACI_RETURN qAT_PercentCNAP ( T_ACI_CMD_SRC srcId )
978 {
979 /* Implements Measure 193 */
980 TRACE_FUNCTION ("qAT_PercentCNAP ()");
981 return (cmhSS_queryHandler (srcId,
982 NULL,
983 AT_CMD_CNAP,
984 SS_CD_CNAP) );
985 }
986
987
988 #ifdef TI_PS_FF_AT_P_CMD_CSCN
989 /*
990 +--------------------------------------------------------------------+
991 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
992 | STATE : code ROUTINE : qAT_PercentCSCN |
993 +--------------------------------------------------------------------+
994
995 PURPOSE : This is the functional counterpart to the %CSCN AT command
996 which is responsible to query the settings.
997
998 */
999 GLOBAL T_ACI_RETURN qAT_PercentCSCN ( T_ACI_CMD_SRC srcId,
1000 T_ACI_SS_CSCN_MOD_STATE *ss_switch,
1001 T_ACI_SS_CSCN_MOD_DIRECTION *ss_direction,
1002 T_ACI_CC_CSCN_MOD_STATE *cc_switch,
1003 T_ACI_CC_CSCN_MOD_DIRECTION *cc_direction )
1004 {
1005 TRACE_FUNCTION ("qAT_PercentCSCN ()");
1006
1007 if(!cmh_IsVldCmdSrc (srcId))
1008 { /* check command source */
1009 return( AT_FAIL );
1010 }
1011
1012 *ss_switch = cmhPrm[srcId].ssCmdPrm.CSCNss_mode.SsCSCNModeState;
1013 *ss_direction = cmhPrm[srcId].ssCmdPrm.CSCNss_mode.SsCSCNModeDirection;
1014 *cc_switch = cmhPrm[srcId].ccCmdPrm.CSCNcc_mode.CcCSCNModeState;
1015 *cc_direction = cmhPrm[srcId].ccCmdPrm.CSCNcc_mode.CcCSCNModeDirection;
1016
1017 return( AT_CMPL);
1018 }
1019 #endif /* TI_PS_FF_AT_P_CMD_CSCN */
1020
1021 #ifdef SIM_PERS
1022 /*
1023 +===========================================================+
1024 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
1025 | STATE : code ROUTINE : qAT_PercentMEPD |
1026 | |
1027 |This is the functional counterpart to the %MEPD AT command |
1028 |which is responsible to query MEPD Configuration Data. |
1029 +===========================================================+
1030 */
1031
1032
1033
1034 GLOBAL T_ACI_RETURN qAT_PercentMEPD( T_ACI_CMD_SRC srcId, T_SUP_INFO *sup_info)
1035 {
1036 T_OPER_RET_STATUS rlockstatus;
1037
1038 TRACE_FUNCTION ("qAT_ PercentMEPD()");
1039
1040 /*
1041 *-------------------------------------------------------------------
1042 * check command source
1043 *-------------------------------------------------------------------
1044 */
1045 if(!cmh_IsVldCmdSrc (srcId))
1046 {
1047 return( AT_FAIL );
1048 }
1049 rlockstatus=aci_slock_sup_info(sup_info);
1050
1051 if (rlockstatus EQ OPER_SUCCESS)
1052 {
1053 return (AT_CMPL);
1054 }
1055 else if (rlockstatus EQ OPER_FAIL)
1056 {
1057 ACI_ERR_DESC( ACI_ERR_CLASS_Cme, CME_ERR_Unknown);
1058 return( AT_FAIL );
1059 }
1060 return( AT_EXCT );
1061 }
1062 #endif /* SIM_PERS */
1063
1064
1065
1066
1067 /* Implements Measure 193 */
1068 /*
1069 +=============================================================+
1070 | PROJECT : GSM-PS (6147) MODULE : CMH_SSQ |
1071 | STATE : code ROUTINE : cmhSS_queryHandler |
1072 | PARAMETERS : srcId - Source of AT Command |
1073 | stat - CLIP or COLP provisioning status |
1074 | atCmd - AT Command sent for querying |
1075 | ssCode - Supplementary service code |
1076 | RETURN : Query status |
1077 |This contains common code for handling CLIP, COLP, COLR, CNAP|
1078 +=============================================================+
1079 */
1080 LOCAL T_ACI_RETURN cmhSS_queryHandler (T_ACI_CMD_SRC srcId,
1081 void *stat,
1082 T_ACI_AT_CMD atCmd,
1083 UBYTE ssCode)
1084 {
1085 SHORT sId; /* holds service id */
1086
1087 T_ACI_RETURN retVal = AT_FAIL;
1088
1089 TRACE_FUNCTION ("cmhSS_queryHandler ()");
1090
1091 /*
1092 *-------------------------------------------------------------------
1093 * check command source
1094 *-------------------------------------------------------------------
1095 */
1096 if(!cmh_IsVldCmdSrc (srcId))
1097 {
1098 return( AT_FAIL );
1099 }
1100
1101 /* SIM TOOLKIT & FDN HANDLING */
1102 switch(atCmd)
1103 {
1104 case AT_CMD_CLIP:
1105 retVal = cmhSS_CLIP_SAT_Handle(srcId);
1106 break;
1107 case AT_CMD_COLP:
1108 retVal = cmhSS_COLP_SAT_Handle(srcId);
1109 break;
1110 case AT_CMD_COLR:
1111 retVal = cmhSS_COLR_SAT_Handle(srcId);
1112 break;
1113 case AT_CMD_CNAP:
1114 retVal = cmhSS_CNAP_SAT_Handle(srcId);
1115 break;
1116 }
1117
1118 if( retVal NEQ AT_CMPL )
1119 {
1120 return( retVal );
1121 }
1122 /*
1123 *-------------------------------------------------------------------
1124 * get a new service table entry to interrogate SS
1125 *-------------------------------------------------------------------
1126 */
1127 sId = psaSS_stbNewEntry();
1128
1129 if( sId EQ NO_ENTRY )
1130 {
1131 ACI_ERR_DESC( ACI_ERR_CLASS_Ext, EXT_ERR_SrvTabFull );
1132 return( AT_FAIL );
1133 }
1134
1135 /*
1136 *-------------------------------------------------------------------
1137 * set up facility information element
1138 *-------------------------------------------------------------------
1139 */
1140 CCD_START;
1141
1142 psaSS_asmInterrogateSS( ssCode, SS_NO_PRM, SS_NO_PRM );
1143 /*
1144 *-----------------------------------------------------------------
1145 * declare service table entry as used and the owner of the service
1146 *-----------------------------------------------------------------
1147 */
1148 ssShrdPrm.stb[sId].ntryUsdFlg = TRUE;
1149 ssShrdPrm.stb[sId].srvOwn = (T_OWN)srcId;
1150
1151 /*
1152 *-------------------------------------------------------------------
1153 * start a new transaction
1154 *-------------------------------------------------------------------
1155 */
1156 ssShrdPrm.stb[sId].curCmd = atCmd;
1157 psaSS_NewTrns(sId);
1158
1159 CCD_END;
1160
1161 /*
1162 *-------------------------------------------------------------------
1163 * log command execution
1164 *-------------------------------------------------------------------
1165 */
1166 #if defined SMI OR defined MFW OR defined FF_MMI_RIV
1167 {
1168 T_ACI_CLOG cmdLog; /* holds logging info */
1169
1170 cmdLog.atCmd = atCmd;
1171 cmdLog.cmdType = CLOG_TYPE_Query;
1172 cmdLog.retCode = AT_EXCT;
1173 cmdLog.cId = ACI_NumParmNotPresent;
1174 cmdLog.sId = sId+1;
1175 switch(atCmd)
1176 {
1177 case AT_CMD_CLIP:
1178 cmdLog.cmdPrm.qCLIP.srcId = srcId;
1179 cmdLog.cmdPrm.qCLIP.stat = (T_ACI_CLIP_STAT *)stat;
1180 break;
1181 case AT_CMD_COLP:
1182 cmdLog.cmdPrm.qCOLP.srcId = srcId;
1183 cmdLog.cmdPrm.qCOLP.stat = (T_ACI_COLP_STAT *)stat;
1184 break;
1185 default:
1186 break;
1187 }
1188
1189 rAT_PercentCLOG( &cmdLog );
1190 }
1191 #endif
1192
1193 return( AT_EXCT );
1194 }
1195
1196 /*==== EOF ========================================================*/