FreeCalypso > hg > freecalypso-citrine
comparison g23m-gsm/sms/sms_pei.c @ 0:75a11d740a02
initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 09 Jun 2016 00:02:41 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:75a11d740a02 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : | |
4 | Modul : | |
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 implements the process body interface | |
18 | for the entity SMS of the mobile station. | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #ifndef SMS_PEI_C | |
23 #define SMS_PEI_C | |
24 | |
25 #include "config.h" | |
26 #include "fixedconf.h" | |
27 #include "condat-features.h" | |
28 | |
29 #define ENTITY_SMS | |
30 | |
31 /*==== INCLUDES ===================================================*/ | |
32 | |
33 #include <string.h> | |
34 #include <stdlib.h> | |
35 #include <stddef.h> | |
36 #include "typedefs.h" | |
37 #include "pcm.h" | |
38 #include "vsi.h" | |
39 #include "custom.h" | |
40 #include "gsm.h" | |
41 #include "message.h" | |
42 #include "ccdapi.h" | |
43 #include "prim.h" | |
44 #include "cus_sms.h" | |
45 #include "cnf_sms.h" | |
46 #include "mon_sms.h" | |
47 #include "pei.h" | |
48 #include "tok.h" | |
49 #include "sms.h" | |
50 #include "sms_em.h" | |
51 | |
52 #ifdef GPRS | |
53 #include "gprs.h" | |
54 #endif /* #ifdef GPRS */ | |
55 | |
56 /*==== EXPORT =====================================================*/ | |
57 #ifdef TI_PS_HCOMM_CHANGE | |
58 #else | |
59 GLOBAL T_HANDLE hCommSIM = VSI_ERROR; /* SIM Communication */ | |
60 GLOBAL T_HANDLE hCommMMI = VSI_ERROR; /* MMI Communication */ | |
61 GLOBAL T_HANDLE hCommMM = VSI_ERROR; /* MM Communication */ | |
62 #endif /* TI_PS_HCOMM_CHANGE */ | |
63 #ifdef GPRS | |
64 GLOBAL T_HANDLE hCommLLC = VSI_ERROR; /* LL Communication */ | |
65 GLOBAL T_HANDLE hCommGMM = VSI_ERROR; /* GMM Communication */ | |
66 #endif /* #ifdef GPRS */ | |
67 GLOBAL T_HANDLE sms_handle; | |
68 | |
69 GLOBAL T_SMS_DATA sms_data_base; | |
70 | |
71 /*==== PRIVATE ====================================================*/ | |
72 | |
73 static void pei_not_supported (void *data); | |
74 | |
75 /*==== VARIABLES ==================================================*/ | |
76 #ifdef _SIMULATION_ | |
77 static BOOL first_access = TRUE; | |
78 #endif /* _SIMULATION_ */ | |
79 static T_MONITOR sms_mon; | |
80 | |
81 /*==== FUNCTIONS ==================================================*/ | |
82 | |
83 LOCAL const T_FUNC mnsms_table[] = { | |
84 MAK_FUNC_0( tl_mnsms_delete_req, MNSMS_DELETE_REQ ), | |
85 MAK_FUNC_0( tl_mnsms_read_req, MNSMS_READ_REQ ), | |
86 MAK_FUNC_0( tl_mnsms_store_req, MNSMS_STORE_REQ ), | |
87 MAK_FUNC_0( tl_mnsms_submit_req, MNSMS_SUBMIT_REQ ), | |
88 MAK_FUNC_0( tl_mnsms_command_req, MNSMS_COMMAND_REQ ), | |
89 MAK_FUNC_0( tl_mnsms_configure_req, MNSMS_CONFIGURE_REQ ), | |
90 MAK_FUNC_0( tl_mnsms_pause_req, MNSMS_PAUSE_REQ ), | |
91 MAK_FUNC_0( tl_mnsms_resume_req, MNSMS_RESUME_REQ ), | |
92 MAK_FUNC_0( tl_mnsms_ack_res, MNSMS_ACK_RES ), | |
93 #ifdef REL99 | |
94 MAK_FUNC_0( tl_mnsms_retrans_req, MNSMS_RETRANS_REQ ), | |
95 #else | |
96 MAK_FUNC_N( pei_not_supported, 0 ), | |
97 #endif | |
98 MAK_FUNC_N( pei_not_supported, 0 ), | |
99 MAK_FUNC_0( tl_mnsms_query_req, MNSMS_QUERY_REQ ) | |
100 | |
101 #ifdef GPRS | |
102 , | |
103 MAK_FUNC_0( tl_mnsms_mo_serv_req, MNSMS_MO_SERV_REQ ) | |
104 #endif /* #ifdef GPRS */ | |
105 #ifdef SIM_PERS_OTA | |
106 , | |
107 MAK_FUNC_0( tl_mnsms_OTA_message_res, MNSMS_OTA_MESSAGE_RES ) | |
108 #endif | |
109 }; | |
110 | |
111 LOCAL const T_FUNC mmsms_table[] = { | |
112 MAK_FUNC_S( for_mmsms_data_ind, MMSMS_DATA_IND ), | |
113 MAK_FUNC_0( cp_mmsms_error_ind, MMSMS_ERROR_IND ), | |
114 MAK_FUNC_0( cp_mmsms_establish_cnf, MMSMS_ESTABLISH_CNF ), | |
115 MAK_FUNC_S( for_mmsms_establish_ind, MMSMS_ESTABLISH_IND ), | |
116 MAK_FUNC_0( cp_mmsms_release_ind, MMSMS_RELEASE_IND ), | |
117 MAK_FUNC_N( pei_not_supported, MMSMS_UNITDATA_IND ) | |
118 }; | |
119 | |
120 LOCAL const T_FUNC sim_table[] = { | |
121 #if defined(SIM_TOOLKIT) OR defined(FF_CPHS) | |
122 MAK_FUNC_0( tl_sim_read_cnf, SIM_READ_CNF ), | |
123 #else | |
124 MAK_FUNC_N( pei_not_supported, SIM_READ_CNF ), | |
125 #endif /* else, #if defined(SIM_TOOLKIT) OR defined(FF_CPHS) */ | |
126 MAK_FUNC_0( tl_sim_update_cnf, SIM_UPDATE_CNF ), | |
127 MAK_FUNC_0( tl_sim_read_record_cnf, SIM_READ_RECORD_CNF ), | |
128 MAK_FUNC_N( pei_not_supported, 0 ), | |
129 MAK_FUNC_0( tl_sim_update_record_cnf, SIM_UPDATE_RECORD_CNF ), | |
130 MAK_FUNC_N( pei_not_supported, 0 ), | |
131 MAK_FUNC_N( pei_not_supported, 0 ), | |
132 MAK_FUNC_N( pei_not_supported, 0 ), | |
133 MAK_FUNC_N( pei_not_supported, SIM_INCREMENT_CNF ), | |
134 MAK_FUNC_N( pei_not_supported, SIM_VERIFY_PIN_CNF ), | |
135 MAK_FUNC_N( pei_not_supported, SIM_CHANGE_PIN_CNF ), | |
136 MAK_FUNC_N( pei_not_supported, SIM_DISABLE_PIN_CNF ), | |
137 MAK_FUNC_N( pei_not_supported, SIM_ENABLE_PIN_CNF ), | |
138 MAK_FUNC_N( pei_not_supported, SIM_UNBLOCK_CNF ), | |
139 MAK_FUNC_N( pei_not_supported, SIM_AUTHENTICATION_CNF), | |
140 MAK_FUNC_N( pei_not_supported, SIM_MMI_INSERT_IND ), | |
141 MAK_FUNC_N( pei_not_supported, SIM_MM_INSERT_IND ), | |
142 MAK_FUNC_0( tl_sim_remove_ind, SIM_REMOVE_IND ), | |
143 MAK_FUNC_N( pei_not_supported, SIM_SYNC_CNF ), | |
144 MAK_FUNC_N( pei_not_supported, SIM_ACTIVATE_CNF ), | |
145 MAK_FUNC_0( tl_sim_sms_insert_ind, SIM_SMS_INSERT_IND ), | |
146 #if defined(SIM_TOOLKIT) AND defined(SAT_SMS_DNL_SUPPORT) | |
147 MAK_FUNC_N( pei_not_supported, SIM_TOOLKIT_IND ), | |
148 MAK_FUNC_0( tl_sim_toolkit_cnf, SIM_TOOLKIT_CNF ), | |
149 #else | |
150 MAK_FUNC_N( pei_not_supported, SIM_TOOLKIT_IND ), | |
151 MAK_FUNC_N( pei_not_supported, SIM_TOOLKIT_CNF ), | |
152 #endif /* else, #if defined(SIM_TOOLKIT) AND defined(SAT_SMS_DNL_SUPPORT) */ | |
153 MAK_FUNC_N( pei_not_supported, 0 ), | |
154 MAK_FUNC_N( pei_not_supported, 0 ), | |
155 MAK_FUNC_N( pei_not_supported, 0 ), | |
156 #ifdef SIM_TOOLKIT | |
157 MAK_FUNC_0( tl_sim_file_update_ind, SIM_FILE_UPDATE_IND ) | |
158 #else | |
159 MAK_FUNC_N( pei_not_supported, SIM_FILE_UPDATE_IND ) | |
160 #endif /* else, #ifdef SIM_TOOLKIT */ | |
161 }; | |
162 | |
163 #ifdef GPRS | |
164 LOCAL const T_FUNC ll_table[] = { | |
165 MAK_FUNC_N( pei_not_supported, 0 ), | |
166 MAK_FUNC_N( pei_not_supported, 0 ), | |
167 MAK_FUNC_N( pei_not_supported, 0 ), | |
168 MAK_FUNC_N( pei_not_supported, 0 ), | |
169 MAK_FUNC_N( pei_not_supported, 0 ), | |
170 MAK_FUNC_N( pei_not_supported, 0 ), | |
171 MAK_FUNC_N( pei_not_supported, 0 ), | |
172 MAK_FUNC_N( pei_not_supported, 0 ), | |
173 MAK_FUNC_0( for_ll_unitready_ind, LL_UNITREADY_IND ), | |
174 MAK_FUNC_N( pei_not_supported, 0 ), | |
175 MAK_FUNC_N( pei_not_supported, 0 ), | |
176 MAK_FUNC_0( for_ll_unitdata_ind, LL_UNITDATA_IND ) | |
177 }; | |
178 | |
179 LOCAL const T_FUNC gmmsms_table[] = { | |
180 MAK_FUNC_0( cp_gmmsms_reg_state_cnf, GMMSMS_REG_STATE_CNF ) | |
181 }; | |
182 #endif /* #ifdef GPRS */ | |
183 | |
184 #ifdef FF_EM_MODE | |
185 LOCAL const T_FUNC em_table[] = { | |
186 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x00 */ | |
187 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x01 */ | |
188 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x02 */ | |
189 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x03 */ | |
190 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x04 */ | |
191 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x05 */ | |
192 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x06 */ | |
193 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x07 */ | |
194 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x08 */ | |
195 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x09 */ | |
196 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x0A */ | |
197 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x0B */ | |
198 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x0C */ | |
199 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x0D */ | |
200 MAK_FUNC_N (pei_not_supported , 0 ), /* 0x0E */ | |
201 MAK_FUNC_0 (sms_em_sms_event_req, EM_SMS_EVENT_REQ) /* 0x0F */ | |
202 }; | |
203 #endif /* #ifdef FF_EM_MODE */ | |
204 | |
205 /* | |
206 +--------------------------------------------------------------------+ | |
207 | PROJECT : GSM-PS (8410) MODULE : SMS_PEI | | |
208 | STATE : code ROUTINE : pei_primitive | | |
209 +--------------------------------------------------------------------+ | |
210 | |
211 PURPOSE : Process protocol specific primitive. | |
212 | |
213 */ | |
214 | |
215 LOCAL SHORT pei_primitive (void * ptr) | |
216 { | |
217 T_PRIM *prim = ptr; | |
218 | |
219 /* | |
220 * | | | | |
221 * MNSMS SIM EM UPLINK | |
222 * | | | | |
223 * +-----v----------v-----v----+ | |
224 * | | | |
225 * | SMS | | |
226 * | | | |
227 * +-------------^-------------+ | |
228 * | | |
229 * MMSMS/LLC DOWNLINK | |
230 * | | |
231 * | |
232 */ | |
233 | |
234 TRACE_FUNCTION ("pei_primitive()"); | |
235 | |
236 if (prim NEQ NULL) | |
237 { | |
238 ULONG opc = prim->custom.opc; | |
239 USHORT n; | |
240 const T_FUNC *table; | |
241 | |
242 VSI_PPM_REC ((T_PRIM_HEADER*)prim, __FILE__, __LINE__); | |
243 | |
244 PTRACE_IN (opc); | |
245 | |
246 switch (SAP_NR(opc)) | |
247 { | |
248 case SAP_NR(MNSMS_UL): table = mnsms_table; n = TAB_SIZE ( mnsms_table); break; | |
249 case SAP_NR(MMSMS_DL): table = mmsms_table; n = TAB_SIZE ( mmsms_table); break; | |
250 case SAP_NR(SIM_UL): table = sim_table; n = TAB_SIZE ( sim_table); break; | |
251 #ifdef GPRS | |
252 case LL_DL: table = ll_table; n = TAB_SIZE ( ll_table); break; | |
253 case GMMSMS_DL: table = gmmsms_table; n = TAB_SIZE (gmmsms_table); break; | |
254 #endif /* #ifdef GPRS */ | |
255 #ifdef FF_EM_MODE | |
256 case EM_Ul: table = em_table; n = TAB_SIZE (em_table) ; break; | |
257 #endif /* #ifdef FF_EM_MODE */ | |
258 default : table = NULL; n = 0; break; | |
259 } | |
260 | |
261 if (table != NULL ) | |
262 { | |
263 if (PRIM_NR(opc) < n) | |
264 { | |
265 table += PRIM_NR(opc); | |
266 #ifdef PALLOC_TRANSITION | |
267 P_SDU(prim) = table->soff ? (T_sdu*) (((char*)&prim->data) + table->soff) : 0; | |
268 #ifndef NO_COPY_ROUTING | |
269 P_LEN(prim) = table->size + sizeof (T_PRIM_HEADER); | |
270 #endif /* NO_COPY_ROUTING */ | |
271 #endif /* PALLOC_TRANSITION */ | |
272 JUMP (table->func) (P2D(prim)); | |
273 } | |
274 else | |
275 { | |
276 pei_not_supported (P2D(prim)); | |
277 } | |
278 return PEI_OK; | |
279 } | |
280 | |
281 /* | |
282 * Primitive is no GSM Primitive | |
283 * then forward to the environment | |
284 */ | |
285 | |
286 #ifdef GSM_ONLY | |
287 PFREE (P2D(prim)) | |
288 | |
289 return PEI_ERROR; | |
290 #else | |
291 if (opc & SYS_MASK) | |
292 vsi_c_primitive (VSI_CALLER prim); | |
293 else | |
294 { | |
295 PFREE (P2D(prim)); | |
296 return PEI_ERROR; | |
297 } | |
298 #endif /* else, #ifdef GSM_ONLY */ | |
299 } | |
300 return PEI_OK; | |
301 } | |
302 | |
303 /* | |
304 +--------------------------------------------------------------------+ | |
305 | PROJECT : GSM-PS (8410) MODULE : SMS_PEI | | |
306 | STATE : code ROUTINE : pei_not_supported | | |
307 +--------------------------------------------------------------------+ | |
308 | |
309 PURPOSE : An unsupported primitive is received. | |
310 | |
311 */ | |
312 | |
313 static void pei_not_supported (void *data) | |
314 { | |
315 TRACE_FUNCTION ("pei_not_supported()"); | |
316 | |
317 PFREE (data); | |
318 } | |
319 | |
320 | |
321 /* | |
322 +--------------------------------------------------------------------+ | |
323 | PROJECT : GSM-PS (8410) MODULE : SMS_PEI | | |
324 | STATE : code ROUTINE : pei_init | | |
325 +--------------------------------------------------------------------+ | |
326 | |
327 PURPOSE : Initialize Protocol Stack Entity | |
328 | |
329 */ | |
330 | |
331 LOCAL SHORT pei_init (T_HANDLE handle) | |
332 { | |
333 sms_handle = handle; | |
334 | |
335 TRACE_FUNCTION ("pei_init()"); | |
336 | |
337 #ifdef TI_PS_HCOMM_CHANGE | |
338 if (!cl_hcom_all_handles_open()) | |
339 { | |
340 return PEI_ERROR; | |
341 } | |
342 #else /* for hCommHandles backward compatibility */ | |
343 if (hCommMMI < VSI_OK) | |
344 { | |
345 /* | |
346 * Open MMI (Layer 4) | |
347 */ | |
348 | |
349 if ((hCommMMI = vsi_c_open (VSI_CALLER ACI_NAME)) < VSI_OK) | |
350 return PEI_ERROR; | |
351 } | |
352 | |
353 if (hCommMM < VSI_OK) | |
354 { | |
355 if ((hCommMM = vsi_c_open (VSI_CALLER MM_NAME)) < VSI_OK) | |
356 return PEI_ERROR; | |
357 } | |
358 | |
359 if (hCommSIM < VSI_OK) | |
360 { | |
361 if ((hCommSIM = vsi_c_open (VSI_CALLER SIM_NAME)) < VSI_OK) | |
362 return PEI_ERROR; | |
363 } | |
364 #endif /* TI_PS_HCOMM_CHANGE */ | |
365 #if defined (GPRS) | |
366 /* | |
367 * Open LLC for GPRS GSMS handling | |
368 */ | |
369 if (hCommLLC < VSI_OK) | |
370 { | |
371 if ((hCommLLC = vsi_c_open (VSI_CALLER LLC_NAME)) < VSI_OK) | |
372 return PEI_ERROR; | |
373 } | |
374 /* | |
375 * Open GMM for GPRS registration inquiry | |
376 */ | |
377 if (hCommGMM < VSI_OK) | |
378 { | |
379 if ((hCommGMM = vsi_c_open (VSI_CALLER GMM_NAME)) < VSI_OK) | |
380 return PEI_ERROR; | |
381 } | |
382 #endif /* GPRS */ | |
383 | |
384 /* | |
385 * Initialize data base | |
386 */ | |
387 cp_init (); | |
388 rl_init (); | |
389 tl_init (); | |
390 for_init_sms (); | |
391 pcm_Init (); | |
392 | |
393 ccd_init (); | |
394 | |
395 #ifdef FF_EM_MODE | |
396 em_init_sms_event_trace(); | |
397 #endif /* #ifdef FF_EM_MODE */ | |
398 | |
399 return PEI_OK; | |
400 } | |
401 | |
402 /* | |
403 +--------------------------------------------------------------------+ | |
404 | PROJECT : GSM-PS (8410) MODULE : SMS_PEI | | |
405 | STATE : code ROUTINE : pei_timeout | | |
406 +--------------------------------------------------------------------+ | |
407 | |
408 PURPOSE : Process timeout | |
409 | |
410 */ | |
411 | |
412 LOCAL SHORT pei_timeout (USHORT index) | |
413 { | |
414 tim_exec_timeout (index); | |
415 return PEI_OK; | |
416 } | |
417 | |
418 #ifdef _SIMULATION_ | |
419 /* | |
420 +--------------------------------------------------------------------+ | |
421 | PROJECT : GSM-PS (8410) MODULE : SMS_PEI | | |
422 | STATE : code ROUTINE : pei_exit | | |
423 +--------------------------------------------------------------------+ | |
424 | |
425 PURPOSE : Close Resources and terminate | |
426 | |
427 */ | |
428 | |
429 LOCAL SHORT pei_exit (void) | |
430 { | |
431 TRACE_FUNCTION ("pei_exit()"); | |
432 | |
433 /* | |
434 * clean up communication | |
435 */ | |
436 #ifdef TI_PS_HCOMM_CHANGE | |
437 #else /* for hCommHandles backward compatibility */ | |
438 vsi_c_close (VSI_CALLER hCommMMI); | |
439 hCommMMI = VSI_ERROR; | |
440 | |
441 vsi_c_close (VSI_CALLER hCommMM); | |
442 hCommMM = VSI_ERROR; | |
443 | |
444 vsi_c_close (VSI_CALLER hCommSIM); | |
445 hCommSIM = VSI_ERROR; | |
446 #endif /* TI_PS_HCOMM_CHANGE */ | |
447 #ifdef GPRS | |
448 vsi_c_close (VSI_CALLER hCommLLC); | |
449 hCommLLC = VSI_ERROR; | |
450 | |
451 vsi_c_close (VSI_CALLER hCommGMM); | |
452 hCommGMM = VSI_ERROR; | |
453 #endif /* #ifdef GPRS */ | |
454 | |
455 return PEI_OK; | |
456 } | |
457 #endif /* _SIMULATION_ */ | |
458 | |
459 /* | |
460 +--------------------------------------------------------------------+ | |
461 | PROJECT : GSM-PS (8410) MODULE : SMS_PEI | | |
462 | STATE : code ROUTINE : pei_config | | |
463 +--------------------------------------------------------------------+ | |
464 | |
465 PURPOSE : Dynamic Configuration | |
466 | |
467 */ | |
468 | |
469 #ifndef NCONFIG | |
470 LOCAL const KW_DATA kwtab[] = { | |
471 SMS_CONF_STRING_PAUSE, SMS_CONF_EVENT_PAUSE, | |
472 SMS_CONF_STRING_RESUME, SMS_CONF_EVENT_RESUME, | |
473 "", 0 | |
474 }; | |
475 #endif /* #ifndef NCONFIG */ | |
476 | |
477 #if !defined(NTRACE) && !defined(NCONFIG) | |
478 GLOBAL const KW_DATA partab[] = { | |
479 TC1M_NAME, TC1M, | |
480 TR1M_NAME, TR1M, | |
481 TR2M_NAME, TR2M, | |
482 TRAM_NAME, TRAM, | |
483 TLCT_NAME, TLCT, | |
484 TMMS_NAME, TMMS, | |
485 "", 0 | |
486 }; | |
487 #endif /* #if !defined(NTRACE) && !defined(NCONFIG) */ | |
488 | |
489 /* Implements Measure#36 */ | |
490 #ifndef NCONFIG | |
491 LOCAL SHORT pei_config (T_PEI_CONFIG inString) | |
492 { | |
493 #ifndef NCONFIG | |
494 char * s = inString; | |
495 char * keyw; | |
496 char * val [10]; | |
497 | |
498 GET_INSTANCE_DATA; | |
499 | |
500 TRACE_FUNCTION ("pei_config()"); | |
501 | |
502 TRACE_FUNCTION (s); | |
503 | |
504 tok_init(s); | |
505 | |
506 /* | |
507 * Parse next keyword and number of variables | |
508 */ | |
509 while ((tok_next(&keyw,val)) NEQ TOK_EOCS) | |
510 { | |
511 switch ((tok_key((KW_DATA *)kwtab,keyw))) | |
512 { | |
513 case TOK_NOT_FOUND: | |
514 TRACE_ERROR ("[PEI_CONFIG]: Illegal Keyword"); | |
515 break; | |
516 | |
517 case SMS_CONF_EVENT_PAUSE: | |
518 TRACE_EVENT("SMS_CONF_EVENT_PAUSE"); | |
519 tl_pause(); | |
520 break; | |
521 case SMS_CONF_EVENT_RESUME: | |
522 TRACE_EVENT("SMS_CONF_EVENT_RESUME"); | |
523 /* tl_resume(sms_data); */ | |
524 | |
525 GET_MO_INSTANCE(sms_data); | |
526 /* | |
527 * TL state transition TL_ESTABLISH | |
528 * EST state transition EST_SMMA | |
529 * MMI state transition MMI_RESUME | |
530 * | |
531 */ | |
532 SET_STATE (STATE_MMI, MMI_RESUME); | |
533 SET_STATE (STATE_EST, EST_SMMA); | |
534 SMS_INST_SET_STATE (STATE_TL, TL_ESTABLISH); | |
535 /* | |
536 * 1st shot | |
537 */ | |
538 SMS_INST.retrans = FALSE; | |
539 /* | |
540 * establish connection | |
541 */ | |
542 tl_establish_connection(FALSE); | |
543 break; | |
544 default: | |
545 break; | |
546 } | |
547 } | |
548 #endif /* #ifndef NCONFIG */ | |
549 | |
550 return PEI_OK; | |
551 } | |
552 #endif /* NCONFIG */ | |
553 | |
554 | |
555 /* | |
556 +--------------------------------------------------------------------+ | |
557 | PROJECT : GSM-PS (6147) MODULE : SMS_PEI | | |
558 | STATE : code ROUTINE : sms_pei_config | | |
559 +--------------------------------------------------------------------+ | |
560 | |
561 PURPOSE : Dynamic Configuration | |
562 | |
563 */ | |
564 /* Implements Measure#36 */ | |
565 #ifndef NCONFIG | |
566 GLOBAL SHORT sms_pei_config ( char * inString, char * dummy ) | |
567 { | |
568 pei_config ( inString ); | |
569 | |
570 return PEI_OK; | |
571 } | |
572 #endif /* NCONFIG */ | |
573 | |
574 | |
575 /* | |
576 +--------------------------------------------------------------------+ | |
577 | PROJECT : GSM-PS (8410) MODULE : SMS_PEI | | |
578 | STATE : code ROUTINE : pei_monitor | | |
579 +--------------------------------------------------------------------+ | |
580 | |
581 PURPOSE : Monitoring of physical Parameters | |
582 | |
583 */ | |
584 | |
585 LOCAL SHORT pei_monitor (void ** monitor) | |
586 { | |
587 TRACE_FUNCTION ("pei_monitor()"); | |
588 | |
589 /* Implements Measure#32: Row 20 */ | |
590 | |
591 * monitor = &sms_mon; | |
592 | |
593 return PEI_OK; | |
594 } | |
595 | |
596 /* | |
597 +--------------------------------------------------------------------+ | |
598 | PROJECT : GSM-PS (8410) MODULE : SMS_PEI | | |
599 | STATE : code ROUTINE : pei_create | | |
600 +--------------------------------------------------------------------+ | |
601 | |
602 PURPOSE : Create the Protocol Stack Entity | |
603 | |
604 */ | |
605 | |
606 GLOBAL SHORT sms_pei_create (T_PEI_INFO **info) | |
607 { | |
608 static const T_PEI_INFO pei_info = | |
609 { | |
610 "SMS", | |
611 { | |
612 pei_init, | |
613 #ifdef _SIMULATION_ | |
614 pei_exit, | |
615 #else | |
616 NULL, | |
617 #endif | |
618 pei_primitive, | |
619 pei_timeout, | |
620 NULL, /* no signal function */ | |
621 NULL, /* no run function */ | |
622 /* Implements Measure#36 */ | |
623 #ifdef NCONFIG | |
624 NULL, /* no pei_config function */ | |
625 #else /* not NCONFIG */ | |
626 pei_config, | |
627 #endif /* NCONFIG */ | |
628 pei_monitor, | |
629 }, | |
630 #if defined (GPRS) | |
631 1792, /* Stack Size */ | |
632 #else | |
633 #if defined (FAX_AND_DATA) | |
634 1792, /* Stack Size */ | |
635 #else | |
636 1500, /* Stacksize */ | |
637 #endif | |
638 #endif | |
639 10, /* Queue Entries */ | |
640 135, /* Priority */ | |
641 MAX_SMS_TIMER*MAX_SMS_CALLS, /* number of timer */ | |
642 0x03|PRIM_NO_SUSPEND /* flags */ | |
643 }; | |
644 | |
645 TRACE_FUNCTION ("pei_create()"); | |
646 | |
647 /* | |
648 * Close Resources if open | |
649 */ | |
650 | |
651 #ifdef _SIMULATION_ | |
652 if (first_access) | |
653 first_access = FALSE; | |
654 else | |
655 pei_exit (); | |
656 #endif | |
657 | |
658 /* | |
659 * Export startup configuration data | |
660 */ | |
661 | |
662 *info = (T_PEI_INFO *)&pei_info; | |
663 | |
664 return PEI_OK; | |
665 } | |
666 | |
667 #endif /* #ifndef SMS_PEI_C */ |