comparison src/g23m-aci/ksd/ksd.c @ 1:fa8dc04885d8

src/g23m-*: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:25:50 +0000
parents
children
comparison
equal deleted inserted replaced
0:4e78acac3d88 1:fa8dc04885d8
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-F&D (8411)
4 | Modul : KSD
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 is used for decoding of EMMI key sequences.
18 +-----------------------------------------------------------------------------
19 */
20
21 #ifndef KSD_C
22 #define KSD_C
23 #endif
24
25 #include "aci_all.h"
26
27 /*==== INCLUDES ===================================================*/
28 #include "aci_cmh.h"
29 #include "psa.h"
30 #include "cmh.h"
31 #include "ksd_utl.h"
32 #include "ksd.h"
33 #include "psa_mm.h"
34 #include "cmh_mm.h"
35
36 #ifdef SMI
37 #include "cus_smi.h"
38 #endif
39 //TISH, patch for OMAPS00110151/OMAPS00130693
40 //start
41 EXTERN SHORT psaCC_ctbCountActiveCall ( void );
42 //end
43
44 /*==== CONSTANTS ==================================================*/
45
46 #define MIN_USSD_LEN 2 /* the minimum length of a USSD */
47
48 #define DATA_CALL '?' /* a phone number terminated with this */
49 /* character leads to setup a data call */
50 #define START_SEQ_1 '*' /* an USSD starts with a '*' or a '#' */
51 #define START_SEQ_2 '#' /* an USSD starts with a '*' or a '#' */
52 #define START_SI '*' /* supplemetary information fields are */
53 /* separated by this character */
54 #define STOP_SEQ '#' /* any keystroke sequence is terminated */
55 /* by this character */
56 #define NULL_TERM '\0' /* string termination */
57 #define DONT_CARE '?' /* either '#' or '*' */
58 #define DIAL_IDX '#' /* indicates reading an index used */
59 /* for abbreviated dialling */
60
61 #define DATA_SPEECH_SEQ "##" /* keystroke sequence to start */
62 /* data followed by speech mode */
63 #define SPEECH_DATA_SEQ "**" /* keystroke sequence to start */
64 /* speech followed by data mode */
65
66 #define MAX_KEYSEQ_SIZE 170 /* must be equal to MAX_KEYSEQ_SIZE */
67 /* of file aca.h in project SMI */
68
69 /*==== TYPES ======================================================*/
70
71 typedef enum /* indicates type of supplementary information */
72 {
73 SI_UBYTE,
74 SI_USHORT,
75 SI_ULONG,
76 SI_BYTE,
77 SI_SHORT,
78 SI_LONG,
79 SI_CHAR_STAR
80 }
81 T_KSD_SI;
82
83 typedef union /* decoded supplementary information */
84 {
85 UBYTE siUbyte;
86 USHORT siUshort;
87 ULONG siUlong;
88 BYTE siByte;
89 SHORT siShort;
90 LONG siLong;
91 CHAR* siCharStar;
92 }
93 T_KSD_SIPARAM;
94
95 typedef struct /* decoded parameter and predefined parameter type */
96 {
97 T_KSD_SIPARAM* param;
98 T_KSD_SI type;
99 }
100 T_KSD_DCD_CPLE;
101
102 typedef BOOL T_KSD_SDF (USHORT inIdx,
103 CHAR* inSeq,
104 T_KSD_SEQGRP* outSeqGrp,
105 CHAR** outRestSeq,
106 T_KSD_SEQPARAM* outSeqParam);
107
108 typedef struct /* structure of key sequence table */
109 {
110 CHAR* keySeq;
111 T_KSD_SDF* func;
112 }
113 T_KEY_SEQ_TABLE;
114
115 /*==== EXPORT =====================================================*/
116
117 /*==== PROTOTYPES==================================================*/
118
119 LOCAL BOOL ksd_extractSi (CHAR* inSeq,
120 USHORT inSiNum,
121 USHORT* outCharsNum,
122 T_KSD_DCD_CPLE* inOutSi);
123
124 LOCAL T_KSD_SDF ksd_seqMsOff;
125 LOCAL T_KSD_SDF ksd_seqMsOn;
126
127 LOCAL T_KSD_SDF ksd_seqHookOff;
128 LOCAL T_KSD_SDF ksd_seqHookOn;
129
130 #ifdef SMI
131 LOCAL T_KSD_SDF ksd_seqKeypadInd;
132 LOCAL T_KSD_SDF ksd_seqStartLcdTest;
133 LOCAL T_KSD_SDF ksd_seqSetAbbrDial;
134 LOCAL T_KSD_SDF ksd_seqShowCallTable;
135
136 LOCAL T_KSD_SDF ksd_seqSmsSend;
137 LOCAL T_KSD_SDF ksd_seqSmsSendFromMem;
138 LOCAL T_KSD_SDF ksd_seqSmsWrite;
139 LOCAL T_KSD_SDF ksd_seqSmsDelete;
140 LOCAL T_KSD_SDF ksd_seqSmsRead;
141 LOCAL T_KSD_SDF ksd_seqSmsList;
142 LOCAL T_KSD_SDF ksd_seqSmsReadSingle;
143
144 LOCAL T_KSD_SDF ksd_seqSndCbst;
145 LOCAL T_KSD_SDF ksd_seqSndCrlp;
146 LOCAL T_KSD_SDF ksd_seqSndDs;
147
148 LOCAL T_KSD_SDF ksd_seqSpeechData;
149 LOCAL T_KSD_SDF ksd_seqDataSpeech;
150 #endif
151
152 #ifdef EM_MODE
153 LOCAL T_KSD_SDF ksd_em_mode;
154 #endif
155
156 LOCAL T_KSD_SDF ksd_seqDtmf;
157
158 LOCAL T_KSD_SDF ksd_seqStartReg;
159 LOCAL T_KSD_SDF ksd_seqAutoReg;
160 LOCAL T_KSD_SDF ksd_seqManReg;
161 LOCAL T_KSD_SDF ksd_seqAutoManReg;
162 LOCAL T_KSD_SDF ksd_seqSetManReg;
163 LOCAL T_KSD_SDF ksd_seqSetAutoReg;
164 LOCAL T_KSD_SDF ksd_seqStartPLMN;
165
166 LOCAL T_KSD_SDF ksd_seqActSimLock;
167 LOCAL T_KSD_SDF ksd_seqDeactSimLock;
168 LOCAL T_KSD_SDF ksd_seqIntrgtSimLock;
169
170 LOCAL T_KSD_SDF ksd_seqDial;
171 LOCAL T_KSD_SDF ksd_seqDialIdx;
172 LOCAL T_KSD_SDF ksd_seqUssd;
173
174 LOCAL T_KSD_SDF ksd_seqActAllCf;
175 LOCAL T_KSD_SDF ksd_seqDeactAllCf;
176 LOCAL T_KSD_SDF ksd_seqRegAllCf;
177 LOCAL T_KSD_SDF ksd_seqEraseAllCf;
178 LOCAL T_KSD_SDF ksd_seqIntrgtAllCf;
179
180 LOCAL T_KSD_SDF ksd_seqActAllCondCf;
181 LOCAL T_KSD_SDF ksd_seqDeactAllCondCf;
182 LOCAL T_KSD_SDF ksd_seqRegAllCondCf;
183 LOCAL T_KSD_SDF ksd_seqEraseAllCondCf;
184 LOCAL T_KSD_SDF ksd_seqIntrgtAllCondCf;
185
186 LOCAL T_KSD_SDF ksd_seqActUncondCf;
187 LOCAL T_KSD_SDF ksd_seqDeactUncondCf;
188 LOCAL T_KSD_SDF ksd_seqRegUncondCf;
189 LOCAL T_KSD_SDF ksd_seqEraseUncondCf;
190 LOCAL T_KSD_SDF ksd_seqIntrgtUncondCf;
191
192 LOCAL T_KSD_SDF ksd_seqActBusyCf;
193 LOCAL T_KSD_SDF ksd_seqDeactBusyCf;
194 LOCAL T_KSD_SDF ksd_seqRegBusyCf;
195 LOCAL T_KSD_SDF ksd_seqEraseBusyCf;
196 LOCAL T_KSD_SDF ksd_seqIntrgtBusyCf;
197
198 LOCAL T_KSD_SDF ksd_seqActNoRepCf;
199 LOCAL T_KSD_SDF ksd_seqDeactNoRepCf;
200 LOCAL T_KSD_SDF ksd_seqRegNoRepCf;
201 LOCAL T_KSD_SDF ksd_seqEraseNoRepCf;
202 LOCAL T_KSD_SDF ksd_seqIntrgtNoRepCf;
203
204 LOCAL T_KSD_SDF ksd_seqActNotReachCf;
205 LOCAL T_KSD_SDF ksd_seqDeactNotReachCf;
206 LOCAL T_KSD_SDF ksd_seqRegNotReachCf;
207 LOCAL T_KSD_SDF ksd_seqEraseNotReachCf;
208 LOCAL T_KSD_SDF ksd_seqIntrgtNotReachCf;
209
210 LOCAL T_KSD_SDF ksd_seqDeactOutBarrServ;
211
212 LOCAL T_KSD_SDF ksd_seqActBaoicExcHome;
213 LOCAL T_KSD_SDF ksd_seqDeactBaoicExcHome;
214 LOCAL T_KSD_SDF ksd_seqIntrgtBaoicExcHome;
215
216 LOCAL T_KSD_SDF ksd_seqActBaoic;
217 LOCAL T_KSD_SDF ksd_seqDeactBaoic;
218 LOCAL T_KSD_SDF ksd_seqIntrgtBaoic;
219
220 LOCAL T_KSD_SDF ksd_seqDeactAllBarrServ;
221
222 LOCAL T_KSD_SDF ksd_seqActBaoc;
223 LOCAL T_KSD_SDF ksd_seqDeactBaoc;
224 LOCAL T_KSD_SDF ksd_seqIntrgtBaoc;
225
226 LOCAL T_KSD_SDF ksd_seqDeactInBarrServ;
227
228 LOCAL T_KSD_SDF ksd_seqActBaicRoam;
229 LOCAL T_KSD_SDF ksd_seqDeactBaicRoam;
230 LOCAL T_KSD_SDF ksd_seqIntrgtBaicRoam;
231
232 LOCAL T_KSD_SDF ksd_seqActBaic;
233 LOCAL T_KSD_SDF ksd_seqDeactBaic;
234 LOCAL T_KSD_SDF ksd_seqIntrgtBaic;
235
236 LOCAL T_KSD_SDF ksd_seqIntrgtClir;
237 LOCAL T_KSD_SDF ksd_seqSupClir;
238 LOCAL T_KSD_SDF ksd_seqInvClir;
239
240 LOCAL T_KSD_SDF ksd_seqIntrgtClip;
241 LOCAL T_KSD_SDF ksd_seqSupClip;
242 LOCAL T_KSD_SDF ksd_seqInvClip;
243
244 LOCAL T_KSD_SDF ksd_seqIntrgtColr;
245 LOCAL T_KSD_SDF ksd_seqSupColr;
246 LOCAL T_KSD_SDF ksd_seqInvColr;
247
248 LOCAL T_KSD_SDF ksd_seqIntrgtColp;
249 LOCAL T_KSD_SDF ksd_seqSupColp;
250 LOCAL T_KSD_SDF ksd_seqInvColp;
251
252 LOCAL T_KSD_SDF ksd_seqSupTTY;
253 LOCAL T_KSD_SDF ksd_seqReqTTY;
254
255 LOCAL T_KSD_SDF ksd_seqRegPwdAllBarrServ;
256 LOCAL T_KSD_SDF ksd_seqRegPwdAllServ;
257
258 #if 0 /* For further study, so not yet used */
259 LOCAL T_KSD_SDF ksd_seqActCCBS;
260 #endif
261 LOCAL T_KSD_SDF ksd_seqDeactCCBS;
262 LOCAL T_KSD_SDF ksd_seqIntrgtCCBS;
263 LOCAL T_KSD_SDF ksd_seqIntrgtCNAP;
264
265 LOCAL T_KSD_SDF ksd_seqChngPin2;
266 LOCAL T_KSD_SDF ksd_seqChngPin;
267 LOCAL T_KSD_SDF ksd_seqUnblckPin2;
268 LOCAL T_KSD_SDF ksd_seqUnblckPin;
269
270 LOCAL T_KSD_SDF ksd_seqActWait;
271 LOCAL T_KSD_SDF ksd_seqDeactWait;
272 LOCAL T_KSD_SDF ksd_seqIntrgtWait;
273
274 LOCAL T_KSD_SDF ksd_seqPrsntImei;
275
276 LOCAL T_KSD_SDF ksd_seqSndChld0;
277 LOCAL T_KSD_SDF ksd_seqSndChld1;
278 LOCAL T_KSD_SDF ksd_seqSndChld2;
279 LOCAL T_KSD_SDF ksd_seqSndChld3;
280 LOCAL T_KSD_SDF ksd_seqSndChld4;
281 LOCAL T_KSD_SDF ksd_seqSndChld4Star;
282 LOCAL T_KSD_SDF ksd_seqSndChld5;
283
284 LOCAL T_KSD_SDF ksd_seqRegPwdOutBarrServ;
285 LOCAL T_KSD_SDF ksd_seqRegPwdInBarrServ;
286 LOCAL T_KSD_SDF ksd_seqActOutBarrServ;
287 LOCAL T_KSD_SDF ksd_seqActInBarrServ;
288 LOCAL T_KSD_SDF ksd_seqActAllBarrServ;
289
290 LOCAL T_KSD_SDF ksd_seqUnknown;
291
292
293 /*LOCAL BOOL ksd_isUSSD (CHAR *keySeq); */
294
295 /*==== VARIABLES ==================================================*/
296
297 /*
298 * keystroke sequence table, additionally used while at
299 * least one call is in
300 * CAL_STAT_Held, CAL_STAT_Active,
301 * CAL_STAT_Dial (CCBS),
302 * CAL_STAT_Incomming (CD), CAL_STAT_Wait (CD)
303 */
304 LOCAL const T_KEY_SEQ_TABLE keyWithinCall[] =
305 {
306 /* 000 - 0 followed by send */
307 "0", ksd_seqSndChld0,
308 /* 001 - 1 followed by send */
309 "1", ksd_seqSndChld1,
310 /* 002 - 2 followed by send */
311 "2", ksd_seqSndChld2,
312 /* 003 - 3 followed by send */
313 "3", ksd_seqSndChld3,
314 /* 004 - 4 followed by star */
315 "4*", ksd_seqSndChld4Star,
316 /* 005 - 4 followed by send */
317 "4", ksd_seqSndChld4,
318 /* 006 - 5 followed by send */
319 "5", ksd_seqSndChld5,
320
321 /* 004 - unknown */
322 NULL, ksd_seqUnknown
323 };
324
325 /* keystroke sequence table for sequences including */
326 /* passwords */
327 LOCAL const T_KEY_SEQ_TABLE keyPasswd[] =
328 {
329 /* 000 - deactivate outgoing barring services */
330 "#333?", ksd_seqDeactOutBarrServ,
331 /* 001 - activate BAOIC except home */
332 "*332?", ksd_seqActBaoicExcHome,
333 /* 002 - deactivate BAOIC except home */
334 "#332?", ksd_seqDeactBaoicExcHome,
335 /* 003 - interrogate BAOIC except home */
336 "*#332?", ksd_seqIntrgtBaoicExcHome,
337 /* 004 - interrogate BAOIC */
338 "*#331?", ksd_seqIntrgtBaoic,
339 /* 005 - activate BAOIC */
340 "*331?", ksd_seqActBaoic,
341 /* 006 - deactivate BAOIC */
342 "#331?", ksd_seqDeactBaoic,
343 /* 007 - deactivate all barring services */
344 "#330?", ksd_seqDeactAllBarrServ,
345 /* 008 - activate BAOC */
346 "*33?", ksd_seqActBaoc,
347 /* 009 - deactivate BAOC */
348 "#33?", ksd_seqDeactBaoc,
349 /* 010 - interrogate BAOC */
350 "*#33?", ksd_seqIntrgtBaoc,
351 /* 011 - deactivate incoming barring services */
352 "#353?", ksd_seqDeactInBarrServ,
353 /* 012 - activate BAIC roaming */
354 "*351?", ksd_seqActBaicRoam,
355 /* 013 - deactivate BAIC roaming */
356 "#351?", ksd_seqDeactBaicRoam,
357 /* 014 - interrogate BAIC roaming */
358 "*#351?", ksd_seqIntrgtBaicRoam,
359 /* 015 - activate BAIC */
360 "*35?", ksd_seqActBaic,
361 /* 016 - deactivate BAIC */
362 "#35?", ksd_seqDeactBaic,
363 /* 017 - interrogate BAIC */
364 "*#35?", ksd_seqIntrgtBaic,
365
366 /* 018 - register password all barring */
367 "*03*330?", ksd_seqRegPwdAllBarrServ,
368 /* 019 - register password for all services */
369 "*03*?", ksd_seqRegPwdAllServ,
370
371 /* 020 - register password all barring */
372 "**03*330?", ksd_seqRegPwdAllBarrServ,
373 /* 021 - register password for all services */
374 "**03*?", ksd_seqRegPwdAllServ,
375
376 /* 022 - change PIN2 */
377 "**042?", ksd_seqChngPin2,
378 /* 023 - change PIN */
379 "**04?", ksd_seqChngPin,
380 /* 024 - unblock PIN2 */
381 "**052?", ksd_seqUnblckPin2,
382 /* 025 - unblock PIN */
383 "**05?", ksd_seqUnblckPin,
384
385 /* 026 - register passwd for outgoing barring services */
386 "**03*333?", ksd_seqRegPwdOutBarrServ,
387 /* 027 - register passwd for incoming barring services */
388 "**03*353?", ksd_seqRegPwdInBarrServ,
389 /* 028 - activation for outgoing barring services */
390 "*333?", ksd_seqActOutBarrServ,
391 /* 029 - activation for incoming barring services */
392 "*353?", ksd_seqActInBarrServ,
393 /* 030 - activation for all barring services */
394 "*330?", ksd_seqActAllBarrServ,
395
396 /* 031 - unknown */
397 NULL, ksd_seqUnknown
398 };
399
400 /* keystroke sequence table for sequences including */
401 /* passwords */
402 LOCAL const T_KEY_SEQ_TABLE keyPasswdNonGsm[] =
403 {
404 /* 000 - lock SIM card */
405 "*77742?", ksd_seqActSimLock,
406 /* 001 - unlock SIM card */
407 "#77742?", ksd_seqDeactSimLock,
408
409 /* 002 - unknown */
410 NULL, ksd_seqUnknown
411 };
412
413 /* standard keystroke sequence table */
414 LOCAL const T_KEY_SEQ_TABLE keyNoFDNSeqTable[] =
415 {
416 /* 001 - present IMEI */
417 "*#06#", ksd_seqPrsntImei,
418 /* 002 - change PIN2 */
419 "**042?", ksd_seqChngPin2,
420 /* 003 - change PIN */
421 "**04?", ksd_seqChngPin,
422 /* 004 - unblock PIN2 */
423 "**052?", ksd_seqUnblckPin2,
424 /* 005 - unblock PIN */
425 "**05?", ksd_seqUnblckPin,
426
427 /* 006 - unknown */
428 NULL, ksd_seqUnknown
429 };
430
431
432 /*
433 * defines for CLIR, this is used for
434 * separate handling of CC by SAT
435 */
436 #define KSD_SUPPRESS_CLIR "*31#"
437 #define KSD_INVOKE_CLIR "#31#"
438
439 /* standard keystroke sequence table */
440 LOCAL const T_KEY_SEQ_TABLE keySeqTable[] =
441 {
442 /* 000 - activate all CF */
443 "*002?", ksd_seqActAllCf,
444 /* 001 - deactivate all CF */
445 "#002?", ksd_seqDeactAllCf,
446 /* 002 - registrate all CF */
447 "**002?", ksd_seqRegAllCf,
448 /* 003 - erase all CF */
449 "##002?", ksd_seqEraseAllCf,
450 /* 004 - interrogate all CF */
451 "*#002?", ksd_seqIntrgtAllCf,
452
453 /* 005 - activate all conditional CF */
454 "*004?", ksd_seqActAllCondCf,
455 /* 006 - deactivate all conditional CF */
456 "#004?", ksd_seqDeactAllCondCf,
457 /* 007 - registrate all conditional CF */
458 "**004?", ksd_seqRegAllCondCf,
459 /* 008 - erase all conditional CF */
460 "##004?", ksd_seqEraseAllCondCf,
461 /* 009 - interrogate all conditional CF */
462 "*#004?", ksd_seqIntrgtAllCondCf,
463
464 /* 010 - activate unconditional CF */
465 "*21?", ksd_seqActUncondCf,
466 /* 011 - deactivate unconditional CF */
467 "#21?", ksd_seqDeactUncondCf,
468 /* 012 - registrate unconditional CF */
469 "**21?", ksd_seqRegUncondCf,
470 /* 013 - erase unconditional CF */
471 "##21?", ksd_seqEraseUncondCf,
472 /* 014 - interrogate unconditional CF */
473 "*#21?", ksd_seqIntrgtUncondCf,
474
475 /* 015 - activate busy CF */
476 "*67?", ksd_seqActBusyCf,
477 /* 016 - deactivate busy CF */
478 "#67?", ksd_seqDeactBusyCf,
479 /* 017 - registrate busy CF */
480 "**67?", ksd_seqRegBusyCf,
481 /* 018 - erase busy CF */
482 "##67?", ksd_seqEraseBusyCf,
483 /* 019 - interrogate busy CF */
484 "*#67?", ksd_seqIntrgtBusyCf,
485
486 /* 020 - activate no reply CF */
487 "*61?", ksd_seqActNoRepCf,
488 /* 021 - deactivate no reply CF */
489 "#61?", ksd_seqDeactNoRepCf,
490 /* 022 - registrate no reply CF */
491 "**61?", ksd_seqRegNoRepCf,
492 /* 023 - erase no reply CF */
493 "##61?", ksd_seqEraseNoRepCf,
494 /* 024 - interrogate no reply CF */
495 "*#61?", ksd_seqIntrgtNoRepCf,
496
497 /* 025 - activate not reachable CF */
498 "*62?", ksd_seqActNotReachCf,
499 /* 026 - deactivate not reachable CF */
500 "#62?", ksd_seqDeactNotReachCf,
501 /* 027 - registrate not reachable CF */
502 "**62?", ksd_seqRegNotReachCf,
503 /* 028 - erase not reachable CF */
504 "##62?", ksd_seqEraseNotReachCf,
505 /* 029 - interrogate not reachable CF */
506 "*#62?", ksd_seqIntrgtNotReachCf,
507
508 /* 030 - interrogate CLIR */
509 "*#31#", ksd_seqIntrgtClir,
510 /* 031 - suppress CLIR */
511 KSD_SUPPRESS_CLIR, ksd_seqSupClir,
512 /* 032 - invoke CLIR */
513 KSD_INVOKE_CLIR, ksd_seqInvClir,
514
515 /* 033 - interrogate CLIP */
516 "*#30#", ksd_seqIntrgtClip,
517 /* 034 - suppress CLIP */
518 "*30#", ksd_seqSupClip,
519 /* 035 - invoke CLIP */
520 "#30#", ksd_seqInvClip,
521
522 /* 036 - interrogate COLR */
523 "*#77#", ksd_seqIntrgtColr,
524 /* 037 - suppress COLR */
525 "*77#", ksd_seqSupColr,
526 /* 038 - invoke COLR */
527 "#77#", ksd_seqInvColr,
528
529 /* 039 - interrogate COLP */
530 "*#76#", ksd_seqIntrgtColp,
531 /* 040 - suppress COLP */
532 "*76#", ksd_seqSupColp,
533 /* 041 - invoke COLP */
534 "#76#", ksd_seqInvColp,
535
536 /* 042 - activate wait */
537 "*43?", ksd_seqActWait,
538 /* 043 - deactivate wait */
539 "#43?", ksd_seqDeactWait,
540 /* 044 - interrogate wait */
541 //TISH, patch for GCF42.3.1.9
542 //start
543 #if 0
544 "*#43#", ksd_seqIntrgtWait,
545 #else
546 "*#43?", ksd_seqIntrgtWait,
547 #endif
548 //end
549 /* 045 - present IMEI */
550 "*#06#", ksd_seqPrsntImei,
551
552 #if 0 /* For further study, so not yet used */
553 /* - activate CCBS */
554 "*37#", ksd_seqActCCBS
555 #endif
556
557 /* 046 - deactivate CCBS */
558 "#37?", ksd_seqDeactCCBS,
559 /* 047 - interrogate CCBS */
560 "*#37#", ksd_seqIntrgtCCBS,
561
562 /* 048 - request TTY service */
563 "*55#", ksd_seqReqTTY,
564 /* 049 - suppress TTY service */
565 "#55#", ksd_seqSupTTY,
566
567 /* 300 - CNAP */
568 "*#300#", ksd_seqIntrgtCNAP,
569
570 /* 050 - unknown */
571 NULL, ksd_seqUnknown
572 };
573
574 /* standard keystroke sequence table */
575 LOCAL const T_KEY_SEQ_TABLE keySeqTableNonGsm[] =
576 {
577 /* 000 - MS off */
578 "#*91*0#", ksd_seqMsOff,
579 /* 001 - MS on */
580 "#*91*1#", ksd_seqMsOn,
581 /* 002 - hook off */
582 "#*43*0#", ksd_seqHookOff,
583 /* 003 - hook on */
584 "#*43*1#", ksd_seqHookOn,
585 /* 004 - DTMF */
586 "#*88*", ksd_seqDtmf,
587 #ifdef SMI
588 /* 005 - keypad indication */
589 "#*92?", ksd_seqKeypadInd,
590 /* 006 - start LCD test */
591 "#*96#", ksd_seqStartLcdTest,
592 /* 007 - show call table */
593 "#*93#", ksd_seqShowCallTable,
594 /* 008 - set phone number used for abbreviated dialing */
595 "#*95?", ksd_seqSetAbbrDial,
596 #endif
597
598 /* 009 - restart registration */
599 "*1#", ksd_seqStartReg,
600 /* 010 - automatic registration */
601 "*1*0#", ksd_seqAutoReg,
602 /* 011 - manual registration */
603 "*1*1#", ksd_seqManReg,
604 /* 012 - manual followed by automatic registration */
605 "*1*4#", ksd_seqAutoManReg,
606 /* 013 - set manual registration */
607 "MANUAL", ksd_seqSetManReg,
608 /* 014 - set automatic registration */
609 "AUTO", ksd_seqSetAutoReg,
610 /* 015 - start cell selection for a selected PLMN */
611 "SPLMN", ksd_seqStartPLMN,
612
613 #ifdef SMI
614 /* 016 - send short message */
615 "#*94*0#", ksd_seqSmsSend,
616 /* 017 - send short message from storage */
617 "#*94*1#", ksd_seqSmsSendFromMem,
618 /* 018 - write short message to memory */
619 "#*94*2#", ksd_seqSmsWrite,
620 /* 019 - delete short message */
621 "#*94*3#", ksd_seqSmsDelete,
622 /* 020 - read short message */
623 "#*94*4#", ksd_seqSmsRead,
624 /* 021 - list short messages */
625 "#*94*5#", ksd_seqSmsList,
626 /* 022 - read a single short message */
627 "#*94*6#", ksd_seqSmsReadSingle,
628 #endif
629 /* 023 - interrogate lock status of SIM card */
630 "*#77742#",ksd_seqIntrgtSimLock,
631 #ifdef SMI
632 /* 024 - send AT+CBST, GSM 07.07, chapter 6.7 */
633 "*7767?", ksd_seqSndCbst,
634 /* 025 - send AT+CRLP, GSM 07.07, chapter 6.8 */
635 "*7768?", ksd_seqSndCrlp,
636
637 /* 026 - send AT+DS, V25ter, chapter 6.6.1 */
638 "*25661?", ksd_seqSndDs,
639 #endif
640 #ifdef EM_MODE
641 /* 027 - engineering mode command */
642 "#*99?", ksd_em_mode,
643 #endif
644 /* 028 - unknown */
645 NULL, ksd_seqUnknown
646 };
647
648 EXTERN UBYTE std;
649 EXTERN T_ACI_CUSCFG_PARAMS cuscfgParams;
650
651 /*==== FUNCTIONS ==================================================*/
652 /*
653 +--------------------------------------------------------------------+
654 | PROJECT : GSM-PS (6147) MODULE : KSD |
655 | STATE : code ROUTINE : ksd_strlen |
656 +--------------------------------------------------------------------+
657
658 PURPOSE : This function calculates the length of a string.
659 If the string ends with a '?' this character will be not
660 taken into account.
661
662 <string>: the length of this string will be calculated
663
664 returns: the number of characters in the string, except
665 an ending '?'
666 */
667 LOCAL USHORT ksd_strlen (CHAR* string)
668 {
669 USHORT len = strlen (string);
670
671 if (string[len - 1] EQ DONT_CARE)
672 len--;
673
674 return len;
675 }
676
677 /*
678 +--------------------------------------------------------------------+
679 | PROJECT : GSM-PS (6147) MODULE : KSD |
680 | STATE : code ROUTINE : ksd_seqMsOff |
681 +--------------------------------------------------------------------+
682
683 PURPOSE : This function sets the output parameter for the
684 SEQGRP_MS_OFF key sequence.
685 */
686 LOCAL BOOL ksd_seqMsOff (USHORT inIdx,
687 CHAR* inSeq,
688 T_KSD_SEQGRP* outSeqGrp,
689 CHAR** outRestSeq,
690 T_KSD_SEQPARAM* outSeqParam)
691 {
692 TRACE_FUNCTION ("ksd_seqMsOff ()");
693
694 *outSeqGrp = SEQGRP_MS_OFF;
695 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
696
697 return TRUE;
698 }
699
700 /*
701 +--------------------------------------------------------------------+
702 | PROJECT : GSM-PS (6147) MODULE : KSD |
703 | STATE : code ROUTINE : ksd_seqMsOn |
704 +--------------------------------------------------------------------+
705
706 PURPOSE : This function sets the ouput parameter for the
707 SEQGRP_MS_ON key sequence.
708 */
709 LOCAL BOOL ksd_seqMsOn (USHORT inIdx,
710 CHAR* inSeq,
711 T_KSD_SEQGRP* outSeqGrp,
712 CHAR** outRestSeq,
713 T_KSD_SEQPARAM* outSeqParam)
714 {
715 TRACE_FUNCTION ("ksd_seqMsOn ()");
716
717 *outSeqGrp = SEQGRP_MS_ON;
718 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
719
720 return TRUE;
721 }
722
723 /*
724 +--------------------------------------------------------------------+
725 | PROJECT : GSM-PS (6147) MODULE : KSD |
726 | STATE : code ROUTINE : ksd_seqHookOff |
727 +--------------------------------------------------------------------+
728
729 PURPOSE : This function sets the ouput parameter for the
730 SEQGRP_HOOK_OFF key sequence.
731 */
732 LOCAL BOOL ksd_seqHookOff (USHORT inIdx,
733 CHAR* inSeq,
734 T_KSD_SEQGRP* outSeqGrp,
735 CHAR** outRestSeq,
736 T_KSD_SEQPARAM* outSeqParam)
737 {
738 TRACE_FUNCTION ("ksd_seqHookOff ()");
739
740 *outSeqGrp = SEQGRP_HOOK_OFF;
741 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
742
743 return TRUE;
744 }
745
746 /*
747 +--------------------------------------------------------------------+
748 | PROJECT : GSM-PS (6147) MODULE : KSD |
749 | STATE : code ROUTINE : ksd_seqHookOn |
750 +--------------------------------------------------------------------+
751
752 PURPOSE : This function sets the ouput parameter for the
753 SEQGRP_HOOK_ON key sequence.
754 */
755 LOCAL BOOL ksd_seqHookOn (USHORT inIdx,
756 CHAR* inSeq,
757 T_KSD_SEQGRP* outSeqGrp,
758 CHAR** outRestSeq,
759 T_KSD_SEQPARAM* outSeqParam)
760 {
761 TRACE_FUNCTION ("ksd_seqHookOn ()");
762
763 *outSeqGrp = SEQGRP_HOOK_ON;
764 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
765
766 return TRUE;
767 }
768
769 /*
770 +--------------------------------------------------------------------+
771 | PROJECT : GSM-PS (6147) MODULE : KSD |
772 | STATE : code ROUTINE : ksd_seqDtmf |
773 +--------------------------------------------------------------------+
774
775 PURPOSE : This function sets the ouput parameter for the SEQGRP_DTMF
776 key sequence.
777 */
778 LOCAL BOOL ksd_seqDtmf (USHORT inIdx,
779 CHAR* inSeq,
780 T_KSD_SEQGRP* outSeqGrp,
781 CHAR** outRestSeq,
782 T_KSD_SEQPARAM* outSeqParam)
783 {
784 CHAR* dtmf = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
785 /* points to the DTMF character */
786 BOOL isSuccess; /* holds whether decoding is successfull */
787
788 TRACE_FUNCTION ("ksd_seqDtmf ()");
789
790 *outSeqGrp = SEQGRP_DTMF;
791
792 /*
793 *-----------------------------------------------------------------
794 * the following characters are valid DTMF characters: 0-9,A-D,*,#
795 *-----------------------------------------------------------------
796 */
797 if ( *dtmf EQ '*' OR
798 *dtmf EQ '#' OR
799 (*dtmf >= 'A' AND *dtmf <= 'D') OR
800 (*dtmf >= 'a' AND *dtmf <= 'd') OR
801 (*dtmf >= '0' AND *dtmf <= '9'))
802 {
803 *outRestSeq = dtmf + 1;
804 outSeqParam->dtmf = *dtmf;
805 isSuccess = TRUE;
806 }
807 else
808 {
809 *outRestSeq = dtmf;
810 isSuccess = FALSE;
811 }
812
813 return isSuccess;
814 }
815
816 #ifdef SMI
817 /*
818 +--------------------------------------------------------------------+
819 | PROJECT : GSM-PS (6147) MODULE : KSD |
820 | STATE : code ROUTINE : ksd_seqKeypadInd |
821 +--------------------------------------------------------------------+
822
823 PURPOSE : This function sets the ouput parameter for the
824 SEQGRP_KEYPAD_IND key sequence.
825 */
826 LOCAL BOOL ksd_seqKeypadInd (USHORT inIdx,
827 CHAR* inSeq,
828 T_KSD_SEQGRP* outSeqGrp,
829 CHAR** outRestSeq,
830 T_KSD_SEQPARAM* outSeqParam)
831 {
832 static const struct T_KSD_KEYS /* key name / key code mapping */
833 {
834 const CHAR* longName; /* long key name */
835 const UBYTE code; /* key code */
836 }
837 keys[] =
838 {
839 "SEND", KP_OFF_HOOK,
840 "END", KP_ON_HOOK,
841 "UP", KP_UP,
842 "DOWN", KP_DOWN,
843 "SHIFT", KP_SHIFT,
844 "CLEAR", KP_CLEAR,
845 "HASH", KP_HASH,
846 "STAR", KP_STAR,
847 "POWER", KP_POWER,
848 NULL, -1
849 };
850
851 USHORT i = 0;
852 const USHORT siNum = 1;
853 T_KSD_DCD_CPLE dcdCple[1];
854 T_KSD_SIPARAM keyParam;
855 USHORT readChars;
856 USHORT lenKeySeq = ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
857 BOOL isSuccess = FALSE;
858
859 TRACE_FUNCTION ("ksd_seqKeypadInd ()");
860
861 dcdCple[0].type = SI_CHAR_STAR;
862 dcdCple[0].param = &keyParam;
863
864 *outSeqGrp = SEQGRP_KEYPAD_IND;
865
866 if (ksd_extractSi (inSeq + lenKeySeq, siNum,
867 &readChars, dcdCple) EQ TRUE)
868 {
869 CHAR* key = keyParam.siCharStar;
870
871 outSeqParam->keypad.keyStat = KEY_STAT_PRS;
872
873 /*
874 *---------------------------------------------------------------
875 * searching for long key name
876 *---------------------------------------------------------------
877 */
878 while (keys[i].longName NEQ NULL AND
879 strcmp (keys[i].longName, key) NEQ 0)
880 i++;
881
882 if (keys[i].longName NEQ NULL)
883 {
884 /*
885 *-------------------------------------------------------------
886 * long key name found
887 *-------------------------------------------------------------
888 */
889 outSeqParam->keypad.keyCode = keys[i].code;
890 isSuccess = TRUE;
891 }
892 else if (strlen (key) EQ 1)
893 {
894 /*
895 *-------------------------------------------------------------
896 * only a single character found
897 *-------------------------------------------------------------
898 */
899 outSeqParam->keypad.keyCode = *key;
900 isSuccess = TRUE;
901 }
902 else
903 isSuccess = FALSE;
904 }
905
906 *outRestSeq = inSeq + lenKeySeq + readChars;
907
908 return isSuccess;
909 }
910 #endif
911
912 #ifdef SMI
913 /*
914 +--------------------------------------------------------------------+
915 | PROJECT : GSM-PS (6147) MODULE : KSD |
916 | STATE : code ROUTINE : ksd_seqStartLcdTest |
917 +--------------------------------------------------------------------+
918
919 PURPOSE : This function sets the ouput parameter for the
920 SEQGRP_LCD_TEST key sequence.
921 */
922 LOCAL BOOL ksd_seqStartLcdTest (USHORT inIdx,
923 CHAR* inSeq,
924 T_KSD_SEQGRP* outSeqGrp,
925 CHAR** outRestSeq,
926 T_KSD_SEQPARAM* outSeqParam)
927 {
928 TRACE_FUNCTION ("ksd_seqStartLcdTest ()");
929
930 *outSeqGrp = SEQGRP_LCD_TEST;
931 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
932
933 return TRUE;
934 }
935 #endif
936
937 #ifdef SMI
938 /*
939 +--------------------------------------------------------------------+
940 | PROJECT : GSM-PS (6147) MODULE : KSD |
941 | STATE : code ROUTINE : ksd_seqShowCallTable |
942 +--------------------------------------------------------------------+
943
944 PURPOSE : This function sets the ouput parameter for the
945 SEQGRP_SHOW_CALL_TABLE key sequence.
946 */
947 LOCAL BOOL ksd_seqShowCallTable (USHORT inIdx,
948 CHAR* inSeq,
949 T_KSD_SEQGRP* outSeqGrp,
950 CHAR** outRestSeq,
951 T_KSD_SEQPARAM* outSeqParam)
952 {
953 TRACE_FUNCTION ("ksd_seqShowCallTable ()");
954
955 *outSeqGrp = SEQGRP_SHOW_CALL_TABLE;
956 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
957
958 return TRUE;
959 }
960 #endif
961
962 /*
963 +--------------------------------------------------------------------+
964 | PROJECT : GSM-PS (6147) MODULE : KSD |
965 | STATE : code ROUTINE : ksd_seqAutoReg |
966 +--------------------------------------------------------------------+
967
968 PURPOSE : This function sets the ouput parameter for the
969 SEQGRP_AUTO_REG key sequence.
970 */
971 LOCAL BOOL ksd_seqAutoReg (USHORT inIdx,
972 CHAR* inSeq,
973 T_KSD_SEQGRP* outSeqGrp,
974 CHAR** outRestSeq,
975 T_KSD_SEQPARAM* outSeqParam)
976 {
977 TRACE_FUNCTION ("ksd_seqAutoReg ()");
978
979 *outSeqGrp = SEQGRP_CHANGE_REGISTER;
980 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
981
982 outSeqParam->cops.mode = COPS_MOD_Auto;
983 outSeqParam->cops.frmt = COPS_FRMT_NotPresent;
984 outSeqParam->cops.oper = NULL;
985
986 return TRUE;
987 }
988
989 /*
990 +--------------------------------------------------------------------+
991 | PROJECT : GSM-PS (6147) MODULE : KSD |
992 | STATE : code ROUTINE : ksd_seqManReg |
993 +--------------------------------------------------------------------+
994
995 PURPOSE : This function sets the ouput parameter for the
996 SEQGRP_MAN_REG key sequence.
997 */
998 LOCAL BOOL ksd_seqManReg (USHORT inIdx,
999 CHAR* inSeq,
1000 T_KSD_SEQGRP* outSeqGrp,
1001 CHAR** outRestSeq,
1002 T_KSD_SEQPARAM* outSeqParam)
1003 {
1004 TRACE_FUNCTION ("ksd_seqManReg ()");
1005
1006 *outSeqGrp = SEQGRP_CHANGE_REGISTER;
1007 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1008
1009 outSeqParam->cops.mode = COPS_MOD_Man;
1010 outSeqParam->cops.frmt = COPS_FRMT_NotPresent;
1011 outSeqParam->cops.oper = NULL;
1012
1013 return TRUE;
1014 }
1015
1016 /*
1017 +--------------------------------------------------------------------+
1018 | PROJECT : GSM-PS (6147) MODULE : KSD |
1019 | STATE : code ROUTINE : ksd_seqAutoManReg |
1020 +--------------------------------------------------------------------+
1021
1022 PURPOSE : This function sets the ouput parameter for the
1023 AUTO_MAN_REG key sequence.
1024 */
1025 LOCAL BOOL ksd_seqAutoManReg (USHORT inIdx,
1026 CHAR* inSeq,
1027 T_KSD_SEQGRP* outSeqGrp,
1028 CHAR** outRestSeq,
1029 T_KSD_SEQPARAM* outSeqParam)
1030 {
1031 TRACE_FUNCTION ("ksd_seqAutoManReg ()");
1032
1033 *outSeqGrp = SEQGRP_CHANGE_REGISTER;
1034 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1035
1036 outSeqParam->cops.mode = COPS_MOD_Both;
1037 outSeqParam->cops.frmt = COPS_FRMT_NotPresent;
1038 outSeqParam->cops.oper = NULL;
1039
1040 return TRUE;
1041 }
1042
1043 /*
1044 +--------------------------------------------------------------------+
1045 | PROJECT : GSM-PS (6147) MODULE : KSD |
1046 | STATE : code ROUTINE : ksd_seqSetManReg |
1047 +--------------------------------------------------------------------+
1048
1049 PURPOSE : This function sets the ouput parameter for the
1050 SEQGRP_SET_MAN_REG key sequence.
1051 */
1052 LOCAL BOOL ksd_seqSetManReg (USHORT inIdx,
1053 CHAR* inSeq,
1054 T_KSD_SEQGRP* outSeqGrp,
1055 CHAR** outRestSeq,
1056 T_KSD_SEQPARAM* outSeqParam)
1057 {
1058 TRACE_FUNCTION ("ksd_seqSetManReg ()");
1059
1060 *outSeqGrp = SEQGRP_SET_REGISTER;
1061 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1062
1063 outSeqParam->cops.mode = COPS_MOD_Man;
1064 outSeqParam->cops.frmt = COPS_FRMT_NotPresent;
1065 outSeqParam->cops.oper = NULL;
1066
1067 return TRUE;
1068 }
1069
1070 /*
1071 +--------------------------------------------------------------------+
1072 | PROJECT : GSM-PS (6147) MODULE : KSD |
1073 | STATE : code ROUTINE : ksd_seqSetAutoReg |
1074 +--------------------------------------------------------------------+
1075
1076 PURPOSE : This function sets the ouput parameter for the
1077 SEQGRP_SET_AUTO_REG key sequence.
1078 */
1079 LOCAL BOOL ksd_seqSetAutoReg (USHORT inIdx,
1080 CHAR* inSeq,
1081 T_KSD_SEQGRP* outSeqGrp,
1082 CHAR** outRestSeq,
1083 T_KSD_SEQPARAM* outSeqParam)
1084 {
1085 TRACE_FUNCTION ("ksd_seqSetAutoReg ()");
1086
1087 *outSeqGrp = SEQGRP_SET_REGISTER;
1088 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1089
1090 outSeqParam->cops.mode = COPS_MOD_Auto;
1091 outSeqParam->cops.frmt = COPS_FRMT_NotPresent;
1092 outSeqParam->cops.oper = NULL;
1093
1094 return TRUE;
1095 }
1096
1097 /*
1098 +--------------------------------------------------------------------+
1099 | PROJECT : GSM-PS (6147) MODULE : KSD |
1100 | STATE : code ROUTINE : ksd_seqStartReg |
1101 +--------------------------------------------------------------------+
1102
1103 PURPOSE : This function sets the ouput parameter for the
1104 SEQGRP_START_REGISTER key sequence.
1105 */
1106 LOCAL BOOL ksd_seqStartReg (USHORT inIdx,
1107 CHAR* inSeq,
1108 T_KSD_SEQGRP* outSeqGrp,
1109 CHAR** outRestSeq,
1110 T_KSD_SEQPARAM* outSeqParam)
1111 {
1112 TRACE_FUNCTION ("ksd_seqStartReg ()");
1113
1114 *outSeqGrp = SEQGRP_START_REGISTER;
1115 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1116
1117 outSeqParam->cops.mode = COPS_MOD_NotPresent;
1118 outSeqParam->cops.frmt = COPS_FRMT_NotPresent;
1119 outSeqParam->cops.oper = NULL;
1120
1121 return TRUE;
1122 }
1123
1124 /*
1125 +--------------------------------------------------------------------+
1126 | PROJECT : GSM-PS (6147) MODULE : KSD |
1127 | STATE : code ROUTINE : ksd_seqStartPLMN |
1128 +--------------------------------------------------------------------+
1129
1130 PURPOSE : This function sets the ouput parameter for the
1131 SEQGRP_START_PLMN key sequence.
1132 */
1133 LOCAL BOOL ksd_seqStartPLMN (USHORT inIdx,
1134 CHAR* inSeq,
1135 T_KSD_SEQGRP* outSeqGrp,
1136 CHAR** outRestSeq,
1137 T_KSD_SEQPARAM* outSeqParam)
1138 {
1139 TRACE_FUNCTION ("ksd_seqStartPLMN ()");
1140
1141 *outSeqGrp = SEQGRP_START_REGISTER;
1142 *outRestSeq = inSeq + strlen (inSeq);
1143
1144 outSeqParam->cops.mode = COPS_MOD_NotPresent;
1145 outSeqParam->cops.frmt = COPS_FRMT_Numeric;
1146 outSeqParam->cops.oper = inSeq +
1147 ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1148
1149 return TRUE;
1150 }
1151
1152 #ifdef SMI
1153 /*
1154 +--------------------------------------------------------------------+
1155 | PROJECT : GSM-PS (6147) MODULE : KSD |
1156 | STATE : code ROUTINE : ksd_seqSmsSend |
1157 +--------------------------------------------------------------------+
1158
1159 PURPOSE : This function sets the ouput parameter for the
1160 SEQGRP_SMS_SEND key sequence.
1161 */
1162 LOCAL BOOL ksd_seqSmsSend (USHORT inIdx,
1163 CHAR* inSeq,
1164 T_KSD_SEQGRP* outSeqGrp,
1165 CHAR** outRestSeq,
1166 T_KSD_SEQPARAM* outSeqParam)
1167 {
1168 TRACE_FUNCTION ("ksd_seqSmsSend ()");
1169
1170 *outSeqGrp = SEQGRP_SMS_SEND;
1171 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1172
1173 return TRUE;
1174 }
1175 #endif
1176
1177 #ifdef SMI
1178 /*
1179 +--------------------------------------------------------------------+
1180 | PROJECT : GSM-PS (6147) MODULE : KSD |
1181 | STATE : code ROUTINE : ksd_seqSmsSendFromMem |
1182 +--------------------------------------------------------------------+
1183
1184 PURPOSE : This function sets the ouput parameter for the
1185 SEQGRP_SMS_SEND_FROM_MEM key sequence.
1186 */
1187 LOCAL BOOL ksd_seqSmsSendFromMem (USHORT inIdx,
1188 CHAR* inSeq,
1189 T_KSD_SEQGRP* outSeqGrp,
1190 CHAR** outRestSeq,
1191 T_KSD_SEQPARAM* outSeqParam)
1192 {
1193 TRACE_FUNCTION ("ksd_seqSmsSendFromMem ()");
1194
1195 *outSeqGrp = SEQGRP_SMS_SEND_FROM_MEM;
1196 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1197
1198 return TRUE;
1199 }
1200 #endif
1201
1202 #ifdef SMI
1203 /*
1204 +--------------------------------------------------------------------+
1205 | PROJECT : GSM-PS (6147) MODULE : KSD |
1206 | STATE : code ROUTINE : ksd_seqSmsWrite |
1207 +--------------------------------------------------------------------+
1208
1209 PURPOSE : This function sets the ouput parameter for the
1210 SEQGRP_SMS_WRITE key sequence.
1211 */
1212 LOCAL BOOL ksd_seqSmsWrite (USHORT inIdx,
1213 CHAR* inSeq,
1214 T_KSD_SEQGRP* outSeqGrp,
1215 CHAR** outRestSeq,
1216 T_KSD_SEQPARAM* outSeqParam)
1217 {
1218 TRACE_FUNCTION ("ksd_seqSmsWrite ()");
1219
1220 *outSeqGrp = SEQGRP_SMS_WRITE;
1221 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1222
1223 return TRUE;
1224 }
1225 #endif
1226
1227 #ifdef EM_MODE
1228 /*
1229 +--------------------------------------------------------------------+
1230 | PROJECT : GSM-PS (6147) MODULE : KSD |
1231 | STATE : code ROUTINE : ksd_em_mode |
1232 +--------------------------------------------------------------------+
1233
1234 PURPOSE : This function sets the ouput parameter for the
1235 SEQGRP_EM_MODE key sequence.
1236 */
1237 LOCAL BOOL ksd_em_mode (USHORT inIdx,
1238 CHAR* inSeq,
1239 T_KSD_SEQGRP* outSeqGrp,
1240 CHAR** outRestSeq,
1241 T_KSD_SEQPARAM* outSeqParam)
1242 {
1243 TRACE_FUNCTION ("ksd_em_mode ()");
1244
1245 *outSeqGrp = SEQGRP_EM_MODE;
1246 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1247
1248 return TRUE;
1249 }
1250 #endif
1251
1252 #ifdef SMI
1253 /*
1254 +--------------------------------------------------------------------+
1255 | PROJECT : GSM-PS (6147) MODULE : KSD |
1256 | STATE : code ROUTINE : ksd_seqSmsDelete |
1257 +--------------------------------------------------------------------+
1258
1259 PURPOSE : This function sets the ouput parameter for the
1260 SEQGRP_SMS_DELETE key sequence.
1261 */
1262 LOCAL BOOL ksd_seqSmsDelete (USHORT inIdx,
1263 CHAR* inSeq,
1264 T_KSD_SEQGRP* outSeqGrp,
1265 CHAR** outRestSeq,
1266 T_KSD_SEQPARAM* outSeqParam)
1267 {
1268 TRACE_FUNCTION ("ksd_seqSmsDelete ()");
1269
1270 *outSeqGrp = SEQGRP_SMS_DELETE;
1271 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1272
1273 return TRUE;
1274 }
1275 #endif
1276
1277 #ifdef SMI
1278 /*
1279 +--------------------------------------------------------------------+
1280 | PROJECT : GSM-PS (6147) MODULE : KSD |
1281 | STATE : code ROUTINE : ksd_seqSmsRead |
1282 +--------------------------------------------------------------------+
1283
1284 PURPOSE : This function sets the ouput parameter for the
1285 SEQGRP_SMS_READ key sequence.
1286 */
1287 LOCAL BOOL ksd_seqSmsRead (USHORT inIdx,
1288 CHAR* inSeq,
1289 T_KSD_SEQGRP* outSeqGrp,
1290 CHAR** outRestSeq,
1291 T_KSD_SEQPARAM* outSeqParam)
1292 {
1293 TRACE_FUNCTION ("ksd_seqSmsRead ()");
1294
1295 *outSeqGrp = SEQGRP_SMS_READ;
1296 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1297
1298 return TRUE;
1299 }
1300 #endif
1301
1302 #ifdef SMI
1303 /*
1304 +--------------------------------------------------------------------+
1305 | PROJECT : GSM-PS (6147) MODULE : KSD |
1306 | STATE : code ROUTINE : ksd_seqSmsList |
1307 +--------------------------------------------------------------------+
1308
1309 PURPOSE : This function sets the ouput parameter for the
1310 SEQGRP_SMS_LIST key sequence.
1311 */
1312 LOCAL BOOL ksd_seqSmsList (USHORT inIdx,
1313 CHAR* inSeq,
1314 T_KSD_SEQGRP* outSeqGrp,
1315 CHAR** outRestSeq,
1316 T_KSD_SEQPARAM* outSeqParam)
1317 {
1318 TRACE_FUNCTION ("ksd_seqSmsList ()");
1319
1320 *outSeqGrp = SEQGRP_SMS_LIST;
1321 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1322
1323 return TRUE;
1324 }
1325 #endif
1326
1327 #ifdef SMI
1328 /*
1329 +--------------------------------------------------------------------+
1330 | PROJECT : GSM-PS (6147) MODULE : KSD |
1331 | STATE : code ROUTINE : ksd_seqSmsReadSingle |
1332 +--------------------------------------------------------------------+
1333
1334 PURPOSE : This function sets the ouput parameter for the
1335 SEQGRP_SMS_READ_SINGLE key sequence.
1336 */
1337 LOCAL BOOL ksd_seqSmsReadSingle (USHORT inIdx,
1338 CHAR* inSeq,
1339 T_KSD_SEQGRP* outSeqGrp,
1340 CHAR** outRestSeq,
1341 T_KSD_SEQPARAM* outSeqParam)
1342 {
1343 TRACE_FUNCTION ("ksd_seqSmsReadSingle ()");
1344
1345 *outSeqGrp = SEQGRP_SMS_READ_SINGLE;
1346 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1347
1348 return TRUE;
1349 }
1350 #endif
1351
1352 /*
1353 +--------------------------------------------------------------------+
1354 | PROJECT : GSM-PS (6147) MODULE : KSD |
1355 | STATE : code ROUTINE : ksd_seqDial |
1356 +--------------------------------------------------------------------+
1357
1358 PURPOSE : This function sets the ouput parameter for the SEQGRP_DIAL
1359 key sequence.
1360 */
1361 LOCAL BOOL ksd_seqDial (USHORT inIdx,
1362 CHAR* inSeq,
1363 T_KSD_SEQGRP* outSeqGrp,
1364 CHAR** outRestSeq,
1365 T_KSD_SEQPARAM* outSeqParam)
1366 {
1367 USHORT lenWholeNumber = strlen (inSeq);
1368 USHORT lenDialNumber = lenWholeNumber;
1369
1370 TRACE_FUNCTION ("ksd_seqDial ()");
1371
1372 /*
1373 *-----------------------------------------------------------------
1374 * process type of call
1375 *-----------------------------------------------------------------
1376 */
1377 if (inSeq[lenDialNumber - 1] EQ DATA_CALL)
1378 {
1379 outSeqParam->dial.callType = D_TOC_Data;
1380 lenDialNumber--;
1381 }
1382 else
1383 outSeqParam->dial.callType = D_TOC_Voice;
1384
1385 outSeqParam->dial.cugCtrl = D_CUG_CTRL_NotPresent;
1386 outSeqParam->dial.clirOvrd = D_CLIR_OVRD_Default;
1387 outSeqParam->dial.number = inSeq;
1388 inSeq[lenDialNumber] = NULL_TERM;
1389
1390 *outSeqGrp = SEQGRP_DIAL;
1391 *outRestSeq = inSeq + lenWholeNumber;
1392
1393 return TRUE;
1394 }
1395
1396 /*
1397 +--------------------------------------------------------------------+
1398 | PROJECT : GSM-PS (6147) MODULE : KSD |
1399 | STATE : code ROUTINE : ksd_seqDialIdx |
1400 +--------------------------------------------------------------------+
1401
1402 PURPOSE : This function sets the ouput parameter for the
1403 SEQGRP_DIAL_IDX key sequence.
1404 */
1405 LOCAL BOOL ksd_seqDialIdx (USHORT inIdx,
1406 CHAR* inSeq,
1407 T_KSD_SEQGRP* outSeqGrp,
1408 CHAR** outRestSeq,
1409 T_KSD_SEQPARAM* outSeqParam)
1410 {
1411 BOOL isSuccess = FALSE;
1412 UBYTE i = 0;
1413 SHORT index = 0;
1414
1415 TRACE_FUNCTION ("ksd_seqDialIdx ()");
1416
1417 *outSeqGrp = SEQGRP_UNKNOWN;
1418 *outRestSeq = inSeq;
1419
1420 /* when operating in a US band (1900 or 850), "0" and "00" shall
1421 * be transmitted to the network as normal dialing numbers
1422 */
1423 if ( ksd_isBCDForUSBand(inSeq) )
1424 {
1425 return FALSE;
1426 }
1427
1428 while ( i < strlen ( inSeq ) AND inSeq[i] NEQ DIAL_IDX )
1429 {
1430 if ( inSeq[i] >= '0' AND inSeq[i] <= '9' )
1431 {
1432 index *= 10;
1433 index += inSeq[i] - '0';
1434 }
1435 else
1436 {
1437 return isSuccess;
1438 }
1439
1440 i++;
1441 }
1442
1443 if ( i > 0 AND
1444 i < 4 AND
1445 inSeq[i+1] EQ NULL_TERM AND
1446 inSeq[i] EQ DIAL_IDX )
1447 {
1448 *outSeqGrp = SEQGRP_DIAL_IDX;
1449 *outRestSeq = &inSeq[i+1];
1450
1451 outSeqParam->dialIdx.str = NULL;
1452 outSeqParam->dialIdx.mem = PB_STOR_NotPresent;
1453 outSeqParam->dialIdx.index = index;
1454 outSeqParam->dialIdx.clirOvrd = D_CLIR_OVRD_Default;
1455 outSeqParam->dialIdx.cugCtrl = D_CUG_CTRL_NotPresent;
1456 outSeqParam->dialIdx.callType = D_TOC_Voice;
1457
1458 isSuccess = TRUE;
1459 }
1460
1461 return isSuccess;
1462 }
1463
1464 /*
1465 +--------------------------------------------------------------------+
1466 | PROJECT : GSM-PS (6147) MODULE : KSD |
1467 | STATE : code ROUTINE : ksd_seqUssd |
1468 +--------------------------------------------------------------------+
1469
1470 PURPOSE : This function sets the ouput parameter for the
1471 SEQGRP_USSD key sequence.
1472 */
1473 LOCAL BOOL ksd_seqUssd (USHORT inIdx,
1474 CHAR* inSeq,
1475 T_KSD_SEQGRP* outSeqGrp,
1476 CHAR** outRestSeq,
1477 T_KSD_SEQPARAM* outSeqParam)
1478 {
1479 TRACE_FUNCTION ("ksd_seqUssd ()");
1480
1481 outSeqParam->ussd.ussd = (UBYTE *)inSeq;
1482
1483 *outSeqGrp = SEQGRP_USSD;
1484 *outRestSeq = inSeq + strlen (inSeq);
1485
1486 return TRUE;
1487 }
1488
1489 #ifdef SMI
1490 /*
1491 +--------------------------------------------------------------------+
1492 | PROJECT : GSM-PS (6147) MODULE : KSD |
1493 | STATE : code ROUTINE : ksd_seqSetAbbrDial |
1494 +--------------------------------------------------------------------+
1495
1496 PURPOSE : This function sets the ouput parameter for the
1497 SEQGRP_SET_ABBR_DIAL key sequence.
1498 */
1499 LOCAL BOOL ksd_seqSetAbbrDial (USHORT inIdx,
1500 CHAR* inSeq,
1501 T_KSD_SEQGRP* outSeqGrp,
1502 CHAR** outRestSeq,
1503 T_KSD_SEQPARAM* outSeqParam)
1504 {
1505 const USHORT siNum = 2;
1506 T_KSD_DCD_CPLE dcdCple[2];
1507 T_KSD_SIPARAM idxParam;
1508 T_KSD_SIPARAM dnParam;
1509 USHORT readChars;
1510 USHORT lenKeySeq = ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
1511 BOOL isSuccess = FALSE;
1512
1513 TRACE_FUNCTION ("ksd_seqSetAbbrDial ()");
1514
1515 dcdCple[0].type = SI_BYTE;
1516 dcdCple[0].param = &idxParam;
1517
1518 dcdCple[1].type = SI_CHAR_STAR;
1519 dcdCple[1].param = &dnParam;
1520
1521 *outSeqGrp = SEQGRP_SET_ABBR_DIAL;
1522
1523 if (ksd_extractSi (inSeq + lenKeySeq, siNum,
1524 &readChars, dcdCple) EQ TRUE)
1525 {
1526 outSeqParam->abbrDial.index = idxParam.siByte;
1527 outSeqParam->abbrDial.number = dnParam.siCharStar;
1528
1529 isSuccess = TRUE;
1530 }
1531
1532 *outRestSeq = inSeq + lenKeySeq + readChars;
1533
1534 return isSuccess;
1535 }
1536 #endif
1537
1538 /*
1539 +--------------------------------------------------------------------+
1540 | PROJECT : GSM-PS (6147) MODULE : KSD |
1541 | STATE : code ROUTINE : ksd_getCcfcFromDnBsT |
1542 +--------------------------------------------------------------------+
1543
1544 PURPOSE : This function extracts the parameters of the sAT_PlusCCFC
1545 function of the ACI out of the supplementary information.
1546
1547 <inIdx>: index of key sequence table
1548 <inSeq>: key sequence, to be decoded
1549 <outRestSeq>: rest key sequence, to be decoded by a
1550 further call to this function
1551 <outSeqParam>: sequence parameter
1552
1553 returns: TRUE if output parameters are valid,
1554 otherwise FALSE
1555 */
1556 LOCAL BOOL ksd_getCcfcFromDnBsT (USHORT inIdx,
1557 CHAR* inSeq,
1558 CHAR** outRestSeq,
1559 T_KSD_SEQPARAM* outSeqParam)
1560 {
1561 const USHORT siNum = 3;
1562 T_KSD_DCD_CPLE dcdCple[3];
1563 T_KSD_SIPARAM dnParam;
1564 T_KSD_SIPARAM bsParam;
1565 T_KSD_SIPARAM tParam;
1566 USHORT readChars;
1567 USHORT lenKeySeq = ksd_strlen (keySeqTable[inIdx].keySeq);
1568 USHORT lenSubaddr;
1569 BOOL international;
1570 BOOL isSuccess = FALSE;
1571
1572 TRACE_FUNCTION ("ksd_getCcfcFromDnBsT ()");
1573
1574 dcdCple[0].type = SI_CHAR_STAR;
1575 dcdCple[0].param = &dnParam;
1576 dnParam.siCharStar = NULL;
1577
1578 dcdCple[1].type = SI_UBYTE;
1579 dcdCple[1].param = &bsParam;
1580 bsParam.siUbyte = KSD_BS_None;
1581
1582 dcdCple[2].type = SI_UBYTE;
1583 dcdCple[2].param = &tParam;
1584 tParam.siUbyte = KSD_TIME_NONE;
1585
1586 if (ksd_extractSi (inSeq + lenKeySeq, siNum,
1587 &readChars, dcdCple) EQ TRUE)
1588 {
1589 CHAR* dn = dnParam.siCharStar;
1590 UBYTE bs = bsParam.siUbyte;
1591 UBYTE t = tParam.siUbyte;
1592
1593 /*
1594 *---------------------------------------------------------------
1595 * process dial number
1596 *---------------------------------------------------------------
1597 */
1598 utl_splitDialnumber ( dn,
1599 (CHAR**)&outSeqParam->cf.num,
1600 &international,
1601 (CHAR**)&outSeqParam->cf.sub,
1602 &lenSubaddr);
1603
1604 /*
1605 *---------------------------------------------------------------
1606 * process main address and type of main address
1607 *---------------------------------------------------------------
1608 */
1609 if (outSeqParam->cf.num EQ NULL)
1610 {
1611 outSeqParam->cf.ton = KSD_TON_Unknown;
1612 outSeqParam->cf.npi = KSD_NPI_Unknown;
1613 }
1614 else
1615 {
1616 outSeqParam->cf.ton = (international ? KSD_TON_International :
1617 KSD_TON_Unknown);
1618 outSeqParam->cf.npi = KSD_NPI_IsdnTelephony;
1619 }
1620
1621 /*
1622 *---------------------------------------------------------------
1623 * process subaddress and type of subaddress
1624 *---------------------------------------------------------------
1625 */
1626 if (outSeqParam->cf.sub EQ NULL)
1627 {
1628 outSeqParam->cf.tos = KSD_TOS_Nsap;
1629 outSeqParam->cf.oe = KSD_OE_Even;
1630 }
1631 else
1632 {
1633 outSeqParam->cf.tos = KSD_TOS_Nsap;
1634 outSeqParam->cf.oe = ((lenSubaddr % 2 EQ 0) ? KSD_OE_Even :
1635 KSD_OE_Odd);
1636 }
1637
1638 /*
1639 *---------------------------------------------------------------
1640 * process class and time
1641 *---------------------------------------------------------------
1642 */
1643 outSeqParam->cf.bsCd = bs;
1644 outSeqParam->cf.time = t;
1645
1646 isSuccess = TRUE;
1647 }
1648
1649 *outRestSeq = inSeq + lenKeySeq + readChars;
1650
1651 return isSuccess;
1652 }
1653
1654 /*
1655 +--------------------------------------------------------------------+
1656 | PROJECT : GSM-PS (6147) MODULE : KSD |
1657 | STATE : code ROUTINE : ksd_getCcfcFromDnBs |
1658 +--------------------------------------------------------------------+
1659
1660 PURPOSE : This function extracts the parameters of the sAT_PlusCCFC
1661 function of the ACI out of the supplementary information.
1662
1663 <inIdx>: index of key sequence table
1664 <inSeq>: key sequence, to be decoded
1665 <outRestSeq>: rest key sequence, to be decoded by a
1666 further call to this function
1667 <outSeqParam>: sequence parameter
1668
1669 returns: TRUE if output parameters are valid,
1670 otherwise FALSE
1671 */
1672 LOCAL BOOL ksd_getCcfcFromDnBs (USHORT inIdx,
1673 CHAR* inSeq,
1674 CHAR** outRestSeq,
1675 T_KSD_SEQPARAM* outSeqParam)
1676 {
1677 const USHORT siNum = 2;
1678 T_KSD_DCD_CPLE dcdCple[2];
1679 T_KSD_SIPARAM dnParam;
1680 T_KSD_SIPARAM bsParam;
1681 USHORT readChars;
1682 USHORT lenKeySeq = ksd_strlen (keySeqTable[inIdx].keySeq);
1683 USHORT lenSubaddr;
1684 BOOL international;
1685 BOOL isSuccess = FALSE;
1686
1687 TRACE_FUNCTION ("ksd_getCcfcFromDnBs ()");
1688
1689 dcdCple[0].type = SI_CHAR_STAR;
1690 dcdCple[0].param = &dnParam;
1691 dnParam.siCharStar = NULL;
1692
1693 dcdCple[1].type = SI_UBYTE;
1694 dcdCple[1].param = &bsParam;
1695 bsParam.siUbyte = KSD_BS_None;
1696
1697 if (ksd_extractSi (inSeq + lenKeySeq, siNum,
1698 &readChars, dcdCple) EQ TRUE)
1699 {
1700 CHAR* dn = dnParam.siCharStar;
1701 UBYTE bs = bsParam.siUbyte;
1702
1703 /*
1704 *---------------------------------------------------------------
1705 * process dial number
1706 *---------------------------------------------------------------
1707 */
1708 utl_splitDialnumber ( dn,
1709 (CHAR**)&outSeqParam->cf.num,
1710 &international,
1711 (CHAR**)&outSeqParam->cf.sub,
1712 &lenSubaddr);
1713
1714 /*
1715 *---------------------------------------------------------------
1716 * process main address and type of main address
1717 *---------------------------------------------------------------
1718 */
1719 if (outSeqParam->cf.num EQ NULL)
1720 {
1721 outSeqParam->cf.ton = KSD_TON_Unknown;
1722 outSeqParam->cf.npi = KSD_NPI_Unknown;
1723 }
1724 else
1725 {
1726 outSeqParam->cf.ton = (international ? KSD_TON_International :
1727 KSD_TON_Unknown);
1728 outSeqParam->cf.npi = KSD_NPI_IsdnTelephony;
1729 }
1730
1731 /*
1732 *---------------------------------------------------------------
1733 * process subaddress and type of subaddress
1734 *---------------------------------------------------------------
1735 */
1736 if (outSeqParam->cf.sub EQ NULL)
1737 {
1738 outSeqParam->cf.tos = KSD_TOS_Nsap;
1739 outSeqParam->cf.oe = KSD_OE_Even;
1740 }
1741 else
1742 {
1743 outSeqParam->cf.tos = KSD_TOS_Nsap;
1744 outSeqParam->cf.oe = ((lenSubaddr % 2 EQ 0) ? KSD_OE_Even :
1745 KSD_OE_Odd);
1746 }
1747
1748 /*
1749 *---------------------------------------------------------------
1750 * process class and time
1751 *---------------------------------------------------------------
1752 */
1753 outSeqParam->cf.bsCd = bs;
1754 outSeqParam->cf.time = KSD_TIME_NONE;
1755
1756 isSuccess = TRUE;
1757 }
1758
1759 *outRestSeq = inSeq + lenKeySeq + readChars;
1760
1761 return isSuccess;
1762 }
1763
1764 /*
1765 +--------------------------------------------------------------------+
1766 | PROJECT : GSM-PS (6147) MODULE : KSD |
1767 | STATE : code ROUTINE : ksd_seqActAllCf |
1768 +--------------------------------------------------------------------+
1769
1770 PURPOSE : This function sets the ouput parameter for the
1771 SEQGRP_CF, KSD_OP_ACT, KSD_SS_ALL_FWSS key sequence.
1772 */
1773 LOCAL BOOL ksd_seqActAllCf (USHORT inIdx,
1774 CHAR* inSeq,
1775 T_KSD_SEQGRP* outSeqGrp,
1776 CHAR** outRestSeq,
1777 T_KSD_SEQPARAM* outSeqParam)
1778 {
1779 BOOL result;
1780
1781 TRACE_FUNCTION ("ksd_seqActAllCf ()");
1782
1783 result = ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
1784
1785 if ( outSeqParam->cf.num EQ NULL )
1786 outSeqParam->cf.opCd = KSD_OP_ACT;
1787 else
1788 outSeqParam->cf.opCd = KSD_OP_REG;
1789
1790 outSeqParam->cf.ssCd = KSD_SS_ALL_FWSS;
1791
1792 *outSeqGrp = SEQGRP_CF;
1793
1794 return result;
1795 }
1796
1797 /*
1798 +--------------------------------------------------------------------+
1799 | PROJECT : GSM-PS (6147) MODULE : KSD |
1800 | STATE : code ROUTINE : ksd_seqDeactAllCf |
1801 +--------------------------------------------------------------------+
1802
1803 PURPOSE : This function sets the ouput parameter for the
1804 SEQGRP_CF, KSD_OP_DEACT, KSD_SS_ALL_FWSS key sequence.
1805 */
1806 LOCAL BOOL ksd_seqDeactAllCf (USHORT inIdx,
1807 CHAR* inSeq,
1808 T_KSD_SEQGRP* outSeqGrp,
1809 CHAR** outRestSeq,
1810 T_KSD_SEQPARAM* outSeqParam)
1811 {
1812
1813 TRACE_FUNCTION ("ksd_seqDeactAllCf ()");
1814
1815 outSeqParam->cf.opCd = KSD_OP_DEACT;
1816 outSeqParam->cf.ssCd = KSD_SS_ALL_FWSS;
1817
1818 *outSeqGrp = SEQGRP_CF;
1819
1820 return ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
1821 }
1822
1823 /*
1824 +--------------------------------------------------------------------+
1825 | PROJECT : GSM-PS (6147) MODULE : KSD |
1826 | STATE : code ROUTINE : ksd_seqRegAllCf |
1827 +--------------------------------------------------------------------+
1828
1829 PURPOSE : This function sets the ouput parameter for the
1830 SEQGRP_CF, KSD_OP_REG, KSD_SS_ALL_FWSS key sequence.
1831 */
1832 LOCAL BOOL ksd_seqRegAllCf (USHORT inIdx,
1833 CHAR* inSeq,
1834 T_KSD_SEQGRP* outSeqGrp,
1835 CHAR** outRestSeq,
1836 T_KSD_SEQPARAM* outSeqParam)
1837 {
1838 TRACE_FUNCTION ("ksd_seqRegAllCf ()");
1839
1840 outSeqParam->cf.opCd = KSD_OP_REG;
1841 outSeqParam->cf.ssCd = KSD_SS_ALL_FWSS;
1842
1843 *outSeqGrp = SEQGRP_CF;
1844
1845 return ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
1846 }
1847
1848 /*
1849 +--------------------------------------------------------------------+
1850 | PROJECT : GSM-PS (6147) MODULE : KSD |
1851 | STATE : code ROUTINE : ksd_seqEraseAllCf |
1852 +--------------------------------------------------------------------+
1853
1854 PURPOSE : This function sets the ouput parameter for the
1855 SEQGRP_CF, KSD_OP_ERS, KSD_SS_ALL_FWSS key sequence.
1856 */
1857 LOCAL BOOL ksd_seqEraseAllCf (USHORT inIdx,
1858 CHAR* inSeq,
1859 T_KSD_SEQGRP* outSeqGrp,
1860 CHAR** outRestSeq,
1861 T_KSD_SEQPARAM* outSeqParam)
1862 {
1863 TRACE_FUNCTION ("ksd_seqEraseAllCf ()");
1864
1865 outSeqParam->cf.opCd = KSD_OP_ERS;
1866 outSeqParam->cf.ssCd = KSD_SS_ALL_FWSS;
1867
1868 *outSeqGrp = SEQGRP_CF;
1869
1870 return ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
1871 }
1872
1873 /*
1874 +--------------------------------------------------------------------+
1875 | PROJECT : GSM-PS (6147) MODULE : KSD |
1876 | STATE : code ROUTINE : ksd_seqIntrgtAllCf |
1877 +--------------------------------------------------------------------+
1878
1879 PURPOSE : This function sets the ouput parameter for the
1880 SEQGRP_CF, KSD_OP_IRGT, KSD_SS_ALL_FWSS key sequence.
1881 */
1882 LOCAL BOOL ksd_seqIntrgtAllCf (USHORT inIdx,
1883 CHAR* inSeq,
1884 T_KSD_SEQGRP* outSeqGrp,
1885 CHAR** outRestSeq,
1886 T_KSD_SEQPARAM* outSeqParam)
1887 {
1888 TRACE_FUNCTION ("ksd_seqIntrgtAllCf ()");
1889
1890 outSeqParam->cf.opCd = KSD_OP_IRGT;
1891 outSeqParam->cf.ssCd = KSD_SS_ALL_FWSS;
1892
1893 *outSeqGrp = SEQGRP_CF;
1894
1895 return ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
1896 }
1897
1898 /*
1899 +--------------------------------------------------------------------+
1900 | PROJECT : GSM-PS (6147) MODULE : KSD |
1901 | STATE : code ROUTINE : ksd_seqActAllCondCf |
1902 +--------------------------------------------------------------------+
1903
1904 PURPOSE : This function sets the ouput parameter for the
1905 SEQGRP_CF, KSD_OP_ACT, KSD_SS_ALL_CFWSS key sequence.
1906 */
1907 LOCAL BOOL ksd_seqActAllCondCf (USHORT inIdx,
1908 CHAR* inSeq,
1909 T_KSD_SEQGRP* outSeqGrp,
1910 CHAR** outRestSeq,
1911 T_KSD_SEQPARAM* outSeqParam)
1912 {
1913 BOOL result;
1914
1915 TRACE_FUNCTION ("ksd_seqActAllCondCf ()");
1916
1917 result = ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
1918
1919 if ( outSeqParam->cf.num EQ NULL )
1920 outSeqParam->cf.opCd = KSD_OP_ACT;
1921 else
1922 outSeqParam->cf.opCd = KSD_OP_REG;
1923
1924 outSeqParam->cf.ssCd = KSD_SS_ALL_CFWSS;
1925
1926 *outSeqGrp = SEQGRP_CF;
1927
1928 return result;
1929 }
1930
1931 /*
1932 +--------------------------------------------------------------------+
1933 | PROJECT : GSM-PS (6147) MODULE : KSD |
1934 | STATE : code ROUTINE : ksd_seqDeactAllCondCf |
1935 +--------------------------------------------------------------------+
1936
1937 PURPOSE : This function sets the ouput parameter for the
1938 SEQGRP_CF, KSD_OP_DEACT, KSD_SS_ALL_CFWSS key sequence.
1939 */
1940 LOCAL BOOL ksd_seqDeactAllCondCf (USHORT inIdx,
1941 CHAR* inSeq,
1942 T_KSD_SEQGRP* outSeqGrp,
1943 CHAR** outRestSeq,
1944 T_KSD_SEQPARAM* outSeqParam)
1945 {
1946 TRACE_FUNCTION ("ksd_seqDeactAllCondCf ()");
1947
1948 outSeqParam->cf.opCd = KSD_OP_DEACT;
1949 outSeqParam->cf.ssCd = KSD_SS_ALL_CFWSS;
1950
1951 *outSeqGrp = SEQGRP_CF;
1952
1953 return ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
1954 }
1955
1956 /*
1957 +--------------------------------------------------------------------+
1958 | PROJECT : GSM-PS (6147) MODULE : KSD |
1959 | STATE : code ROUTINE : ksd_seqRegAllCondCf |
1960 +--------------------------------------------------------------------+
1961
1962 PURPOSE : This function sets the ouput parameter for the
1963 SEQGRP_CF, KSD_OP_REG, KSD_SS_ALL_CFWSS key sequence.
1964 */
1965 LOCAL BOOL ksd_seqRegAllCondCf (USHORT inIdx,
1966 CHAR* inSeq,
1967 T_KSD_SEQGRP* outSeqGrp,
1968 CHAR** outRestSeq,
1969 T_KSD_SEQPARAM* outSeqParam)
1970 {
1971 TRACE_FUNCTION ("ksd_seqRegAllCondCf ()");
1972
1973 outSeqParam->cf.opCd = KSD_OP_REG;
1974 outSeqParam->cf.ssCd = KSD_SS_ALL_CFWSS;
1975
1976 *outSeqGrp = SEQGRP_CF;
1977
1978 return ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
1979 }
1980
1981 /*
1982 +--------------------------------------------------------------------+
1983 | PROJECT : GSM-PS (6147) MODULE : KSD |
1984 | STATE : code ROUTINE : ksd_seqEraseAllCondCf |
1985 +--------------------------------------------------------------------+
1986
1987 PURPOSE : This function sets the ouput parameter for the
1988 SEQGRP_CF, KSD_OP_ERS, KSD_SS_ALL_CFWSS key sequence.
1989 */
1990 LOCAL BOOL ksd_seqEraseAllCondCf (USHORT inIdx,
1991 CHAR* inSeq,
1992 T_KSD_SEQGRP* outSeqGrp,
1993 CHAR** outRestSeq,
1994 T_KSD_SEQPARAM* outSeqParam)
1995 {
1996 TRACE_FUNCTION ("ksd_seqEraseAllCondCf ()");
1997
1998 outSeqParam->cf.opCd = KSD_OP_ERS;
1999 outSeqParam->cf.ssCd = KSD_SS_ALL_CFWSS;
2000
2001 *outSeqGrp = SEQGRP_CF;
2002
2003 return ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
2004 }
2005
2006 /*
2007 +--------------------------------------------------------------------+
2008 | PROJECT : GSM-PS (6147) MODULE : KSD |
2009 | STATE : code ROUTINE : ksd_seqIntrgtAllCondCf |
2010 +--------------------------------------------------------------------+
2011
2012 PURPOSE : This function sets the ouput parameter for the
2013 SEQGRP_CF, KSD_OP_IRGT, KSD_SS_ALL_CFWSS key sequence.
2014 */
2015 LOCAL BOOL ksd_seqIntrgtAllCondCf (USHORT inIdx,
2016 CHAR* inSeq,
2017 T_KSD_SEQGRP* outSeqGrp,
2018 CHAR** outRestSeq,
2019 T_KSD_SEQPARAM* outSeqParam)
2020 {
2021 TRACE_FUNCTION ("ksd_seqIntrgtAllCondCf ()");
2022
2023 outSeqParam->cf.opCd = KSD_OP_IRGT;
2024 outSeqParam->cf.ssCd = KSD_SS_ALL_CFWSS;
2025
2026 *outSeqGrp = SEQGRP_CF;
2027
2028 return ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
2029 }
2030
2031 /*
2032 +--------------------------------------------------------------------+
2033 | PROJECT : GSM-PS (6147) MODULE : KSD |
2034 | STATE : code ROUTINE : ksd_seqActNoRepCf |
2035 +--------------------------------------------------------------------+
2036
2037 PURPOSE : This function sets the ouput parameter for the
2038 SEQGRP_CF, KSD_OP_ACT, KSD_SS_CFNRY key sequence.
2039 */
2040 LOCAL BOOL ksd_seqActNoRepCf (USHORT inIdx,
2041 CHAR* inSeq,
2042 T_KSD_SEQGRP* outSeqGrp,
2043 CHAR** outRestSeq,
2044 T_KSD_SEQPARAM* outSeqParam)
2045 {
2046 BOOL result;
2047
2048 TRACE_FUNCTION ("ksd_seqActNoRepCf ()");
2049
2050 result = ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
2051
2052 if ( outSeqParam->cf.num EQ NULL )
2053 outSeqParam->cf.opCd = KSD_OP_ACT;
2054 else
2055 outSeqParam->cf.opCd = KSD_OP_REG;
2056
2057 outSeqParam->cf.ssCd = KSD_SS_CFNRY;
2058
2059 *outSeqGrp = SEQGRP_CF;
2060
2061 return result;
2062 }
2063
2064 /*
2065 +--------------------------------------------------------------------+
2066 | PROJECT : GSM-PS (6147) MODULE : KSD |
2067 | STATE : code ROUTINE : ksd_seqDeactNoRepCf |
2068 +--------------------------------------------------------------------+
2069
2070 PURPOSE : This function sets the ouput parameter for the
2071 SEQGRP_CF, KSD_OP_DEACT, KSD_SS_CFNRY key sequence.
2072 */
2073 LOCAL BOOL ksd_seqDeactNoRepCf (USHORT inIdx,
2074 CHAR* inSeq,
2075 T_KSD_SEQGRP* outSeqGrp,
2076 CHAR** outRestSeq,
2077 T_KSD_SEQPARAM* outSeqParam)
2078 {
2079 TRACE_FUNCTION ("ksd_seqDeactNoRepCf ()");
2080
2081 outSeqParam->cf.opCd = KSD_OP_DEACT;
2082 outSeqParam->cf.ssCd = KSD_SS_CFNRY;
2083
2084 *outSeqGrp = SEQGRP_CF;
2085
2086 return ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
2087 }
2088
2089 /*
2090 +--------------------------------------------------------------------+
2091 | PROJECT : GSM-PS (6147) MODULE : KSD |
2092 | STATE : code ROUTINE : ksd_seqRegNoRepCf |
2093 +--------------------------------------------------------------------+
2094
2095 PURPOSE : This function sets the ouput parameter for the
2096 SEQGRP_CF, KSD_OP_REG, KSD_SS_CFNRY key sequence.
2097 */
2098 LOCAL BOOL ksd_seqRegNoRepCf (USHORT inIdx,
2099 CHAR* inSeq,
2100 T_KSD_SEQGRP* outSeqGrp,
2101 CHAR** outRestSeq,
2102 T_KSD_SEQPARAM* outSeqParam)
2103 {
2104 //TISH, patch for OMAPS00124821
2105 //start
2106 #if 0
2107 TRACE_FUNCTION ("ksd_seqRegNoRepCf ()");
2108
2109 outSeqParam->cf.opCd = KSD_OP_REG;
2110 outSeqParam->cf.ssCd = KSD_SS_CFNRY;
2111
2112 *outSeqGrp = SEQGRP_CF;
2113
2114 return ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
2115 #else
2116 BOOL result;
2117 char *tempInSeq;
2118 TRACE_FUNCTION ("ksd_seqRegNoRepCf ()");
2119 MALLOC(tempInSeq,strlen(inSeq)+1);
2120 strcpy(tempInSeq,inSeq);
2121 result=ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
2122 if (result==TRUE)
2123 {
2124 //TISH patch for OMAPS00129224
2125 //start
2126 // if (outSeqParam->cf.time>30 || outSeqParam->cf.time<5)
2127 if ((outSeqParam->cf.time != KSD_TIME_NONE) && (outSeqParam->cf.time>30 || outSeqParam->cf.time<5))
2128 //end
2129 {
2130 memset(&(outSeqParam->cf),0,sizeof(T_ACI_KSD_CF_PRM));
2131 strcpy(inSeq,tempInSeq);
2132 result = ksd_seqUssd (inIdx,
2133 inSeq,
2134 outSeqGrp,
2135 outRestSeq,
2136 outSeqParam);
2137 }
2138 else
2139 {
2140 outSeqParam->cf.opCd = KSD_OP_REG;
2141 outSeqParam->cf.ssCd = KSD_SS_CFNRY;
2142 *outSeqGrp = SEQGRP_CF;
2143 }
2144 }
2145 MFREE(tempInSeq);
2146 return result;
2147 #endif
2148 //end
2149 }
2150
2151 /*
2152 +--------------------------------------------------------------------+
2153 | PROJECT : GSM-PS (6147) MODULE : KSD |
2154 | STATE : code ROUTINE : ksd_seqEraseNoRepCf |
2155 +--------------------------------------------------------------------+
2156
2157 PURPOSE : This function sets the ouput parameter for the
2158 SEQGRP_CF, KSD_OP_ERS, KSD_SS_CFNRY key sequence.
2159 */
2160 LOCAL BOOL ksd_seqEraseNoRepCf (USHORT inIdx,
2161 CHAR* inSeq,
2162 T_KSD_SEQGRP* outSeqGrp,
2163 CHAR** outRestSeq,
2164 T_KSD_SEQPARAM* outSeqParam)
2165 {
2166 TRACE_FUNCTION ("ksd_seqEraseNoRepCf ()");
2167
2168 outSeqParam->cf.opCd = KSD_OP_ERS;
2169 outSeqParam->cf.ssCd = KSD_SS_CFNRY;
2170
2171 *outSeqGrp = SEQGRP_CF;
2172
2173 return ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
2174 }
2175
2176 /*
2177 +--------------------------------------------------------------------+
2178 | PROJECT : GSM-PS (6147) MODULE : KSD |
2179 | STATE : code ROUTINE : ksd_seqIntrgtNoRepCf |
2180 +--------------------------------------------------------------------+
2181
2182 PURPOSE : This function sets the ouput parameter for the
2183 SEQGRP_CF, KSD_OP_IRGT, KSD_SS_CFNRY key sequence.
2184 */
2185 LOCAL BOOL ksd_seqIntrgtNoRepCf (USHORT inIdx,
2186 CHAR* inSeq,
2187 T_KSD_SEQGRP* outSeqGrp,
2188 CHAR** outRestSeq,
2189 T_KSD_SEQPARAM* outSeqParam)
2190 {
2191 TRACE_FUNCTION ("ksd_seqIntrgtNoRepCf ()");
2192
2193 outSeqParam->cf.opCd = KSD_OP_IRGT;
2194 outSeqParam->cf.ssCd = KSD_SS_CFNRY;
2195
2196 *outSeqGrp = SEQGRP_CF;
2197
2198 return ksd_getCcfcFromDnBsT (inIdx, inSeq, outRestSeq, outSeqParam);
2199 }
2200
2201 /*
2202 +--------------------------------------------------------------------+
2203 | PROJECT : GSM-PS (6147) MODULE : KSD |
2204 | STATE : code ROUTINE : ksd_seqActUncondCf |
2205 +--------------------------------------------------------------------+
2206
2207 PURPOSE : This function sets the ouput parameter for the
2208 SEQGRP_CF, KSD_OP_ACT, KSD_SS_CFU key sequence.
2209 */
2210 LOCAL BOOL ksd_seqActUncondCf (USHORT inIdx,
2211 CHAR* inSeq,
2212 T_KSD_SEQGRP* outSeqGrp,
2213 CHAR** outRestSeq,
2214 T_KSD_SEQPARAM* outSeqParam)
2215 {
2216 BOOL result;
2217
2218 TRACE_FUNCTION ("ksd_seqActUncondCf ()");
2219
2220 result = ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2221
2222 if ( outSeqParam->cf.num EQ NULL )
2223 outSeqParam->cf.opCd = KSD_OP_ACT;
2224 else
2225 outSeqParam->cf.opCd = KSD_OP_REG;
2226
2227 outSeqParam->cf.ssCd = KSD_SS_CFU;
2228
2229 *outSeqGrp = SEQGRP_CF;
2230
2231 return result;
2232 }
2233
2234 /*
2235 +--------------------------------------------------------------------+
2236 | PROJECT : GSM-PS (6147) MODULE : KSD |
2237 | STATE : code ROUTINE : ksd_seqDeactUncondCf |
2238 +--------------------------------------------------------------------+
2239
2240 PURPOSE : This function sets the ouput parameter for the
2241 SEQGRP_CF, KSD_OP_DEACT, KSD_SS_CFU key sequence.
2242 */
2243 LOCAL BOOL ksd_seqDeactUncondCf (USHORT inIdx,
2244 CHAR* inSeq,
2245 T_KSD_SEQGRP* outSeqGrp,
2246 CHAR** outRestSeq,
2247 T_KSD_SEQPARAM* outSeqParam)
2248 {
2249 TRACE_FUNCTION ("ksd_seqDeactUncondCf ()");
2250
2251 outSeqParam->cf.opCd = KSD_OP_DEACT;
2252 outSeqParam->cf.ssCd = KSD_SS_CFU;
2253
2254 *outSeqGrp = SEQGRP_CF;
2255
2256 return ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2257 }
2258
2259 /*
2260 +--------------------------------------------------------------------+
2261 | PROJECT : GSM-PS (6147) MODULE : KSD |
2262 | STATE : code ROUTINE : ksd_seqRegUncondCf |
2263 +--------------------------------------------------------------------+
2264
2265 PURPOSE : This function sets the ouput parameter for the
2266 SEQGRP_CF, KSD_OP_REG, KSD_SS_CFU key sequence.
2267 */
2268 LOCAL BOOL ksd_seqRegUncondCf (USHORT inIdx,
2269 CHAR* inSeq,
2270 T_KSD_SEQGRP* outSeqGrp,
2271 CHAR** outRestSeq,
2272 T_KSD_SEQPARAM* outSeqParam)
2273 {
2274 TRACE_FUNCTION ("ksd_seqRegUncondCf ()");
2275
2276 outSeqParam->cf.opCd = KSD_OP_REG;
2277 outSeqParam->cf.ssCd = KSD_SS_CFU;
2278
2279 *outSeqGrp = SEQGRP_CF;
2280
2281 return ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2282 }
2283
2284 /*
2285 +--------------------------------------------------------------------+
2286 | PROJECT : GSM-PS (6147) MODULE : KSD |
2287 | STATE : code ROUTINE : ksd_seqEraseUncondCf |
2288 +--------------------------------------------------------------------+
2289
2290 PURPOSE : This function sets the ouput parameter for the
2291 SEQGRP_CF, KSD_OP_ERS, KSD_SS_CFU key sequence.
2292 */
2293 LOCAL BOOL ksd_seqEraseUncondCf (USHORT inIdx,
2294 CHAR* inSeq,
2295 T_KSD_SEQGRP* outSeqGrp,
2296 CHAR** outRestSeq,
2297 T_KSD_SEQPARAM* outSeqParam)
2298 {
2299 TRACE_FUNCTION ("ksd_seqEraseUncondCf ()");
2300
2301 outSeqParam->cf.opCd = KSD_OP_ERS;
2302 outSeqParam->cf.ssCd = KSD_SS_CFU;
2303
2304 *outSeqGrp = SEQGRP_CF;
2305
2306 return ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2307 }
2308
2309 /*
2310 +--------------------------------------------------------------------+
2311 | PROJECT : GSM-PS (6147) MODULE : KSD |
2312 | STATE : code ROUTINE : ksd_seqIntrgtUncondCf |
2313 +--------------------------------------------------------------------+
2314
2315 PURPOSE : This function sets the ouput parameter for the
2316 SEQGRP_CF, KSD_OP_IRGT, KSD_SS_CFU key sequence.
2317 */
2318 LOCAL BOOL ksd_seqIntrgtUncondCf (USHORT inIdx,
2319 CHAR* inSeq,
2320 T_KSD_SEQGRP* outSeqGrp,
2321 CHAR** outRestSeq,
2322 T_KSD_SEQPARAM* outSeqParam)
2323 {
2324 TRACE_FUNCTION ("ksd_seqIntrgtUncondCf ()");
2325
2326 outSeqParam->cf.opCd = KSD_OP_IRGT;
2327 outSeqParam->cf.ssCd = KSD_SS_CFU;
2328
2329 *outSeqGrp = SEQGRP_CF;
2330
2331 return ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2332 }
2333
2334 /*
2335 +--------------------------------------------------------------------+
2336 | PROJECT : GSM-PS (6147) MODULE : KSD |
2337 | STATE : code ROUTINE : ksd_seqActBusyCf |
2338 +--------------------------------------------------------------------+
2339
2340 PURPOSE : This function sets the ouput parameter for the
2341 SEQGRP_CF, KSD_OP_ACT, KSD_SS_CFB key sequence.
2342 */
2343 LOCAL BOOL ksd_seqActBusyCf (USHORT inIdx,
2344 CHAR* inSeq,
2345 T_KSD_SEQGRP* outSeqGrp,
2346 CHAR** outRestSeq,
2347 T_KSD_SEQPARAM* outSeqParam)
2348 {
2349 BOOL result;
2350
2351 TRACE_FUNCTION ("ksd_seqActBusyCf ()");
2352
2353 result = ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2354
2355 if ( outSeqParam->cf.num EQ NULL )
2356 outSeqParam->cf.opCd = KSD_OP_ACT;
2357 else
2358 outSeqParam->cf.opCd = KSD_OP_REG;
2359
2360 outSeqParam->cf.ssCd = KSD_SS_CFB;
2361
2362 *outSeqGrp = SEQGRP_CF;
2363
2364 return result;
2365 }
2366
2367 /*
2368 +--------------------------------------------------------------------+
2369 | PROJECT : GSM-PS (6147) MODULE : KSD |
2370 | STATE : code ROUTINE : ksd_seqDeactBusyCf |
2371 +--------------------------------------------------------------------+
2372
2373 PURPOSE : This function sets the ouput parameter for the
2374 SEQGRP_CF, KSD_OP_DEACT, KSD_SS_CFB key sequence.
2375 */
2376 LOCAL BOOL ksd_seqDeactBusyCf (USHORT inIdx,
2377 CHAR* inSeq,
2378 T_KSD_SEQGRP* outSeqGrp,
2379 CHAR** outRestSeq,
2380 T_KSD_SEQPARAM* outSeqParam)
2381 {
2382 TRACE_FUNCTION ("ksd_seqDeactBusyCf ()");
2383
2384 outSeqParam->cf.opCd = KSD_OP_DEACT;
2385 outSeqParam->cf.ssCd = KSD_SS_CFB;
2386
2387 *outSeqGrp = SEQGRP_CF;
2388
2389 return ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2390 }
2391
2392 /*
2393 +--------------------------------------------------------------------+
2394 | PROJECT : GSM-PS (6147) MODULE : KSD |
2395 | STATE : code ROUTINE : ksd_seqRegBusyCf |
2396 +--------------------------------------------------------------------+
2397
2398 PURPOSE : This function sets the ouput parameter for the
2399 SEQGRP_CF, KSD_OP_REG, KSD_SS_CFB key sequence.
2400 */
2401 LOCAL BOOL ksd_seqRegBusyCf (USHORT inIdx,
2402 CHAR* inSeq,
2403 T_KSD_SEQGRP* outSeqGrp,
2404 CHAR** outRestSeq,
2405 T_KSD_SEQPARAM* outSeqParam)
2406 {
2407 TRACE_FUNCTION ("ksd_seqRegBusyCf ()");
2408
2409 outSeqParam->cf.opCd = KSD_OP_REG;
2410 outSeqParam->cf.ssCd = KSD_SS_CFB;
2411
2412 *outSeqGrp = SEQGRP_CF;
2413
2414 return ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2415 }
2416
2417 /*
2418 +--------------------------------------------------------------------+
2419 | PROJECT : GSM-PS (6147) MODULE : KSD |
2420 | STATE : code ROUTINE : ksd_seqEraseBusyCf |
2421 +--------------------------------------------------------------------+
2422
2423 PURPOSE : This function sets the ouput parameter for the
2424 SEQGRP_CF, KSD_OP_ERS, KSD_SS_CFB key sequence.
2425 */
2426 LOCAL BOOL ksd_seqEraseBusyCf (USHORT inIdx,
2427 CHAR* inSeq,
2428 T_KSD_SEQGRP* outSeqGrp,
2429 CHAR** outRestSeq,
2430 T_KSD_SEQPARAM* outSeqParam)
2431 {
2432 TRACE_FUNCTION ("ksd_seqEraseBusyCf ()");
2433
2434 outSeqParam->cf.opCd = KSD_OP_ERS;
2435 outSeqParam->cf.ssCd = KSD_SS_CFB;
2436
2437 *outSeqGrp = SEQGRP_CF;
2438
2439 return ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2440 }
2441
2442 /*
2443 +--------------------------------------------------------------------+
2444 | PROJECT : GSM-PS (6147) MODULE : KSD |
2445 | STATE : code ROUTINE : ksd_seqIntrgtBusyCf |
2446 +--------------------------------------------------------------------+
2447
2448 PURPOSE : This function sets the ouput parameter for the
2449 SEQGRP_CF, KSD_OP_IRGT, KSD_SS_CFB key sequence.
2450 */
2451 LOCAL BOOL ksd_seqIntrgtBusyCf (USHORT inIdx,
2452 CHAR* inSeq,
2453 T_KSD_SEQGRP* outSeqGrp,
2454 CHAR** outRestSeq,
2455 T_KSD_SEQPARAM* outSeqParam)
2456 {
2457 TRACE_FUNCTION ("ksd_seqIntrgtBusyCf ()");
2458
2459 outSeqParam->cf.opCd = KSD_OP_IRGT;
2460 outSeqParam->cf.ssCd = KSD_SS_CFB;
2461
2462 *outSeqGrp = SEQGRP_CF;
2463
2464 return ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2465 }
2466
2467 /*
2468 +--------------------------------------------------------------------+
2469 | PROJECT : GSM-PS (6147) MODULE : KSD |
2470 | STATE : code ROUTINE : ksd_seqActNotReachCf |
2471 +--------------------------------------------------------------------+
2472
2473 PURPOSE : This function sets the ouput parameter for the
2474 SEQGRP_CF, KSD_OP_ACT, KSD_SS_CFNRC key sequence.
2475 */
2476 LOCAL BOOL ksd_seqActNotReachCf (USHORT inIdx,
2477 CHAR* inSeq,
2478 T_KSD_SEQGRP* outSeqGrp,
2479 CHAR** outRestSeq,
2480 T_KSD_SEQPARAM* outSeqParam)
2481 {
2482 BOOL result;
2483
2484 TRACE_FUNCTION ("ksd_seqActNotReachCf ()");
2485
2486 result = ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2487
2488 if ( outSeqParam->cf.num EQ NULL )
2489 outSeqParam->cf.opCd = KSD_OP_ACT;
2490 else
2491 outSeqParam->cf.opCd = KSD_OP_REG;
2492
2493 outSeqParam->cf.ssCd = KSD_SS_CFNRC;
2494
2495 *outSeqGrp = SEQGRP_CF;
2496
2497 return result;
2498 }
2499
2500 /*
2501 +--------------------------------------------------------------------+
2502 | PROJECT : GSM-PS (6147) MODULE : KSD |
2503 | STATE : code ROUTINE : ksd_seqDeactNotReachCf |
2504 +--------------------------------------------------------------------+
2505
2506 PURPOSE : This function sets the ouput parameter for the
2507 SEQGRP_CF, KSD_OP_DEACT, KSD_SS_CFNRC key sequence.
2508 */
2509 LOCAL BOOL ksd_seqDeactNotReachCf (USHORT inIdx,
2510 CHAR* inSeq,
2511 T_KSD_SEQGRP* outSeqGrp,
2512 CHAR** outRestSeq,
2513 T_KSD_SEQPARAM* outSeqParam)
2514 {
2515 TRACE_FUNCTION ("ksd_seqDeactNotReachCf ()");
2516
2517 outSeqParam->cf.opCd = KSD_OP_DEACT;
2518 outSeqParam->cf.ssCd = KSD_SS_CFNRC;
2519
2520 *outSeqGrp = SEQGRP_CF;
2521
2522 return ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2523 }
2524
2525 /*
2526 +--------------------------------------------------------------------+
2527 | PROJECT : GSM-PS (6147) MODULE : KSD |
2528 | STATE : code ROUTINE : ksd_seqRegNotReachCf |
2529 +--------------------------------------------------------------------+
2530
2531 PURPOSE : This function sets the ouput parameter for the
2532 SEQGRP_CF, KSD_OP_REG, KSD_SS_CFNRC key sequence.
2533 */
2534 LOCAL BOOL ksd_seqRegNotReachCf (USHORT inIdx,
2535 CHAR* inSeq,
2536 T_KSD_SEQGRP* outSeqGrp,
2537 CHAR** outRestSeq,
2538 T_KSD_SEQPARAM* outSeqParam)
2539 {
2540 TRACE_FUNCTION ("ksd_seqRegNotReachCf ()");
2541
2542 outSeqParam->cf.opCd = KSD_OP_REG;
2543 outSeqParam->cf.ssCd = KSD_SS_CFNRC;
2544
2545 *outSeqGrp = SEQGRP_CF;
2546
2547 return ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2548 }
2549
2550 /*
2551 +--------------------------------------------------------------------+
2552 | PROJECT : GSM-PS (6147) MODULE : KSD |
2553 | STATE : code ROUTINE : ksd_seqEraseNotReachCf |
2554 +--------------------------------------------------------------------+
2555
2556 PURPOSE : This function sets the ouput parameter for the
2557 SEQGRP_CF, KSD_OP_ERS, KSD_SS_CFNRC key sequence.
2558 */
2559 LOCAL BOOL ksd_seqEraseNotReachCf (USHORT inIdx,
2560 CHAR* inSeq,
2561 T_KSD_SEQGRP* outSeqGrp,
2562 CHAR** outRestSeq,
2563 T_KSD_SEQPARAM* outSeqParam)
2564 {
2565 TRACE_FUNCTION ("ksd_seqEraseNotReachCf ()");
2566
2567 outSeqParam->cf.opCd = KSD_OP_ERS;
2568 outSeqParam->cf.ssCd = KSD_SS_CFNRC;
2569
2570 *outSeqGrp = SEQGRP_CF;
2571
2572 return ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2573 }
2574
2575 /*
2576 +--------------------------------------------------------------------+
2577 | PROJECT : GSM-PS (6147) MODULE : KSD |
2578 | STATE : code ROUTINE : ksd_seqIntrgtNotReachCf |
2579 +--------------------------------------------------------------------+
2580
2581 PURPOSE : This function sets the ouput parameter for the
2582 SEQGRP_CF, KSD_OP_IRGT, KSD_SS_CFNRC key sequence.
2583 */
2584 LOCAL BOOL ksd_seqIntrgtNotReachCf (USHORT inIdx,
2585 CHAR* inSeq,
2586 T_KSD_SEQGRP* outSeqGrp,
2587 CHAR** outRestSeq,
2588 T_KSD_SEQPARAM* outSeqParam)
2589 {
2590 TRACE_FUNCTION ("ksd_seqIntrgtNotReachCf ()");
2591
2592 outSeqParam->cf.opCd = KSD_OP_IRGT;
2593 outSeqParam->cf.ssCd = KSD_SS_CFNRC;
2594
2595 *outSeqGrp = SEQGRP_CF;
2596
2597 return ksd_getCcfcFromDnBs (inIdx, inSeq, outRestSeq, outSeqParam);
2598 }
2599
2600 /*
2601 +--------------------------------------------------------------------+
2602 | PROJECT : GSM-PS (6147) MODULE : KSD |
2603 | STATE : code ROUTINE : ksd_getClckFromPwBs |
2604 +--------------------------------------------------------------------+
2605
2606 PURPOSE : This function extracts the parameters of the sAT_PlusCLCK
2607 function of the ACI out of the supplementary information.
2608
2609 <inIdx>: index of key sequence table
2610 <inSeq>: key sequence, to be decoded
2611 <inGsm>: indicates whether this SSC group is
2612 GSM standard
2613 <outRestSeq>: rest key sequence, to be decoded by a
2614 further call to this function
2615 <outSeqParam>: sequence parameter
2616
2617 returns: TRUE if output parameters are valid,
2618 otherwise FALSE
2619 */
2620 LOCAL BOOL ksd_getClckFromPwBs (USHORT inIdx,
2621 CHAR* inSeq,
2622 BOOL inGsm,
2623 CHAR** outRestSeq,
2624 T_KSD_SEQPARAM* outSeqParam)
2625 {
2626 const USHORT siNum = 2;
2627 T_KSD_DCD_CPLE dcdCple[2];
2628 T_KSD_SIPARAM pwParam;
2629 T_KSD_SIPARAM bsParam;
2630 USHORT readChars = 0;
2631 USHORT lenKeySeq;
2632 BOOL isSuccess = FALSE;
2633
2634 TRACE_FUNCTION ("ksd_getClckFromPwBs ()");
2635
2636 lenKeySeq = (inGsm ? ksd_strlen (keyPasswd[inIdx].keySeq) :
2637 ksd_strlen (keyPasswdNonGsm[inIdx].keySeq));
2638
2639 dcdCple[0].type = SI_CHAR_STAR;
2640 dcdCple[0].param = &pwParam;
2641 pwParam.siCharStar = NULL;
2642
2643 dcdCple[1].type = SI_UBYTE;
2644 dcdCple[1].param = &bsParam;
2645 bsParam.siUbyte = KSD_BS_None;
2646
2647 if(*(inSeq+lenKeySeq) EQ STOP_SEQ OR
2648 *(inSeq+lenKeySeq+1) EQ 0x00)
2649 {
2650 /* no password given, eg a query, where it is not needed */
2651 TRACE_EVENT("ss code for password but none given");
2652 outSeqParam->cb.pwd = 0x00;
2653 outSeqParam->cb.bsCd = bsParam.siUbyte;
2654
2655 isSuccess = TRUE;
2656 }
2657 else if (ksd_extractSi (inSeq + lenKeySeq, siNum,
2658 &readChars, dcdCple) EQ TRUE)
2659 {
2660 outSeqParam->cb.pwd = (UBYTE*)pwParam.siCharStar;
2661 outSeqParam->cb.bsCd = bsParam.siUbyte;
2662
2663 isSuccess = TRUE;
2664 }
2665
2666 *outRestSeq = inSeq + lenKeySeq + readChars;
2667
2668 return isSuccess;
2669 }
2670
2671 /*
2672 +--------------------------------------------------------------------+
2673 | PROJECT : GSM-PS (6147) MODULE : KSD |
2674 | STATE : code ROUTINE : ksd_seqActSimLock |
2675 +--------------------------------------------------------------------+
2676
2677 PURPOSE : This function sets the ouput parameter for the
2678 SEQGRP_ACT_SIM_LOCK key sequence.
2679 */
2680 LOCAL BOOL ksd_seqActSimLock (USHORT inIdx,
2681 CHAR* inSeq,
2682 T_KSD_SEQGRP* outSeqGrp,
2683 CHAR** outRestSeq,
2684 T_KSD_SEQPARAM* outSeqParam)
2685 {
2686 TRACE_FUNCTION ("ksd_seqActSimLock ()");
2687
2688 outSeqParam->clck.fac = FAC_Sc;
2689 outSeqParam->clck.mode = CLCK_MOD_Lock;
2690
2691 *outSeqGrp = SEQGRP_ACT_SIM_LOCK;
2692
2693 return ksd_getClckFromPwBs (inIdx, inSeq, FALSE, outRestSeq, outSeqParam);
2694 }
2695
2696 /*
2697 +--------------------------------------------------------------------+
2698 | PROJECT : GSM-PS (6147) MODULE : KSD |
2699 | STATE : code ROUTINE : ksd_seqDeactSimLock |
2700 +--------------------------------------------------------------------+
2701
2702 PURPOSE : This function sets the ouput parameter for the
2703 SEQGRP_DEACT_SIM_LOCK key sequence.
2704 */
2705 LOCAL BOOL ksd_seqDeactSimLock (USHORT inIdx,
2706 CHAR* inSeq,
2707 T_KSD_SEQGRP* outSeqGrp,
2708 CHAR** outRestSeq,
2709 T_KSD_SEQPARAM* outSeqParam)
2710 {
2711 TRACE_FUNCTION ("ksd_seqDeactSimLock ()");
2712
2713 outSeqParam->clck.fac = FAC_Sc;
2714 outSeqParam->clck.mode = CLCK_MOD_Unlock;
2715
2716 *outSeqGrp = SEQGRP_DEACT_SIM_LOCK;
2717
2718 return ksd_getClckFromPwBs (inIdx, inSeq, FALSE, outRestSeq, outSeqParam);
2719 }
2720
2721 /*
2722 +--------------------------------------------------------------------+
2723 | PROJECT : GSM-PS (6147) MODULE : KSD |
2724 | STATE : code ROUTINE : ksd_seqIntrgtSimLock |
2725 +--------------------------------------------------------------------+
2726
2727 PURPOSE : This function sets the ouput parameter for the
2728 SEQGRP_INTRGT_SIM_LOCK key sequence.
2729 */
2730 LOCAL BOOL ksd_seqIntrgtSimLock (USHORT inIdx,
2731 CHAR* inSeq,
2732 T_KSD_SEQGRP* outSeqGrp,
2733 CHAR** outRestSeq,
2734 T_KSD_SEQPARAM* outSeqParam)
2735 {
2736 TRACE_FUNCTION ("ksd_seqIntrgtSimLock ()");
2737
2738 *outSeqGrp = SEQGRP_INTRGT_SIM_LOCK;
2739 *outRestSeq = inSeq + ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
2740
2741 outSeqParam->clck_query.fac = FAC_Sc;
2742
2743 return TRUE;
2744 }
2745
2746
2747 /*
2748 +--------------------------------------------------------------------+
2749 | PROJECT : GSM-PS (6147) MODULE : KSD |
2750 | STATE : code ROUTINE : ksd_seqDeactOutBarrServ |
2751 +--------------------------------------------------------------------+
2752
2753 PURPOSE : This function sets the ouput parameter for the
2754 SEQGRP_CB, KSD_OP_DEACT, KSD_SS_BOC key sequence.
2755 */
2756 LOCAL BOOL ksd_seqDeactOutBarrServ (USHORT inIdx,
2757 CHAR* inSeq,
2758 T_KSD_SEQGRP* outSeqGrp,
2759 CHAR** outRestSeq,
2760 T_KSD_SEQPARAM* outSeqParam)
2761 {
2762 TRACE_FUNCTION ("ksd_seqDeactOutBarrServ ()");
2763
2764 outSeqParam->cb.opCd = KSD_OP_DEACT;
2765 outSeqParam->cb.ssCd = KSD_SS_BOC;
2766
2767 *outSeqGrp = SEQGRP_CB;
2768
2769 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
2770 }
2771
2772
2773 /*
2774 +--------------------------------------------------------------------+
2775 | PROJECT : GSM-PS (6147) MODULE : KSD |
2776 | STATE : code ROUTINE : ksd_seqActBaoicExcHome |
2777 +--------------------------------------------------------------------+
2778
2779 PURPOSE : This function sets the ouput parameter for the
2780 SEQGRP_CB, KSD_OP_ACT, KSD_SS_BOICXH key sequence.
2781 */
2782 LOCAL BOOL ksd_seqActBaoicExcHome (USHORT inIdx,
2783 CHAR* inSeq,
2784 T_KSD_SEQGRP* outSeqGrp,
2785 CHAR** outRestSeq,
2786 T_KSD_SEQPARAM* outSeqParam)
2787 {
2788 TRACE_FUNCTION ("ksd_seqActBaoicExcHome ()");
2789
2790 outSeqParam->cb.opCd = KSD_OP_ACT;
2791 outSeqParam->cb.ssCd = KSD_SS_BOICXH;
2792
2793 *outSeqGrp = SEQGRP_CB;
2794
2795 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
2796 }
2797
2798 /*
2799 +--------------------------------------------------------------------+
2800 | PROJECT : GSM-PS (6147) MODULE : KSD |
2801 | STATE : code ROUTINE : ksd_seqDeactBaoicExcHome |
2802 +--------------------------------------------------------------------+
2803
2804 PURPOSE : This function sets the ouput parameter for the
2805 SEQGRP_CB, KSD_OP_DEACT, KSD_SS_BOICXH key sequence.
2806 */
2807 LOCAL BOOL ksd_seqDeactBaoicExcHome (USHORT inIdx,
2808 CHAR* inSeq,
2809 T_KSD_SEQGRP* outSeqGrp,
2810 CHAR** outRestSeq,
2811 T_KSD_SEQPARAM* outSeqParam)
2812 {
2813 TRACE_FUNCTION ("ksd_seqDeactBaoicExcHome ()");
2814
2815 outSeqParam->cb.opCd = KSD_OP_DEACT;
2816 outSeqParam->cb.ssCd = KSD_SS_BOICXH;
2817
2818 *outSeqGrp = SEQGRP_CB;
2819
2820 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
2821 }
2822
2823 /*
2824 +--------------------------------------------------------------------+
2825 | PROJECT : GSM-PS (6147) MODULE : KSD |
2826 | STATE : code ROUTINE : ksd_seqIntrgtBaoicExcHome|
2827 +--------------------------------------------------------------------+
2828
2829 PURPOSE : This function sets the ouput parameter for the
2830 SEQGRP_CB, KSD_OP_IRGT, KSD_SS_BOICXH key sequence.
2831 */
2832 LOCAL BOOL ksd_seqIntrgtBaoicExcHome (USHORT inIdx,
2833 CHAR* inSeq,
2834 T_KSD_SEQGRP* outSeqGrp,
2835 CHAR** outRestSeq,
2836 T_KSD_SEQPARAM* outSeqParam)
2837 {
2838 TRACE_FUNCTION ("ksd_seqIntrgtBaoicExcHome ()");
2839
2840 outSeqParam->cb.opCd = KSD_OP_IRGT;
2841 outSeqParam->cb.ssCd = KSD_SS_BOICXH;
2842
2843 *outSeqGrp = SEQGRP_CB;
2844
2845 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
2846 }
2847
2848 /*
2849 +--------------------------------------------------------------------+
2850 | PROJECT : GSM-PS (6147) MODULE : KSD |
2851 | STATE : code ROUTINE : ksd_seqActBaoic |
2852 +--------------------------------------------------------------------+
2853
2854 PURPOSE : This function sets the ouput parameter for the
2855 SEQGRP_CB, KSD_OP_ACT, KSD_SS_BOIC key sequence.
2856 */
2857 LOCAL BOOL ksd_seqActBaoic (USHORT inIdx,
2858 CHAR* inSeq,
2859 T_KSD_SEQGRP* outSeqGrp,
2860 CHAR** outRestSeq,
2861 T_KSD_SEQPARAM* outSeqParam)
2862 {
2863 TRACE_FUNCTION ("ksd_seqActBaoic ()");
2864
2865 outSeqParam->cb.opCd = KSD_OP_ACT;
2866 outSeqParam->cb.ssCd = KSD_SS_BOIC;
2867
2868 *outSeqGrp = SEQGRP_CB;
2869
2870 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
2871 }
2872
2873 /*
2874 +--------------------------------------------------------------------+
2875 | PROJECT : GSM-PS (6147) MODULE : KSD |
2876 | STATE : code ROUTINE : ksd_seqDeactBaoic |
2877 +--------------------------------------------------------------------+
2878
2879 PURPOSE : This function sets the ouput parameter for the
2880 SEQGRP_CB, KSD_OP_DEACT, KSD_SS_BOIC key sequence.
2881 */
2882 LOCAL BOOL ksd_seqDeactBaoic (USHORT inIdx,
2883 CHAR* inSeq,
2884 T_KSD_SEQGRP* outSeqGrp,
2885 CHAR** outRestSeq,
2886 T_KSD_SEQPARAM* outSeqParam)
2887 {
2888 TRACE_FUNCTION ("ksd_seqDeactBaoic ()");
2889
2890 outSeqParam->cb.opCd = KSD_OP_DEACT;
2891 outSeqParam->cb.ssCd = KSD_SS_BOIC;
2892
2893 *outSeqGrp = SEQGRP_CB;
2894
2895 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
2896 }
2897
2898 /*
2899 +--------------------------------------------------------------------+
2900 | PROJECT : GSM-PS (6147) MODULE : KSD |
2901 | STATE : code ROUTINE : ksd_seqIntrgtBaoic |
2902 +--------------------------------------------------------------------+
2903
2904 PURPOSE : This function sets the ouput parameter for the
2905 SEQGRP_CB, KSD_OP_IRGT, KSD_SS_BOIC key sequence.
2906 */
2907 LOCAL BOOL ksd_seqIntrgtBaoic (USHORT inIdx,
2908 CHAR* inSeq,
2909 T_KSD_SEQGRP* outSeqGrp,
2910 CHAR** outRestSeq,
2911 T_KSD_SEQPARAM* outSeqParam)
2912 {
2913 TRACE_FUNCTION ("ksd_seqIntrgtBaoic ()");
2914
2915 outSeqParam->cb.opCd = KSD_OP_IRGT;
2916 outSeqParam->cb.ssCd = KSD_SS_BOIC;
2917
2918 *outSeqGrp = SEQGRP_CB;
2919
2920 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
2921 }
2922
2923
2924 /*
2925 +--------------------------------------------------------------------+
2926 | PROJECT : GSM-PS (6147) MODULE : KSD |
2927 | STATE : code ROUTINE : ksd_seqDeactAllBarrServ |
2928 +--------------------------------------------------------------------+
2929
2930 PURPOSE : This function sets the ouput parameter for the
2931 SEQGRP_CB, KSD_OP_DEACT, KSD_SS_ALL_CBSS key sequence.
2932 */
2933 LOCAL BOOL ksd_seqDeactAllBarrServ (USHORT inIdx,
2934 CHAR* inSeq,
2935 T_KSD_SEQGRP* outSeqGrp,
2936 CHAR** outRestSeq,
2937 T_KSD_SEQPARAM* outSeqParam)
2938 {
2939 TRACE_FUNCTION ("ksd_seqDeactAllBarrServ ()");
2940
2941 outSeqParam->cb.opCd = KSD_OP_DEACT;
2942 outSeqParam->cb.ssCd = KSD_SS_ALL_CBSS;
2943
2944 *outSeqGrp = SEQGRP_CB;
2945
2946 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
2947 }
2948
2949 /*
2950 +--------------------------------------------------------------------+
2951 | PROJECT : GSM-PS (6147) MODULE : KSD |
2952 | STATE : code ROUTINE : ksd_seqActBaoc |
2953 +--------------------------------------------------------------------+
2954
2955 PURPOSE : This function sets the ouput parameter for the
2956 SEQGRP_CB, KSD_OP_ACT, KSD_SS_BAOC key sequence.
2957 */
2958 LOCAL BOOL ksd_seqActBaoc (USHORT inIdx,
2959 CHAR* inSeq,
2960 T_KSD_SEQGRP* outSeqGrp,
2961 CHAR** outRestSeq,
2962 T_KSD_SEQPARAM* outSeqParam)
2963 {
2964 TRACE_FUNCTION ("ksd_seqActBaoc ()");
2965
2966 outSeqParam->cb.opCd = KSD_OP_ACT;
2967 outSeqParam->cb.ssCd = KSD_SS_BAOC;
2968
2969 *outSeqGrp = SEQGRP_CB;
2970
2971 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
2972 }
2973
2974 /*
2975 +--------------------------------------------------------------------+
2976 | PROJECT : GSM-PS (6147) MODULE : KSD |
2977 | STATE : code ROUTINE : ksd_seqDeactBaoc |
2978 +--------------------------------------------------------------------+
2979
2980 PURPOSE : This function sets the ouput parameter for the
2981 SEQGRP_CB, KSD_OP_DEACT, KSD_SS_BAOC key sequence.
2982 */
2983 LOCAL BOOL ksd_seqDeactBaoc (USHORT inIdx,
2984 CHAR* inSeq,
2985 T_KSD_SEQGRP* outSeqGrp,
2986 CHAR** outRestSeq,
2987 T_KSD_SEQPARAM* outSeqParam)
2988 {
2989 TRACE_FUNCTION ("ksd_seqDeactBaoc ()");
2990
2991 outSeqParam->cb.opCd = KSD_OP_DEACT;
2992 outSeqParam->cb.ssCd = KSD_SS_BAOC;
2993
2994 *outSeqGrp = SEQGRP_CB;
2995
2996 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
2997 }
2998
2999 /*
3000 +--------------------------------------------------------------------+
3001 | PROJECT : GSM-PS (6147) MODULE : KSD |
3002 | STATE : code ROUTINE : ksd_seqIntrgtBaoc |
3003 +--------------------------------------------------------------------+
3004
3005 PURPOSE : This function sets the ouput parameter for the
3006 SEQGRP_CB, KSD_OP_IRGT, KSD_SS_BAOC key sequence.
3007 */
3008 LOCAL BOOL ksd_seqIntrgtBaoc (USHORT inIdx,
3009 CHAR* inSeq,
3010 T_KSD_SEQGRP* outSeqGrp,
3011 CHAR** outRestSeq,
3012 T_KSD_SEQPARAM* outSeqParam)
3013 {
3014 TRACE_FUNCTION ("ksd_seqIntrgtBaoc ()");
3015
3016 outSeqParam->cb.opCd = KSD_OP_IRGT;
3017 outSeqParam->cb.ssCd = KSD_SS_BAOC;
3018
3019 *outSeqGrp = SEQGRP_CB;
3020
3021 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
3022 }
3023
3024
3025 /*
3026 +--------------------------------------------------------------------+
3027 | PROJECT : GSM-PS (6147) MODULE : KSD |
3028 | STATE : code ROUTINE : ksd_seqDeactInBarrServ |
3029 +--------------------------------------------------------------------+
3030
3031 PURPOSE : This function sets the ouput parameter for the
3032 SEQGRP_CB, KSD_OP_DEACT, KSD_SS_BIC key sequence.
3033 */
3034 LOCAL BOOL ksd_seqDeactInBarrServ (USHORT inIdx,
3035 CHAR* inSeq,
3036 T_KSD_SEQGRP* outSeqGrp,
3037 CHAR** outRestSeq,
3038 T_KSD_SEQPARAM* outSeqParam)
3039 {
3040 TRACE_FUNCTION ("ksd_seqDeactInBarrServ ()");
3041
3042 outSeqParam->cb.opCd = KSD_OP_DEACT;
3043 outSeqParam->cb.ssCd = KSD_SS_BIC;
3044
3045 *outSeqGrp = SEQGRP_CB;
3046
3047 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
3048 }
3049
3050
3051 /*
3052 +--------------------------------------------------------------------+
3053 | PROJECT : GSM-PS (6147) MODULE : KSD |
3054 | STATE : code ROUTINE : ksd_seqActBaicRoam |
3055 +--------------------------------------------------------------------+
3056
3057 PURPOSE : This function sets the ouput parameter for the
3058 SEQGRP_CB, KSD_OP_ACT, KSD_SS_BICRM key sequence.
3059 */
3060 LOCAL BOOL ksd_seqActBaicRoam (USHORT inIdx,
3061 CHAR* inSeq,
3062 T_KSD_SEQGRP* outSeqGrp,
3063 CHAR** outRestSeq,
3064 T_KSD_SEQPARAM* outSeqParam)
3065 {
3066 TRACE_FUNCTION ("ksd_seqActBaicRoam ()");
3067
3068 outSeqParam->cb.opCd = KSD_OP_ACT;
3069 outSeqParam->cb.ssCd = KSD_SS_BICRM;
3070
3071 *outSeqGrp = SEQGRP_CB;
3072
3073 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
3074 }
3075
3076 /*
3077 +--------------------------------------------------------------------+
3078 | PROJECT : GSM-PS (6147) MODULE : KSD |
3079 | STATE : code ROUTINE : ksd_seqDeactBaicRoam |
3080 +--------------------------------------------------------------------+
3081
3082 PURPOSE : This function sets the ouput parameter for the
3083 SEQGRP_CB, KSD_OP_DEACT, KSD_SS_BICRM key sequence.
3084 */
3085 LOCAL BOOL ksd_seqDeactBaicRoam (USHORT inIdx,
3086 CHAR* inSeq,
3087 T_KSD_SEQGRP* outSeqGrp,
3088 CHAR** outRestSeq,
3089 T_KSD_SEQPARAM* outSeqParam)
3090 {
3091 TRACE_FUNCTION ("ksd_seqDeactBaicRoam ()");
3092
3093 outSeqParam->cb.opCd = KSD_OP_DEACT;
3094 outSeqParam->cb.ssCd = KSD_SS_BICRM;
3095
3096 *outSeqGrp = SEQGRP_CB;
3097
3098 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
3099 }
3100
3101 /*
3102 +--------------------------------------------------------------------+
3103 | PROJECT : GSM-PS (6147) MODULE : KSD |
3104 | STATE : code ROUTINE : ksd_seqIntrgtBaicRoam |
3105 +--------------------------------------------------------------------+
3106
3107 PURPOSE : This function sets the ouput parameter for the
3108 SEQGRP_CB, KSD_OP_IRGT, KSD_SS_BICRM key sequence.
3109 */
3110 LOCAL BOOL ksd_seqIntrgtBaicRoam (USHORT inIdx,
3111 CHAR* inSeq,
3112 T_KSD_SEQGRP* outSeqGrp,
3113 CHAR** outRestSeq,
3114 T_KSD_SEQPARAM* outSeqParam)
3115 {
3116 TRACE_FUNCTION ("ksd_seqIntrgtBaicRoam ()");
3117
3118 outSeqParam->cb.opCd = KSD_OP_IRGT;
3119 outSeqParam->cb.ssCd = KSD_SS_BICRM;
3120
3121 *outSeqGrp = SEQGRP_CB;
3122
3123 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
3124 }
3125
3126 /*
3127 +--------------------------------------------------------------------+
3128 | PROJECT : GSM-PS (6147) MODULE : KSD |
3129 | STATE : code ROUTINE : ksd_seqActBaic |
3130 +--------------------------------------------------------------------+
3131
3132 PURPOSE : This function sets the ouput parameter for the
3133 SEQGRP_CB, KSD_OP_ACT, KSD_SS_BAIC key sequence.
3134 */
3135 LOCAL BOOL ksd_seqActBaic (USHORT inIdx,
3136 CHAR* inSeq,
3137 T_KSD_SEQGRP* outSeqGrp,
3138 CHAR** outRestSeq,
3139 T_KSD_SEQPARAM* outSeqParam)
3140 {
3141 TRACE_FUNCTION ("ksd_seqActBaic ()");
3142
3143 outSeqParam->cb.opCd = KSD_OP_ACT;
3144 outSeqParam->cb.ssCd = KSD_SS_BAIC;
3145
3146 *outSeqGrp = SEQGRP_CB;
3147
3148 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
3149 }
3150
3151 /*
3152 +--------------------------------------------------------------------+
3153 | PROJECT : GSM-PS (6147) MODULE : KSD |
3154 | STATE : code ROUTINE : ksd_seqDeactBaic |
3155 +--------------------------------------------------------------------+
3156
3157 PURPOSE : This function sets the ouput parameter for the
3158 SEQGRP_CB, KSD_OP_DEACT, KSD_SS_BAIC key sequence.
3159 */
3160 LOCAL BOOL ksd_seqDeactBaic (USHORT inIdx,
3161 CHAR* inSeq,
3162 T_KSD_SEQGRP* outSeqGrp,
3163 CHAR** outRestSeq,
3164 T_KSD_SEQPARAM* outSeqParam)
3165 {
3166 TRACE_FUNCTION ("ksd_seqDeactBaic ()");
3167
3168 outSeqParam->cb.opCd = KSD_OP_DEACT;
3169 outSeqParam->cb.ssCd = KSD_SS_BAIC;
3170
3171 *outSeqGrp = SEQGRP_CB;
3172
3173 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
3174 }
3175
3176 /*
3177 +--------------------------------------------------------------------+
3178 | PROJECT : GSM-PS (6147) MODULE : KSD |
3179 | STATE : code ROUTINE : ksd_seqIntrgtBaic |
3180 +--------------------------------------------------------------------+
3181
3182 PURPOSE : This function sets the ouput parameter for the
3183 SEQGRP_CB, KSD_OP_IRGT, KSD_SS_BAIC key sequence.
3184 */
3185 LOCAL BOOL ksd_seqIntrgtBaic (USHORT inIdx,
3186 CHAR* inSeq,
3187 T_KSD_SEQGRP* outSeqGrp,
3188 CHAR** outRestSeq,
3189 T_KSD_SEQPARAM* outSeqParam)
3190 {
3191 TRACE_FUNCTION ("ksd_seqIntrgtBaic ()");
3192
3193 outSeqParam->cb.opCd = KSD_OP_IRGT;
3194 outSeqParam->cb.ssCd = KSD_SS_BAIC;
3195
3196 *outSeqGrp = SEQGRP_CB;
3197
3198 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
3199 }
3200
3201 /*
3202 +--------------------------------------------------------------------+
3203 | PROJECT : GSM-PS (6147) MODULE : KSD |
3204 | STATE : code ROUTINE : ksd_seqIntrgtClir |
3205 +--------------------------------------------------------------------+
3206
3207 PURPOSE : This function sets the ouput parameter for the
3208 SEQGRP_CL, KSD_OP_IRGT, KSD_SS_CLIR key sequence.
3209 */
3210 LOCAL BOOL ksd_seqIntrgtClir (USHORT inIdx,
3211 CHAR* inSeq,
3212 T_KSD_SEQGRP* outSeqGrp,
3213 CHAR** outRestSeq,
3214 T_KSD_SEQPARAM* outSeqParam)
3215 {
3216 TRACE_FUNCTION ("ksd_seqIntrgtClir ()");
3217
3218 outSeqParam->cb.opCd = KSD_OP_IRGT;
3219 outSeqParam->cb.ssCd = KSD_SS_CLIR;
3220
3221 *outSeqGrp = SEQGRP_CL;
3222
3223 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3224
3225 return TRUE;
3226 }
3227
3228
3229
3230 /*
3231 +--------------------------------------------------------------------+
3232 | PROJECT : GSM-PS (6147) MODULE : KSD |
3233 | STATE : code ROUTINE : ksd_seqSupClir |
3234 +--------------------------------------------------------------------+
3235
3236 PURPOSE : This function sets the ouput parameter for the
3237 SEQGRP_SUP_CLIR key sequence.
3238 */
3239 LOCAL BOOL ksd_seqSupClir (USHORT inIdx,
3240 CHAR* inSeq,
3241 T_KSD_SEQGRP* outSeqGrp,
3242 CHAR** outRestSeq,
3243 T_KSD_SEQPARAM* outSeqParam)
3244 {
3245 TRACE_FUNCTION ("ksd_seqSupClir ()");
3246
3247 *outSeqGrp = SEQGRP_SUP_CLIR;
3248 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3249
3250 outSeqParam->Clir.mode = CLIR_MOD_Supp;
3251
3252 return TRUE;
3253 }
3254
3255 /*
3256 +--------------------------------------------------------------------+
3257 | PROJECT : GSM-PS (6147) MODULE : KSD |
3258 | STATE : code ROUTINE : ksd_seqInvClir |
3259 +--------------------------------------------------------------------+
3260
3261 PURPOSE : This function sets the ouput parameter for the
3262 SEQGRP_INV_CLIR key sequence.
3263 */
3264 LOCAL BOOL ksd_seqInvClir (USHORT inIdx,
3265 CHAR* inSeq,
3266 T_KSD_SEQGRP* outSeqGrp,
3267 CHAR** outRestSeq,
3268 T_KSD_SEQPARAM* outSeqParam)
3269 {
3270 TRACE_FUNCTION ("ksd_seqInvClir ()");
3271
3272 *outSeqGrp = SEQGRP_INV_CLIR;
3273 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3274
3275 outSeqParam->Clir.mode = CLIR_MOD_Invoc;
3276
3277 return TRUE;
3278 }
3279
3280 /*
3281 +--------------------------------------------------------------------+
3282 | PROJECT : GSM-PS (6147) MODULE : KSD |
3283 | STATE : code ROUTINE : ksd_seqIntrgtClip |
3284 +--------------------------------------------------------------------+
3285
3286 PURPOSE : This function sets the ouput parameter for the
3287 SEQGRP_CL, KSD_OP_IRGT, KSD_SS_CLIP key sequence.
3288 */
3289 LOCAL BOOL ksd_seqIntrgtClip (USHORT inIdx,
3290 CHAR* inSeq,
3291 T_KSD_SEQGRP* outSeqGrp,
3292 CHAR** outRestSeq,
3293 T_KSD_SEQPARAM* outSeqParam)
3294 {
3295 TRACE_FUNCTION ("ksd_seqIntrgtClip ()");
3296
3297 outSeqParam->cb.opCd = KSD_OP_IRGT;
3298 outSeqParam->cb.ssCd = KSD_SS_CLIP;
3299
3300 *outSeqGrp = SEQGRP_CL;
3301
3302 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3303
3304 return TRUE;
3305 }
3306
3307 /*
3308 +--------------------------------------------------------------------+
3309 | PROJECT : GSM-PS (6147) MODULE : KSD |
3310 | STATE : code ROUTINE : ksd_seqSupClip |
3311 +--------------------------------------------------------------------+
3312
3313 PURPOSE : This function sets the ouput parameter for the
3314 SEQGRP_SUP_CLIP key sequence.
3315 */
3316 LOCAL BOOL ksd_seqSupClip (USHORT inIdx,
3317 CHAR* inSeq,
3318 T_KSD_SEQGRP* outSeqGrp,
3319 CHAR** outRestSeq,
3320 T_KSD_SEQPARAM* outSeqParam)
3321 {
3322 TRACE_FUNCTION ("ksd_seqSupClip ()");
3323
3324 *outSeqGrp = SEQGRP_SUP_CLIP;
3325 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3326
3327 outSeqParam->Clip.mode = CLIP_MOD_Disable;
3328
3329 return TRUE;
3330 }
3331
3332 /*
3333 +--------------------------------------------------------------------+
3334 | PROJECT : GSM-PS (6147) MODULE : KSD |
3335 | STATE : code ROUTINE : ksd_seqInvClip |
3336 +--------------------------------------------------------------------+
3337
3338 PURPOSE : This function sets the ouput parameter for the
3339 SEQGRP_INV_CLIP key sequence.
3340 */
3341 LOCAL BOOL ksd_seqInvClip (USHORT inIdx,
3342 CHAR* inSeq,
3343 T_KSD_SEQGRP* outSeqGrp,
3344 CHAR** outRestSeq,
3345 T_KSD_SEQPARAM* outSeqParam)
3346 {
3347 TRACE_FUNCTION ("ksd_seqInvClip ()");
3348
3349 *outSeqGrp = SEQGRP_INV_CLIP;
3350 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3351
3352 outSeqParam->Clip.mode = CLIP_MOD_Enable;
3353
3354 return TRUE;
3355 }
3356
3357 /*
3358 +--------------------------------------------------------------------+
3359 | PROJECT : GSM-PS (6147) MODULE : KSD |
3360 | STATE : code ROUTINE : ksd_seqIntrgtColr |
3361 +--------------------------------------------------------------------+
3362
3363 PURPOSE : This function sets the ouput parameter for the
3364 SEQGRP_CL, KSD_OP_IRGT, KSD_SS_COLR key sequence.
3365 */
3366 LOCAL BOOL ksd_seqIntrgtColr (USHORT inIdx,
3367 CHAR* inSeq,
3368 T_KSD_SEQGRP* outSeqGrp,
3369 CHAR** outRestSeq,
3370 T_KSD_SEQPARAM* outSeqParam)
3371 {
3372 TRACE_FUNCTION ("ksd_seqIntrgtColr ()");
3373
3374 outSeqParam->cb.opCd = KSD_OP_IRGT;
3375 outSeqParam->cb.ssCd = KSD_SS_COLR;
3376
3377 *outSeqGrp = SEQGRP_CL;
3378
3379 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3380
3381 return TRUE;
3382 }
3383
3384 /*
3385 +--------------------------------------------------------------------+
3386 | PROJECT : GSM-PS (6147) MODULE : KSD |
3387 | STATE : code ROUTINE : ksd_seqSupColr |
3388 +--------------------------------------------------------------------+
3389
3390 PURPOSE : This function sets the ouput parameter for the
3391 SEQGRP_SUP_COLR key sequence.
3392 */
3393 LOCAL BOOL ksd_seqSupColr (USHORT inIdx,
3394 CHAR* inSeq,
3395 T_KSD_SEQGRP* outSeqGrp,
3396 CHAR** outRestSeq,
3397 T_KSD_SEQPARAM* outSeqParam)
3398 {
3399 TRACE_FUNCTION ("ksd_seqSupColr ()");
3400
3401 *outSeqGrp = SEQGRP_SUP_COLR;
3402 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3403
3404 return TRUE;
3405 }
3406
3407 /*
3408 +--------------------------------------------------------------------+
3409 | PROJECT : GSM-PS (6147) MODULE : KSD |
3410 | STATE : code ROUTINE : ksd_seqInvColr |
3411 +--------------------------------------------------------------------+
3412
3413 PURPOSE : This function sets the ouput parameter for the
3414 SEQGRP_INV_COLR key sequence.
3415 */
3416 LOCAL BOOL ksd_seqInvColr (USHORT inIdx,
3417 CHAR* inSeq,
3418 T_KSD_SEQGRP* outSeqGrp,
3419 CHAR** outRestSeq,
3420 T_KSD_SEQPARAM* outSeqParam)
3421 {
3422 TRACE_FUNCTION ("ksd_seqInvColr ()");
3423
3424 *outSeqGrp = SEQGRP_INV_COLR;
3425 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3426
3427 return TRUE;
3428 }
3429
3430 /*
3431 +--------------------------------------------------------------------+
3432 | PROJECT : GSM-PS (6147) MODULE : KSD |
3433 | STATE : code ROUTINE : ksd_seqIntrgtColp |
3434 +--------------------------------------------------------------------+
3435
3436 PURPOSE : This function sets the ouput parameter for the
3437 SEQGRP_CL, KSD_OP_IRGT, KSD_SS_COLP key sequence.
3438 */
3439 LOCAL BOOL ksd_seqIntrgtColp (USHORT inIdx,
3440 CHAR* inSeq,
3441 T_KSD_SEQGRP* outSeqGrp,
3442 CHAR** outRestSeq,
3443 T_KSD_SEQPARAM* outSeqParam)
3444 {
3445 TRACE_FUNCTION ("ksd_seqIntrgtColp ()");
3446
3447 outSeqParam->cb.opCd = KSD_OP_IRGT;
3448 outSeqParam->cb.ssCd = KSD_SS_COLP;
3449
3450 *outSeqGrp = SEQGRP_CL;
3451
3452 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3453
3454 return TRUE;
3455 }
3456
3457 /*
3458 +--------------------------------------------------------------------+
3459 | PROJECT : GSM-PS (6147) MODULE : KSD |
3460 | STATE : code ROUTINE : ksd_seqSupColp |
3461 +--------------------------------------------------------------------+
3462
3463 PURPOSE : This function sets the ouput parameter for the
3464 SEQGRP_SUP_COLP key sequence.
3465 */
3466 LOCAL BOOL ksd_seqSupColp (USHORT inIdx,
3467 CHAR* inSeq,
3468 T_KSD_SEQGRP* outSeqGrp,
3469 CHAR** outRestSeq,
3470 T_KSD_SEQPARAM* outSeqParam)
3471 {
3472 TRACE_FUNCTION ("ksd_seqSupColp ()");
3473
3474 *outSeqGrp = SEQGRP_SUP_COLP;
3475 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3476
3477 outSeqParam->Colp.mode = COLP_MOD_Disable;
3478
3479 return TRUE;
3480 }
3481
3482 /*
3483 +--------------------------------------------------------------------+
3484 | PROJECT : GSM-PS (6147) MODULE : KSD |
3485 | STATE : code ROUTINE : ksd_seqInvColp |
3486 +--------------------------------------------------------------------+
3487
3488 PURPOSE : This function sets the ouput parameter for the
3489 SEQGRP_INV_COLP key sequence.
3490 */
3491 LOCAL BOOL ksd_seqInvColp (USHORT inIdx,
3492 CHAR* inSeq,
3493 T_KSD_SEQGRP* outSeqGrp,
3494 CHAR** outRestSeq,
3495 T_KSD_SEQPARAM* outSeqParam)
3496 {
3497 TRACE_FUNCTION ("ksd_seqInvColp ()");
3498
3499 *outSeqGrp = SEQGRP_INV_COLP;
3500 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3501
3502 outSeqParam->Colp.mode = COLP_MOD_Enable;
3503
3504 return TRUE;
3505 }
3506
3507 /*
3508 +--------------------------------------------------------------------+
3509 | PROJECT : GSM-PS (6147) MODULE : KSD |
3510 | STATE : code ROUTINE : ksd_seqSupTTY |
3511 +--------------------------------------------------------------------+
3512
3513 PURPOSE : This function sets the ouput parameter for the
3514 SEQGRP_TTY_SERV key sequence 'Suppress TTY Service'.
3515 */
3516 LOCAL BOOL ksd_seqSupTTY (USHORT inIdx,
3517 CHAR* inSeq,
3518 T_KSD_SEQGRP* outSeqGrp,
3519 CHAR** outRestSeq,
3520 T_KSD_SEQPARAM* outSeqParam)
3521 {
3522 TRACE_FUNCTION ("ksd_seqSupTTY ()");
3523
3524 *outSeqGrp = SEQGRP_TTY_SERV;
3525 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3526
3527 outSeqParam->ctty.req = CTTY_REQ_Off;
3528
3529 return TRUE;
3530 }
3531
3532 /*
3533 +--------------------------------------------------------------------+
3534 | PROJECT : GSM-PS (6147) MODULE : KSD |
3535 | STATE : code ROUTINE : ksd_seqReqTTY |
3536 +--------------------------------------------------------------------+
3537
3538 PURPOSE : This function sets the ouput parameter for the
3539 SEQGRP_TTY_SERV key sequence 'Request TTY Service'.
3540 */
3541 LOCAL BOOL ksd_seqReqTTY (USHORT inIdx,
3542 CHAR* inSeq,
3543 T_KSD_SEQGRP* outSeqGrp,
3544 CHAR** outRestSeq,
3545 T_KSD_SEQPARAM* outSeqParam)
3546 {
3547 TRACE_FUNCTION ("ksd_seqInvTTY ()");
3548
3549 *outSeqGrp = SEQGRP_TTY_SERV;
3550 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3551
3552 outSeqParam->ctty.req = CTTY_REQ_On;
3553
3554 return TRUE;
3555 }
3556
3557 /*
3558 +--------------------------------------------------------------------+
3559 | PROJECT : GSM-PS (6147) MODULE : KSD |
3560 | STATE : code ROUTINE : ksd_getCpwdFromTriplePw |
3561 +--------------------------------------------------------------------+
3562
3563 PURPOSE : This function extracts the parameters of the sAT_PlusCPWD
3564 function of the ACI out of the supplementary information.
3565
3566 <inIdx>: index of key sequence table
3567 <inSeq>: key sequence, to be decoded
3568 <outRestSeq>: rest key sequence, to be decoded by a
3569 further call to this function
3570 <outSeqParam>: sequence parameter
3571
3572 returns: TRUE if output parameters are valid,
3573 otherwise FALSE
3574 */
3575 LOCAL BOOL ksd_getCpwdFromTriplePw (USHORT inIdx,
3576 CHAR* inSeq,
3577 CHAR** outRestSeq,
3578 T_KSD_SEQPARAM* outSeqParam)
3579 {
3580 const USHORT siNum = 3;
3581 T_KSD_DCD_CPLE dcdCple[3];
3582 T_KSD_SIPARAM oldPwParam;
3583 T_KSD_SIPARAM newPw1Param;
3584 T_KSD_SIPARAM newPw2Param;
3585 USHORT readChars;
3586 USHORT lenKeySeq = ksd_strlen (keyPasswd[inIdx].keySeq);
3587 BOOL isSuccess = FALSE;
3588
3589 TRACE_FUNCTION ("ksd_getCpwdFromTriplePw ()");
3590
3591 dcdCple[0].type = SI_CHAR_STAR;
3592 dcdCple[0].param = &oldPwParam;
3593 oldPwParam.siCharStar = NULL;
3594
3595 dcdCple[1].type = SI_CHAR_STAR;
3596 dcdCple[1].param = &newPw1Param;
3597 newPw1Param.siCharStar = NULL;
3598
3599 dcdCple[2].type = SI_CHAR_STAR;
3600 dcdCple[2].param = &newPw2Param;
3601 newPw2Param.siCharStar = NULL;
3602
3603 if (ksd_extractSi (inSeq + lenKeySeq, siNum,
3604 &readChars, dcdCple) EQ TRUE)
3605 {
3606 outSeqParam->pwd.oldPwd = (UBYTE*)oldPwParam.siCharStar;
3607 outSeqParam->pwd.newPwd = (UBYTE*)newPw1Param.siCharStar;
3608 outSeqParam->pwd.newPwd2 = (UBYTE*)newPw2Param.siCharStar;
3609
3610 isSuccess = TRUE;
3611 }
3612
3613 *outRestSeq = inSeq + lenKeySeq + readChars;
3614
3615 return isSuccess;
3616 }
3617
3618
3619 /*
3620 +--------------------------------------------------------------------+
3621 | PROJECT : GSM-PS (6147) MODULE : KSD |
3622 | STATE : code ROUTINE : ksd_seqRegPwdAllBarrServ |
3623 +--------------------------------------------------------------------+
3624
3625 PURPOSE : This function sets the ouput parameter for the
3626 SEQGRP_PWD, KSD_SS_ALL_CBSS key sequence.
3627 */
3628 LOCAL BOOL ksd_seqRegPwdAllBarrServ (USHORT inIdx,
3629 CHAR* inSeq,
3630 T_KSD_SEQGRP* outSeqGrp,
3631 CHAR** outRestSeq,
3632 T_KSD_SEQPARAM* outSeqParam)
3633 {
3634 TRACE_FUNCTION ("ksd_seqRegPwdAllBarrServ ()");
3635
3636 outSeqParam->pwd.ssCd = KSD_SS_ALL_CBSS;
3637
3638 *outSeqGrp = SEQGRP_PWD;
3639
3640 return ksd_getCpwdFromTriplePw (inIdx, inSeq, outRestSeq, outSeqParam);
3641 }
3642
3643
3644 /*
3645 +--------------------------------------------------------------------+
3646 | PROJECT : GSM-PS (6147) MODULE : KSD |
3647 | STATE : code ROUTINE : ksd_seqRegPwdAllServ |
3648 +--------------------------------------------------------------------+
3649
3650 PURPOSE : This function sets the ouput parameter for the
3651 SEQGRP_PWD, KSD_SS_... key sequence.
3652 */
3653 LOCAL BOOL ksd_seqRegPwdAllServ (USHORT inIdx,
3654 CHAR* inSeq,
3655 T_KSD_SEQGRP* outSeqGrp,
3656 CHAR** outRestSeq,
3657 T_KSD_SEQPARAM* outSeqParam)
3658 {
3659 TRACE_FUNCTION ("ksd_seqRegPwdAllServ ()");
3660
3661 outSeqParam->pwd.ssCd = KSD_SS_ALL_SERV;
3662
3663 *outSeqGrp = SEQGRP_PWD;
3664
3665 return ksd_getCpwdFromTriplePw (inIdx, inSeq, outRestSeq, outSeqParam);
3666 }
3667
3668 /*
3669 +--------------------------------------------------------------------+
3670 | PROJECT : GSM-PS (6147) MODULE : KSD |
3671 | STATE : code ROUTINE : ksd_seqChngPin2 |
3672 +--------------------------------------------------------------------+
3673
3674 PURPOSE : This function sets the ouput parameter for the
3675 SEQGRP_PWD, KSD_SS_PIN2 key sequence.
3676 */
3677 LOCAL BOOL ksd_seqChngPin2 (USHORT inIdx,
3678 CHAR* inSeq,
3679 T_KSD_SEQGRP* outSeqGrp,
3680 CHAR** outRestSeq,
3681 T_KSD_SEQPARAM* outSeqParam)
3682 {
3683 TRACE_FUNCTION ("ksd_seqChngPin2 ()");
3684
3685 outSeqParam->pwd.ssCd = KSD_SS_PIN2;
3686
3687 *outSeqGrp = SEQGRP_PWD;
3688
3689 return ksd_getCpwdFromTriplePw (inIdx, inSeq, outRestSeq, outSeqParam);
3690 }
3691
3692 /*
3693 +--------------------------------------------------------------------+
3694 | PROJECT : GSM-PS (6147) MODULE : KSD |
3695 | STATE : code ROUTINE : ksd_seqChngPin |
3696 +--------------------------------------------------------------------+
3697
3698 PURPOSE : This function sets the ouput parameter for the
3699 SEQGRP_PWD, KSD_SS_PIN1 key sequence.
3700 */
3701 LOCAL BOOL ksd_seqChngPin (USHORT inIdx,
3702 CHAR* inSeq,
3703 T_KSD_SEQGRP* outSeqGrp,
3704 CHAR** outRestSeq,
3705 T_KSD_SEQPARAM* outSeqParam)
3706 {
3707 TRACE_FUNCTION ("ksd_seqChngPin ()");
3708
3709 outSeqParam->pwd.ssCd = KSD_SS_PIN1;
3710
3711 *outSeqGrp = SEQGRP_PWD;
3712
3713 return ksd_getCpwdFromTriplePw (inIdx, inSeq, outRestSeq, outSeqParam);
3714 }
3715
3716 /*
3717 +--------------------------------------------------------------------+
3718 | PROJECT : GSM-PS (6147) MODULE : KSD |
3719 | STATE : code ROUTINE : ksd_getUblkFromTriplePw |
3720 +--------------------------------------------------------------------+
3721
3722 PURPOSE : This function extracts the parameters of the sAT_PlusCPWD
3723 function of the ACI out of the supplementary information.
3724
3725 <inIdx>: index of key sequence table
3726 <inSeq>: key sequence, to be decoded
3727 <outRestSeq>: rest key sequence, to be decoded by a
3728 further call to this function
3729 <outSeqParam>: sequence parameter
3730
3731 returns: TRUE if output parameters are valid,
3732 otherwise FALSE
3733 */
3734 LOCAL BOOL ksd_getUblkFromTriplePw (USHORT inIdx,
3735 CHAR* inSeq,
3736 CHAR** outRestSeq,
3737 T_KSD_SEQPARAM* outSeqParam)
3738 {
3739 const USHORT siNum = 3;
3740 T_KSD_DCD_CPLE dcdCple[3];
3741 T_KSD_SIPARAM oldPwParam;
3742 T_KSD_SIPARAM newPw1Param;
3743 T_KSD_SIPARAM newPw2Param;
3744 USHORT readChars;
3745 USHORT lenKeySeq = ksd_strlen (keyPasswd[inIdx].keySeq);
3746 BOOL isSuccess = FALSE;
3747
3748 TRACE_FUNCTION ("ksd_getUblkFromTriplePw ()");
3749
3750 dcdCple[0].type = SI_CHAR_STAR;
3751 dcdCple[0].param = &oldPwParam;
3752 oldPwParam.siCharStar = NULL;
3753
3754 dcdCple[1].type = SI_CHAR_STAR;
3755 dcdCple[1].param = &newPw1Param;
3756 newPw1Param.siCharStar = NULL;
3757
3758 dcdCple[2].type = SI_CHAR_STAR;
3759 dcdCple[2].param = &newPw2Param;
3760 newPw2Param.siCharStar = NULL;
3761
3762 if (ksd_extractSi (inSeq + lenKeySeq, siNum,
3763 &readChars, dcdCple) EQ TRUE)
3764 {
3765 outSeqParam->ublk.puk = (UBYTE*)oldPwParam.siCharStar;
3766 outSeqParam->ublk.pin = (UBYTE*)newPw1Param.siCharStar;
3767
3768 /*
3769 *---------------------------------------------------------------
3770 * the new password must be given twice
3771 *---------------------------------------------------------------
3772 */
3773 if (!strcmp ((CHAR*)outSeqParam->ublk.pin, newPw2Param.siCharStar))
3774 isSuccess = TRUE;
3775 else
3776 isSuccess = FALSE;
3777 }
3778
3779 *outRestSeq = inSeq + lenKeySeq + readChars;
3780
3781 return isSuccess;
3782 }
3783
3784 /*
3785 +--------------------------------------------------------------------+
3786 | PROJECT : GSM-PS (6147) MODULE : KSD |
3787 | STATE : code ROUTINE : ksd_seqUnblckPin2 |
3788 +--------------------------------------------------------------------+
3789
3790 PURPOSE : This function sets the ouput parameter for the
3791 SEQGRP_UBLK, KSD_SS_PIN2 key sequence.
3792 */
3793 LOCAL BOOL ksd_seqUnblckPin2 (USHORT inIdx,
3794 CHAR* inSeq,
3795 T_KSD_SEQGRP* outSeqGrp,
3796 CHAR** outRestSeq,
3797 T_KSD_SEQPARAM* outSeqParam)
3798 {
3799 TRACE_FUNCTION ("ksd_seqUnblckPin2 ()");
3800
3801 outSeqParam->pwd.ssCd = KSD_SS_PIN2;
3802
3803 *outSeqGrp = SEQGRP_UBLK;
3804
3805 return ksd_getUblkFromTriplePw (inIdx, inSeq, outRestSeq, outSeqParam);
3806 }
3807
3808 /*
3809 +--------------------------------------------------------------------+
3810 | PROJECT : GSM-PS (6147) MODULE : KSD |
3811 | STATE : code ROUTINE : ksd_seqUnblckPin |
3812 +--------------------------------------------------------------------+
3813
3814 PURPOSE : This function sets the ouput parameter for the
3815 SEQGRP_UBLK, KSD_SS_PIN1 key sequence.
3816 */
3817 LOCAL BOOL ksd_seqUnblckPin (USHORT inIdx,
3818 CHAR* inSeq,
3819 T_KSD_SEQGRP* outSeqGrp,
3820 CHAR** outRestSeq,
3821 T_KSD_SEQPARAM* outSeqParam)
3822 {
3823 TRACE_FUNCTION ("ksd_seqUnblckPin ()");
3824
3825 outSeqParam->pwd.ssCd = KSD_SS_PIN1;
3826
3827 *outSeqGrp = SEQGRP_UBLK;
3828
3829 return ksd_getUblkFromTriplePw (inIdx, inSeq, outRestSeq, outSeqParam);
3830 }
3831
3832 /*
3833 +--------------------------------------------------------------------+
3834 | PROJECT : GSM-PS (6147) MODULE : KSD |
3835 | STATE : code ROUTINE : ksd_getCcwaFromBs |
3836 +--------------------------------------------------------------------+
3837
3838 PURPOSE : This function extracts the parameters of the sAT_PlusCCWA
3839 function of the ACI out of the supplementary information.
3840
3841 <inIdx>: index of key sequence table
3842 <inSeq>: key sequence, to be decoded
3843 <outRestSeq>: rest key sequence, to be decoded by a
3844 further call to this function
3845 <outSeqParam>: sequence parameter
3846
3847 returns: TRUE if output parameters are valid,
3848 otherwise FALSE
3849 */
3850 LOCAL BOOL ksd_getCcwaFromBs (USHORT inIdx,
3851 CHAR* inSeq,
3852 CHAR** outRestSeq,
3853 T_KSD_SEQPARAM* outSeqParam)
3854 {
3855 const USHORT siNum = 1;
3856 T_KSD_DCD_CPLE dcdCple[1];
3857 T_KSD_SIPARAM bsParam;
3858 USHORT readChars;
3859 USHORT lenKeySeq = ksd_strlen (keySeqTable[inIdx].keySeq);
3860 BOOL isSuccess = FALSE;
3861
3862 TRACE_FUNCTION ("ksd_getCcwaFromBs ()");
3863
3864 dcdCple[0].type = SI_UBYTE;
3865 dcdCple[0].param = &bsParam;
3866 bsParam.siUbyte = KSD_BS_None;
3867
3868 if (ksd_extractSi (inSeq + lenKeySeq, siNum,
3869 &readChars, dcdCple) EQ TRUE)
3870 {
3871 outSeqParam->cw.bsCd = bsParam.siUbyte;
3872
3873 isSuccess = TRUE;
3874 }
3875
3876 *outRestSeq = inSeq + lenKeySeq + readChars;
3877
3878 return isSuccess;
3879 }
3880
3881 /*
3882 +--------------------------------------------------------------------+
3883 | PROJECT : GSM-PS (6147) MODULE : KSD |
3884 | STATE : code ROUTINE : ksd_seqActWait |
3885 +--------------------------------------------------------------------+
3886
3887 PURPOSE : This function sets the ouput parameter for the
3888 SEQGRP_CW, KSD_OP_ACT key sequence.
3889 */
3890 LOCAL BOOL ksd_seqActWait (USHORT inIdx,
3891 CHAR* inSeq,
3892 T_KSD_SEQGRP* outSeqGrp,
3893 CHAR** outRestSeq,
3894 T_KSD_SEQPARAM* outSeqParam)
3895 {
3896 TRACE_FUNCTION ("ksd_seqActWait ()");
3897
3898 outSeqParam->cw.opCd = KSD_OP_ACT;
3899
3900 *outSeqGrp = SEQGRP_CW;
3901
3902 return ksd_getCcwaFromBs (inIdx, inSeq, outRestSeq, outSeqParam);
3903 }
3904
3905 /*
3906 +--------------------------------------------------------------------+
3907 | PROJECT : GSM-PS (6147) MODULE : KSD |
3908 | STATE : code ROUTINE : ksd_seqDeactWait |
3909 +--------------------------------------------------------------------+
3910
3911 PURPOSE : This function sets the ouput parameter for the
3912 SEQGRP_CW, KSD_OP_DEACT key sequence.
3913 */
3914 LOCAL BOOL ksd_seqDeactWait (USHORT inIdx,
3915 CHAR* inSeq,
3916 T_KSD_SEQGRP* outSeqGrp,
3917 CHAR** outRestSeq,
3918 T_KSD_SEQPARAM* outSeqParam)
3919 {
3920 TRACE_FUNCTION ("ksd_seqDeactWait ()");
3921
3922 outSeqParam->cw.opCd = KSD_OP_DEACT;
3923
3924 *outSeqGrp = SEQGRP_CW;
3925
3926 return ksd_getCcwaFromBs (inIdx, inSeq, outRestSeq, outSeqParam);
3927 }
3928
3929 /*
3930 +--------------------------------------------------------------------+
3931 | PROJECT : GSM-PS (6147) MODULE : KSD |
3932 | STATE : code ROUTINE : ksd_seqIntrgtWait |
3933 +--------------------------------------------------------------------+
3934
3935 PURPOSE : This function sets the ouput parameter for the
3936 SEQGRP_CW, KSD_OP_IRGT key sequence.
3937 */
3938 LOCAL BOOL ksd_seqIntrgtWait (USHORT inIdx,
3939 CHAR* inSeq,
3940 T_KSD_SEQGRP* outSeqGrp,
3941 CHAR** outRestSeq,
3942 T_KSD_SEQPARAM* outSeqParam)
3943 {
3944 TRACE_FUNCTION ("ksd_seqIntrgtWait ()");
3945
3946 outSeqParam->cw.opCd = KSD_OP_IRGT;
3947 //TISH, hot fix for OMAPS00130692
3948 //start
3949 #if 0
3950 /* Interrogation of Call Waiting is always without any Basic Service Code, see 4.83 */
3951 outSeqParam->cw.bsCd = KSD_BS_None;
3952
3953 *outSeqGrp = SEQGRP_CW;
3954
3955 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3956
3957 return TRUE;
3958 #else
3959 *outSeqGrp = SEQGRP_CW;
3960 return ksd_getCcwaFromBs (inIdx, inSeq, outRestSeq, outSeqParam);
3961 #endif
3962 //end
3963 }
3964
3965 /*
3966 +--------------------------------------------------------------------+
3967 | PROJECT : GSM-PS (6147) MODULE : KSD |
3968 | STATE : code ROUTINE : ksd_seqIPrsntImei |
3969 +--------------------------------------------------------------------+
3970
3971 PURPOSE : This function sets the ouput parameter for the
3972 SEQGRP_PRSNT_IMEI key sequence.
3973 */
3974 LOCAL BOOL ksd_seqPrsntImei (USHORT inIdx,
3975 CHAR* inSeq,
3976 T_KSD_SEQGRP* outSeqGrp,
3977 CHAR** outRestSeq,
3978 T_KSD_SEQPARAM* outSeqParam)
3979 {
3980 TRACE_FUNCTION ("ksd_seqPrsntImei ()");
3981
3982 *outSeqGrp = SEQGRP_PRSNT_IMEI;
3983 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
3984
3985 return TRUE;
3986 }
3987
3988 /*
3989 +--------------------------------------------------------------------+
3990 | PROJECT : GSM-PS (6147) MODULE : KSD |
3991 | STATE : code ROUTINE : ksd_seqIntrgtCCBS |
3992 +--------------------------------------------------------------------+
3993
3994 PURPOSE : This function sets the ouput parameter for the
3995 SEQGRP_CCBS, KSD_OP_IRGT, KSD_SS_CCBS key sequence.
3996 */
3997 LOCAL BOOL ksd_seqIntrgtCCBS (USHORT inIdx,
3998 CHAR* inSeq,
3999 T_KSD_SEQGRP* outSeqGrp,
4000 CHAR** outRestSeq,
4001 T_KSD_SEQPARAM* outSeqParam)
4002 {
4003 TRACE_FUNCTION ("ksd_seqIntrgtCCBS ()");
4004
4005 outSeqParam->ccbs.opCd = KSD_OP_IRGT;
4006 outSeqParam->ccbs.idx = KSD_IDX_NONE;
4007
4008 *outSeqGrp = SEQGRP_CCBS;
4009
4010 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
4011
4012 return TRUE;
4013 }
4014
4015 /*
4016 +--------------------------------------------------------------------+
4017 | PROJECT : GSM-PS (6147) MODULE : KSD |
4018 | STATE : code ROUTINE : ksd_getCCBSFromN |
4019 +--------------------------------------------------------------------+
4020
4021 PURPOSE : This function extracts the parameters of the sAT_PercentCCBS
4022 function of the ACI out of the supplementary information.
4023
4024 <inIdx>: index of key sequence table
4025 <inSeq>: key sequence, to be decoded
4026 <outRestSeq>: rest key sequence, to be decoded by a
4027 further call to this function
4028 <outSeqParam>: sequence parameter
4029
4030 returns: TRUE if output parameters are valid,
4031 otherwise FALSE
4032 */
4033 LOCAL BOOL ksd_getCCBSFromN (USHORT inIdx,
4034 CHAR* inSeq,
4035 CHAR** outRestSeq,
4036 T_KSD_SEQPARAM* outSeqParam)
4037 {
4038 const USHORT siNum = 1;
4039 T_KSD_DCD_CPLE dcdCple[1];
4040 T_KSD_SIPARAM nParam;
4041 USHORT readChars;
4042 USHORT lenKeySeq = ksd_strlen (keySeqTable[inIdx].keySeq);
4043 BOOL isSuccess = FALSE;
4044
4045 TRACE_FUNCTION ("ksd_getCCBSFromN ()");
4046
4047 dcdCple[0].type = SI_UBYTE;
4048 dcdCple[0].param = &nParam;
4049 nParam.siUbyte = KSD_IDX_NONE;
4050
4051 if (ksd_extractSi (inSeq + lenKeySeq, siNum,
4052 &readChars, dcdCple) EQ TRUE)
4053 {
4054 outSeqParam->ccbs.idx = nParam.siUbyte;
4055
4056 isSuccess = TRUE;
4057 }
4058
4059 *outRestSeq = inSeq + lenKeySeq + readChars;
4060
4061 return isSuccess;
4062 }
4063
4064 /*
4065 +--------------------------------------------------------------------+
4066 | PROJECT : GSM-PS (6147) MODULE : KSD |
4067 | STATE : code ROUTINE : ksd_seqDeactCCBS |
4068 +--------------------------------------------------------------------+
4069
4070 PURPOSE : This function sets the ouput parameter for the
4071 SEQGRP_CCBS, KSD_OP_DEACT key sequence.
4072 */
4073 LOCAL BOOL ksd_seqDeactCCBS (USHORT inIdx,
4074 CHAR* inSeq,
4075 T_KSD_SEQGRP* outSeqGrp,
4076 CHAR** outRestSeq,
4077 T_KSD_SEQPARAM* outSeqParam)
4078 {
4079 TRACE_FUNCTION ("ksd_seqDeactCCBS ()");
4080
4081 outSeqParam->ccbs.opCd = KSD_OP_DEACT;
4082 outSeqParam->ccbs.idx = KSD_IDX_NONE;
4083
4084 *outSeqGrp = SEQGRP_CCBS;
4085
4086 return ksd_getCCBSFromN (inIdx, inSeq, outRestSeq, outSeqParam);
4087 }
4088
4089 /*
4090 +--------------------------------------------------------------------+
4091 | PROJECT : GSM-PS (6147) MODULE : KSD |
4092 | STATE : code ROUTINE : ksd_seqIntrgtCNAP |
4093 +--------------------------------------------------------------------+
4094
4095 PURPOSE : This function sets the ouput parameter for the
4096 SEQGRP_CL, KSD_OP_IRGT, KSD_SS_CNAP key sequence.
4097 */
4098 LOCAL BOOL ksd_seqIntrgtCNAP (USHORT inIdx,
4099 CHAR* inSeq,
4100 T_KSD_SEQGRP* outSeqGrp,
4101 CHAR** outRestSeq,
4102 T_KSD_SEQPARAM* outSeqParam)
4103 {
4104 TRACE_FUNCTION ("ksd_seqIntrgtCNAP ()");
4105
4106 outSeqParam->cb.opCd = KSD_OP_IRGT;
4107 outSeqParam->cb.ssCd = KSD_SS_CNAP;
4108
4109 *outSeqGrp = SEQGRP_CL;
4110
4111 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
4112
4113 return TRUE;
4114 }
4115
4116 #if 0 /* For further study, so not yet used */
4117 +--------------------------------------------------------------------+
4118 | PROJECT : GSM-PS (6147) MODULE : KSD |
4119 | STATE : code ROUTINE : ksd_seqActCCBS |
4120 +--------------------------------------------------------------------+
4121
4122 PURPOSE : This function sets the ouput parameter for the
4123 SEQGRP_CCBS, KSD_OP_ACT key sequence.
4124
4125
4126 LOCAL BOOL ksd_seqActCCBS (USHORT inIdx,
4127 CHAR* inSeq,
4128 T_KSD_SEQGRP* outSeqGrp,
4129 CHAR** outRestSeq,
4130 T_KSD_SEQPARAM* outSeqParam)
4131 {
4132 TRACE_FUNCTION ("ksd_seqActCCBS ()");
4133
4134 outSeqParam->ccbs.opCd = KSD_OP_ACT;
4135 outSeqParam->ccbs.idx = KSD_IDX_NONE;
4136
4137 *outSeqGrp = SEQGRP_CCBS;
4138
4139 *outRestSeq = inSeq + ksd_strlen (keySeqTable[inIdx].keySeq);
4140
4141 return TRUE;
4142 }
4143 #endif
4144
4145
4146 /*
4147 +--------------------------------------------------------------------+
4148 | PROJECT : GSM-PS (6147) MODULE : KSD |
4149 | STATE : code ROUTINE : ksd_seqSndChld0 |
4150 +--------------------------------------------------------------------+
4151
4152 PURPOSE : This function sets the ouput parameter for the
4153 SEQGRP_CHLD key sequence.
4154 */
4155 LOCAL BOOL ksd_seqSndChld0 (USHORT inIdx,
4156 CHAR* inSeq,
4157 T_KSD_SEQGRP* outSeqGrp,
4158 CHAR** outRestSeq,
4159 T_KSD_SEQPARAM* outSeqParam)
4160 {
4161 BOOL isSuccess = FALSE;
4162 USHORT lenInSeq = strlen (inSeq);
4163 USHORT lenKeySeq = ksd_strlen (keyWithinCall[inIdx].keySeq);
4164
4165 TRACE_FUNCTION ("ksd_seqSndChld0 ()");
4166
4167 /*
4168 *-----------------------------------------------------------------
4169 * entering a single '0' is a valid +CHLD parameter
4170 *-----------------------------------------------------------------
4171 */
4172 if (lenInSeq EQ lenKeySeq)
4173 {
4174 *outSeqGrp = SEQGRP_CHLD;
4175 *outRestSeq = inSeq + lenInSeq;
4176 outSeqParam->chld.mode = CHLD_MOD_RelHldOrUdub;
4177 outSeqParam->chld.call = NULL;
4178
4179 isSuccess = TRUE;
4180 }
4181 else
4182 {
4183 *outSeqGrp = SEQGRP_UNKNOWN;
4184 *outRestSeq = inSeq;
4185 }
4186
4187 return isSuccess;
4188 }
4189
4190 /*
4191 +--------------------------------------------------------------------+
4192 | PROJECT : GSM-PS (6147) MODULE : KSD |
4193 | STATE : code ROUTINE : ksd_seqSndChld1 |
4194 +--------------------------------------------------------------------+
4195
4196 PURPOSE : This function sets the ouput parameter for the
4197 SEQGRP_CHLD key sequence.
4198 */
4199 LOCAL BOOL ksd_seqSndChld1 (USHORT inIdx,
4200 CHAR* inSeq,
4201 T_KSD_SEQGRP* outSeqGrp,
4202 CHAR** outRestSeq,
4203 T_KSD_SEQPARAM* outSeqParam)
4204 {
4205 BOOL isSuccess = FALSE;
4206 USHORT lenInSeq = strlen (inSeq);
4207 USHORT lenKeySeq = ksd_strlen (keyWithinCall[inIdx].keySeq);
4208
4209 TRACE_FUNCTION ("ksd_seqSndChld1 ()");
4210
4211 if (lenInSeq EQ lenKeySeq)
4212 {
4213 /*
4214 *---------------------------------------------------------------
4215 * entering a single '1' is a valid +CHLD parameter
4216 *---------------------------------------------------------------
4217 */
4218 *outSeqGrp = SEQGRP_CHLD;
4219 *outRestSeq = inSeq + lenInSeq;
4220 outSeqParam->chld.mode = CHLD_MOD_RelActAndAcpt;
4221 outSeqParam->chld.call = NULL;
4222
4223 isSuccess = TRUE;
4224 }
4225 else if (lenInSeq EQ lenKeySeq + 1)
4226 {
4227 if (*(inSeq + lenKeySeq) >= '0' AND
4228 *(inSeq + lenKeySeq) <= '9')
4229 {
4230 /*
4231 *---------------------------------------------------------------
4232 * entering a '1X' is a valid +CHLD parameter, while X is a
4233 * number between '0' and '9'
4234 *---------------------------------------------------------------
4235 */
4236 *outSeqGrp = SEQGRP_CHLD;
4237 *outRestSeq = inSeq + lenInSeq;
4238 outSeqParam->chld.mode = CHLD_MOD_RelActSpec;
4239 outSeqParam->chld.call = inSeq + lenKeySeq;
4240
4241 isSuccess = TRUE;
4242 }
4243 else
4244 {
4245 *outSeqGrp = SEQGRP_UNKNOWN;
4246 *outRestSeq = inSeq;
4247 }
4248 }
4249 else
4250 {
4251 *outSeqGrp = SEQGRP_UNKNOWN;
4252 *outRestSeq = inSeq;
4253 }
4254
4255 return isSuccess;
4256 }
4257
4258 /*
4259 +--------------------------------------------------------------------+
4260 | PROJECT : GSM-PS (6147) MODULE : KSD |
4261 | STATE : code ROUTINE : ksd_seqSndChld2 |
4262 +--------------------------------------------------------------------+
4263
4264 PURPOSE : This function sets the ouput parameter for the
4265 SEQGRP_CHLD key sequence.
4266 */
4267 LOCAL BOOL ksd_seqSndChld2 (USHORT inIdx,
4268 CHAR* inSeq,
4269 T_KSD_SEQGRP* outSeqGrp,
4270 CHAR** outRestSeq,
4271 T_KSD_SEQPARAM* outSeqParam)
4272 {
4273 BOOL isSuccess = FALSE;
4274 USHORT lenInSeq = strlen (inSeq);
4275 USHORT lenKeySeq = ksd_strlen (keyWithinCall[inIdx].keySeq);
4276
4277 TRACE_FUNCTION ("ksd_seqSndChld2 ()");
4278
4279 if (lenInSeq EQ lenKeySeq)
4280 {
4281 /*
4282 *---------------------------------------------------------------
4283 * entering a single '2' is a valid +CHLD parameter
4284 *---------------------------------------------------------------
4285 */
4286 *outSeqGrp = SEQGRP_CHLD;
4287 *outRestSeq = inSeq + lenInSeq;
4288 outSeqParam->chld.mode = CHLD_MOD_HldActAndAcpt;
4289 outSeqParam->chld.call = NULL;
4290
4291 isSuccess = TRUE;
4292 }
4293 else if (lenInSeq EQ lenKeySeq + 1)
4294 {
4295 if (*(inSeq + lenKeySeq) >= '0' AND
4296 *(inSeq + lenKeySeq) <= '9')
4297 {
4298 /*
4299 *---------------------------------------------------------------
4300 * entering a '2X' is a valid +CHLD parameter, while X is a
4301 * number between '0' and '9'
4302 *---------------------------------------------------------------
4303 */
4304 *outSeqGrp = SEQGRP_CHLD;
4305 *outRestSeq = inSeq + lenInSeq;
4306 outSeqParam->chld.mode = CHLD_MOD_HldActExc;
4307 outSeqParam->chld.call = inSeq + lenKeySeq;
4308
4309 isSuccess = TRUE;
4310 }
4311 else
4312 {
4313 *outSeqGrp = SEQGRP_UNKNOWN;
4314 *outRestSeq = inSeq;
4315 }
4316 }
4317 else
4318 {
4319 *outSeqGrp = SEQGRP_UNKNOWN;
4320 *outRestSeq = inSeq;
4321 }
4322
4323 return isSuccess;
4324 }
4325
4326 /*
4327 +--------------------------------------------------------------------+
4328 | PROJECT : GSM-PS (6147) MODULE : KSD |
4329 | STATE : code ROUTINE : ksd_seqSndChld3 |
4330 +--------------------------------------------------------------------+
4331
4332 PURPOSE : This function sets the ouput parameter for the
4333 SEQGRP_CHLD key sequence.
4334 */
4335 LOCAL BOOL ksd_seqSndChld3 (USHORT inIdx,
4336 CHAR* inSeq,
4337 T_KSD_SEQGRP* outSeqGrp,
4338 CHAR** outRestSeq,
4339 T_KSD_SEQPARAM* outSeqParam)
4340 {
4341 BOOL isSuccess = FALSE;
4342 USHORT lenInSeq = strlen (inSeq);
4343 USHORT lenKeySeq = ksd_strlen (keyWithinCall[inIdx].keySeq);
4344
4345 TRACE_FUNCTION ("ksd_seqSndChld3 ()");
4346
4347 /*
4348 *-----------------------------------------------------------------
4349 * entering a single '3' is a valid +CHLD parameter
4350 *-----------------------------------------------------------------
4351 */
4352 if (lenInSeq EQ lenKeySeq)
4353 {
4354 *outSeqGrp = SEQGRP_CHLD;
4355 *outRestSeq = inSeq + lenInSeq;
4356 outSeqParam->chld.mode = CHLD_MOD_AddHld;
4357 outSeqParam->chld.call = NULL;
4358
4359 isSuccess = TRUE;
4360 }
4361 else
4362 {
4363 *outSeqGrp = SEQGRP_UNKNOWN;
4364 *outRestSeq = inSeq;
4365 }
4366
4367 return isSuccess;
4368 }
4369
4370 /*
4371 +--------------------------------------------------------------------+
4372 | PROJECT : GSM-PS (6147) MODULE : KSD |
4373 | STATE : code ROUTINE : ksd_seqSndChld4 |
4374 +--------------------------------------------------------------------+
4375
4376 PURPOSE : This function sets the ouput parameter for the
4377 SEQGRP_CHLD key sequence.
4378 */
4379 LOCAL BOOL ksd_seqSndChld4 (USHORT inIdx,
4380 CHAR* inSeq,
4381 T_KSD_SEQGRP* outSeqGrp,
4382 CHAR** outRestSeq,
4383 T_KSD_SEQPARAM* outSeqParam)
4384 {
4385 BOOL isSuccess = FALSE;
4386 USHORT lenInSeq = strlen (inSeq);
4387 USHORT lenKeySeq = ksd_strlen (keyWithinCall[inIdx].keySeq);
4388
4389 TRACE_FUNCTION ("ksd_seqSndChld4()");
4390
4391 /*
4392 *-----------------------------------------------------------------
4393 * entering a single '4' is a valid +CHLD parameter
4394 *-----------------------------------------------------------------
4395 */
4396 if (lenInSeq EQ lenKeySeq)
4397 {
4398 *outSeqGrp = SEQGRP_CHLD;
4399 *outRestSeq = inSeq + lenInSeq;
4400 outSeqParam->chld.mode = CHLD_MOD_Ect;
4401 outSeqParam->chld.call = NULL;
4402
4403 isSuccess = TRUE;
4404 }
4405
4406 return isSuccess;
4407 }
4408
4409 /*
4410 +--------------------------------------------------------------------+
4411 | PROJECT : GSM-PS (6147) MODULE : KSD |
4412 | STATE : code ROUTINE : ksd_seqSndChld4Star |
4413 +--------------------------------------------------------------------+
4414
4415 PURPOSE : This function sets the ouput parameter for the
4416 SEQGRP_CHLD key sequence.
4417 */
4418 LOCAL BOOL ksd_seqSndChld4Star (USHORT inIdx,
4419 CHAR* inSeq,
4420 T_KSD_SEQGRP* outSeqGrp,
4421 CHAR** outRestSeq,
4422 T_KSD_SEQPARAM* outSeqParam)
4423 {
4424 USHORT lenInSeq = strlen (inSeq);
4425 USHORT lenKeySeq = ksd_strlen (keyWithinCall[inIdx].keySeq);
4426 USHORT lenSubaddr;
4427 BOOL international;
4428 BOOL isSuccess = FALSE;
4429
4430 TRACE_FUNCTION ("ksd_seqSndChld4Star()");
4431
4432 /*
4433 *-----------------------------------------------------------------
4434 * entering a '4' and a '*' is a valid +CTFR parameter
4435 *-----------------------------------------------------------------
4436 */
4437 *outSeqGrp = SEQGRP_CTFR;
4438 *outRestSeq = inSeq + lenKeySeq;
4439
4440 /*
4441 *-----------------------------------------------------------------
4442 * process dial DeflectedToNumber
4443 *-----------------------------------------------------------------
4444 */
4445 utl_splitDialnumber (*outRestSeq,
4446 &outSeqParam->ctfr.number,
4447 &international,
4448 &outSeqParam->ctfr.subaddr,
4449 &lenSubaddr);
4450
4451 /*
4452 *-----------------------------------------------------------------
4453 * process main address and type of main address
4454 *-----------------------------------------------------------------
4455 */
4456 if (outSeqParam->ctfr.number EQ NULL)
4457 {
4458 outSeqParam->ctfr.type.ton = TON_Unknown;
4459 outSeqParam->ctfr.type.npi = NPI_Unknown;
4460 }
4461 else
4462 {
4463 outSeqParam->ctfr.type.ton = (international) ? TON_International :
4464 TON_Unknown;
4465 outSeqParam->ctfr.type.npi = NPI_IsdnTelephony;
4466 isSuccess = TRUE;
4467 }
4468
4469 /*
4470 *---------------------------------------------------------------
4471 * process subaddress and type of subaddress
4472 *---------------------------------------------------------------
4473 */
4474 if (outSeqParam->ctfr.subaddr EQ NULL)
4475 {
4476 outSeqParam->ctfr.satype.tos = TOS_Nsap;
4477 outSeqParam->ctfr.satype.oe = OE_Even;
4478 }
4479 else
4480 {
4481 outSeqParam->ctfr.satype.tos = TOS_Nsap;
4482 outSeqParam->ctfr.satype.oe = ((lenSubaddr & 1) EQ 0) ? OE_Even :
4483 OE_Odd;
4484 }
4485
4486 *outRestSeq = *outRestSeq + strlen (*outRestSeq);
4487
4488 return isSuccess;
4489 }
4490
4491 /*
4492 +--------------------------------------------------------------------+
4493 | PROJECT : GSM-PS (6147) MODULE : KSD |
4494 | STATE : code ROUTINE : ksd_seqSndChld5 |
4495 +--------------------------------------------------------------------+
4496
4497 PURPOSE : This function sets the ouput parameter for the
4498 SEQGRP_CHLD key sequence.
4499 */
4500 LOCAL BOOL ksd_seqSndChld5 (USHORT inIdx,
4501 CHAR* inSeq,
4502 T_KSD_SEQGRP* outSeqGrp,
4503 CHAR** outRestSeq,
4504 T_KSD_SEQPARAM* outSeqParam)
4505 {
4506 BOOL isSuccess = FALSE;
4507 USHORT lenInSeq = strlen (inSeq);
4508 USHORT lenKeySeq = ksd_strlen (keyWithinCall[inIdx].keySeq);
4509
4510 TRACE_FUNCTION ("ksd_seqSndChld5()");
4511
4512 /*
4513 *-----------------------------------------------------------------
4514 * entering a single '5' is a valid +CHLD parameter
4515 *-----------------------------------------------------------------
4516 */
4517 if (lenInSeq EQ lenKeySeq)
4518 {
4519 *outSeqGrp = SEQGRP_CHLD;
4520 *outRestSeq = inSeq + lenInSeq;
4521 outSeqParam->chld.mode = CHLD_MOD_Ccbs;
4522 outSeqParam->chld.call = NULL;
4523
4524 isSuccess = TRUE;
4525 }
4526
4527 return isSuccess;
4528 }
4529
4530 #ifdef SMI
4531 /*
4532 +--------------------------------------------------------------------+
4533 | PROJECT : GSM-PS (6147) MODULE : KSD |
4534 | STATE : code ROUTINE : ksd_seqSndCbst |
4535 +--------------------------------------------------------------------+
4536
4537 PURPOSE : This function sets the ouput parameter for the
4538 SEQGRP_SND_CBST key sequence.
4539 */
4540 LOCAL BOOL ksd_seqSndCbst (USHORT inIdx,
4541 CHAR* inSeq,
4542 T_KSD_SEQGRP* outSeqGrp,
4543 CHAR** outRestSeq,
4544 T_KSD_SEQPARAM* outSeqParam)
4545 {
4546 const USHORT siNum = 3;
4547 T_KSD_DCD_CPLE dcdCple[3];
4548 T_KSD_SIPARAM speedParam;
4549 T_KSD_SIPARAM nameParam;
4550 T_KSD_SIPARAM ceParam;
4551 USHORT readChars;
4552 USHORT lenKeySeq = ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
4553 BOOL isSuccess = FALSE;
4554
4555 TRACE_FUNCTION ("ksd_seqSndCbst ()");
4556
4557 dcdCple[0].type = SI_SHORT;
4558 dcdCple[0].param = &speedParam;
4559
4560 dcdCple[1].type = SI_SHORT;
4561 dcdCple[1].param = &nameParam;
4562
4563 dcdCple[2].type = SI_SHORT;
4564 dcdCple[2].param = &ceParam;
4565
4566 *outSeqGrp = SEQGRP_SND_CBST;
4567
4568 if (ksd_extractSi (inSeq + lenKeySeq, siNum,
4569 &readChars, dcdCple) EQ TRUE)
4570 {
4571 outSeqParam->cbst.speed = speedParam.siShort;
4572 outSeqParam->cbst.name = nameParam.siShort;
4573 outSeqParam->cbst.ce = ceParam.siShort;
4574
4575 isSuccess = TRUE;
4576 }
4577
4578 *outRestSeq = inSeq + lenKeySeq + readChars;
4579
4580 return isSuccess;
4581 }
4582 #endif
4583
4584 #ifdef SMI
4585 /*
4586 +--------------------------------------------------------------------+
4587 | PROJECT : GSM-PS (6147) MODULE : KSD |
4588 | STATE : code ROUTINE : ksd_seqSndCrlp |
4589 +--------------------------------------------------------------------+
4590
4591 PURPOSE : This function sets the ouput parameter for the
4592 SEQGRP_SND_CRLP key sequence.
4593 */
4594 LOCAL BOOL ksd_seqSndCrlp (USHORT inIdx,
4595 CHAR* inSeq,
4596 T_KSD_SEQGRP* outSeqGrp,
4597 CHAR** outRestSeq,
4598 T_KSD_SEQPARAM* outSeqParam)
4599 {
4600 const USHORT siNum = 4;
4601 T_KSD_DCD_CPLE dcdCple[4];
4602 T_KSD_SIPARAM iwsParam;
4603 T_KSD_SIPARAM mwsParam;
4604 T_KSD_SIPARAM t1Param;
4605 T_KSD_SIPARAM n2Param;
4606 USHORT readChars;
4607 USHORT lenKeySeq = ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
4608 BOOL isSuccess = FALSE;
4609
4610 TRACE_FUNCTION ("ksd_seqSndCrlp ()");
4611
4612 dcdCple[0].type = SI_SHORT;
4613 dcdCple[0].param = &iwsParam;
4614
4615 dcdCple[1].type = SI_SHORT;
4616 dcdCple[1].param = &mwsParam;
4617
4618 dcdCple[2].type = SI_SHORT;
4619 dcdCple[2].param = &t1Param;
4620
4621 dcdCple[3].type = SI_SHORT;
4622 dcdCple[3].param = &n2Param;
4623
4624 *outSeqGrp = SEQGRP_SND_CRLP;
4625
4626 if (ksd_extractSi (inSeq + lenKeySeq, siNum,
4627 &readChars, dcdCple) EQ TRUE)
4628 {
4629 outSeqParam->crlp.iws = iwsParam.siShort;
4630 outSeqParam->crlp.mws = mwsParam.siShort;
4631 outSeqParam->crlp.t1 = t1Param.siShort;
4632 outSeqParam->crlp.n2 = n2Param.siShort;
4633
4634 isSuccess = TRUE;
4635 }
4636
4637 *outRestSeq = inSeq + lenKeySeq + readChars;
4638
4639 return isSuccess;
4640 }
4641 #endif
4642
4643 #ifdef SMI
4644 /*
4645 +--------------------------------------------------------------------+
4646 | PROJECT : GSM-PS (6147) MODULE : KSD |
4647 | STATE : code ROUTINE : ksd_seqSndDs |
4648 +--------------------------------------------------------------------+
4649
4650 PURPOSE : This function sets the ouput parameter for the
4651 SEQGRP_SND_DS key sequence.
4652 */
4653 LOCAL BOOL ksd_seqSndDs (USHORT inIdx,
4654 CHAR* inSeq,
4655 T_KSD_SEQGRP* outSeqGrp,
4656 CHAR** outRestSeq,
4657 T_KSD_SEQPARAM* outSeqParam)
4658 {
4659 const USHORT siNum = 4;
4660 T_KSD_DCD_CPLE dcdCple[4];
4661 T_KSD_SIPARAM dirParam;
4662 T_KSD_SIPARAM compParam;
4663 T_KSD_SIPARAM maxDictParam;
4664 T_KSD_SIPARAM maxStrParam;
4665 USHORT readChars;
4666 USHORT lenKeySeq = ksd_strlen (keySeqTableNonGsm[inIdx].keySeq);
4667 BOOL isSuccess = FALSE;
4668
4669 TRACE_FUNCTION ("ksd_seqSndDs ()");
4670
4671 dcdCple[0].type = SI_SHORT;
4672 dcdCple[0].param = &dirParam;
4673
4674 dcdCple[1].type = SI_SHORT;
4675 dcdCple[1].param = &compParam;
4676
4677 dcdCple[2].type = SI_LONG;
4678 dcdCple[2].param = &maxDictParam;
4679
4680 dcdCple[3].type = SI_SHORT;
4681 dcdCple[3].param = &maxStrParam;
4682
4683 *outSeqGrp = SEQGRP_SND_DS;
4684
4685 if (ksd_extractSi (inSeq + lenKeySeq, siNum,
4686 &readChars, dcdCple) EQ TRUE)
4687 {
4688 outSeqParam->ds.dir = dirParam.siShort;
4689 outSeqParam->ds.comp = compParam.siShort;
4690 outSeqParam->ds.maxDict = maxDictParam.siLong;
4691 outSeqParam->ds.maxStr = maxStrParam.siShort;
4692
4693 isSuccess = TRUE;
4694 }
4695
4696 *outRestSeq = inSeq + lenKeySeq + readChars;
4697
4698 return isSuccess;
4699 }
4700 #endif
4701
4702 #ifdef SMI
4703 /*
4704 +--------------------------------------------------------------------+
4705 | PROJECT : GSM-PS (6147) MODULE : KSD |
4706 | STATE : code ROUTINE : ksd_seqSpeechData |
4707 +--------------------------------------------------------------------+
4708
4709 PURPOSE : This function sets the ouput parameter for the
4710 SEQGRP_SPEECH_DATA key sequence.
4711 */
4712 LOCAL BOOL ksd_seqSpeechData (USHORT inIdx,
4713 CHAR* inSeq,
4714 T_KSD_SEQGRP* outSeqGrp,
4715 CHAR** outRestSeq,
4716 T_KSD_SEQPARAM* outSeqParam)
4717 {
4718 TRACE_FUNCTION ("ksd_seqSpeechData ()");
4719
4720 *outSeqGrp = SEQGRP_SPEECH_DATA;
4721 *outRestSeq = inSeq + ksd_strlen(SPEECH_DATA_SEQ);
4722
4723 return TRUE;
4724 }
4725 #endif
4726
4727 #ifdef SMI
4728 /*
4729 +--------------------------------------------------------------------+
4730 | PROJECT : GSM-PS (6147) MODULE : KSD |
4731 | STATE : code ROUTINE : ksd_seqDataSpeech |
4732 +--------------------------------------------------------------------+
4733
4734 PURPOSE : This function sets the ouput parameter for the
4735 SEQGRP_DATA_SPEECH key sequence.
4736 */
4737 LOCAL BOOL ksd_seqDataSpeech (USHORT inIdx,
4738 CHAR* inSeq,
4739 T_KSD_SEQGRP* outSeqGrp,
4740 CHAR** outRestSeq,
4741 T_KSD_SEQPARAM* outSeqParam)
4742 {
4743 TRACE_FUNCTION ("ksd_seqDataSpeech ()");
4744
4745 *outSeqGrp = SEQGRP_DATA_SPEECH;
4746 *outRestSeq = inSeq + ksd_strlen(DATA_SPEECH_SEQ);
4747
4748 return TRUE;
4749 }
4750 #endif
4751
4752 /*
4753 +--------------------------------------------------------------------+
4754 | PROJECT : GSM-PS (6147) MODULE : KSD |
4755 | STATE : code ROUTINE : ksd_seqUnknown |
4756 +--------------------------------------------------------------------+
4757
4758 PURPOSE : This function sets the ouput parameter for the
4759 SEQGRP_UNKNOWN key sequence.
4760 */
4761 LOCAL BOOL ksd_seqUnknown (USHORT inIdx,
4762 CHAR* inSeq,
4763 T_KSD_SEQGRP* outSeqGrp,
4764 CHAR** outRestSeq,
4765 T_KSD_SEQPARAM* outSeqParam)
4766 {
4767 TRACE_FUNCTION ("ksd_seqUnknown ()");
4768
4769 *outSeqGrp = SEQGRP_UNKNOWN;
4770 *outRestSeq = inSeq;
4771
4772 return TRUE;
4773 }
4774
4775 /*
4776 +--------------------------------------------------------------------+
4777 | PROJECT : GSM-PS (6147) MODULE : KSD |
4778 | STATE : code ROUTINE : ksd_isUSSD |
4779 +--------------------------------------------------------------------+
4780
4781 PURPOSE : This function checks whether key sequence is an
4782 unstructured SS command.
4783
4784 <keySeq>: buffer containing the key sequence
4785 */
4786 GLOBAL BOOL ksd_isUSSD (CHAR *keySeq)
4787 {
4788 USHORT i=0, lenKeySeq = strlen (keySeq); /* length of incoming */
4789 /* sequence */
4790 BOOL ussdStr=TRUE;
4791
4792 TRACE_FUNCTION("ksd_isUSSD");
4793
4794 /* when operating in a US band (1900 or 850), "0" and "00" shall
4795 * be transmitted to the network as normal dialing numbers
4796 */
4797 if ( ksd_isBCDForUSBand( keySeq ) )
4798 {
4799 return FALSE;
4800 }
4801
4802 /* If the last key sequence character is equal to STOP_SEQ, then check whether key
4803 * sequence contains dtmf separator('p','P','w','W'). If dtmf separator is present then
4804 * setup a call instead of sending the string as USSD to n/w.
4805 */
4806 if (keySeq[lenKeySeq - 1] EQ STOP_SEQ)
4807 {
4808 for (; i<lenKeySeq AND (ussdStr EQ TRUE); i++)
4809 {
4810 switch(keySeq[i])
4811 {
4812 case 'p':
4813 case 'P':
4814 case 'w':
4815 case 'W':
4816 ussdStr = FALSE;
4817 break;
4818 #ifdef FF_CPHS_REL4
4819 /* If the suscriber wants to initiate a MO call using a profile( on a per
4820 call basis) other than the registered profile,then setup a call instead
4821 of sending the string as USSD to n/w
4822 */
4823 case '*':
4824 if(i NEQ 0 AND keySeq[i+1] EQ '5' AND keySeq[i+2] EQ '9')
4825 {
4826 ussdStr = FALSE;
4827 }
4828 break;
4829 #endif
4830 }
4831 }
4832 }
4833 if (cuscfgParams.USSD_As_MO_Call EQ CUSCFG_MOD_Enable)
4834 {
4835 ussdStr = FALSE;
4836 }
4837
4838 /*
4839 *-----------------------------------------------------------------
4840 * USSD starts with '*' or '#' and end with '#'
4841 *-----------------------------------------------------------------
4842 */
4843 if (lenKeySeq >= MIN_USSD_LEN AND
4844 keySeq[lenKeySeq - 1] EQ STOP_SEQ AND
4845 ussdStr EQ TRUE)
4846 /*
4847 * As according to 2.30 :
4848 * "Entry of any characters defined in the GSM 03.38 [15] Default Alphabet
4849 * (up to the maximum defined in GSM 04.80 [17]), followed by #SEND".
4850 * is to be treated as USSD the startcheck is removed
4851 AND
4852 (keySeq[0] EQ START_SEQ_1 OR keySeq[0] EQ START_SEQ_2))
4853 */
4854 {
4855 return TRUE;
4856 }
4857 else
4858 {
4859 return FALSE;
4860 }
4861 }
4862
4863 /*
4864 +--------------------------------------------------------------------+
4865 | PROJECT : GSM-PS (6147) MODULE : KSD |
4866 | STATE : code ROUTINE : ksd_searchChr |
4867 +--------------------------------------------------------------------+
4868
4869 PURPOSE : This function is used to search for the next appearance
4870 of a character in a given buffer.
4871
4872 <from>: start searching from this address
4873 <to>: stop searching when reaching this address
4874 <c>: the character to be searched
4875 <inclFirstChar>:
4876 searching starts at address <from> when TRUE,
4877 at address <from + 1> when FALSE
4878
4879 returns: a pointer pointing to the found character
4880 */
4881 LOCAL CHAR* ksd_searchChr (CHAR* from,
4882 CHAR* to,
4883 int c,
4884 BOOL inclFirstChar)
4885 {
4886 CHAR* result; /* pointer to the found character */
4887
4888 /*
4889 *-----------------------------------------------------------------
4890 * valid starting point is needed
4891 *-----------------------------------------------------------------
4892 */
4893 if (from EQ NULL)
4894 return NULL;
4895
4896 /*
4897 *-----------------------------------------------------------------
4898 * leave out the first character
4899 *-----------------------------------------------------------------
4900 */
4901 if (!inclFirstChar)
4902 from++;
4903
4904 if ((result = strchr (from, c)) EQ NULL)
4905 return NULL;
4906
4907 /*
4908 *-----------------------------------------------------------------
4909 * found characters after the given end point are not considered
4910 *-----------------------------------------------------------------
4911 */
4912 if (to NEQ NULL AND result >= to)
4913 result = NULL;
4914
4915 return result;
4916 }
4917
4918 /*
4919 +--------------------------------------------------------------------+
4920 | PROJECT : GSM-PS (6147) MODULE : KSD |
4921 | STATE : code ROUTINE : ksd_scanSi |
4922 +--------------------------------------------------------------------+
4923
4924 PURPOSE : This function scans a buffer whether it contains a valid
4925 SI parameter.
4926
4927 <inSeq>: buffer containing the SI parameter
4928 <inLen>: number of characters to be taken into account
4929 <inSiInd>: indicates the data type of the SI parameter
4930 <outSi>: the scanned parameter
4931
4932 returns: TRUE if the scanning was successful,
4933 otherwise false.
4934 */
4935 LOCAL BOOL ksd_scanSi (CHAR* inSeq,
4936 USHORT inLen,
4937 T_KSD_SI inSiInd,
4938 T_KSD_SIPARAM* outSi)
4939 {
4940 BOOL ret = FALSE; /* indicates the success of scanning */
4941
4942 TRACE_FUNCTION ("ksd_scanSi ()");
4943
4944 switch (inSiInd)
4945 {
4946 case (SI_UBYTE):
4947 ret = utl_string2UByte (inSeq, inLen, &outSi->siUbyte);
4948 break;
4949
4950 case (SI_USHORT):
4951 break;
4952
4953 case (SI_ULONG):
4954 break;
4955
4956 case (SI_BYTE):
4957 ret = utl_string2Byte (inSeq, inLen, &outSi->siByte);
4958 break;
4959
4960 case (SI_SHORT):
4961 ret = utl_string2Short (inSeq, inLen, &outSi->siShort);
4962 break;
4963
4964 case (SI_LONG):
4965 ret = utl_string2Long (inSeq, inLen, &outSi->siLong);
4966 break;
4967
4968 case (SI_CHAR_STAR):
4969 if (*inSeq NEQ START_SI AND *inSeq NEQ STOP_SEQ)
4970 outSi->siCharStar = inSeq;
4971
4972 ret = TRUE;
4973 break;
4974
4975 default:
4976 break;
4977 }
4978
4979 return ret;
4980 }
4981
4982 /*
4983 +--------------------------------------------------------------------+
4984 | PROJECT : GSM-PS (6147) MODULE : KSD |
4985 | STATE : code ROUTINE : ksd_extractSi |
4986 +--------------------------------------------------------------------+
4987
4988 PURPOSE : This function extracts the SIs from the key sequence.
4989
4990 <inSeq>: key sequence to be decoded
4991 <inSiNum>: number of SI to be decoded
4992 <outCharsNum>: number of characters read
4993 <inOutSi>: decoded SI and predefined type of SI
4994
4995 returns: TRUE if SI are extracted successfully,
4996 otherwise FALSE
4997 */
4998 LOCAL BOOL ksd_extractSi (CHAR* inSeq,
4999 USHORT inSiNum,
5000 USHORT* outCharsNum,
5001 T_KSD_DCD_CPLE* inOutSi)
5002 {
5003 USHORT readChars = 0; /* number of characters read */
5004 CHAR* siEnd; /* points to the end of key sequence*/
5005 /* ('#' character is searched) */
5006 CHAR* siNextStart; /* points to the start of the next */
5007 /* SI field */
5008 CHAR* siNextStop; /* points to the end of the next SI */
5009 /* field */
5010 BOOL scanSuccess = TRUE; /* indicates whether scanning is */
5011 /* successfull */
5012 BOOL siEndReached = FALSE; /* indicates whether the last SI */
5013 /* field is reached */
5014 USHORT i; /* used for counting */
5015 BOOL isSuccess = FALSE; /* indicates whether the extraction */
5016 /* process is successfull */
5017
5018 TRACE_FUNCTION ("ksd_extractSi ()");
5019
5020 if ((siEnd = ksd_searchChr (inSeq, NULL, STOP_SEQ, TRUE)) NEQ NULL)
5021 {
5022 /*
5023 *---------------------------------------------------------------
5024 * a supplementary information delimiter closing the key
5025 * sequence was found
5026 *---------------------------------------------------------------
5027 */
5028 readChars++;
5029
5030 if (siEnd NEQ inSeq)
5031 {
5032 /*
5033 *-------------------------------------------------------------
5034 * searching for the next supplementary information delimiter
5035 * but not for those closing the key sequence
5036 *-------------------------------------------------------------
5037 */
5038 siNextStart = ksd_searchChr (inSeq, siEnd, START_SI, TRUE);
5039
5040 if (siNextStart NEQ inSeq)
5041 /*
5042 *-----------------------------------------------------------
5043 * the next supplementary information delimiter must be the
5044 * first character in string, otherwise a failure occured
5045 *-----------------------------------------------------------
5046 */
5047 readChars = 0;
5048 else
5049 {
5050 /*
5051 *-----------------------------------------------------------
5052 * searching for the next supplementary information delimiter
5053 * but not for those closing the key sequence
5054 *-----------------------------------------------------------
5055 */
5056 siNextStop = ksd_searchChr (siNextStart,
5057 siEnd,
5058 START_SI,
5059 FALSE);
5060
5061 i = 0;
5062
5063 /*
5064 *-----------------------------------------------------------
5065 * successive decoding of the supplementary information
5066 *-----------------------------------------------------------
5067 */
5068 while (scanSuccess AND i < inSiNum AND !siEndReached)
5069 {
5070 if (siNextStop NEQ NULL)
5071 {
5072 /*
5073 *-------------------------------------------------------
5074 * scan the next supplementary information
5075 *-------------------------------------------------------
5076 */
5077 scanSuccess = ksd_scanSi (siNextStart + 1,
5078 (USHORT)( siNextStop
5079 - siNextStart
5080 - 1),
5081 inOutSi[i].type,
5082 inOutSi[i].param);
5083 readChars += siNextStop - siNextStart;
5084 *siNextStop = NULL_TERM;
5085 siNextStart = siNextStop;
5086 siNextStop = ksd_searchChr (siNextStart,
5087 siEnd,
5088 START_SI,
5089 FALSE);
5090
5091 }
5092 else
5093 {
5094 /*
5095 *-------------------------------------------------------
5096 * scan the last supplementary information
5097 *-------------------------------------------------------
5098 */
5099 scanSuccess = ksd_scanSi (siNextStart + 1,
5100 (USHORT)( siEnd
5101 - siNextStart
5102 - 1),
5103 inOutSi[i].type,
5104 inOutSi[i].param);
5105 readChars += siEnd - siNextStart;
5106 *siEnd = NULL_TERM;
5107
5108 siEndReached = TRUE;
5109 }
5110
5111 i++;
5112 }
5113
5114 if (!scanSuccess OR (i EQ inSiNum AND !siEndReached))
5115 isSuccess = FALSE;
5116 else
5117 isSuccess = TRUE;
5118 }
5119 }
5120 else
5121 {
5122 isSuccess = TRUE;
5123 }
5124 }
5125
5126 *outCharsNum = readChars;
5127
5128 return isSuccess;
5129 }
5130
5131 /*
5132 +--------------------------------------------------------------------+
5133 | PROJECT : GSM-PS (6147) MODULE : KSD |
5134 | STATE : code ROUTINE : ksd_decode |
5135 +--------------------------------------------------------------------+
5136
5137 PURPOSE : This function decodes the incoming keystroke sequence.
5138
5139 <inSeq>: key sequence, to be decoded
5140 <inCall>: TRUE if MMI is within a call, otherwise
5141 FALSE
5142 <outSeqGrp>: sequence group
5143 <outRestSeq>: rest key sequence, to be decoded by a
5144 further call to this function
5145 <outSeqParam>: sequence parameter
5146
5147 returns: TRUE if decoding was successfull,
5148 otherwise FALSE
5149 */
5150 GLOBAL BOOL ksd_decode (CHAR* inSeq,
5151 BOOL inCall,
5152 T_KSD_SEQGRP* outSeqGrp,
5153 CHAR** outRestSeq,
5154 T_KSD_SEQPARAM* outSeqParam)
5155 {
5156 USHORT lastIdx; /* index of the last character in key */
5157 /* sequence stored in sequence table */
5158 BOOL isEqual = FALSE; /* indicates whether incoming sequence */
5159 /* matches key sequence in sequence */
5160 /* table */
5161 USHORT i; /* used for counting */
5162 USHORT j; /* counts the number of key sequence */
5163 /* tables already searched through */
5164 BOOL isSuccess = FALSE; /* indicates whether decoding was */
5165 /* successfull */
5166 const T_KEY_SEQ_TABLE* table; /* actual key sequence table */
5167
5168 TRACE_FUNCTION ("ksd_decode ()");
5169
5170 *outSeqGrp = SEQGRP_UNKNOWN;
5171 *outRestSeq = inSeq;
5172
5173 if (inSeq EQ NULL OR strlen (inSeq) EQ 0)
5174 {
5175 return TRUE;
5176 }
5177
5178 /*
5179 *-----------------------------------------------------------------
5180 * determining whether incoming sequence starts with a well known
5181 * key sequence
5182 *-----------------------------------------------------------------
5183 * the four tables 'keySeqTable', 'keySeqTableNonGsm', 'keyPasswd'
5184 * and 'keyPasswdNonGsm' are searched through
5185 *-----------------------------------------------------------------
5186 */
5187 j = 0;
5188 table = &keySeqTable[0];
5189
5190 while (j < 4 AND !isEqual)
5191 {
5192 i = 0;
5193
5194 while (table[i].keySeq NEQ NULL AND !isEqual)
5195 {
5196 lastIdx = strlen (table[i].keySeq) - 1;
5197
5198 if (!strncmp (inSeq, table[i].keySeq, ksd_strlen (table[i].keySeq))
5199 AND ( inSeq[lastIdx] EQ START_SI
5200 OR inSeq[lastIdx] EQ STOP_SEQ
5201 OR table[i].keySeq[lastIdx] NEQ DONT_CARE) )
5202 {
5203 isEqual = TRUE;
5204 }
5205 else
5206 {
5207 i++;
5208 }
5209 }
5210
5211 if (!isEqual)
5212 {
5213 switch (j)
5214 {
5215 case (0): table = &keySeqTableNonGsm[0]; break;
5216 case (1): table = &keyPasswd[0]; break;
5217 case (2): table = &keyPasswdNonGsm[0]; break;
5218 default : break;
5219 }
5220 }
5221
5222 j++;
5223 }
5224
5225 if (isEqual)
5226 isSuccess = table[i].func (i,
5227 inSeq,
5228 outSeqGrp,
5229 outRestSeq,
5230 outSeqParam);
5231 else
5232 {
5233 if (ksd_isUSSD (inSeq))
5234 /*
5235 *-------------------------------------------------------------
5236 * incoming sequence is handled like an unstructured
5237 * SS command
5238 *-------------------------------------------------------------
5239 */
5240 isSuccess = ksd_seqUssd (i,
5241 inSeq,
5242 outSeqGrp,
5243 outRestSeq,
5244 outSeqParam);
5245 else
5246 {
5247 /*
5248 *-------------------------------------------------------------
5249 * the handlings of the sequences for changing the call
5250 * mode are separated from the normal handling to avoid
5251 * an incorrect interpretation
5252 *-------------------------------------------------------------
5253 */
5254 #ifdef SMI
5255 if (strncmp (inSeq, DATA_SPEECH_SEQ,
5256 ksd_strlen(DATA_SPEECH_SEQ)) EQ 0)
5257 isSuccess = ksd_seqDataSpeech (i,
5258 inSeq,
5259 outSeqGrp,
5260 outRestSeq,
5261 outSeqParam);
5262 else if (strncmp (inSeq, SPEECH_DATA_SEQ,
5263 ksd_strlen(SPEECH_DATA_SEQ)) EQ 0)
5264 isSuccess = ksd_seqSpeechData (i,
5265 inSeq,
5266 outSeqGrp,
5267 outRestSeq,
5268 outSeqParam);
5269 else
5270 #endif
5271 {
5272 /*
5273 *-------------------------------------------------------------
5274 * determining whether incoming sequence starts with a
5275 * well known key sequence specific for in call mode
5276 *-------------------------------------------------------------
5277 */
5278 //TISH, patch for OMAPS00110151/OMAPS00130693
5279 //start
5280 // if (inCall)
5281 // if (inCall AND (strlen(inSeq) EQ 1)) //disabled by Jinshu Wang, 2007-05-05
5282 if (inCall AND !((psaCC_ctbCountActiveCall() EQ 1) AND (strlen(inSeq) EQ 2) AND (inSeq[0] EQ '1')))
5283 //end
5284 {
5285 i = 0;
5286 table = &keyWithinCall[0];
5287
5288 while (table[i].keySeq NEQ NULL AND
5289 strncmp (inSeq,
5290 table[i].keySeq,
5291 ksd_strlen (table[i].keySeq)) NEQ 0)
5292 i++;
5293
5294 if (table[i].keySeq NEQ NULL)
5295 isSuccess = table[i].func (i,
5296 inSeq,
5297 outSeqGrp,
5298 outRestSeq,
5299 outSeqParam);
5300 }
5301
5302 if (!isSuccess)
5303 isSuccess = ksd_seqDialIdx (i,
5304 inSeq,
5305 outSeqGrp,
5306 outRestSeq,
5307 outSeqParam);
5308
5309 if (!isSuccess)
5310 isSuccess = ksd_seqDial (i,
5311 inSeq,
5312 outSeqGrp,
5313 outRestSeq,
5314 outSeqParam);
5315 }
5316 }
5317 }
5318
5319 return isSuccess;
5320 }
5321
5322 /*
5323 +--------------------------------------------------------------------+
5324 | PROJECT : GSM-PS (6147) MODULE : KSD |
5325 | STATE : code ROUTINE : ksd_getPwdHidden |
5326 +--------------------------------------------------------------------+
5327
5328 PURPOSE : This function is used to hide passwords which are being
5329 entered during input of a keystroke sequence.
5330
5331 <inSeq>: key sequence to be manipulated
5332 <replace>: character which is used for replacing of
5333 passwords
5334 */
5335 GLOBAL void ksd_getPwdHidden (CHAR* inSeq,
5336 CHAR replace)
5337 {
5338 USHORT lastIdx; /* index of the last character in key */
5339 BOOL isEqual = FALSE; /* indicates whether incoming sequence */
5340 /* matches key sequence in sequence */
5341 /* table */
5342 USHORT i; /* used for counting */
5343 USHORT j; /* counts the number of key sequence */
5344 /* tables already searched through */
5345 CHAR bufSeq[MAX_KEYSEQ_SIZE]; /* local copy of incoming */
5346 /* sequence */
5347 const T_KEY_SEQ_TABLE* table; /* actual key sequence table */
5348
5349 CHAR* restSeq; /* rest sequence */
5350 T_KSD_SEQGRP seqGrp; /* seqeunce group */
5351 T_KSD_SEQPARAM seqParam; /* sequence parameter */
5352
5353 TRACE_FUNCTION ("ksd_getPwdHidden ()");
5354
5355 if (inSeq EQ NULL)
5356 return;
5357 else if (strlen (inSeq) EQ 0)
5358 return;
5359
5360 /*
5361 *-----------------------------------------------------------------
5362 * make a local copy of the incoming sequence
5363 *-----------------------------------------------------------------
5364 * decoding process used for identify the sequence group might
5365 * change content of string
5366 *-----------------------------------------------------------------
5367 */
5368 strncpy (bufSeq, inSeq, MAX_KEYSEQ_SIZE-1);
5369 bufSeq[MAX_KEYSEQ_SIZE-1] = NULL_TERM;
5370
5371 /*
5372 *-----------------------------------------------------------------
5373 * determining whether incoming sequence starts with a well known
5374 * key sequence which contains passwords
5375 *-----------------------------------------------------------------
5376 * the two tables 'keyPasswd' and 'keyPasswdNonGsm' are searched
5377 * through
5378 *-----------------------------------------------------------------
5379 */
5380 j = 0;
5381 table = &keyPasswd[0];
5382
5383 while (j < 2 AND !isEqual)
5384 {
5385 i = 0;
5386
5387 while (table[i].keySeq NEQ NULL AND !isEqual)
5388 {
5389 lastIdx = strlen (table[i].keySeq) - 1;
5390
5391 if (!strncmp (inSeq, table[i].keySeq, ksd_strlen (table[i].keySeq))
5392 AND ( inSeq[lastIdx] EQ START_SI
5393 OR inSeq[lastIdx] EQ STOP_SEQ
5394 OR table[i].keySeq[lastIdx] NEQ DONT_CARE) )
5395 {
5396 isEqual = TRUE;
5397 }
5398 else
5399 {
5400 i++;
5401 }
5402 }
5403
5404 if (!isEqual)
5405 {
5406 table = &keyPasswdNonGsm[0];
5407 }
5408
5409 j++;
5410 }
5411
5412 if (isEqual)
5413 {
5414 CHAR* token = inSeq + ksd_strlen(table[i].keySeq);
5415 CHAR* endToken = inSeq + strlen (inSeq) - 1;
5416
5417 (void)table[i].func (i,
5418 bufSeq,
5419 &seqGrp,
5420 &restSeq,
5421 &seqParam);
5422
5423 switch (seqGrp)
5424 {
5425 case (SEQGRP_ACT_SIM_LOCK):
5426 case (SEQGRP_DEACT_SIM_LOCK):
5427 case (SEQGRP_CB):
5428 {
5429 /*
5430 *---------------------------------------------------------
5431 * replace only the characters of the first supplementary
5432 * information field
5433 *---------------------------------------------------------
5434 */
5435 if (*token EQ START_SI)
5436 {
5437 token++;
5438
5439 while (token <= endToken AND
5440 *token NEQ STOP_SEQ AND
5441 *token NEQ START_SI )
5442 {
5443 *token = replace;
5444 token++;
5445 }
5446 }
5447 }
5448 break;
5449
5450 case (SEQGRP_PWD):
5451 case (SEQGRP_UBLK):
5452 {
5453 j = 0;
5454
5455 /*
5456 *---------------------------------------------------------
5457 * replace the characters of the first three supplementary
5458 * information fields
5459 *---------------------------------------------------------
5460 */
5461 while (j < 3)
5462 {
5463 if (*token EQ START_SI)
5464 {
5465 token++;
5466
5467 while (token <= endToken AND
5468 *token NEQ STOP_SEQ AND
5469 *token NEQ START_SI )
5470 {
5471 *token = replace;
5472 token++;
5473 }
5474 }
5475
5476 j++;
5477 }
5478 }
5479 break;
5480
5481 default:
5482 break;
5483 }
5484 }
5485 }
5486
5487 /*
5488 +--------------------------------------------------------------------+
5489 | PROJECT : GSM-PS (6147) MODULE : KSD |
5490 | STATE : code ROUTINE : ksd_isSATSscs |
5491 +--------------------------------------------------------------------+
5492
5493 PURPOSE : This function return whether the given string is a
5494 supplementary service control string for SAT.
5495
5496 <inSeq>: key sequence
5497
5498 returns: TRUE if string is a supplementary service
5499 control string, otherwise FALSE
5500 */
5501 GLOBAL BOOL ksd_isSATSscs ( CHAR* inSeq )
5502 {
5503 char *clirSeq;
5504
5505 if ( !ksd_isSscs ( inSeq ) )
5506 {
5507 return ( FALSE );
5508 }
5509
5510 if ( (clirSeq = strstr ( inSeq, KSD_SUPPRESS_CLIR )) NEQ NULL )
5511 {
5512 clirSeq += strlen ( KSD_SUPPRESS_CLIR );
5513 }
5514 else if ( (clirSeq = strstr ( inSeq, KSD_INVOKE_CLIR )) NEQ NULL )
5515 {
5516 clirSeq += strlen ( KSD_INVOKE_CLIR );
5517 }
5518 else
5519 {
5520 return ( TRUE ); /* no CLIR override found */
5521 }
5522
5523 if ( *clirSeq NEQ '\0' )
5524 {
5525 /* number is provided */
5526 return ( FALSE );
5527 }
5528 return ( TRUE );
5529 }
5530
5531 /*
5532 +--------------------------------------------------------------------+
5533 | PROJECT : GSM-PS (6147) MODULE : KSD |
5534 | STATE : code ROUTINE : ksd_isSscs |
5535 +--------------------------------------------------------------------+
5536
5537 PURPOSE : This function return whether the given string is a !known!
5538 supplementary service control string. (ussd return FALSE !!)
5539
5540 <inSeq>: key sequence
5541
5542 returns: TRUE if string is a supplementary service
5543 control string, otherwise FALSE
5544 */
5545 GLOBAL BOOL ksd_isSscs (CHAR* inSeq)
5546 {
5547 USHORT lastIdx; /* index of the last character in key */
5548 /* sequence stored in sequence table */
5549 BOOL isEqual = FALSE; /* indicates whether incoming sequence */
5550 /* matches key sequence in sequence */
5551 /* table */
5552 USHORT i; /* used for counting */
5553 USHORT j; /* counts the number of key sequence */
5554 /* tables already searched through */
5555 BOOL isSscs = FALSE; /* indicates whether decoding was */
5556 /* successfull */
5557 const T_KEY_SEQ_TABLE* table; /* actual key sequence table */
5558
5559 TRACE_FUNCTION ("ksd_isSscs ()");
5560
5561 if (inSeq EQ NULL OR strlen (inSeq) EQ 0)
5562 {
5563 return isSscs;
5564 }
5565
5566 /*
5567 *-----------------------------------------------------------------
5568 * determining whether incoming sequence starts with a well known
5569 * key sequence
5570 *-----------------------------------------------------------------
5571 * the two tables 'keySeqTable' and 'keyPasswd' are searched
5572 * through
5573 *-----------------------------------------------------------------
5574 */
5575 j = 0;
5576 table = &keySeqTable[0];
5577
5578 while (j < 2 AND !isEqual)
5579 {
5580 i = 0;
5581
5582 while (table[i].keySeq NEQ NULL AND !isEqual)
5583 {
5584 lastIdx = strlen (table[i].keySeq) - 1;
5585
5586 if (!strncmp (inSeq, table[i].keySeq, ksd_strlen (table[i].keySeq))
5587 AND ( inSeq[lastIdx] EQ START_SI
5588 OR inSeq[lastIdx] EQ STOP_SEQ
5589 OR table[i].keySeq[lastIdx] NEQ DONT_CARE) )
5590 {
5591 isEqual = TRUE;
5592 }
5593 else
5594 {
5595 i++;
5596 }
5597 }
5598
5599 if (!isEqual)
5600 {
5601 table = &keyPasswd[0];
5602 }
5603
5604 j++;
5605 }
5606
5607 if (isEqual /*OR ksd_isUSSD (inSeq)*/) /* changed from clb 05/12/00 for SAT */
5608 {
5609 isSscs = TRUE;
5610 }
5611
5612 return isSscs;
5613 }
5614
5615 /*
5616 +--------------------------------------------------------------------+
5617 | PROJECT : GSM-PS (6147) MODULE : KSD |
5618 | STATE : code ROUTINE : ksd_isFDNCheckSeq |
5619 +--------------------------------------------------------------------+
5620
5621 PURPOSE : This function return whether the given string must check
5622 in FDN phonebook
5623
5624 <inSeq>: key sequence
5625
5626 returns: TRUE if string must check,
5627 otherwise FALSE
5628 */
5629
5630 GLOBAL BOOL ksd_isFDNCheckSeq (CHAR* inSeq)
5631 {
5632 USHORT lastIdx; /* index of the last character in key */
5633 /* sequence stored in sequence table */
5634 USHORT i=0; /* used for counting */
5635
5636 TRACE_FUNCTION ("ksd_isFDNCheckSeq ()");
5637
5638 if ( ( inSeq EQ NULL ) OR ( *inSeq EQ '\0' ) )
5639 {
5640 return ( FALSE ); /* no check */
5641 }
5642 /* check if the inSeq a key sequence */
5643 if ( ( *inSeq NEQ START_SEQ_1 ) AND ( *inSeq NEQ START_SEQ_2 ) )
5644 {
5645 /* normal number must check in FDN */
5646 return ( TRUE ); /* check */
5647 }
5648
5649 /*
5650 *-----------------------------------------------------------------
5651 * determining whether incoming sequence starts with a well known
5652 * key sequence
5653 */
5654 while ( keyNoFDNSeqTable[i].keySeq NEQ NULL )
5655 {
5656 lastIdx = strlen (keyNoFDNSeqTable[i].keySeq) - 1;
5657
5658 if ( strncmp ( inSeq,
5659 keyNoFDNSeqTable[i].keySeq,
5660 ksd_strlen ( keyNoFDNSeqTable[i].keySeq ) ) EQ 0 )
5661 {
5662 if ( keyNoFDNSeqTable[i].keySeq[lastIdx] EQ DONT_CARE )
5663 {
5664 if ( inSeq[lastIdx] EQ START_SI OR inSeq[lastIdx] EQ STOP_SEQ )
5665 {
5666 return ( FALSE ); /* no check */
5667 }
5668 }
5669 else
5670 {
5671 return ( FALSE ); /* no check */
5672 }
5673 }
5674 i++;
5675 }
5676
5677 return ( TRUE ); /* check */
5678 }
5679
5680
5681 /*
5682 +--------------------------------------------------------------------+
5683 | PROJECT : GSM-PS (6147) MODULE : KSD |
5684 | STATE : code ROUTINE : ksd_isBCDForUSBand |
5685 +--------------------------------------------------------------------+
5686
5687 PURPOSE : This function checks if US band is used and key sequence
5688 is "0" or "00", because these key sequences shall be send
5689 to network as normal dialing numbers when using US band.
5690
5691 <inSeq>: key sequence
5692
5693 returns: TRUE if US band is used and key sequence
5694 is "0" or "00",
5695 otherwise FALSE
5696 */
5697 GLOBAL BOOL ksd_isBCDForUSBand (CHAR* inSeq)
5698 {
5699 SHORT mcc,mnc;
5700
5701 TRACE_FUNCTION("ksd_isBCDForUSBand()");
5702
5703 /*
5704 * Get the current MCC (and MNC, although we are not interested
5705 * in that) in SHORT form.
5706 */
5707 cmhMM_CnvrtPLMN2INT(mmShrdPrm.usedPLMN.mcc,mmShrdPrm.usedPLMN.mnc,&mcc,&mnc);
5708
5709 /*
5710 * Check if band is US band, based on whether the current MCC is
5711 * a US MCC.
5712 */
5713 if ((mcc>=0x310) AND (mcc<=0x316))
5714 {
5715 /* US band is used, check key sequence */
5716 if ( !strcmp(inSeq, "0") OR !strcmp(inSeq, "00") )
5717 {
5718 TRACE_EVENT("US band detected, %s are normal dialing numbers");
5719 return TRUE;
5720 }
5721 }
5722
5723 return FALSE;
5724 }
5725
5726 /*
5727 +--------------------------------------------------------------------+
5728 | PROJECT : GSM-PS (6147) MODULE : KSD |
5729 | STATE : code ROUTINE : ksd_check_write_to_LDN |
5730 +--------------------------------------------------------------------+
5731
5732 PURPOSE : This function is used to decide if the keystroke sequence needs to
5733 be stored in the LDN or not.
5734
5735 <inSeq>: key sequence
5736
5737 returns: TRUE if the keystroke sequence doesn't contain password
5738 or it is not a local string
5739 otherwise FALSE
5740 */
5741 GLOBAL BOOL ksd_isLDNWriteCheckSeq (CHAR* inSeq)
5742 {
5743
5744 USHORT lastIdx; /* index of the last character in key */
5745 /* sequence stored in sequence table */
5746 USHORT i; /* used for counting */
5747 USHORT j; /* counts the number of key sequence */
5748 /* tables already searched through */
5749 const T_KEY_SEQ_TABLE* table; /* actual key sequence table */
5750
5751 TRACE_FUNCTION("ksd_isLDNWriteCheckSeq()");
5752
5753 if (inSeq EQ NULL OR strlen (inSeq) EQ 0)
5754 {
5755 return TRUE;
5756 }
5757
5758 j = 0;
5759 table = &keySeqTableNonGsm[0];
5760
5761 while (j < 4)
5762 {
5763 i = 0;
5764
5765 while (table[i].keySeq NEQ NULL)
5766 {
5767 lastIdx = strlen (table[i].keySeq) - 1;
5768
5769 if (!strncmp (inSeq, table[i].keySeq, ksd_strlen (table[i].keySeq))
5770 AND ( inSeq[lastIdx] EQ START_SI
5771 OR inSeq[lastIdx] EQ STOP_SEQ
5772 OR table[i].keySeq[lastIdx] NEQ DONT_CARE) )
5773 {
5774 return FALSE;
5775 }
5776 else
5777 {
5778 i++;
5779 }
5780 }
5781
5782 switch (j)
5783 {
5784 case (0): table = &keyPasswd[0]; break;
5785 case (1): table = &keyPasswdNonGsm[0]; break;
5786 case (2): table = &keyNoFDNSeqTable[0]; break;
5787 default : break;
5788 }
5789
5790 j++;
5791 }
5792 return TRUE;
5793 }
5794
5795 /*
5796 +--------------------------------------------------------------------+
5797 | PROJECT : GSM-PS (6147) MODULE : KSD |
5798 | STATE : code ROUTINE : ksd_seqRegPwdOutBarrServ |
5799 +--------------------------------------------------------------------+
5800
5801 PURPOSE : This function sets the ouput parameter for the
5802 SEQGRP_PWD, key sequence.
5803 */
5804 LOCAL BOOL ksd_seqRegPwdOutBarrServ (USHORT inIdx,
5805 CHAR* inSeq,
5806 T_KSD_SEQGRP* outSeqGrp,
5807 CHAR** outRestSeq,
5808 T_KSD_SEQPARAM* outSeqParam)
5809 {
5810 TRACE_FUNCTION ("ksd_seqRegPwdOutBarrServ ()");
5811
5812 outSeqParam->pwd.ssCd = KSD_SS_BOC;
5813
5814 *outSeqGrp = SEQGRP_PWD;
5815
5816 return ksd_getCpwdFromTriplePw (inIdx, inSeq, outRestSeq, outSeqParam);
5817 }
5818
5819 /*
5820 +--------------------------------------------------------------------+
5821 | PROJECT : GSM-PS (6147) MODULE : KSD |
5822 | STATE : code ROUTINE : ksd_seqRegPwdInBarrServ |
5823 +--------------------------------------------------------------------+
5824
5825 PURPOSE : This function sets the ouput parameter for the
5826 SEQGRP_PWD, key sequence.
5827 */
5828 LOCAL BOOL ksd_seqRegPwdInBarrServ (USHORT inIdx,
5829 CHAR* inSeq,
5830 T_KSD_SEQGRP* outSeqGrp,
5831 CHAR** outRestSeq,
5832 T_KSD_SEQPARAM* outSeqParam)
5833 {
5834 TRACE_FUNCTION ("ksd_seqRegPwdInBarrServ ()");
5835
5836 outSeqParam->pwd.ssCd = KSD_SS_BIC;
5837
5838 *outSeqGrp = SEQGRP_PWD;
5839
5840 return ksd_getCpwdFromTriplePw (inIdx, inSeq, outRestSeq, outSeqParam);
5841 }
5842
5843 /*
5844 +--------------------------------------------------------------------+
5845 | PROJECT : GSM-PS (6147) MODULE : KSD |
5846 | STATE : code ROUTINE : ksd_seqActOutBarrServ |
5847 +--------------------------------------------------------------------+
5848
5849 PURPOSE : This function sets the ouput parameter for the
5850 SEQGRP_CB, KSD_OP_ACT, KSD_SS_BOC key sequence.
5851 */
5852 LOCAL BOOL ksd_seqActOutBarrServ (USHORT inIdx,
5853 CHAR* inSeq,
5854 T_KSD_SEQGRP* outSeqGrp,
5855 CHAR** outRestSeq,
5856 T_KSD_SEQPARAM* outSeqParam)
5857 {
5858 TRACE_FUNCTION ("ksd_seqActOutBarrServ ()");
5859
5860 outSeqParam->cb.opCd = KSD_OP_ACT;
5861 outSeqParam->cb.ssCd = KSD_SS_BOC;
5862
5863 *outSeqGrp = SEQGRP_CB;
5864
5865 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
5866 }
5867
5868 /*
5869 +--------------------------------------------------------------------+
5870 | PROJECT : GSM-PS (6147) MODULE : KSD |
5871 | STATE : code ROUTINE : ksd_seqActInBarrServ |
5872 +--------------------------------------------------------------------+
5873
5874 PURPOSE : This function sets the ouput parameter for the
5875 SEQGRP_CB, KSD_OP_ACT, KSD_SS_BIC key sequence.
5876 */
5877 LOCAL BOOL ksd_seqActInBarrServ (USHORT inIdx,
5878 CHAR* inSeq,
5879 T_KSD_SEQGRP* outSeqGrp,
5880 CHAR** outRestSeq,
5881 T_KSD_SEQPARAM* outSeqParam)
5882 {
5883 TRACE_FUNCTION ("ksd_seqActInBarrServ ()");
5884
5885 outSeqParam->cb.opCd = KSD_OP_ACT;
5886 outSeqParam->cb.ssCd = KSD_SS_BIC;
5887
5888 *outSeqGrp = SEQGRP_CB;
5889
5890 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
5891 }
5892
5893
5894 /*
5895 +--------------------------------------------------------------------+
5896 | PROJECT : GSM-PS (6147) MODULE : KSD |
5897 | STATE : code ROUTINE : ksd_seqActAllBarrServ |
5898 +--------------------------------------------------------------------+
5899
5900 PURPOSE : This function sets the ouput parameter for the
5901 SEQGRP_CB, KSD_OP_ACT, KSD_SS_ALL_CBSS key sequence.
5902 */
5903 LOCAL BOOL ksd_seqActAllBarrServ (USHORT inIdx,
5904 CHAR* inSeq,
5905 T_KSD_SEQGRP* outSeqGrp,
5906 CHAR** outRestSeq,
5907 T_KSD_SEQPARAM* outSeqParam)
5908 {
5909 TRACE_FUNCTION ("ksd_seqActAllBarrServ ()");
5910
5911 outSeqParam->cb.opCd = KSD_OP_ACT;
5912 outSeqParam->cb.ssCd = KSD_SS_ALL_CBSS;
5913
5914 *outSeqGrp = SEQGRP_CB;
5915
5916 return ksd_getClckFromPwBs (inIdx, inSeq, TRUE, outRestSeq, outSeqParam);
5917 }