comparison src/ui/mfw/mfw_gprs.c @ 188:92abb46dc1ba

src/ui/mfw/*.[ch]: rm trailing white space
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 19 Jan 2021 06:10:27 +0000
parents 67bfe9f274f6
children
comparison
equal deleted inserted replaced
187:a33dd8a5dcc9 188:92abb46dc1ba
6 | STATE : code | 6 | STATE : code |
7 +--------------------------------------------------------------------+ 7 +--------------------------------------------------------------------+
8 8
9 MODULE : MFW_GPRS 9 MODULE : MFW_GPRS
10 10
11 PURPOSE : This modul contains functions needed for the GPRS 11 PURPOSE : This modul contains functions needed for the GPRS
12 management in MFW. 12 management in MFW.
13 13
14 $History: Mfw_gprs.c 14 $History: Mfw_gprs.c
15 15
16 Feb 24, 2006 REF:DR OMAPS00068976 x0035544 16 Feb 24, 2006 REF:DR OMAPS00068976 x0035544
17 Description: GPRS attach icon - MMI follow up issue of OMAPS00051034 17 Description: GPRS attach icon - MMI follow up issue of OMAPS00051034
18 solution: Added the function p_gprs_status() to querry the gprs status and to 18 solution: Added the function p_gprs_status() to querry the gprs status and to
19 store the status info in the structure variable stat. 19 store the status info in the structure variable stat.
20 20
21 $End 21 $End
22 */ 22 */
23 23
24 /* include necessary header files ----------------------------------*/ 24 /* include necessary header files ----------------------------------*/
25 25
26 #ifndef NEW_FRAME 26 #ifndef NEW_FRAME
82 82
83 /* definition of constants -----------------------------------------*/ 83 /* definition of constants -----------------------------------------*/
84 84
85 /* definition of internal functions --------------------------------*/ 85 /* definition of internal functions --------------------------------*/
86 86
87 static BOOL gprs_sign_exec ( T_MFW_HDR *cur_elem, T_MFW_EVENT event, 87 static BOOL gprs_sign_exec ( T_MFW_HDR *cur_elem, T_MFW_EVENT event,
88 T_MFW_GPRS_PARA *para ); 88 T_MFW_GPRS_PARA *para );
89 89
90 /* 90 /*
91 +--------------------------------------------------------------------+ 91 +--------------------------------------------------------------------+
92 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 92 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
99 */ 99 */
100 void gprs_init ( void ) 100 void gprs_init ( void )
101 { 101 {
102 TRACE_FUNCTION ("gprs_init()"); 102 TRACE_FUNCTION ("gprs_init()");
103 103
104 /* 104 /*
105 * set callback for MFW commands 105 * set callback for MFW commands
106 */ 106 */
107 mfwCommand[MfwTypGprs] = (MfwCb) gprsCommand; 107 mfwCommand[MfwTypGprs] = (MfwCb) gprsCommand;
108 } 108 }
109 109
110 110
141 T_MFW_EVENT event, 141 T_MFW_EVENT event,
142 T_MFW_CB cbfunc ) 142 T_MFW_CB cbfunc )
143 { 143 {
144 T_MFW_HDR *hdr; 144 T_MFW_HDR *hdr;
145 T_MFW_GPRS *gprs_data; 145 T_MFW_GPRS *gprs_data;
146 146
147 /*a0393213 compiler warnings removal - variables state ,cls, regState, lac, ci removed*/ 147 /*a0393213 compiler warnings removal - variables state ,cls, regState, lac, ci removed*/
148 148
149 149
150 150
151 151
152 152
153 MfwHdr *insert_status =0; 153 MfwHdr *insert_status =0;
154 154
155 TRACE_FUNCTION ("gprs_create()"); 155 TRACE_FUNCTION ("gprs_create()");
156 156
158 gprs_data = (T_MFW_GPRS *) mfwAlloc(sizeof (T_MFW_GPRS)); 158 gprs_data = (T_MFW_GPRS *) mfwAlloc(sizeof (T_MFW_GPRS));
159 159
160 if ( !hdr OR !gprs_data ) 160 if ( !hdr OR !gprs_data )
161 { 161 {
162 TRACE_ERROR("ERROR: gprs_create() Mem Alloc Failed."); 162 TRACE_ERROR("ERROR: gprs_create() Mem Alloc Failed.");
163 163
164 if(hdr) 164 if(hdr)
165 mfwFree((U8*)hdr,sizeof(MfwHdr)); 165 mfwFree((U8*)hdr,sizeof(MfwHdr));
166 166
167 if(gprs_data) 167 if(gprs_data)
168 mfwFree((U8*)gprs_data,sizeof(T_MFW_GPRS)); 168 mfwFree((U8*)gprs_data,sizeof(T_MFW_GPRS));
169 169
170 return FALSE; 170 return FALSE;
171 } 171 }
172 172
173 /* 173 /*
174 * initialisation of the handler 174 * initialisation of the handler
175 */ 175 */
176 gprs_data->emask = event; 176 gprs_data->emask = event;
177 gprs_data->handler = cbfunc; 177 gprs_data->handler = cbfunc;
178 178
179 hdr->data = gprs_data; /* store gprs control block in node */ 179 hdr->data = gprs_data; /* store gprs control block in node */
180 hdr->type = MfwTypGprs; /* store type of event handler */ 180 hdr->type = MfwTypGprs; /* store type of event handler */
181 181
182 182
183 /* 183 /*
184 * initialisation of gprs data 184 * initialisation of gprs data
185 */ 185 */
186 gprs_data->data.numContexts = 0; 186 gprs_data->data.numContexts = 0;
187 187
188 gprs_data->data.tclass = (T_CGCLASS_CLASS)NULL; 188 gprs_data->data.tclass = (T_CGCLASS_CLASS)NULL;
189 //x0035544 Feb 23, 2006 DR:OMAPS00068976 189 //x0035544 Feb 23, 2006 DR:OMAPS00068976
190 gprs_data->data.Reg_state.regState = (T_CGREG_STAT)NULL; 190 gprs_data->data.Reg_state.regState = (T_CGREG_STAT)NULL;
191 gprs_data->data.attached = (T_CGATT_STATE)NULL; 191 gprs_data->data.attached = (T_CGATT_STATE)NULL;
192 192
193 gprs_data->data.contexts = 193 gprs_data->data.contexts =
194 (T_MFW_GPRS_CONTEXT *) mfwAlloc(sizeof(T_MFW_GPRS_CONTEXT) * MAX_CID_PLUS_EINS); 194 (T_MFW_GPRS_CONTEXT *) mfwAlloc(sizeof(T_MFW_GPRS_CONTEXT) * MAX_CID_PLUS_EINS);
195 195
196 /* 196 /*
197 * installation of the handler 197 * installation of the handler
198 */ 198 */
199 insert_status = mfwInsert((T_MFW_HDR *)h, hdr); 199 insert_status = mfwInsert((T_MFW_HDR *)h, hdr);
200 200
201 if(!insert_status) 201 if(!insert_status)
202 { 202 {
203 TRACE_ERROR("ERROR: gprs_create() Failed to Install Handler. "); 203 TRACE_ERROR("ERROR: gprs_create() Failed to Install Handler. ");
204 mfwFree((U8*)hdr,sizeof(MfwHdr)); 204 mfwFree((U8*)hdr,sizeof(MfwHdr));
205 mfwFree((U8*)gprs_data,sizeof(T_MFW_GPRS)); 205 mfwFree((U8*)gprs_data,sizeof(T_MFW_GPRS));
231 TRACE_FUNCTION ("gprs_delete()"); 231 TRACE_FUNCTION ("gprs_delete()");
232 232
233 if ( !h OR !((T_MFW_HDR *)h)->data ) 233 if ( !h OR !((T_MFW_HDR *)h)->data )
234 return MFW_RES_ILL_HND; 234 return MFW_RES_ILL_HND;
235 235
236 /* 236 /*
237 * deinstallation of the handler 237 * deinstallation of the handler
238 */ 238 */
239 239
240 //if ( !mfwRemove((T_MFW_HDR *)h) ) 240 //if ( !mfwRemove((T_MFW_HDR *)h) )
241 if ( !mfwRemove(h) ) 241 if ( !mfwRemove(h) )
299 PARAMETERS : 299 PARAMETERS :
300 event : current event 300 event : current event
301 *para : pointer to the event parameters 301 *para : pointer to the event parameters
302 302
303 */ 303 */
304 void gprs_signal( T_MFW_EVENT event, 304 void gprs_signal( T_MFW_EVENT event,
305 void *para) 305 void *para)
306 {/*MC, SPR 1389, we have to enable the display whenever 306 {/*MC, SPR 1389, we have to enable the display whenever
307 we send an event up to the MMI*/ 307 we send an event up to the MMI*/
308 UBYTE temp = dspl_Enable(0); 308 UBYTE temp = dspl_Enable(0);
309 309
310 TRACE_FUNCTION ("gprs_signal()"); 310 TRACE_FUNCTION ("gprs_signal()");
311 311
312 if ( mfwSignallingMethod EQ 0 ) 312 if ( mfwSignallingMethod EQ 0 )
313 { 313 {
314 /* 314 /*
315 * focus is on a window 315 * focus is on a window
316 */ 316 */
317 if ( mfwFocus ) 317 if ( mfwFocus )
318 { 318 {
319 /* 319 /*
320 * send event to sim management handler if available 320 * send event to sim management handler if available
321 */ 321 */
322 if (gprs_sign_exec (mfwFocus, event, para)) 322 if (gprs_sign_exec (mfwFocus, event, para))
323 { dspl_Enable(temp);/*MC, SPR 1389*/ 323 { dspl_Enable(temp);/*MC, SPR 1389*/
324 return; 324 return;
325 } 325 }
326 } 326 }
327 327
328 /* 328 /*
329 * acutal focussed window is not available or has no 329 * acutal focussed window is not available or has no
330 * network management registration handler, then search 330 * network management registration handler, then search
331 * all nodes from the root. 331 * all nodes from the root.
332 */ 332 */
333 if ( mfwRoot ) 333 if ( mfwRoot )
334 gprs_sign_exec (mfwRoot, event, para); 334 gprs_sign_exec (mfwRoot, event, para);
335 } 335 }
336 else 336 else
337 { 337 {
338 MfwHdr *h = 0; 338 MfwHdr *h = 0;
339 339
340 /* 340 /*
341 * Focus set, then start here 341 * Focus set, then start here
342 */ 342 */
343 if ( mfwFocus ) 343 if ( mfwFocus )
344 h = mfwFocus; 344 h = mfwFocus;
345 345
346 /* 346 /*
347 * Focus not set, then start at root 347 * Focus not set, then start at root
348 */ 348 */
349 if ( !h ) 349 if ( !h )
350 h = mfwRoot; 350 h = mfwRoot;
351 351
352 /* 352 /*
353 * while elements found 353 * while elements found
354 */ 354 */
355 while ( h ) 355 while ( h )
356 { 356 {
357 /* 357 /*
358 * Signal consumed, then return 358 * Signal consumed, then return
359 */ 359 */
360 if ( gprs_sign_exec (h, event, para) ) 360 if ( gprs_sign_exec (h, event, para) )
361 { dspl_Enable(temp);/*MC, SPR 1389*/ 361 { dspl_Enable(temp);/*MC, SPR 1389*/
362 return; 362 return;
363 } 363 }
364 364
365 /* 365 /*
366 * All windows tried inclusive root 366 * All windows tried inclusive root
367 */ 367 */
368 if ( h == mfwRoot ) 368 if ( h == mfwRoot )
369 { dspl_Enable(temp);/*MC, SPR 1389*/ 369 { dspl_Enable(temp);/*MC, SPR 1389*/
370 return; 370 return;
371 } 371 }
372 372
373 /* 373 /*
374 * get parent window 374 * get parent window
375 */ 375 */
376 h = mfwParent(mfwParent(h)); 376 h = mfwParent(mfwParent(h));
377 377
378 /* 378 /*
379 * look for next element 379 * look for next element
380 */ 380 */
381 if ( h ) 381 if ( h )
382 h = ((MfwWin * )(h->data))->elems; 382 h = ((MfwWin * )(h->data))->elems;
383 } 383 }
384 gprs_sign_exec (mfwRoot, event, para); 384 gprs_sign_exec (mfwRoot, event, para);
397 397
398 PURPOSE : Handle a signal if GPRS management handler. 398 PURPOSE : Handle a signal if GPRS management handler.
399 399
400 PARAMETERS : 400 PARAMETERS :
401 401
402 RETURNS : 402 RETURNS :
403 TRUE, if signal is processed 403 TRUE, if signal is processed
404 FALSE, if signal is not processed 404 FALSE, if signal is not processed
405 */ 405 */
406 BOOL gprs_sign_exec ( T_MFW_HDR *cur_elem, 406 BOOL gprs_sign_exec ( T_MFW_HDR *cur_elem,
407 T_MFW_EVENT event, 407 T_MFW_EVENT event,
408 T_MFW_GPRS_PARA *para ) 408 T_MFW_GPRS_PARA *para )
409 { 409 {
410 int i,j; 410 int i,j;
411 T_CGATT_STATE state; 411 T_CGATT_STATE state;
412 #if(BOARD != 61) 412 #if(BOARD != 61)
417 USHORT lac; 417 USHORT lac;
418 USHORT ci; 418 USHORT ci;
419 419
420 TRACE_FUNCTION ("gprs_sign_exec()"); 420 TRACE_FUNCTION ("gprs_sign_exec()");
421 421
422 /* 422 /*
423 * while event handler is available 423 * while event handler is available
424 */ 424 */
425 while ( cur_elem ) 425 while ( cur_elem )
426 { 426 {
427 /* 427 /*
428 * if handler is GPRS management handler 428 * if handler is GPRS management handler
430 if ( cur_elem->type EQ MfwTypGprs ) 430 if ( cur_elem->type EQ MfwTypGprs )
431 { 431 {
432 T_MFW_GPRS *gprs_data; 432 T_MFW_GPRS *gprs_data;
433 gprs_data = (T_MFW_GPRS *)cur_elem->data; 433 gprs_data = (T_MFW_GPRS *)cur_elem->data;
434 434
435 /* 435 /*
436 * if event is expected by the call back function 436 * if event is expected by the call back function
437 */ 437 */
438 if ( gprs_data->emask & event ) 438 if ( gprs_data->emask & event )
439 { 439 {
440 gprs_data->event = event; 440 gprs_data->event = event;
446 * Check if contexts is defined in ACI ( if too many context 446 * Check if contexts is defined in ACI ( if too many context
447 * are defined, the new one will not be defined 447 * are defined, the new one will not be defined
448 */ 448 */
449 #ifndef FF_2TO1_PS 449 #ifndef FF_2TO1_PS
450 qAT_PlusCGDCONT(CMD_SRC_LCL, tst_ctrc, &tst_cid); 450 qAT_PlusCGDCONT(CMD_SRC_LCL, tst_ctrc, &tst_cid);
451 #endif 451 #endif
452 452
453 if ( tst_cid >= gprs_data->data.numContexts + 1) 453 if ( tst_cid >= gprs_data->data.numContexts + 1)
454 { 454 {
455 455
456 /* 456 /*
457 * insert the new context 457 * insert the new context
458 */ 458 */
459 memcpy (&(gprs_data->data.contexts[gprs_data->data.numContexts]), para, 459 memcpy (&(gprs_data->data.contexts[gprs_data->data.numContexts]), para,
460 sizeof (T_MFW_GPRS_CONTEXT)); 460 sizeof (T_MFW_GPRS_CONTEXT));
461 gprs_data->data.numContexts++; 461 gprs_data->data.numContexts++;
462 } 462 }
463 break; 463 break;
464 464
466 case E_MFW_GPRS_R_EREP_ATT: 466 case E_MFW_GPRS_R_EREP_ATT:
467 /* SPR#1983 - SH -'attached' is now of correct type. 467 /* SPR#1983 - SH -'attached' is now of correct type.
468 * Don't check if unchanged, as this rejects some cases 468 * Don't check if unchanged, as this rejects some cases
469 * where signal needs to be sent to BMI 469 * where signal needs to be sent to BMI
470 */ 470 */
471 471
472 gprs_data->data.attached = para->attached; 472 gprs_data->data.attached = para->attached;
473 473
474 /* 474 /*
475 * set all contexts to deactivated after detach 475 * set all contexts to deactivated after detach
476 */ 476 */
477 if ( gprs_data->data.attached == CGATT_STATE_DETACHED ) 477 if ( gprs_data->data.attached == CGATT_STATE_DETACHED )
478 { 478 {
497 497
498 case E_MFW_GPRS_S_ACT: 498 case E_MFW_GPRS_S_ACT:
499 /* 499 /*
500 * search in the known context for the context ids given 500 * search in the known context for the context ids given
501 * in the parameter 501 * in the parameter
502 */ 502 */
503 for ( i=0; i > gprs_data->data.numContexts; i++) 503 for ( i=0; i > gprs_data->data.numContexts; i++)
504 { 504 {
505 j=0; 505 j=0;
506 506
507 do 507 do
508 { 508 {
509 /* 509 /*
510 * set the new activation state for the found context id 510 * set the new activation state for the found context id
511 */ 511 */
512 if ( para->contextAct.ids[j] == gprs_data->data.contexts[i].id) 512 if ( para->contextAct.ids[j] == gprs_data->data.contexts[i].id)
513 { 513 {
514 gprs_data->data.contexts[i].activated = para->contextAct.state; 514 gprs_data->data.contexts[i].activated = para->contextAct.state;
515 } 515 }
516 } 516 }
517 while ( j < MAX_CID && 517 while ( j < MAX_CID &&
518 (para->contextAct.ids[j] != gprs_data->data.contexts[i].id) ); 518 (para->contextAct.ids[j] != gprs_data->data.contexts[i].id) );
519 } 519 }
520 break; 520 break;
521 521
522 case E_MFW_GPRS_S_DATA: 522 case E_MFW_GPRS_S_DATA:
523 /* 523 /*
524 * if attached mode was detached, set mode to attached 524 * if attached mode was detached, set mode to attached
525 */ 525 */
526 if ( gprs_data->data.attached == CGATT_STATE_DETACHED ) 526 if ( gprs_data->data.attached == CGATT_STATE_DETACHED )
527 { 527 {
528 gprs_data->data.attached = CGATT_STATE_ATTACHED; 528 gprs_data->data.attached = CGATT_STATE_ATTACHED;
529 } 529 }
530 530
531 /* 531 /*
532 * search in the known context for the context ids given 532 * search in the known context for the context ids given
533 * in the parameter 533 * in the parameter
534 */ 534 */
535 for ( i=0; i < gprs_data->data.numContexts; i++) 535 for ( i=0; i < gprs_data->data.numContexts; i++)
536 { 536 {
537 j=0; 537 j=0;
538 538
539 do 539 do
540 { 540 {
541 /* 541 /*
542 * if context id of parameter is known, set the activation state 542 * if context id of parameter is known, set the activation state
543 * to activated when it was detached and copy L2P value 543 * to activated when it was detached and copy L2P value
544 */ 544 */
545 if ( para->contextL2P.ids[j] == gprs_data->data.contexts[i].id) 545 if ( para->contextL2P.ids[j] == gprs_data->data.contexts[i].id)
546 { 546 {
547 if ( gprs_data->data.contexts[j].activated == CGACT_STATE_DEACTIVATED ) 547 if ( gprs_data->data.contexts[j].activated == CGACT_STATE_DEACTIVATED )
548 { 548 {
549 gprs_data->data.contexts[j].activated = CGACT_STATE_ACTIVATED; 549 gprs_data->data.contexts[j].activated = CGACT_STATE_ACTIVATED;
550 } 550 }
551 551
552 if (!(gprs_data->data.contexts[i].L2P) ) 552 if (!(gprs_data->data.contexts[i].L2P) )
553 gprs_data->data.contexts[i].L2P = 553 gprs_data->data.contexts[i].L2P =
554 (char *) mfwAlloc(sizeof(char) * strlen(para->contextL2P.L2P)); 554 (char *) mfwAlloc(sizeof(char) * strlen(para->contextL2P.L2P));
555 555
556 memcpy (gprs_data->data.contexts[i].L2P, para->contextL2P.L2P, 556 memcpy (gprs_data->data.contexts[i].L2P, para->contextL2P.L2P,
557 strlen( para->contextL2P.L2P ) * sizeof(char)); 557 strlen( para->contextL2P.L2P ) * sizeof(char));
558 } 558 }
559 j++; 559 j++;
560 } 560 }
561 while ( j < MAX_CID && 561 while ( j < MAX_CID &&
562 ( para->contextL2P.ids[j]!= gprs_data->data.contexts[i].id) ); 562 ( para->contextL2P.ids[j]!= gprs_data->data.contexts[i].id) );
563 } 563 }
564 break; 564 break;
565 565
566 case E_MFW_GPRS_R_ACT: 566 case E_MFW_GPRS_R_ACT:
569 gprs_data->data.link_id = para->link_id; 569 gprs_data->data.link_id = para->link_id;
570 break; 570 break;
571 571
572 case E_MFW_GPRS_S_QOS: 572 case E_MFW_GPRS_S_QOS:
573 case E_MFW_GPRS_R_QOS: 573 case E_MFW_GPRS_R_QOS:
574 for ( i=0; (i > gprs_data->data.numContexts) && 574 for ( i=0; (i > gprs_data->data.numContexts) &&
575 (gprs_data->data.contexts[i].id == para->context.id); i++); 575 (gprs_data->data.contexts[i].id == para->context.id); i++);
576 576
577 if (gprs_data->data.contexts[i].id == para->context.id) 577 if (gprs_data->data.contexts[i].id == para->context.id)
578 memcpy (&(gprs_data->data.contexts[i].data.qos), 578 memcpy (&(gprs_data->data.contexts[i].data.qos),
579 #ifdef FF_2TO1_PS 579 #ifdef FF_2TO1_PS
580 &(para->context.data.qos), sizeof(T_PS_qos)); 580 &(para->context.data.qos), sizeof(T_PS_qos));
581 #else 581 #else
582 &(para->context.data.qos), sizeof(T_PS_qos)); 582 &(para->context.data.qos), sizeof(T_PS_qos));
583 #endif 583 #endif
584 else 584 else
585 TRACE_ERROR("context id not defined"); 585 TRACE_ERROR("context id not defined");
586 break; 586 break;
587 587
588 case E_MFW_GPRS_S_QOS_MIN: 588 case E_MFW_GPRS_S_QOS_MIN:
589 for ( i=0; (i > gprs_data->data.numContexts) && 589 for ( i=0; (i > gprs_data->data.numContexts) &&
590 (gprs_data->data.contexts[i].id == para->context.id); i++); 590 (gprs_data->data.contexts[i].id == para->context.id); i++);
591 591
592 if (gprs_data->data.contexts[i].id == para->context.id) 592 if (gprs_data->data.contexts[i].id == para->context.id)
593 memcpy (&(gprs_data->data.contexts[i].data.min_qos), 593 memcpy (&(gprs_data->data.contexts[i].data.min_qos),
594 #ifdef FF_2TO1_PS 594 #ifdef FF_2TO1_PS
595 &(para->context.data.min_qos), sizeof(T_PS_qos)); 595 &(para->context.data.min_qos), sizeof(T_PS_qos));
596 #else 596 #else
597 &(para->context.data.min_qos), sizeof(T_PS_qos)); 597 &(para->context.data.min_qos), sizeof(T_PS_qos));
598 #endif 598 #endif
599 else 599 else
600 TRACE_ERROR("context id not defined"); 600 TRACE_ERROR("context id not defined");
601 break; 601 break;
602 602
603 case E_MFW_GPRS_S_CLASS: 603 case E_MFW_GPRS_S_CLASS:
608 case E_MFW_GPRS_R_EREP_ACT: 608 case E_MFW_GPRS_R_EREP_ACT:
609 /* 609 /*
610 * search for context 610 * search for context
611 */ 611 */
612 /* SPR#2243 - SH - Changed 'para->context' to 'para->erepAct' */ 612 /* SPR#2243 - SH - Changed 'para->context' to 'para->erepAct' */
613 for ( i=0; (i > gprs_data->data.numContexts) && 613 for ( i=0; (i > gprs_data->data.numContexts) &&
614 (gprs_data->data.contexts[i].id == para->erepAct.cid); i++); 614 (gprs_data->data.contexts[i].id == para->erepAct.cid); i++);
615 615
616 /* 616 /*
617 * if context found, copy PDP address data to MFW data 617 * if context found, copy PDP address data to MFW data
618 */ 618 */
619 /* SPR#2243 - SH - Changed 'para->context' to 'para->erepAct' */ 619 /* SPR#2243 - SH - Changed 'para->context' to 'para->erepAct' */
620 if (gprs_data->data.contexts[i].id == para->erepAct.cid) 620 if (gprs_data->data.contexts[i].id == para->erepAct.cid)
621 { 621 {
622 #ifdef FF_2TO1_PS 622 #ifdef FF_2TO1_PS
623 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_addr), 623 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_addr),
624 &para->erepAct.pdp_addr, sizeof(T_NAS_ip)); 624 &para->erepAct.pdp_addr, sizeof(T_NAS_ip));
625 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_type), 625 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_type),
626 &para->erepAct.pdp_type, sizeof(T_NAS_ip)); 626 &para->erepAct.pdp_type, sizeof(T_NAS_ip));
627 #else 627 #else
628 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_addr), 628 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_addr),
629 &para->erepAct.pdp_addr, sizeof(T_NAS_ip)); 629 &para->erepAct.pdp_addr, sizeof(T_NAS_ip));
630 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_type), 630 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_type),
631 &para->erepAct.pdp_type, sizeof(T_PDP_TYPE)); 631 &para->erepAct.pdp_type, sizeof(T_PDP_TYPE));
632 #endif 632 #endif
633 gprs_data->data.contexts[i].activated = CGACT_STATE_ACTIVATED; 633 gprs_data->data.contexts[i].activated = CGACT_STATE_ACTIVATED;
634 } 634 }
635 else 635 else
636 { 636 {
637 if (gprs_data->data.numContexts < MAX_CID ) 637 if (gprs_data->data.numContexts < MAX_CID )
641 &para->erepAct.pdp_addr, sizeof (T_NAS_ip)); 641 &para->erepAct.pdp_addr, sizeof (T_NAS_ip));
642 memcpy (&(gprs_data->data.contexts[gprs_data->data.numContexts].data.attributes.pdp_type), 642 memcpy (&(gprs_data->data.contexts[gprs_data->data.numContexts].data.attributes.pdp_type),
643 para->erepAct.pdp_type, sizeof (T_PDP_TYPE)); 643 para->erepAct.pdp_type, sizeof (T_PDP_TYPE));
644 gprs_data->data.contexts[gprs_data->data.numContexts].id = (U8)para->erepAct.cid; 644 gprs_data->data.contexts[gprs_data->data.numContexts].id = (U8)para->erepAct.cid;
645 #else 645 #else
646 memcpy (&(gprs_data->data.contexts[gprs_data->data.numContexts].data.attributes.pdp_addr), &para->erepAct.pdp_addr, 646 memcpy (&(gprs_data->data.contexts[gprs_data->data.numContexts].data.attributes.pdp_addr), &para->erepAct.pdp_addr,
647 sizeof (T_NAS_ip)); 647 sizeof (T_NAS_ip));
648 memcpy (&(gprs_data->data.contexts[gprs_data->data.numContexts].data.attributes.pdp_type),para->erepAct.pdp_type, 648 memcpy (&(gprs_data->data.contexts[gprs_data->data.numContexts].data.attributes.pdp_type),para->erepAct.pdp_type,
649 sizeof (T_PDP_TYPE)); 649 sizeof (T_PDP_TYPE));
650 gprs_data->data.contexts[gprs_data->data.numContexts].id = para->erepAct.cid; 650 gprs_data->data.contexts[gprs_data->data.numContexts].id = para->erepAct.cid;
651 #endif 651 #endif
652 gprs_data->data.contexts[gprs_data->data.numContexts].activated = CGACT_STATE_ACTIVATED; 652 gprs_data->data.contexts[gprs_data->data.numContexts].activated = CGACT_STATE_ACTIVATED;
653 gprs_data->data.numContexts++; 653 gprs_data->data.numContexts++;
654 } 654 }
655 else 655 else
656 TRACE_ERROR("MFW_GPRS: ERROR: Too many contexts!"); 656 TRACE_ERROR("MFW_GPRS: ERROR: Too many contexts!");
661 * Uses para->context throughout. */ 661 * Uses para->context throughout. */
662 case E_MFW_GPRS_S_PDPADDR: 662 case E_MFW_GPRS_S_PDPADDR:
663 /* 663 /*
664 * search for context 664 * search for context
665 */ 665 */
666 for ( i=0; (i > gprs_data->data.numContexts) && 666 for ( i=0; (i > gprs_data->data.numContexts) &&
667 (gprs_data->data.contexts[i].id == para->context.id); i++); 667 (gprs_data->data.contexts[i].id == para->context.id); i++);
668 668
669 /* 669 /*
670 * if context found, copy PDP address data to MFW data 670 * if context found, copy PDP address data to MFW data
671 */ 671 */
672 if (gprs_data->data.contexts[i].id == para->context.id) 672 if (gprs_data->data.contexts[i].id == para->context.id)
673 { 673 {
674 #ifdef FF_2TO1_PS 674 #ifdef FF_2TO1_PS
675 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_addr), 675 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_addr),
676 &para->context.data.attributes.pdp_addr, sizeof(T_NAS_ip)); 676 &para->context.data.attributes.pdp_addr, sizeof(T_NAS_ip));
677 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_type), 677 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_type),
678 &para->context.data.attributes.pdp_type, sizeof(T_PDP_TYPE)); 678 &para->context.data.attributes.pdp_type, sizeof(T_PDP_TYPE));
679 #else 679 #else
680 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_addr), 680 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_addr),
681 &para->context.data.attributes.pdp_addr, sizeof(T_NAS_ip)); 681 &para->context.data.attributes.pdp_addr, sizeof(T_NAS_ip));
682 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_type), 682 memcpy (&(gprs_data->data.contexts[i].data.attributes.pdp_type),
683 &para->context.data.attributes.pdp_type, sizeof(T_PDP_TYPE)); 683 &para->context.data.attributes.pdp_type, sizeof(T_PDP_TYPE));
684 #endif 684 #endif
685 gprs_data->data.contexts[i].activated = para->context.activated; 685 gprs_data->data.contexts[i].activated = para->context.activated;
686 } 686 }
687 else 687 else
688 { 688 {
689 if (gprs_data->data.numContexts < MAX_CID ) 689 if (gprs_data->data.numContexts < MAX_CID )
698 memcpy (&(gprs_data->data.contexts[gprs_data->data.numContexts].data.attributes.pdp_addr), 698 memcpy (&(gprs_data->data.contexts[gprs_data->data.numContexts].data.attributes.pdp_addr),
699 &para->context.data.attributes.pdp_addr, sizeof (T_NAS_ip)); 699 &para->context.data.attributes.pdp_addr, sizeof (T_NAS_ip));
700 memcpy (&(gprs_data->data.contexts[gprs_data->data.numContexts].data.attributes.pdp_type), 700 memcpy (&(gprs_data->data.contexts[gprs_data->data.numContexts].data.attributes.pdp_type),
701 &para->context.data.attributes.pdp_type, sizeof (T_PDP_TYPE)); 701 &para->context.data.attributes.pdp_type, sizeof (T_PDP_TYPE));
702 gprs_data->data.contexts[gprs_data->data.numContexts].id = para->context.id; 702 gprs_data->data.contexts[gprs_data->data.numContexts].id = para->context.id;
703 #endif 703 #endif
704 gprs_data->data.contexts[gprs_data->data.numContexts].activated = para->context.activated; 704 gprs_data->data.contexts[gprs_data->data.numContexts].activated = para->context.activated;
705 gprs_data->data.numContexts++; 705 gprs_data->data.numContexts++;
706 } 706 }
707 else 707 else
708 TRACE_ERROR("MFW_GPRS: ERROR: Too many contexts!"); 708 TRACE_ERROR("MFW_GPRS: ERROR: Too many contexts!");
711 711
712 case E_MFW_GPRS_R_EREP_DEACT: 712 case E_MFW_GPRS_R_EREP_DEACT:
713 /* 713 /*
714 * search for context 714 * search for context
715 */ 715 */
716 for ( i=0; (i < gprs_data->data.numContexts) && 716 for ( i=0; (i < gprs_data->data.numContexts) &&
717 (gprs_data->data.contexts[i].id != para->erepAct.cid); i++); 717 (gprs_data->data.contexts[i].id != para->erepAct.cid); i++);
718 718
719 /* 719 /*
720 * if context found, set mode to deactivated 720 * if context found, set mode to deactivated
721 */ 721 */
722 if (gprs_data->data.contexts[i].id == para->erepAct.cid) 722 if (gprs_data->data.contexts[i].id == para->erepAct.cid)
723 { 723 {
724 gprs_data->data.contexts[i].activated = CGACT_STATE_DEACTIVATED; 724 gprs_data->data.contexts[i].activated = CGACT_STATE_DEACTIVATED;
725 } 725 }
726 else 726 else
727 { 727 {
728 for ( i=0; (i < gprs_data->data.numContexts) && 728 for ( i=0; (i < gprs_data->data.numContexts) &&
729 #ifdef FF_2TO1_PS 729 #ifdef FF_2TO1_PS
730 ( strcmp(gprs_data->data.contexts[i].data.attributes.pdp_type, para->erepAct.pdp_type) || 730 ( strcmp(gprs_data->data.contexts[i].data.attributes.pdp_type, para->erepAct.pdp_type) ||
731 strcmp((const char *)&gprs_data->data.contexts[i].data.attributes.pdp_addr.ip_address.ipv4_addr.a4, 731 strcmp((const char *)&gprs_data->data.contexts[i].data.attributes.pdp_addr.ip_address.ipv4_addr.a4,
732 (const char *)&para->erepAct.pdp_addr.ip_address.ipv4_addr.a4) ); i++); 732 (const char *)&para->erepAct.pdp_addr.ip_address.ipv4_addr.a4) ); i++);
733 733
734 #else 734 #else
735 ( strcmp(gprs_data->data.contexts[i].data.attributes.pdp_type, para->erepAct.pdp_type) || 735 ( strcmp(gprs_data->data.contexts[i].data.attributes.pdp_type, para->erepAct.pdp_type) ||
736 strcmp((const char *)&gprs_data->data.contexts[i].data.attributes.pdp_addr.ip_address.ipv4_addr.a4 736 strcmp((const char *)&gprs_data->data.contexts[i].data.attributes.pdp_addr.ip_address.ipv4_addr.a4
737 , (const char *)&para->erepAct.pdp_addr.ip_address.ipv4_addr.a4 )); i++); 737 , (const char *)&para->erepAct.pdp_addr.ip_address.ipv4_addr.a4 )); i++);
738 #endif 738 #endif
739 739
740 /* 740 /*
741 * if context found, set mode to deactivated 741 * if context found, set mode to deactivated
742 */ 742 */
743 #ifdef FF_2TO1_PS 743 #ifdef FF_2TO1_PS
744 if (!strcmp((const char *)&gprs_data->data.contexts[i].data.attributes.pdp_type, (const char *)&para->erepAct.pdp_type) && 744 if (!strcmp((const char *)&gprs_data->data.contexts[i].data.attributes.pdp_type, (const char *)&para->erepAct.pdp_type) &&
745 !strcmp((const char *)&gprs_data->data.contexts[i].data.attributes.pdp_addr.ip_address.ipv4_addr.a4, (const char *)&para->erepAct.pdp_addr.ip_address.ipv4_addr.a4) ) 745 !strcmp((const char *)&gprs_data->data.contexts[i].data.attributes.pdp_addr.ip_address.ipv4_addr.a4, (const char *)&para->erepAct.pdp_addr.ip_address.ipv4_addr.a4) )
746 #else 746 #else
747 if (!strcmp((const char *)&gprs_data->data.contexts[i].data.attributes.pdp_type, (const char *)&para->erepAct.pdp_type) && 747 if (!strcmp((const char *)&gprs_data->data.contexts[i].data.attributes.pdp_type, (const char *)&para->erepAct.pdp_type) &&
748 !strcmp((const char *)&gprs_data->data.contexts[i].data.attributes.pdp_addr.ip_address.ipv4_addr.a4, (const char *)&para->erepAct.pdp_addr.ip_address.ipv4_addr.a4) ) 748 !strcmp((const char *)&gprs_data->data.contexts[i].data.attributes.pdp_addr.ip_address.ipv4_addr.a4, (const char *)&para->erepAct.pdp_addr.ip_address.ipv4_addr.a4) )
749 #endif 749 #endif
750 { 750 {
751 gprs_data->data.contexts[i].activated = CGACT_STATE_DEACTIVATED; 751 gprs_data->data.contexts[i].activated = CGACT_STATE_DEACTIVATED;
752 } 752 }
753 } 753 }
754 754
755 break; 755 break;
756 756
757 case E_MFW_GPRS_S_AUTORESP: 757 case E_MFW_GPRS_S_AUTORESP:
758 gprs_data->data.autoResponse = para->mode; 758 gprs_data->data.autoResponse = para->mode;
759 break; 759 break;
764 case E_MFW_GPRS_S_EREP: 764 case E_MFW_GPRS_S_EREP:
765 /* 765 /*
766 * copy new event reporting settings to MFW data 766 * copy new event reporting settings to MFW data
767 */ 767 */
768 gprs_data->data.eventRep.mode = para->eventRep.mode; 768 gprs_data->data.eventRep.mode = para->eventRep.mode;
769 gprs_data->data.eventRep.bfr = para->eventRep.bfr; 769 gprs_data->data.eventRep.bfr = para->eventRep.bfr;
770 break; 770 break;
771 771
772 case E_MFW_GPRS_R_EREP_RJ: 772 case E_MFW_GPRS_R_EREP_RJ:
773 break; 773 break;
774 774
816 * perhaps an error? 816 * perhaps an error?
817 */ 817 */
818 TRACE_EVENT("mfw_gprs.gprs_sign_exec: unused event"); 818 TRACE_EVENT("mfw_gprs.gprs_sign_exec: unused event");
819 break; 819 break;
820 } 820 }
821 821
822 /* 822 /*
823 * if callback defined, call it 823 * if callback defined, call it
824 */ 824 */
825 if ( gprs_data->handler ) 825 if ( gprs_data->handler )
826 { 826 {
827 current_mfw_elem = cur_elem; 827 current_mfw_elem = cur_elem;
828 828
829 if ( (*(gprs_data->handler))( gprs_data->event, 829 if ( (*(gprs_data->handler))( gprs_data->event,
830 (void*)&gprs_data->data ) ) 830 (void*)&gprs_data->data ) )
831 return TRUE; 831 return TRUE;
832 } 832 }
833 } 833 }
834 } 834 }
835 835
836 /* 836 /*
837 * look for next element 837 * look for next element
838 */ 838 */
839 cur_elem = cur_elem->next; 839 cur_elem = cur_elem->next;
840 } 840 }
841 return FALSE; 841 return FALSE;
842 } 842 }
846 +--------------------------------------------------------------------+ 846 +--------------------------------------------------------------------+
847 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 847 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
848 | STATE : code ROUTINE: gprs_ok | 848 | STATE : code ROUTINE: gprs_ok |
849 +--------------------------------------------------------------------+ 849 +--------------------------------------------------------------------+
850 850
851 PURPOSE : success indication from ACI 851 PURPOSE : success indication from ACI
852 (This function is called by rAT_OK) 852 (This function is called by rAT_OK)
853 853
854 PARAMETERS : AT command ID 854 PARAMETERS : AT command ID
855 */ 855 */
856 void gprs_ok(T_ACI_AT_CMD cmdId) 856 void gprs_ok(T_ACI_AT_CMD cmdId)
857 { 857 {
858 TRACE_FUNCTION("mfw_gprs.gprs_ok"); 858 TRACE_FUNCTION("mfw_gprs.gprs_ok");
859 859
860 gprs_signal(E_MFW_GPRS_OK, &cmdId); 860 gprs_signal(E_MFW_GPRS_OK, &cmdId);
861 861
862 return; 862 return;
863 } 863 }
864 864
865 865
866 /* 866 /*
867 +--------------------------------------------------------------------+ 867 +--------------------------------------------------------------------+
868 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 868 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
869 | STATE : code ROUTINE: gprs_error | 869 | STATE : code ROUTINE: gprs_error |
870 +--------------------------------------------------------------------+ 870 +--------------------------------------------------------------------+
871 871
872 PURPOSE : failure indication from ACI 872 PURPOSE : failure indication from ACI
873 (This function is called by rAT_PlusCME) 873 (This function is called by rAT_PlusCME)
874 874
875 PARAMETERS : AT command ID 875 PARAMETERS : AT command ID
876 */ 876 */
877 void gprs_error(T_ACI_AT_CMD cmdId, T_ACI_CME_ERR err) 877 void gprs_error(T_ACI_AT_CMD cmdId, T_ACI_CME_ERR err)
878 { 878 {
879 TRACE_FUNCTION("mfw_gprs.gprs_error"); 879 TRACE_FUNCTION("mfw_gprs.gprs_error");
880 880
881 gprs_signal(E_MFW_GPRS_ERROR, &cmdId); 881 gprs_signal(E_MFW_GPRS_ERROR, &cmdId);
882 882
883 return; 883 return;
884 } 884 }
885 885
886 886
887 /* 887 /*
933 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 933 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
934 | STATE : code ROUTINE: gprs_definePDPContext| 934 | STATE : code ROUTINE: gprs_definePDPContext|
935 +---------------------------------------------------------------------+ 935 +---------------------------------------------------------------------+
936 936
937 937
938 PURPOSE : Define PDP context. If the contexts for cid does not 938 PURPOSE : Define PDP context. If the contexts for cid does not
939 exist in the contexts list, the new context will be 939 exist in the contexts list, the new context will be
940 inserted in the contexts list. 940 inserted in the contexts list.
941 941
942 PARAMETERS : 942 PARAMETERS :
943 cid : context ID 943 cid : context ID
944 *context: context data 944 *context: context data
945 */ 945 */
946 #ifdef FF_2TO1_PS 946 #ifdef FF_2TO1_PS
947 T_MFW_RES gprs_definePDPContext(SHORT cid, T_PDP_CONTEXT *inputCtxt) 947 T_MFW_RES gprs_definePDPContext(SHORT cid, T_PDP_CONTEXT *inputCtxt)
948 { 948 {
949 T_MFW_GPRS_CONTEXT *context; 949 T_MFW_GPRS_CONTEXT *context;
950 950
951 TRACE_FUNCTION ("gprs_definePDPContext()"); 951 TRACE_FUNCTION ("gprs_definePDPContext()");
952 952
953 /* 953 /*
954 * ACI call 954 * ACI call
975 return MFW_RES_OK; 975 return MFW_RES_OK;
976 } 976 }
977 #else 977 #else
978 T_MFW_RES gprs_definePDPContext(SHORT cid, T_PDP_CONTEXT *inputCtxt) 978 T_MFW_RES gprs_definePDPContext(SHORT cid, T_PDP_CONTEXT *inputCtxt)
979 { 979 {
980 T_MFW_GPRS_CONTEXT *context; 980 T_MFW_GPRS_CONTEXT *context;
981 981
982 TRACE_FUNCTION ("gprs_definePDPContext()"); 982 TRACE_FUNCTION ("gprs_definePDPContext()");
983 983
984 /* 984 /*
985 * ACI call 985 * ACI call
1014 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1014 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1015 | STATE : code ROUTINE: gprs_setQOS | 1015 | STATE : code ROUTINE: gprs_setQOS |
1016 +---------------------------------------------------------------------+ 1016 +---------------------------------------------------------------------+
1017 1017
1018 1018
1019 PURPOSE : Set the Quality of Service Profile for the context 1019 PURPOSE : Set the Quality of Service Profile for the context
1020 specified by cid. The Quality of Service Profile is given 1020 specified by cid. The Quality of Service Profile is given
1021 in the pointer parameter qos. 1021 in the pointer parameter qos.
1022 1022
1023 PARAMETERS : 1023 PARAMETERS :
1024 cid : context ID 1024 cid : context ID
1025 *inputQos : quality of service data 1025 *inputQos : quality of service data
1026 */ 1026 */
1027 #ifdef FF_2TO1_PS 1027 #ifdef FF_2TO1_PS
1028 T_MFW_RES gprs_setQOS(SHORT cid ,T_PS_qos *inputQos) 1028 T_MFW_RES gprs_setQOS(SHORT cid ,T_PS_qos *inputQos)
1029 { 1029 {
1030 T_MFW_GPRS_CONTEXT *cntxt; 1030 T_MFW_GPRS_CONTEXT *cntxt;
1031 1031
1032 TRACE_FUNCTION ("gprs_setQOS()"); 1032 TRACE_FUNCTION ("gprs_setQOS()");
1033 1033
1034 /* 1034 /*
1035 * ACI call 1035 * ACI call
1053 return MFW_RES_OK; 1053 return MFW_RES_OK;
1054 } 1054 }
1055 #else 1055 #else
1056 T_MFW_RES gprs_setQOS(SHORT cid ,T_PS_qos *inputQos) 1056 T_MFW_RES gprs_setQOS(SHORT cid ,T_PS_qos *inputQos)
1057 { 1057 {
1058 T_MFW_GPRS_CONTEXT *cntxt; 1058 T_MFW_GPRS_CONTEXT *cntxt;
1059 1059
1060 TRACE_FUNCTION ("gprs_setQOS()"); 1060 TRACE_FUNCTION ("gprs_setQOS()");
1061 1061
1062 /* 1062 /*
1063 * ACI call 1063 * ACI call
1088 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1088 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1089 | STATE : code ROUTINE: gprs_setQOSMin | 1089 | STATE : code ROUTINE: gprs_setQOSMin |
1090 +---------------------------------------------------------------------+ 1090 +---------------------------------------------------------------------+
1091 1091
1092 1092
1093 PURPOSE : Set the minimum acceptable Quality of Service Profile for 1093 PURPOSE : Set the minimum acceptable Quality of Service Profile for
1094 the context specified by cid. 1094 the context specified by cid.
1095 1095
1096 PARAMETERS : 1096 PARAMETERS :
1097 cid : context ID 1097 cid : context ID
1098 *inputQos : quality of service data 1098 *inputQos : quality of service data
1099 */ 1099 */
1100 #ifdef FF_2TO1_PS 1100 #ifdef FF_2TO1_PS
1101 T_MFW_RES gprs_setQOSMin(SHORT cid ,T_PS_qos *inputQos) 1101 T_MFW_RES gprs_setQOSMin(SHORT cid ,T_PS_qos *inputQos)
1102 { 1102 {
1103 T_MFW_GPRS_CONTEXT *cntxt; 1103 T_MFW_GPRS_CONTEXT *cntxt;
1104 1104
1105 TRACE_FUNCTION ("gprs_setQOSMin()"); 1105 TRACE_FUNCTION ("gprs_setQOSMin()");
1106 1106
1107 /* 1107 /*
1108 * ACI call 1108 * ACI call
1126 return MFW_RES_OK; 1126 return MFW_RES_OK;
1127 } 1127 }
1128 #else 1128 #else
1129 T_MFW_RES gprs_setQOSMin(SHORT cid ,T_PS_qos *inputQos) 1129 T_MFW_RES gprs_setQOSMin(SHORT cid ,T_PS_qos *inputQos)
1130 { 1130 {
1131 T_MFW_GPRS_CONTEXT *cntxt; 1131 T_MFW_GPRS_CONTEXT *cntxt;
1132 1132
1133 TRACE_FUNCTION ("gprs_setQOSMin()"); 1133 TRACE_FUNCTION ("gprs_setQOSMin()");
1134 1134
1135 /* 1135 /*
1136 * ACI call 1136 * ACI call
1161 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1161 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1162 | STATE : code ROUTINE: gprs_attach | 1162 | STATE : code ROUTINE: gprs_attach |
1163 +---------------------------------------------------------------------+ 1163 +---------------------------------------------------------------------+
1164 1164
1165 1165
1166 PURPOSE : Attach to or detach from the GPRS Service. The parameter 1166 PURPOSE : Attach to or detach from the GPRS Service. The parameter
1167 state indicates the state of GPRS attchement 1167 state indicates the state of GPRS attchement
1168 1168
1169 PARAMETERS : 1169 PARAMETERS :
1170 state : attachement state ( 0 - detached, 1 - attached) 1170 state : attachement state ( 0 - detached, 1 - attached)
1171 1171
1172 */ 1172 */
1173 T_MFW_RES gprs_attach(T_CGATT_STATE state) 1173 T_MFW_RES gprs_attach(T_CGATT_STATE state)
1174 { 1174 {
1175 T_ACI_RETURN result; 1175 T_ACI_RETURN result;
1176 1176
1177 TRACE_FUNCTION ("gprs_attach()"); 1177 TRACE_FUNCTION ("gprs_attach()");
1178 1178
1179 /* 1179 /*
1180 * ACI call 1180 * ACI call
1181 * SPR#1574 - SH - Don't return fail for AT_CMPL result 1181 * SPR#1574 - SH - Don't return fail for AT_CMPL result
1184 if ( result!= AT_EXCT && result!=AT_CMPL) 1184 if ( result!= AT_EXCT && result!=AT_CMPL)
1185 { 1185 {
1186 TRACE_EVENT("MFW_GPRS: Error. sAT_PlusCGATT failed"); 1186 TRACE_EVENT("MFW_GPRS: Error. sAT_PlusCGATT failed");
1187 return MFW_RES_ERR; 1187 return MFW_RES_ERR;
1188 } 1188 }
1189 1189
1190 /* 1190 /*
1191 * change attachement state in MFW GPRS data 1191 * change attachement state in MFW GPRS data
1192 */ 1192 */
1193 gprs_signal(E_MFW_GPRS_S_ATT, &state); 1193 gprs_signal(E_MFW_GPRS_S_ATT, &state);
1194 1194
1204 +---------------------------------------------------------------------+ 1204 +---------------------------------------------------------------------+
1205 1205
1206 1206
1207 PURPOSE : Cancel attachment to or detachment from GPRS service 1207 PURPOSE : Cancel attachment to or detachment from GPRS service
1208 SPR#1983 - SH - Added. 1208 SPR#1983 - SH - Added.
1209 1209
1210 PARAMETERS : None. 1210 PARAMETERS : None.
1211 1211
1212 */ 1212 */
1213 T_MFW_RES gprs_attach_abort(void) 1213 T_MFW_RES gprs_attach_abort(void)
1214 { 1214 {
1215 T_ACI_RETURN result; 1215 T_ACI_RETURN result;
1216 1216
1217 TRACE_EVENT("gprs_attach_abort()"); 1217 TRACE_EVENT("gprs_attach_abort()");
1218 1218
1219 result = sAT_Abort(CMD_SRC_LCL, AT_CMD_CGATT); 1219 result = sAT_Abort(CMD_SRC_LCL, AT_CMD_CGATT);
1220 1220
1221 if (result==AT_FAIL) 1221 if (result==AT_FAIL)
1222 return MFW_RES_ERR; 1222 return MFW_RES_ERR;
1223 1223
1230 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1230 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1231 | STATE : code ROUTINE: gprs_contextActivation| 1231 | STATE : code ROUTINE: gprs_contextActivation|
1232 +----------------------------------------------------------------------+ 1232 +----------------------------------------------------------------------+
1233 1233
1234 1234
1235 PURPOSE : Activate or Deactivate PDP contexts. The parameter state 1235 PURPOSE : Activate or Deactivate PDP contexts. The parameter state
1236 indicates the state of GPRS activation. 1236 indicates the state of GPRS activation.
1237 The parameter cids points to a list of contexts definitions. 1237 The parameter cids points to a list of contexts definitions.
1238 If the list is empty all contexts will be attached or 1238 If the list is empty all contexts will be attached or
1239 detached. If the mobile is not attached before, a GPRS 1239 detached. If the mobile is not attached before, a GPRS
1240 attach is first performed. 1240 attach is first performed.
1241 1241
1242 PARAMETERS : 1242 PARAMETERS :
1243 state : activation state ( 0 - deactivated, 1 - activated) 1243 state : activation state ( 0 - deactivated, 1 - activated)
1244 cids : list of contexts 1244 cids : list of contexts
1245 */ 1245 */
1246 T_MFW_RES gprs_contextActivation(T_CGACT_STATE state, SHORT *cids) 1246 T_MFW_RES gprs_contextActivation(T_CGACT_STATE state, SHORT *cids)
1247 { 1247 {
1248 T_MFW_GPRS_CNTXT_ACT *cntxtAct; 1248 T_MFW_GPRS_CNTXT_ACT *cntxtAct;
1249 1249
1250 TRACE_FUNCTION ("gprs_contextActivation()"); 1250 TRACE_FUNCTION ("gprs_contextActivation()");
1251 1251
1252 /* 1252 /*
1253 * ACI call 1253 * ACI call
1254 */ 1254 */
1255 #ifdef FF_2TO1_PS 1255 #ifdef FF_2TO1_PS
1256 if (sAT_PlusCGACT(CMD_SRC_LCL, state, (U8 *)cids) == AT_FAIL) 1256 if (sAT_PlusCGACT(CMD_SRC_LCL, state, (U8 *)cids) == AT_FAIL)
1257 #else 1257 #else
1258 if (sAT_PlusCGACT(CMD_SRC_LCL, state, cids) == AT_FAIL) 1258 if (sAT_PlusCGACT(CMD_SRC_LCL, state, cids) == AT_FAIL)
1259 #endif 1259 #endif
1260 { 1260 {
1261 TRACE_EVENT("MFW_GPRS: Error. sAT_PlusCGCACT failed"); 1261 TRACE_EVENT("MFW_GPRS: Error. sAT_PlusCGCACT failed");
1262 return MFW_RES_ERR; 1262 return MFW_RES_ERR;
1263 } 1263 }
1264 1264
1282 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1282 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1283 | STATE : code ROUTINE: gprs_setData | 1283 | STATE : code ROUTINE: gprs_setData |
1284 +---------------------------------------------------------------------+ 1284 +---------------------------------------------------------------------+
1285 1285
1286 1286
1287 PURPOSE : Enter data state. Whatever actions are necessary to 1287 PURPOSE : Enter data state. Whatever actions are necessary to
1288 establish communication between the TE and the network 1288 establish communication between the TE and the network
1289 will be performed (e.g. attach, context activate) 1289 will be performed (e.g. attach, context activate)
1290 PARAMETERS : 1290 PARAMETERS :
1291 L2P : Layer 2 protocoll 1291 L2P : Layer 2 protocoll
1292 cids : list of contexts 1292 cids : list of contexts
1293 1293
1294 */ 1294 */
1295 #ifdef FF_2TO1_PS 1295 #ifdef FF_2TO1_PS
1296 T_MFW_RES gprs_setData(char *L2P, SHORT *cids) 1296 T_MFW_RES gprs_setData(char *L2P, SHORT *cids)
1297 { 1297 {
1298 T_MFW_GPRS_CNTXT_L2P *cntxtL2P; 1298 T_MFW_GPRS_CNTXT_L2P *cntxtL2P;
1299 1299
1300 TRACE_FUNCTION ("gprs_setData()"); 1300 TRACE_FUNCTION ("gprs_setData()");
1301 1301
1302 /* 1302 /*
1303 * ACI call 1303 * ACI call
1327 return MFW_RES_OK; 1327 return MFW_RES_OK;
1328 } 1328 }
1329 #else 1329 #else
1330 T_MFW_RES gprs_setData(char *L2P, SHORT *cids) 1330 T_MFW_RES gprs_setData(char *L2P, SHORT *cids)
1331 { 1331 {
1332 T_MFW_GPRS_CNTXT_L2P *cntxtL2P; 1332 T_MFW_GPRS_CNTXT_L2P *cntxtL2P;
1333 1333
1334 TRACE_FUNCTION ("gprs_setData()"); 1334 TRACE_FUNCTION ("gprs_setData()");
1335 1335
1336 /* 1336 /*
1337 * ACI call 1337 * ACI call
1369 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1369 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1370 | STATE : code ROUTINE: gprs_showPDPAddress | 1370 | STATE : code ROUTINE: gprs_showPDPAddress |
1371 +-----------------------------------------------------------------------+ 1371 +-----------------------------------------------------------------------+
1372 1372
1373 1373
1374 PURPOSE : Show PDP address. The Function sets the pointer pdp_adress 1374 PURPOSE : Show PDP address. The Function sets the pointer pdp_adress
1375 to a list of PDP addresses for the specified context 1375 to a list of PDP addresses for the specified context
1376 identifiers in the parameter cids. 1376 identifiers in the parameter cids.
1377 1377
1378 PARAMETERS : 1378 PARAMETERS :
1379 pdp_address: list of contexts 1379 pdp_address: list of contexts
1380 1380
1381 RETURNS: 1381 RETURNS:
1382 MFW_RES_OK: On success 1382 MFW_RES_OK: On success
1383 MFW_RES_ERR: On failure 1383 MFW_RES_ERR: On failure
1384 */ 1384 */
1385 #ifdef FF_2TO1_PS 1385 #ifdef FF_2TO1_PS
1386 T_MFW_RES gprs_showPDPAddress(SHORT *cids, T_NAS_ip *pdp_address) 1386 T_MFW_RES gprs_showPDPAddress(SHORT *cids, T_NAS_ip *pdp_address)
1387 { 1387 {
1388 int i; 1388 int i;
1389 1389
1390 T_MFW_GPRS_CONTEXT *cntxt; 1390 T_MFW_GPRS_CONTEXT *cntxt;
1391 1391
1392 TRACE_FUNCTION ("gprs_showPDPAddress()"); 1392 TRACE_FUNCTION ("gprs_showPDPAddress()");
1393 1393
1394 /* 1394 /*
1395 * ACI call, get PDP addresses 1395 * ACI call, get PDP addresses
1419 #else 1419 #else
1420 T_MFW_RES gprs_showPDPAddress(SHORT *cids, T_NAS_ip *pdp_address) 1420 T_MFW_RES gprs_showPDPAddress(SHORT *cids, T_NAS_ip *pdp_address)
1421 { 1421 {
1422 int i; 1422 int i;
1423 1423
1424 T_MFW_GPRS_CONTEXT *cntxt; 1424 T_MFW_GPRS_CONTEXT *cntxt;
1425 1425
1426 TRACE_FUNCTION ("gprs_showPDPAddress()"); 1426 TRACE_FUNCTION ("gprs_showPDPAddress()");
1427 1427
1428 /* 1428 /*
1429 * ACI call, get PDP addresses 1429 * ACI call, get PDP addresses
1458 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1458 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1459 | STATE : code ROUTINE: gprs_setAutoResponse | 1459 | STATE : code ROUTINE: gprs_setAutoResponse |
1460 +----------------------------------------------------------------------+ 1460 +----------------------------------------------------------------------+
1461 1461
1462 1462
1463 PURPOSE : Enable or Disable an automatic positive response to the 1463 PURPOSE : Enable or Disable an automatic positive response to the
1464 receipt of Context Activation Requests from the network. 1464 receipt of Context Activation Requests from the network.
1465 The parameter mode indicates if the automatic response will 1465 The parameter mode indicates if the automatic response will
1466 be enabled or disabled. 1466 be enabled or disabled.
1467 1467
1468 PARAMETERS : 1468 PARAMETERS :
1469 mode : mode of auto response 1469 mode : mode of auto response
1470 */ 1470 */
1496 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1496 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1497 | STATE : code ROUTINE: gprs_ManualResponse | 1497 | STATE : code ROUTINE: gprs_ManualResponse |
1498 +----------------------------------------------------------------------+ 1498 +----------------------------------------------------------------------+
1499 1499
1500 1500
1501 PURPOSE : This Function is for a manual response to network request 1501 PURPOSE : This Function is for a manual response to network request
1502 for PDP context activation. The parameter response 1502 for PDP context activation. The parameter response
1503 indicates if the request will be accepted or rejected. 1503 indicates if the request will be accepted or rejected.
1504 PARAMETERS : 1504 PARAMETERS :
1505 response : ( 0 - rejected, 1 - accepted) 1505 response : ( 0 - rejected, 1 - accepted)
1506 */ 1506 */
1507 T_MFW_RES gprs_ManualResponse(USHORT response, char *l2p, SHORT cid) 1507 T_MFW_RES gprs_ManualResponse(USHORT response, char *l2p, SHORT cid)
1531 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1531 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1532 | STATE : code ROUTINE: gprs_setClass | 1532 | STATE : code ROUTINE: gprs_setClass |
1533 +----------------------------------------------------------------------+ 1533 +----------------------------------------------------------------------+
1534 1534
1535 1535
1536 PURPOSE : Set the mobile to operate according to a GPRS mobile class. 1536 PURPOSE : Set the mobile to operate according to a GPRS mobile class.
1537 1537
1538 PARAMETERS : 1538 PARAMETERS :
1539 m_class : GPRS mobile class 1539 m_class : GPRS mobile class
1540 */ 1540 */
1541 T_MFW_RES gprs_setClass(T_CGCLASS_CLASS new_cls) 1541 T_MFW_RES gprs_setClass(T_CGCLASS_CLASS new_cls)
1577 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1577 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1578 | STATE : code ROUTINE: gprs_setEventReporting| 1578 | STATE : code ROUTINE: gprs_setEventReporting|
1579 +----------------------------------------------------------------------+ 1579 +----------------------------------------------------------------------+
1580 1580
1581 1581
1582 PURPOSE : Enables or Disables the sending of certain events 1582 PURPOSE : Enables or Disables the sending of certain events
1583 occuring in the GPRS ME or the network to the TE. 1583 occuring in the GPRS ME or the network to the TE.
1584 1584
1585 PARAMETERS : 1585 PARAMETERS :
1586 mode : mode to specifies if the event reporting will be 1586 mode : mode to specifies if the event reporting will be
1587 enabled or disabled 1587 enabled or disabled
1588 bfr : controls the effect on buffered events. 1588 bfr : controls the effect on buffered events.
1589 */ 1589 */
1590 T_MFW_RES gprs_setEventReporting(T_CGEREP_MODE mode, T_CGEREP_BFR bfr) 1590 T_MFW_RES gprs_setEventReporting(T_CGEREP_MODE mode, T_CGEREP_BFR bfr)
1591 { 1591 {
1592 T_MFW_GPRS_EVENTREP *eventRep; 1592 T_MFW_GPRS_EVENTREP *eventRep;
1593 1593
1594 TRACE_FUNCTION ("gprs_setEventReporting()"); 1594 TRACE_FUNCTION ("gprs_setEventReporting()");
1595 1595
1596 /* 1596 /*
1597 * ACI call 1597 * ACI call
1617 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1617 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1618 | STATE : code ROUTINE: gprs_setServiceSMS | 1618 | STATE : code ROUTINE: gprs_setServiceSMS |
1619 +----------------------------------------------------------------------+ 1619 +----------------------------------------------------------------------+
1620 1620
1621 1621
1622 PURPOSE : The function specifies the service or service preference 1622 PURPOSE : The function specifies the service or service preference
1623 to be used for SMS. 1623 to be used for SMS.
1624 1624
1625 1625
1626 PARAMETERS : 1626 PARAMETERS :
1627 n : service to use for SMS ( 0 - GPRS, 1 - circuit switch, 1627 n : service to use for SMS ( 0 - GPRS, 1 - circuit switch,
1628 2 - GPRS preferred, 3 circuit switch preferred) 1628 2 - GPRS preferred, 3 circuit switch preferred)
1629 */ 1629 */
1630 1630
1631 T_MFW_RES gprs_setServiceSMS(T_CGSMS_SERVICE service) 1631 T_MFW_RES gprs_setServiceSMS(T_CGSMS_SERVICE service)
1632 { 1632 {
1654 | STATE : code ROUTINE: gprs_getServiceSMS | 1654 | STATE : code ROUTINE: gprs_getServiceSMS |
1655 +----------------------------------------------------------------------+ 1655 +----------------------------------------------------------------------+
1656 1656
1657 1657
1658 PURPOSE : This function returns the service preference to be used for SMS. 1658 PURPOSE : This function returns the service preference to be used for SMS.
1659 1659
1660 1660
1661 PARAMETERS : 1661 PARAMETERS :
1662 n : service to use for SMS ( 0 - GPRS, 1 - circuit switch, 1662 n : service to use for SMS ( 0 - GPRS, 1 - circuit switch,
1663 2 - GPRS preferred, 3 circuit switch preferred) 1663 2 - GPRS preferred, 3 circuit switch preferred)
1664 */ 1664 */
1665 1665
1666 T_CGSMS_SERVICE gprs_getServiceSMS(void) 1666 T_CGSMS_SERVICE gprs_getServiceSMS(void)
1667 { 1667 {
1668 T_CGSMS_SERVICE service; 1668 T_CGSMS_SERVICE service;
1669 1669
1670 if (qAT_PlusCGSMS(CMD_SRC_LCL, &service) != AT_FAIL ) 1670 if (qAT_PlusCGSMS(CMD_SRC_LCL, &service) != AT_FAIL )
1671 return service; 1671 return service;
1672 else 1672 else
1673 TRACE_EVENT("MFW_GPRS: Error. qAT_PlusCGCLASS failed"); 1673 TRACE_EVENT("MFW_GPRS: Error. qAT_PlusCGCLASS failed");
1674 return CGSMS_SERVICE_INVALID; 1674 return CGSMS_SERVICE_INVALID;
1692 { 1692 {
1693 T_ACI_RETURN result; 1693 T_ACI_RETURN result;
1694 TRACE_FUNCTION("gprs_counter"); 1694 TRACE_FUNCTION("gprs_counter");
1695 1695
1696 result = sAT_PercentSNCNT(CMD_SRC_LCL, reset_counter); 1696 result = sAT_PercentSNCNT(CMD_SRC_LCL, reset_counter);
1697 1697
1698 if (result!=AT_EXCT && result!=AT_CMPL) 1698 if (result!=AT_EXCT && result!=AT_CMPL)
1699 return MFW_RES_ERR; 1699 return MFW_RES_ERR;
1700 1700
1701 if (result==AT_CMPL) 1701 if (result==AT_CMPL)
1702 return MfwResDone; /* No response expected */ 1702 return MfwResDone; /* No response expected */
1703 1703
1704 return MFW_RES_OK; 1704 return MFW_RES_OK;
1705 } 1705 }
1706 1706
1707 1707
1708 /* 1708 /*
1712 +---------------------------------------------------------------------+ 1712 +---------------------------------------------------------------------+
1713 1713
1714 1714
1715 PURPOSE : Cancel request for data count 1715 PURPOSE : Cancel request for data count
1716 SPR#1983 - SH - Added. 1716 SPR#1983 - SH - Added.
1717 1717
1718 PARAMETERS : None. 1718 PARAMETERS : None.
1719 1719
1720 */ 1720 */
1721 1721
1722 T_MFW_RES gprs_counter_abort(void) 1722 T_MFW_RES gprs_counter_abort(void)
1723 { 1723 {
1724 T_ACI_RETURN result; 1724 T_ACI_RETURN result;
1725 1725
1726 result = sAT_Abort(CMD_SRC_LCL, AT_CMD_SNCNT); 1726 result = sAT_Abort(CMD_SRC_LCL, AT_CMD_SNCNT);
1727 1727
1728 if (result==AT_FAIL) 1728 if (result==AT_FAIL)
1729 return MFW_RES_ERR; 1729 return MFW_RES_ERR;
1730 1730
1744 * @see 1744 * @see
1745 */ 1745 */
1746 /* =========================================================== */ 1746 /* =========================================================== */
1747 int mfw_gprs_edge_status(int *iStatus) 1747 int mfw_gprs_edge_status(int *iStatus)
1748 { 1748 {
1749 /* Get the registered status */ 1749 /* Get the registered status */
1750 T_P_CGREG_STAT status = (T_P_CGREG_STAT)0; 1750 T_P_CGREG_STAT status = (T_P_CGREG_STAT)0;
1751 T_ACI_CREG_STAT stat = (T_ACI_CREG_STAT)0; 1751 T_ACI_CREG_STAT stat = (T_ACI_CREG_STAT)0;
1752 USHORT lac = 0; 1752 USHORT lac = 0;
1753 USHORT cid = 0; 1753 USHORT cid = 0;
1754 U8 rat = 0; 1754 U8 rat = 0;
1755 U8 gprs_ind = 0; 1755 U8 gprs_ind = 0;
1756 /* char temp[TEMP_STRING_SIZE]; */ 1756 /* char temp[TEMP_STRING_SIZE]; */
1757 1757
1758 1758
1759 /* Get the GPRS registered status */ 1759 /* Get the GPRS registered status */
1760 if (qAT_PercentCGREG(CMD_SRC_LCL, &status, &lac, &cid) == AT_FAIL ) 1760 if (qAT_PercentCGREG(CMD_SRC_LCL, &status, &lac, &cid) == AT_FAIL )
1761 { 1761 {
1762 TRACE_EVENT("MFW_GPRS: Error. qAT_PercentCGREG failed"); 1762 TRACE_EVENT("MFW_GPRS: Error. qAT_PercentCGREG failed");
1763 1763
1764 *iStatus = (int)0; /* GSM only */ 1764 *iStatus = (int)0; /* GSM only */
1765 return 0; /* rat - returned as GSM only */ 1765 return 0; /* rat - returned as GSM only */
1766 } 1766 }
1767 1767
1768 1768
1769 1769
1770 /* Reassign lac and cid values */ 1770 /* Reassign lac and cid values */
1773 1773
1774 /* To get the gprs_ind and rat */ 1774 /* To get the gprs_ind and rat */
1775 if(qAT_PercentCREG(CMD_SRC_LCL, &stat, &lac, &cid, &gprs_ind, &rat) NEQ AT_CMPL) 1775 if(qAT_PercentCREG(CMD_SRC_LCL, &stat, &lac, &cid, &gprs_ind, &rat) NEQ AT_CMPL)
1776 { 1776 {
1777 TRACE_EVENT("MFW_GPRS: Error. qAT_PercentCREG failed"); 1777 TRACE_EVENT("MFW_GPRS: Error. qAT_PercentCREG failed");
1778 1778
1779 *iStatus = (int)status; 1779 *iStatus = (int)status;
1780 return 0; /* rat - returned as GSM only */ 1780 return 0; /* rat - returned as GSM only */
1781 } 1781 }
1782 1782
1783 *iStatus = (int)status; 1783 *iStatus = (int)status;
1803 1803
1804 /*a0393213 compiler warnings removal - variable result removed*/ 1804 /*a0393213 compiler warnings removal - variable result removed*/
1805 1805
1806 T_CGREG_STAT status = (T_CGREG_STAT)0; 1806 T_CGREG_STAT status = (T_CGREG_STAT)0;
1807 USHORT lac, ci; 1807 USHORT lac, ci;
1808 1808
1809 TRACE_FUNCTION("gprs_status"); 1809 TRACE_FUNCTION("gprs_status");
1810 1810
1811 if (qAT_PlusCGREG(CMD_SRC_LCL, &status, &lac, &ci) == AT_FAIL ) 1811 if (qAT_PlusCGREG(CMD_SRC_LCL, &status, &lac, &ci) == AT_FAIL )
1812 { 1812 {
1813 TRACE_EVENT("MFW_GPRS: Error. qAT_PlusCGREG failed"); 1813 TRACE_EVENT("MFW_GPRS: Error. qAT_PlusCGREG failed");
1814 } 1814 }
1815 1815
1816 return status; 1816 return status;
1817 } 1817 }
1818 //x0035544 Feb 23, 2006 DR:OMAPS00068976 1818 //x0035544 Feb 23, 2006 DR:OMAPS00068976
1819 /* 1819 /*
1820 PURPOSE : Returns the GPRS status value 1820 PURPOSE : Returns the GPRS status value
1824 1824
1825 /*a0393213 compiler warnings removal - variable result removed*/ 1825 /*a0393213 compiler warnings removal - variable result removed*/
1826 1826
1827 T_P_CGREG_STAT status = (T_P_CGREG_STAT)0; 1827 T_P_CGREG_STAT status = (T_P_CGREG_STAT)0;
1828 USHORT lac, ci; 1828 USHORT lac, ci;
1829 1829
1830 TRACE_FUNCTION("p_gprs_status"); 1830 TRACE_FUNCTION("p_gprs_status");
1831 1831
1832 if (qAT_PercentCGREG(CMD_SRC_LCL, &status, &lac, &ci) == AT_FAIL ) 1832 if (qAT_PercentCGREG(CMD_SRC_LCL, &status, &lac, &ci) == AT_FAIL )
1833 { 1833 {
1834 TRACE_EVENT("MFW_GPRS: Error. qAT_PercentCGREG failed"); 1834 TRACE_EVENT("MFW_GPRS: Error. qAT_PercentCGREG failed");
1835 } 1835 }
1836 1836
1837 return status; 1837 return status;
1838 } 1838 }
1839 1839
1840 1840
1841 /*-------------------------------------------------------------------- 1841 /*--------------------------------------------------------------------
1842 ACI callback functions 1842 ACI callback functions
1843 --------------------------------------------------------------------*/ 1843 --------------------------------------------------------------------*/
1844 1844
1845 /* 1845 /*
1846 +--------------------------------------------------------------------+ 1846 +--------------------------------------------------------------------+
1847 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1847 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1848 | STATE : code ROUTINE: rAT_PlusCGACT | 1848 | STATE : code ROUTINE: rAT_PlusCGACT |
1849 +--------------------------------------------------------------------+ 1849 +--------------------------------------------------------------------+
1850 1850
1851 1851
1852 PURPOSE : The function rAt_PlusCGACT informs the application about 1852 PURPOSE : The function rAt_PlusCGACT informs the application about
1853 the link identifier for the data transfer. 1853 the link identifier for the data transfer.
1854 ( ACI callback funtion ) 1854 ( ACI callback funtion )
1855 1855
1856 PARAMETERS : 1856 PARAMETERS :
1857 link_id: Link identifier 1857 link_id: Link identifier
1858 1858
1859 */ 1859 */
1860 void rAT_PlusCGACT ( SHORT link_id ) 1860 void rAT_PlusCGACT ( SHORT link_id )
1861 { 1861 {
1862 TRACE_FUNCTION ("rAT_PlusCGACT()"); 1862 TRACE_FUNCTION ("rAT_PlusCGACT()");
1873 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1873 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1874 | STATE : code ROUTINE: rAT_PlusCGDATA | 1874 | STATE : code ROUTINE: rAT_PlusCGDATA |
1875 +--------------------------------------------------------------------+ 1875 +--------------------------------------------------------------------+
1876 1876
1877 1877
1878 PURPOSE : The function rAt_PlusCGDATA informs the application about 1878 PURPOSE : The function rAt_PlusCGDATA informs the application about
1879 the link identifier for the data transfer after 1879 the link identifier for the data transfer after
1880 activation/deactivation (without connect). 1880 activation/deactivation (without connect).
1881 ( ACI callback funtion ) 1881 ( ACI callback funtion )
1882 1882
1883 PARAMETERS : 1883 PARAMETERS :
1884 link_id: Link identifier 1884 link_id: Link identifier
1885 */ 1885 */
1886 void rAT_PlusCGDATA ( SHORT link_id ) 1886 void rAT_PlusCGDATA ( SHORT link_id )
1887 { 1887 {
1888 TRACE_FUNCTION ("rAT_PlusCGDATA()"); 1888 TRACE_FUNCTION ("rAT_PlusCGDATA()");
1889 1889
1899 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1899 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1900 | STATE : code ROUTINE: rAT_PlusCGANS | 1900 | STATE : code ROUTINE: rAT_PlusCGANS |
1901 +--------------------------------------------------------------------+ 1901 +--------------------------------------------------------------------+
1902 1902
1903 1903
1904 PURPOSE : The function rAt_PlusCGANS informs the application about 1904 PURPOSE : The function rAt_PlusCGANS informs the application about
1905 the link identifier for the data transfer. It is a 1905 the link identifier for the data transfer. It is a
1906 manual reponse to a network request for PDP context 1906 manual reponse to a network request for PDP context
1907 activation (after request by +CRING or RING). 1907 activation (after request by +CRING or RING).
1908 ( ACI callback funtion ) 1908 ( ACI callback funtion )
1909 1909
1910 PARAMETERS : 1910 PARAMETERS :
1911 link_id: Link identifier 1911 link_id: Link identifier
1912 */ 1912 */
1913 void rAT_PlusCGANS ( SHORT link_id ) 1913 void rAT_PlusCGANS ( SHORT link_id )
1914 { 1914 {
1915 TRACE_FUNCTION ("rAT_PlusCGANS()"); 1915 TRACE_FUNCTION ("rAT_PlusCGANS()");
1916 1916
1926 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 1926 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
1927 | STATE : code ROUTINE: rAT_PlusCGEREP | 1927 | STATE : code ROUTINE: rAT_PlusCGEREP |
1928 +--------------------------------------------------------------------+ 1928 +--------------------------------------------------------------------+
1929 1929
1930 1930
1931 PURPOSE : The function rAt_PlusCGEREP informs the application about 1931 PURPOSE : The function rAt_PlusCGEREP informs the application about
1932 GPRS events connect. 1932 GPRS events connect.
1933 ( ACI callback funtion ) 1933 ( ACI callback funtion )
1934 1934
1935 PARAMETERS : 1935 PARAMETERS :
1936 event : GPRS event 1936 event : GPRS event
1937 param : event parameter 1937 param : event parameter
1938 1938
1939 */ 1939 */
1940 void rAT_PlusCGEREP ( T_CGEREP_EVENT event, 1940 void rAT_PlusCGEREP ( T_CGEREP_EVENT event,
1941 T_CGEREP_EVENT_REP_PARAM *param ) 1941 T_CGEREP_EVENT_REP_PARAM *param )
1942 { 1942 {
1943 1943
1944 /*a0393213 compiler warnings removal - variable msg removed*/ 1944 /*a0393213 compiler warnings removal - variable msg removed*/
1945 1945
2005 /* gprs_signal(E_MFW_GPRS_R_EREP_RJ, &param->reject); - Use a different event for %CGEV */ 2005 /* gprs_signal(E_MFW_GPRS_R_EREP_RJ, &param->reject); - Use a different event for %CGEV */
2006 break; 2006 break;
2007 2007
2008 case CGEREP_EVENT_NW_DETACH: 2008 case CGEREP_EVENT_NW_DETACH:
2009 case CGEREP_EVENT_ME_DETACH: 2009 case CGEREP_EVENT_ME_DETACH:
2010 2010
2011 /* gprs_signal(E_MFW_GPRS_R_EREP_ATT, &state); - Use a different event for %CGEV */ 2011 /* gprs_signal(E_MFW_GPRS_R_EREP_ATT, &state); - Use a different event for %CGEV */
2012 break; 2012 break;
2013 2013
2014 case CGEREP_EVENT_NW_REACT: 2014 case CGEREP_EVENT_NW_REACT:
2015 /* gprs_signal(E_MFW_GPRS_R_EREP_ACT, &param->act); - Use a different event for %CGEV */ 2015 /* gprs_signal(E_MFW_GPRS_R_EREP_ACT, &param->act); - Use a different event for %CGEV */
2046 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 2046 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
2047 | STATE : code ROUTINE: rAT_PlusCGREG | 2047 | STATE : code ROUTINE: rAT_PlusCGREG |
2048 +--------------------------------------------------------------------+ 2048 +--------------------------------------------------------------------+
2049 2049
2050 2050
2051 PURPOSE : The function rAt_PlusCGREG informs the application about 2051 PURPOSE : The function rAt_PlusCGREG informs the application about
2052 the GPRS registration status and location information. 2052 the GPRS registration status and location information.
2053 ( ACI callback funtion ) 2053 ( ACI callback funtion )
2054 2054
2055 PARAMETERS : 2055 PARAMETERS :
2056 stat : indicates the current registration 2056 stat : indicates the current registration
2057 lac : two byte location area code 2057 lac : two byte location area code
2058 ci : two byte cell ID 2058 ci : two byte cell ID
2059 */ 2059 */
2060 void rAT_PlusCGREG ( T_CGREG_STAT stat, 2060 void rAT_PlusCGREG ( T_CGREG_STAT stat,
2061 USHORT lac, 2061 USHORT lac,
2062 USHORT ci ) 2062 USHORT ci )
2063 { 2063 {
2064 T_MFW_GPRS_CELL_STRUCT cell; 2064 T_MFW_GPRS_CELL_STRUCT cell;
2065 2065
2066 TRACE_FUNCTION ("rAT_PlusCGREG()"); 2066 TRACE_FUNCTION ("rAT_PlusCGREG()");
2067 #ifndef WIN32 2067 #ifndef WIN32
2068 TRACE_EVENT_P3("GPRS regState: %d, lac %X, ci %X", (short)stat, lac, ci); 2068 TRACE_EVENT_P3("GPRS regState: %d, lac %X, ci %X", (short)stat, lac, ci);
2091 */ 2091 */
2092 2092
2093 GLOBAL void rAT_PercentCGREG ( T_P_CGREG_STAT stat, USHORT lac, USHORT ci, BOOL bActiveContext ) 2093 GLOBAL void rAT_PercentCGREG ( T_P_CGREG_STAT stat, USHORT lac, USHORT ci, BOOL bActiveContext )
2094 2094
2095 { 2095 {
2096 2096
2097 T_MFW_GPRS_CELL_STRUCT_P cell; 2097 T_MFW_GPRS_CELL_STRUCT_P cell;
2098 2098
2099 TRACE_FUNCTION ("rAT_PercentCGREG()"); 2099 TRACE_FUNCTION ("rAT_PercentCGREG()");
2100 #ifndef WIN32 2100 #ifndef WIN32
2101 TRACE_EVENT_P3("GPRS regState: %d, lac %X, ci %X", (short)stat, lac, ci); 2101 TRACE_EVENT_P3("GPRS regState: %d, lac %X, ci %X", (short)stat, lac, ci);
2119 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS | 2119 | PROJECT: MMI-Framework (8417) MODULE: MFW_GPRS |
2120 | STATE : code ROUTINE: rAT_changedQOS | 2120 | STATE : code ROUTINE: rAT_changedQOS |
2121 +--------------------------------------------------------------------+ 2121 +--------------------------------------------------------------------+
2122 2122
2123 2123
2124 PURPOSE : The function rAt_changedQOS informs the application about 2124 PURPOSE : The function rAt_changedQOS informs the application about
2125 changes for the Quality of Service Profiles. 2125 changes for the Quality of Service Profiles.
2126 ( ACI callback funtion ) 2126 ( ACI callback funtion )
2127 2127
2128 PARAMETERS : 2128 PARAMETERS :
2129 cid : 2129 cid :
2130 *qos : 2130 *qos :
2131 */ 2131 */
2132 // ADDED - 1-11-2005 2132 // ADDED - 1-11-2005
2133 #ifdef FF_2TO1_PS 2133 #ifdef FF_2TO1_PS
2134 void rAT_changedQOS ( U8 cid, 2134 void rAT_changedQOS ( U8 cid,
2135 T_PS_qos *qos ) 2135 T_PS_qos *qos )
2136 { 2136 {
2137 T_MFW_GPRS_CONTEXT *cntxt; 2137 T_MFW_GPRS_CONTEXT *cntxt;
2138 2138
2139 TRACE_FUNCTION ("rAT_changedQOS()"); 2139 TRACE_FUNCTION ("rAT_changedQOS()");
2140 2140
2141 /* 2141 /*
2142 * send signal for changed quality of service profile to current 2142 * send signal for changed quality of service profile to current
2149 2149
2150 gprs_signal(E_MFW_GPRS_R_QOS, cntxt); 2150 gprs_signal(E_MFW_GPRS_R_QOS, cntxt);
2151 } 2151 }
2152 2152
2153 #else 2153 #else
2154 void rAT_changedQOS ( SHORT cid, 2154 void rAT_changedQOS ( SHORT cid,
2155 T_PS_qos *qos ) 2155 T_PS_qos *qos )
2156 { 2156 {
2157 T_MFW_GPRS_CONTEXT *cntxt; 2157 T_MFW_GPRS_CONTEXT *cntxt;
2158 2158
2159 TRACE_FUNCTION ("rAT_changedQOS()"); 2159 TRACE_FUNCTION ("rAT_changedQOS()");
2160 2160
2161 /* 2161 /*
2162 * send signal for changed quality of service profile to current 2162 * send signal for changed quality of service profile to current
2190 ULONG packets_downlink ) 2190 ULONG packets_downlink )
2191 { 2191 {
2192 T_MFW_GPRS_COUNTER counter; 2192 T_MFW_GPRS_COUNTER counter;
2193 2193
2194 TRACE_FUNCTION("rAT_PercentSNCNT()"); 2194 TRACE_FUNCTION("rAT_PercentSNCNT()");
2195 2195
2196 counter.octets_uplink = octets_uplink; 2196 counter.octets_uplink = octets_uplink;
2197 counter.octets_downlink = octets_downlink; 2197 counter.octets_downlink = octets_downlink;
2198 counter.packets_uplink = packets_uplink; 2198 counter.packets_uplink = packets_uplink;
2199 counter.packets_downlink = packets_downlink; 2199 counter.packets_downlink = packets_downlink;
2200 2200
2201 gprs_signal(E_MFW_GPRS_COUNTER, &counter); 2201 gprs_signal(E_MFW_GPRS_COUNTER, &counter);
2202 2202
2203 return; 2203 return;
2204 } 2204 }