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