comparison src/ui/bmi/mmiGprs.c @ 92:c0052fe355d3

src/ui/bmi/*.[ch]: rm trailing white space
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 08 Nov 2020 06:39:16 +0000
parents 67bfe9f274f6
children abaee5bdfdc9
comparison
equal deleted inserted replaced
91:c3d28a37caad 92:c0052fe355d3
1 /******************************************************************************* 1 /*******************************************************************************
2 2
3 CONDAT (UK) 3 CONDAT (UK)
4 4
5 ******************************************************************************** 5 ********************************************************************************
6 6
7 This software product is the property of Condat (UK) Ltd and may not be 7 This software product is the property of Condat (UK) Ltd and may not be
8 disclosed to any third party without the express permission of the owner. 8 disclosed to any third party without the express permission of the owner.
9 9
10 ******************************************************************************** 10 ********************************************************************************
11 11
12 $Project name: 12 $Project name:
13 $Project code: 13 $Project code:
14 $Module: 14 $Module:
15 $File: MmiGprs.c 15 $File: MmiGprs.c
16 $Revision: 16 $Revision:
17 17
18 $Author: Condat(UK) 18 $Author: Condat(UK)
19 $Date: 19 $Date:
20 20
21 ******************************************************************************** 21 ********************************************************************************
22 22
23 Description: 23 Description:
24 GPRS handling for MMI. 24 GPRS handling for MMI.
25 25
26 26
27 ******************************************************************************** 27 ********************************************************************************
28 28
29 $History: MmiGprs.c 29 $History: MmiGprs.c
30 30
31 Oct 18,2006 REF:DR OMAPS00099409 x0047075 31 Oct 18,2006 REF:DR OMAPS00099409 x0047075
37 Solution: A condition is added when not regeistered, no searching the gprs status 37 Solution: A condition is added when not regeistered, no searching the gprs status
38 is updated as not attached. 38 is updated as not attached.
39 39
40 Feb 24, 2006 REF:DR OMAPS00068976 x0035544 40 Feb 24, 2006 REF:DR OMAPS00068976 x0035544
41 Description: GPRS attach icon - MMI follow up issue of OMAPS00051034 41 Description: GPRS attach icon - MMI follow up issue of OMAPS00051034
42 solution: a Check is added for the idle mode display and querry the GPRS status of 42 solution: a Check is added for the idle mode display and querry the GPRS status of
43 network registration and update the GPRS state and attach icon display accordingly. 43 network registration and update the GPRS state and attach icon display accordingly.
44 44
45 15/05/2003 - SPR#1983 - SH - Updated to latest from 1.6.3 version. 45 15/05/2003 - SPR#1983 - SH - Updated to latest from 1.6.3 version.
46 46
47 Dec 02, 2005 REF: DR OMAPS00048551 x0039928 47 Dec 02, 2005 REF: DR OMAPS00048551 x0039928
48 Description: MMI Cloud displays ""GPRS Detached"" in place 48 Description: MMI Cloud displays ""GPRS Detached"" in place
49 of ""GPRS Not Attached"" when unable to attach.. 49 of ""GPRS Not Attached"" when unable to attach..
50 Solution: A condition is added to check if the request is for attach and then display 50 Solution: A condition is added to check if the request is for attach and then display
51 "GPRS Not Attached" in case it fails. 51 "GPRS Not Attached" in case it fails.
52 52
53 Dec 01, 2005 REF: DR OMAPS00048530 x0039928 53 Dec 01, 2005 REF: DR OMAPS00048530 x0039928
54 Description: After the GPRS detach the MMI shows it is attached. 54 Description: After the GPRS detach the MMI shows it is attached.
55 Solution: A check is made to display "GPRS Attached" only when an GPRS attach is 55 Solution: A check is made to display "GPRS Attached" only when an GPRS attach is
56 requested but not when GPRS detach is request. 56 requested but not when GPRS detach is request.
57 57
58 Jun 14, 2005 REF: MMI-FIX-30439 x0018858 58 Jun 14, 2005 REF: MMI-FIX-30439 x0018858
59 Description: The homezone/cityzone tags were not being displayed properly. 59 Description: The homezone/cityzone tags were not being displayed properly.
60 Solution: Modified to save the tags properly in caches and also made the 60 Solution: Modified to save the tags properly in caches and also made the
61 appropriate modifications to update the same properly during mobility. 61 appropriate modifications to update the same properly during mobility.
62 62
63 $End 63 $End
64 64
65 *******************************************************************************/ 65 *******************************************************************************/
66 66
67 #define ENTITY_MFW 67 #define ENTITY_MFW
205 { 205 {
206 if (gprs_data==NULL) 206 if (gprs_data==NULL)
207 { 207 {
208 TRACE_EVENT("***ERROR*** MMI GPRS not initialised properly"); 208 TRACE_EVENT("***ERROR*** MMI GPRS not initialised properly");
209 } 209 }
210 210
211 return gprs_data; 211 return gprs_data;
212 } 212 }
213 213
214 /******************************************************************************* 214 /*******************************************************************************
215 215
224 *******************************************************************************/ 224 *******************************************************************************/
225 225
226 void GPRS_Init(void) 226 void GPRS_Init(void)
227 { 227 {
228 T_MMI_GPRS_DATA *data; 228 T_MMI_GPRS_DATA *data;
229 229
230 tracefunction("GPRS_Init()"); 230 tracefunction("GPRS_Init()");
231 231
232 gprs_init(); 232 gprs_init();
233 233
234 /* Allocate memory for mmi data */ 234 /* Allocate memory for mmi data */
243 data->sms_service = SMS_SERVICE_OMITTED; 243 data->sms_service = SMS_SERVICE_OMITTED;
244 data->display = FALSE; 244 data->display = FALSE;
245 data->notify_win = NULL; 245 data->notify_win = NULL;
246 data->callback = NULL; 246 data->callback = NULL;
247 data->reg_status = GPRS_OFF; 247 data->reg_status = GPRS_OFF;
248 248
249 return; 249 return;
250 } 250 }
251 251
252 252
253 /******************************************************************************* 253 /*******************************************************************************
299 T_MMI_GPRS_DATA *data = GPRS_Data(); 299 T_MMI_GPRS_DATA *data = GPRS_Data();
300 300
301 tracefunction("GPRS_Exit()"); 301 tracefunction("GPRS_Exit()");
302 302
303 if (data) 303 if (data)
304 { 304 {
305 /* Delete any remaining please wait window (just in case!)*/ 305 /* Delete any remaining please wait window (just in case!)*/
306 GPRS_PleaseWaitDestroy(); 306 GPRS_PleaseWaitDestroy();
307 307
308 /* Delete the MFW module */ 308 /* Delete the MFW module */
309 if (data->mfw_gprs) 309 if (data->mfw_gprs)
310 { 310 {
311 gprs_delete(data->mfw_gprs); 311 gprs_delete(data->mfw_gprs);
312 } 312 }
313 313
314 /* Delete MMI data */ 314 /* Delete MMI data */
315 FREE_MEMORY((void *)data, sizeof(T_MMI_GPRS_DATA)); 315 FREE_MEMORY((void *)data, sizeof(T_MMI_GPRS_DATA));
316 gprs_data = NULL; 316 gprs_data = NULL;
317 } 317 }
318 318
319 gprs_exit(); 319 gprs_exit();
320 return; 320 return;
321 } 321 }
322 322
323 323
336 int GPRS_Status(void) 336 int GPRS_Status(void)
337 { 337 {
338 T_MMI_GPRS_DATA *data = GPRS_Data(); 338 T_MMI_GPRS_DATA *data = GPRS_Data();
339 T_MFW_GPRS *gprs; 339 T_MFW_GPRS *gprs;
340 int result; 340 int result;
341 341
342 #ifdef NEPTUNE_BOARD 342 #ifdef NEPTUNE_BOARD
343 int iStatus = 0; 343 int iStatus = 0;
344 int iDisplayIcn = 0; 344 int iDisplayIcn = 0;
345 #endif 345 #endif
346 346
348 348
349 if (!data) 349 if (!data)
350 { 350 {
351 return GPRS_OFF; 351 return GPRS_OFF;
352 } 352 }
353 353
354 /* Keeps track of last status value, so we only need to call callback when a change occurs. 354 /* Keeps track of last status value, so we only need to call callback when a change occurs.
355 * Default state is GPRS OFF */ 355 * Default state is GPRS OFF */
356 356
357 iconsDeleteState(iconIdGPRSOn); 357 iconsDeleteState(iconIdGPRSOn);
358 358
359 #ifdef NEPTUNE_BOARD 359 #ifdef NEPTUNE_BOARD
360 /* OMAPS00074454 - For Edge Icon Display */ 360 /* OMAPS00074454 - For Edge Icon Display */
361 iconsDeleteState(iconIdEdgeOn); 361 iconsDeleteState(iconIdEdgeOn);
362 /* END */ 362 /* END */
363 #endif 363 #endif
364 result = GPRS_OFF; 364 result = GPRS_OFF;
365 365
366 /* Check if searching or attached */ 366 /* Check if searching or attached */
367 367
368 if (data->mfw_gprs) 368 if (data->mfw_gprs)
369 { 369 {
370 gprs = ((T_MFW_HDR *)data->mfw_gprs)->data; 370 gprs = ((T_MFW_HDR *)data->mfw_gprs)->data;
371 //x0035544 Feb 23, 2006 DR:OMAPS00068976 371 //x0035544 Feb 23, 2006 DR:OMAPS00068976
372 /* Check for the idle mode and querry the status of network registration 372 /* Check for the idle mode and querry the status of network registration
373 *and update the GPRS state and attach icon display accordingly */ 373 *and update the GPRS state and attach icon display accordingly */
374 if (gprs && (idleIsFocussed() ||data->menu_win == NULL) ) 374 if (gprs && (idleIsFocussed() ||data->menu_win == NULL) )
375 { 375 {
376 #ifdef NEPTUNE_BOARD 376 #ifdef NEPTUNE_BOARD
377 iDisplayIcn = mfw_gprs_edge_status (&iStatus); 377 iDisplayIcn = mfw_gprs_edge_status (&iStatus);
378 378
379 /* Status is obtained from AT command and assigned. */ 379 /* Status is obtained from AT command and assigned. */
380 gprs->data.Reg_state.p_reg_State = (T_P_CGREG_STAT) iStatus; 380 gprs->data.Reg_state.p_reg_State = (T_P_CGREG_STAT) iStatus;
381 381
382 if ((gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_SEARCHING) && 382 if ((gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_SEARCHING) &&
383 (iDisplayIcn == GPRS_ICON_SET)) 383 (iDisplayIcn == GPRS_ICON_SET))
384 { 384 {
385 result = GPRS_SEARCHING; 385 result = GPRS_SEARCHING;
386 } 386 }
387 387
388 else if((gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_SEARCHING) && 388 else if((gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_SEARCHING) &&
389 (iDisplayIcn == EDGE_ICON_SET)) 389 (iDisplayIcn == EDGE_ICON_SET))
390 { 390 {
391 result = EDGE_SEARCHING; 391 result = EDGE_SEARCHING;
392 } 392 }
393 393
394 /* Check regState and iDisplayIcn For display of GPRS*/ 394 /* Check regState and iDisplayIcn For display of GPRS*/
395 else if ((gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_HOME || 395 else if ((gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_HOME ||
396 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_ROAM ) && 396 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_ROAM ) &&
397 (iDisplayIcn == GPRS_ICON_SET)) 397 (iDisplayIcn == GPRS_ICON_SET))
398 { 398 {
399 iconsSetState(iconIdGPRSOn); 399 iconsSetState(iconIdGPRSOn);
400 result = GPRS_ATTACHED; 400 result = GPRS_ATTACHED;
401 } 401 }
402 402
403 /* Check regState and iDisplayIcn For display of EDGE*/ 403 /* Check regState and iDisplayIcn For display of EDGE*/
404 else if ((gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_HOME || 404 else if ((gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_HOME ||
405 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_ROAM ) && 405 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_ROAM ) &&
406 (iDisplayIcn == EDGE_ICON_SET)) 406 (iDisplayIcn == EDGE_ICON_SET))
407 { 407 {
408 iconsSetState(iconIdEdgeOn); 408 iconsSetState(iconIdEdgeOn);
409 result = EDGE_ATTACHED; 409 result = EDGE_ATTACHED;
410 } 410 }
411 else if ((gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_NO_CELL || 411 else if ((gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_NO_CELL ||
412 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_LIMITED || 412 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_LIMITED ||
413 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_UNKN || 413 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_UNKN ||
414 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_DEN ) && 414 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_DEN ) &&
415 (iDisplayIcn == EDGE_ICON_SET)) 415 (iDisplayIcn == EDGE_ICON_SET))
416 { 416 {
417 iconsDeleteState(iconIdGPRSOn ); 417 iconsDeleteState(iconIdGPRSOn );
418 result = GPRS_ERROR; 418 result = GPRS_ERROR;
419 } 419 }
420 else if ((gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_NO_CELL || 420 else if ((gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_NO_CELL ||
421 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_LIMITED || 421 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_LIMITED ||
422 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_UNKN || 422 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_UNKN ||
423 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_DEN ) && 423 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_DEN ) &&
424 (iDisplayIcn == EDGE_ICON_SET)) 424 (iDisplayIcn == EDGE_ICON_SET))
425 { 425 {
426 iconsDeleteState(iconIdEdgeOn ); 426 iconsDeleteState(iconIdEdgeOn );
427 result = EDGE_ERROR; 427 result = EDGE_ERROR;
428 } 428 }
429 /* May 29, 2006 Ref bug OMAPS00078997 */ 429 /* May 29, 2006 Ref bug OMAPS00078997 */
430 else if (gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_NOT_REG ) 430 else if (gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_NOT_REG )
431 { 431 {
432 iconsDeleteState(iconIdGPRSOn ); 432 iconsDeleteState(iconIdGPRSOn );
436 else 436 else
437 { 437 {
438 iconsDeleteState(iconIdGPRSOn); 438 iconsDeleteState(iconIdGPRSOn);
439 iconsDeleteState(iconIdEdgeOn); 439 iconsDeleteState(iconIdEdgeOn);
440 } 440 }
441 441
442 #else 442 #else
443 443
444 gprs->data.Reg_state.p_reg_State = p_gprs_status(); 444 gprs->data.Reg_state.p_reg_State = p_gprs_status();
445 445
446 trace_P1("GPRS_Status: p_regState = %d", gprs->data.Reg_state.p_reg_State); 446 trace_P1("GPRS_Status: p_regState = %d", gprs->data.Reg_state.p_reg_State);
450 result = GPRS_SEARCHING; 450 result = GPRS_SEARCHING;
451 } 451 }
452 452
453 /* Check regState rather than attached to find GPRS status */ 453 /* Check regState rather than attached to find GPRS status */
454 454
455 else if (gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_HOME || 455 else if (gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_HOME ||
456 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_ROAM ) 456 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_ROAM )
457 { 457 {
458 iconsSetState(iconIdGPRSOn); 458 iconsSetState(iconIdGPRSOn);
459 result = GPRS_ATTACHED; 459 result = GPRS_ATTACHED;
460 } 460 }
461 else if(gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_NO_CELL || 461 else if(gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_NO_CELL ||
462 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_LIMITED || 462 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_LIMITED ||
463 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_UNKN || 463 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_UNKN ||
464 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_DEN) 464 gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_REG_DEN)
465 465
466 { 466 {
467 iconsDeleteState(iconIdGPRSOn ); 467 iconsDeleteState(iconIdGPRSOn );
468 result = GPRS_ERROR; 468 result = GPRS_ERROR;
469 } 469 }
470 //Oct 18,2006 REF:DR OMAPS00099409 x0047075 470 //Oct 18,2006 REF:DR OMAPS00099409 x0047075
473 else if (gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_NOT_REG ) 473 else if (gprs->data.Reg_state.p_reg_State == P_CGREG_STAT_NOT_REG )
474 { 474 {
475 iconsDeleteState(iconIdGPRSOn ); 475 iconsDeleteState(iconIdGPRSOn );
476 result = GPRS_OFF; 476 result = GPRS_OFF;
477 } 477 }
478 #endif 478 #endif
479 479
480 } 480 }
481 else if (gprs ) 481 else if (gprs )
482 { 482 {
483 483
484 #ifdef NEPTUNE_BOARD 484 #ifdef NEPTUNE_BOARD
487 /* Status is obtained from AT command and assigned. */ 487 /* Status is obtained from AT command and assigned. */
488 /* x0045876, 14-Aug-2006 (WR - enumerated type mixed with another type) */ 488 /* x0045876, 14-Aug-2006 (WR - enumerated type mixed with another type) */
489 /* gprs->data.Reg_state.regState = iStatus; */ 489 /* gprs->data.Reg_state.regState = iStatus; */
490 gprs->data.Reg_state.regState = (T_CGREG_STAT) iStatus; 490 gprs->data.Reg_state.regState = (T_CGREG_STAT) iStatus;
491 491
492 if ((gprs->data.Reg_state.regState==CGREG_STAT_SEARCHING) && 492 if ((gprs->data.Reg_state.regState==CGREG_STAT_SEARCHING) &&
493 (iDisplayIcn == GPRS_ICON_SET)) 493 (iDisplayIcn == GPRS_ICON_SET))
494 { 494 {
495 result = GPRS_SEARCHING; 495 result = GPRS_SEARCHING;
496 } 496 }
497 497
498 else if((gprs->data.Reg_state.regState==CGREG_STAT_SEARCHING) && 498 else if((gprs->data.Reg_state.regState==CGREG_STAT_SEARCHING) &&
499 (iDisplayIcn == EDGE_ICON_SET)) 499 (iDisplayIcn == EDGE_ICON_SET))
500 { 500 {
501 result = EDGE_SEARCHING; 501 result = EDGE_SEARCHING;
502 } 502 }
503 503
504 /* Check regState and iDisplayIcn For display of GPRS*/ 504 /* Check regState and iDisplayIcn For display of GPRS*/
505 else if ((gprs->data.Reg_state.regState==CGREG_STAT_REG_HOME || 505 else if ((gprs->data.Reg_state.regState==CGREG_STAT_REG_HOME ||
506 gprs->data.Reg_state.regState==CGREG_STAT_REG_ROAM) && 506 gprs->data.Reg_state.regState==CGREG_STAT_REG_ROAM) &&
507 (iDisplayIcn == GPRS_ICON_SET)) 507 (iDisplayIcn == GPRS_ICON_SET))
508 { 508 {
509 iconsSetState(iconIdGPRSOn); 509 iconsSetState(iconIdGPRSOn);
510 result = GPRS_ATTACHED; 510 result = GPRS_ATTACHED;
511 } 511 }
512 512
513 /* Check regState and iDisplayIcn For display of EDGE*/ 513 /* Check regState and iDisplayIcn For display of EDGE*/
514 else if ((gprs->data.Reg_state.regState==CGREG_STAT_REG_HOME || 514 else if ((gprs->data.Reg_state.regState==CGREG_STAT_REG_HOME ||
515 gprs->data.Reg_state.regState==CGREG_STAT_REG_ROAM) && 515 gprs->data.Reg_state.regState==CGREG_STAT_REG_ROAM) &&
516 (iDisplayIcn == EDGE_ICON_SET)) 516 (iDisplayIcn == EDGE_ICON_SET))
517 { 517 {
518 iconsSetState(iconIdEdgeOn); 518 iconsSetState(iconIdEdgeOn);
519 result = EDGE_ATTACHED; 519 result = EDGE_ATTACHED;
520 } 520 }
521 #else 521 #else
522 522
523 //x0035544 Feb 23, 2006 DR:OMAPS00068976 523 //x0035544 Feb 23, 2006 DR:OMAPS00068976
536 gprs->data.Reg_state.regState ==CGREG_STAT_REG_ROAM) 536 gprs->data.Reg_state.regState ==CGREG_STAT_REG_ROAM)
537 { 537 {
538 iconsSetState(iconIdGPRSOn); 538 iconsSetState(iconIdGPRSOn);
539 result = GPRS_ATTACHED; 539 result = GPRS_ATTACHED;
540 } 540 }
541 #endif 541 #endif
542 } 542 }
543 } 543 }
544 544
545 /* If status has changed, notify */ 545 /* If status has changed, notify */
546 if (data->callback!=NULL && result!=data->reg_status) 546 if (data->callback!=NULL && result!=data->reg_status)
547 { 547 {
548 data->callback(result); 548 data->callback(result);
549 } 549 }
562 $Returns: None. 562 $Returns: None.
563 563
564 $Arguments: parent_win - the parent window 564 $Arguments: parent_win - the parent window
565 TextId1 - the first text string to be shown 565 TextId1 - the first text string to be shown
566 TextId2 - the second text string to be shown 566 TextId2 - the second text string to be shown
567 567
568 [afo 03/10/03] Moved function to an earlier location in the file and changed 568 [afo 03/10/03] Moved function to an earlier location in the file and changed
569 the return type to void. We were taking liberties with C which we 569 the return type to void. We were taking liberties with C which we
570 got away with using the TI compiler but which Visual C flagged as 570 got away with using the TI compiler but which Visual C flagged as
571 an error. 571 an error.
572 572
573 We seem to be a bit slack on function scope and return values in 573 We seem to be a bit slack on function scope and return values in
574 some cases in this file. 574 some cases in this file.
575 575
576 *******************************************************************************/ 576 *******************************************************************************/
577 577
578 static void GPRS_ResultScreen(T_MFW_HND parent_win, USHORT TextId1, USHORT TextId2) 578 static void GPRS_ResultScreen(T_MFW_HND parent_win, USHORT TextId1, USHORT TextId2)
579 { 579 {
580 T_MMI_GPRS_DATA *data = GPRS_Data(); 580 T_MMI_GPRS_DATA *data = GPRS_Data();
581 581
582 tracefunction("GPRS_ResultScreen()"); 582 tracefunction("GPRS_ResultScreen()");
583 583
584 if (!data) 584 if (!data)
585 { 585 {
586 return; 586 return;
587 } 587 }
588 588
589 GPRS_PleaseWaitDestroy(); 589 GPRS_PleaseWaitDestroy();
590 590
591 info_screen(parent_win, TextId1, TextId2, NULL); 591 info_screen(parent_win, TextId1, TextId2, NULL);
592 592
593 data->display = FALSE; 593 data->display = FALSE;
594 594
595 return; 595 return;
617 { 617 {
618 /* x0045876, 14-Aug-2006 (WR - non-void function "GPRS_Attach" should return a value) */ 618 /* x0045876, 14-Aug-2006 (WR - non-void function "GPRS_Attach" should return a value) */
619 /* return; */ 619 /* return; */
620 return 0; 620 return 0;
621 } 621 }
622 622
623 data->status = MMI_GPRS_STATUS_ATTACHING; 623 data->status = MMI_GPRS_STATUS_ATTACHING;
624 624
625 if (win) 625 if (win)
626 { 626 {
627 GPRS_PleaseWait(win, TxtPleaseWait, NULL); 627 GPRS_PleaseWait(win, TxtPleaseWait, NULL);
628 } 628 }
629 629
630 /* Perform the attach */ 630 /* Perform the attach */
631 631
632 if (gprs_attach(CGATT_STATE_ATTACHED)==MFW_RES_OK) 632 if (gprs_attach(CGATT_STATE_ATTACHED)==MFW_RES_OK)
633 { 633 {
634 trace("GPRSAttach executing, awaiting confirmation."); 634 trace("GPRSAttach executing, awaiting confirmation.");
635 } 635 }
636 else 636 else
676 676
677 if (win) 677 if (win)
678 { 678 {
679 GPRS_PleaseWait(win, TxtPleaseWait, NULL); 679 GPRS_PleaseWait(win, TxtPleaseWait, NULL);
680 } 680 }
681 681
682 if (gprs_attach(CGATT_STATE_DETACHED)==MFW_RES_OK) 682 if (gprs_attach(CGATT_STATE_DETACHED)==MFW_RES_OK)
683 { 683 {
684 trace("GPRSDetach executing, awaiting confirmation."); 684 trace("GPRSDetach executing, awaiting confirmation.");
685 } 685 }
686 else 686 else
711 *******************************************************************************/ 711 *******************************************************************************/
712 #ifdef FF_2TO1_PS 712 #ifdef FF_2TO1_PS
713 int GPRS_ContextDefine(SHORT cid, char *IPAddress, char *APN) 713 int GPRS_ContextDefine(SHORT cid, char *IPAddress, char *APN)
714 { 714 {
715 static T_PDP_CONTEXT context; 715 static T_PDP_CONTEXT context;
716 716
717 strcpy(context.pdp_apn, APN); 717 strcpy(context.pdp_apn, APN);
718 strcpy(context.pdp_type, "IP"); 718 strcpy(context.pdp_type, "IP");
719 strcpy((char*)context.pdp_addr.ip_address.ipv4_addr.a4, (char*)IPAddress); 719 strcpy((char*)context.pdp_addr.ip_address.ipv4_addr.a4, (char*)IPAddress);
720 720
721 context.pdp_addr.ctrl_ip_address = NAS_is_ipv4; 721 context.pdp_addr.ctrl_ip_address = NAS_is_ipv4;
725 context.d_comp = CGDCONT_D_COMP_OMITTED; 725 context.d_comp = CGDCONT_D_COMP_OMITTED;
726 context.h_comp = CGDCONT_H_COMP_OMITTED; 726 context.h_comp = CGDCONT_H_COMP_OMITTED;
727 */ 727 */
728 context.d_comp = (U8) CGDCONT_D_COMP_OMITTED; 728 context.d_comp = (U8) CGDCONT_D_COMP_OMITTED;
729 context.h_comp = (U8) CGDCONT_H_COMP_OMITTED; 729 context.h_comp = (U8) CGDCONT_H_COMP_OMITTED;
730 730
731 // memset(&context.qos,0,sizeof(T_PS_qos)); 731 // memset(&context.qos,0,sizeof(T_PS_qos));
732 // memset(&context.min_qos,0,sizeof(T_PS_qos)); 732 // memset(&context.min_qos,0,sizeof(T_PS_qos));
733 733
734 if (gprs_definePDPContext(cid, &context)!=MFW_RES_OK) 734 if (gprs_definePDPContext(cid, &context)!=MFW_RES_OK)
735 { 735 {
740 } 740 }
741 #else 741 #else
742 int GPRS_ContextDefine(SHORT cid, char *IPAddress, char *APN) 742 int GPRS_ContextDefine(SHORT cid, char *IPAddress, char *APN)
743 { 743 {
744 static T_PDP_CONTEXT context; 744 static T_PDP_CONTEXT context;
745 745
746 strcpy(context.pdp_apn, APN); 746 strcpy(context.pdp_apn, APN);
747 strcpy(context.pdp_type, "IP"); 747 strcpy(context.pdp_type, "IP");
748 strcpy((char*)context.pdp_addr.ip_address.ipv4_addr.a4, (char*)IPAddress); 748 strcpy((char*)context.pdp_addr.ip_address.ipv4_addr.a4, (char*)IPAddress);
749 context.pdp_addr.ctrl_ip_address = NAS_is_ipv4; 749 context.pdp_addr.ctrl_ip_address = NAS_is_ipv4;
750 context.d_comp = (U8)CGDCONT_D_COMP_OMITTED; 750 context.d_comp = (U8)CGDCONT_D_COMP_OMITTED;
777 int GPRS_ContextActivate(SHORT cid) 777 int GPRS_ContextActivate(SHORT cid)
778 { 778 {
779 SHORT cids[2]; 779 SHORT cids[2];
780 780
781 tracefunction("GPRS_ContextActivate()"); 781 tracefunction("GPRS_ContextActivate()");
782 782
783 cids[0] = cid; 783 cids[0] = cid;
784 cids[1] = 0; 784 cids[1] = 0;
785 785
786 if (gprs_contextActivation(CGACT_STATE_ACTIVATED, cids)==MFW_RES_OK) 786 if (gprs_contextActivation(CGACT_STATE_ACTIVATED, cids)==MFW_RES_OK)
787 { 787 {
788 trace("GPRS_ContextActivate: Failed."); 788 trace("GPRS_ContextActivate: Failed.");
789 return FALSE; 789 return FALSE;
790 } 790 }
809 int GPRS_ContextDeactivate(SHORT cid) 809 int GPRS_ContextDeactivate(SHORT cid)
810 { 810 {
811 SHORT cids[2]; 811 SHORT cids[2];
812 812
813 tracefunction("GPRS_ContextDeactivate()"); 813 tracefunction("GPRS_ContextDeactivate()");
814 814
815 cids[0] = cid; 815 cids[0] = cid;
816 cids[1] = 0; 816 cids[1] = 0;
817 817
818 if (gprs_contextActivation(CGACT_STATE_DEACTIVATED, cids)==MFW_RES_OK) 818 if (gprs_contextActivation(CGACT_STATE_DEACTIVATED, cids)==MFW_RES_OK)
819 { 819 {
820 trace("GPRS_ContextDeactivate: Failed."); 820 trace("GPRS_ContextDeactivate: Failed.");
821 return FALSE; 821 return FALSE;
822 } 822 }
849 QOS.qos_r97.preced = preced; 849 QOS.qos_r97.preced = preced;
850 QOS.qos_r97.delay = delay; 850 QOS.qos_r97.delay = delay;
851 QOS.qos_r97.relclass = relclass; 851 QOS.qos_r97.relclass = relclass;
852 QOS.qos_r97.peak = peak; 852 QOS.qos_r97.peak = peak;
853 QOS.qos_r97.mean = mean; 853 QOS.qos_r97.mean = mean;
854 854
855 if (gprs_setQOS(cid, &QOS)!=MFW_RES_OK) 855 if (gprs_setQOS(cid, &QOS)!=MFW_RES_OK)
856 { 856 {
857 trace("GPRS_MenuSetQOS: Failed"); 857 trace("GPRS_MenuSetQOS: Failed");
858 return FALSE; 858 return FALSE;
859 } 859 }
860 860
861 trace("GPRS_MenuSetQOS: OK"); 861 trace("GPRS_MenuSetQOS: OK");
862 862
863 return TRUE; 863 return TRUE;
864 } 864 }
865 #else 865 #else
866 int GPRS_SetQOS(SHORT cid, UBYTE preced, UBYTE delay, UBYTE relclass, UBYTE peak, UBYTE mean) 866 int GPRS_SetQOS(SHORT cid, UBYTE preced, UBYTE delay, UBYTE relclass, UBYTE peak, UBYTE mean)
867 { 867 {
872 QOS.qos_r97.preced = preced; 872 QOS.qos_r97.preced = preced;
873 QOS.qos_r97.delay = delay; 873 QOS.qos_r97.delay = delay;
874 QOS.qos_r97.relclass = relclass; 874 QOS.qos_r97.relclass = relclass;
875 QOS.qos_r97.peak = peak; 875 QOS.qos_r97.peak = peak;
876 QOS.qos_r97.mean = mean; 876 QOS.qos_r97.mean = mean;
877 877
878 878
879 if (gprs_setQOS(cid, &QOS)!=MFW_RES_OK) 879 if (gprs_setQOS(cid, &QOS)!=MFW_RES_OK)
880 { 880 {
881 trace("GPRS_MenuSetQOS: Failed"); 881 trace("GPRS_MenuSetQOS: Failed");
882 return FALSE; 882 return FALSE;
883 } 883 }
884 884
885 trace("GPRS_MenuSetQOS: OK"); 885 trace("GPRS_MenuSetQOS: OK");
886 886
887 return TRUE; 887 return TRUE;
888 } 888 }
889 #endif 889 #endif
890 890
891 /******************************************************************************* 891 /*******************************************************************************
911 QOS.qos_r97.preced = preced; 911 QOS.qos_r97.preced = preced;
912 QOS.qos_r97.delay = delay; 912 QOS.qos_r97.delay = delay;
913 QOS.qos_r97.relclass = relclass; 913 QOS.qos_r97.relclass = relclass;
914 QOS.qos_r97.peak = peak; 914 QOS.qos_r97.peak = peak;
915 QOS.qos_r97.mean = mean; 915 QOS.qos_r97.mean = mean;
916 916
917 if (gprs_setQOSMin(cid, &QOS)!=MFW_RES_OK) 917 if (gprs_setQOSMin(cid, &QOS)!=MFW_RES_OK)
918 { 918 {
919 trace("GPRS_MenuSetMinQOS: Failed"); 919 trace("GPRS_MenuSetMinQOS: Failed");
920 return FALSE; 920 return FALSE;
921 } 921 }
922 922
923 trace("GPRS_MenuSetMinQOS: OK"); 923 trace("GPRS_MenuSetMinQOS: OK");
924 924
925 return TRUE; 925 return TRUE;
926 } 926 }
927 #else 927 #else
928 int GPRS_SetMinQOS(SHORT cid, UBYTE preced, UBYTE delay, UBYTE relclass, UBYTE peak, UBYTE mean) 928 int GPRS_SetMinQOS(SHORT cid, UBYTE preced, UBYTE delay, UBYTE relclass, UBYTE peak, UBYTE mean)
929 { 929 {
934 QOS.qos_r97.preced = preced; 934 QOS.qos_r97.preced = preced;
935 QOS.qos_r97.delay = delay; 935 QOS.qos_r97.delay = delay;
936 QOS.qos_r97.relclass = relclass; 936 QOS.qos_r97.relclass = relclass;
937 QOS.qos_r97.peak = peak; 937 QOS.qos_r97.peak = peak;
938 QOS.qos_r97.mean = mean; 938 QOS.qos_r97.mean = mean;
939 939
940 if (gprs_setQOSMin(cid, &QOS)!=MFW_RES_OK) 940 if (gprs_setQOSMin(cid, &QOS)!=MFW_RES_OK)
941 { 941 {
942 trace("GPRS_MenuSetMinQOS: Failed"); 942 trace("GPRS_MenuSetMinQOS: Failed");
943 return FALSE; 943 return FALSE;
944 } 944 }
945 945
946 trace("GPRS_MenuSetMinQOS: OK"); 946 trace("GPRS_MenuSetMinQOS: OK");
947 947
948 return TRUE; 948 return TRUE;
949 } 949 }
950 #endif 950 #endif
951 951
952 /******************************************************************************* 952 /*******************************************************************************
969 969
970 if (!data) 970 if (!data)
971 { 971 {
972 return SMS_SERVICE_OMITTED; 972 return SMS_SERVICE_OMITTED;
973 } 973 }
974 974
975 return data->sms_service; 975 return data->sms_service;
976 } 976 }
977 977
978 978
979 /******************************************************************************* 979 /*******************************************************************************
993 T_MMI_GPRS_DATA *data = GPRS_Data(); 993 T_MMI_GPRS_DATA *data = GPRS_Data();
994 T_CGSMS_SERVICE ACISmsService; 994 T_CGSMS_SERVICE ACISmsService;
995 UBYTE old_service = 0; /* Warning Correction - 29-11-2005 */ 995 UBYTE old_service = 0; /* Warning Correction - 29-11-2005 */
996 tracefunction("GPRS_SetSmsService"); 996 tracefunction("GPRS_SetSmsService");
997 trace_P1("Service: %d", service); 997 trace_P1("Service: %d", service);
998 998
999 switch(service) 999 switch(service)
1000 { 1000 {
1001 case SMS_SERVICE_GPRS: 1001 case SMS_SERVICE_GPRS:
1002 ACISmsService = CGSMS_SERVICE_GPRS; 1002 ACISmsService = CGSMS_SERVICE_GPRS;
1003 break; 1003 break;
1018 if (data) 1018 if (data)
1019 { 1019 {
1020 old_service = data->sms_service; 1020 old_service = data->sms_service;
1021 data->sms_service = service; 1021 data->sms_service = service;
1022 } 1022 }
1023 1023
1024 if (gprs_setServiceSMS(ACISmsService) != MFW_RES_OK) 1024 if (gprs_setServiceSMS(ACISmsService) != MFW_RES_OK)
1025 { 1025 {
1026 trace("gprs_setServiceSMS failed"); 1026 trace("gprs_setServiceSMS failed");
1027 /* Failed - set service back to old value */ 1027 /* Failed - set service back to old value */
1028 if (data) 1028 if (data)
1029 { 1029 {
1030 data->sms_service = old_service; 1030 data->sms_service = old_service;
1031 } 1031 }
1032 return FALSE; 1032 return FALSE;
1033 } 1033 }
1034 1034
1035 return TRUE; 1035 return TRUE;
1036 } 1036 }
1037 1037
1038 1038
1039 /******************************************************************************* 1039 /*******************************************************************************
1054 T_MMI_GPRS_DATA *data = GPRS_Data(); 1054 T_MMI_GPRS_DATA *data = GPRS_Data();
1055 T_MFW_HND win = mfwParent( mfw_header()); 1055 T_MFW_HND win = mfwParent( mfw_header());
1056 T_MFW_GPRS_DATA *gprs_data = (T_MFW_GPRS_DATA *)para; // Structure that stores data from mfw 1056 T_MFW_GPRS_DATA *gprs_data = (T_MFW_GPRS_DATA *)para; // Structure that stores data from mfw
1057 USHORT textId; 1057 USHORT textId;
1058 int result; 1058 int result;
1059 1059
1060 tracefunction("GPRS_MfwCb()"); 1060 tracefunction("GPRS_MfwCb()");
1061 1061
1062 if (!data) 1062 if (!data)
1063 { 1063 {
1064 return FALSE; /* Warning Correction - provide return value */ 1064 return FALSE; /* Warning Correction - provide return value */
1065 } 1065 }
1066 1066
1067 /* Result of GPRS_NOTHING will not be sent */ 1067 /* Result of GPRS_NOTHING will not be sent */
1068 1068
1069 result = GPRS_NOTHING; 1069 result = GPRS_NOTHING;
1070 1070
1071 /* Find GPRS status */ 1071 /* Find GPRS status */
1072 1072
1073 if (idleIsFocussed()) 1073 if (idleIsFocussed())
1074 { 1074 {
1075 /* Update idle screen icons to show any change in GPRS status */ 1075 /* Update idle screen icons to show any change in GPRS status */
1076 iconsShow(); 1076 iconsShow();
1077 } 1077 }
1078 else 1078 else
1079 { 1079 {
1080 /* iconsShow calls GPRS_Status; if we don't call that, call this on its own */ 1080 /* iconsShow calls GPRS_Status; if we don't call that, call this on its own */
1081 GPRS_Status(); 1081 GPRS_Status();
1082 } 1082 }
1083 1083
1084 switch(event) 1084 switch(event)
1085 { 1085 {
1086 case E_MFW_GPRS_S_CNTXT: 1086 case E_MFW_GPRS_S_CNTXT:
1087 trace("GPRS_MfwCb: E_MFW_GPRS_S_CNTXT"); 1087 trace("GPRS_MfwCb: E_MFW_GPRS_S_CNTXT");
1088 break; 1088 break;
1089 1089
1090 case E_MFW_GPRS_S_ATT: 1090 case E_MFW_GPRS_S_ATT:
1091 trace("GPRS_MfwCb: E_MFW_GPRS_S_ATT"); 1091 trace("GPRS_MfwCb: E_MFW_GPRS_S_ATT");
1092 1092
1093 // Dec 01, 2005 REF: DR OMAPS00048530 x0039928 1093 // Dec 01, 2005 REF: DR OMAPS00048530 x0039928
1094 // Fix : Set the current status to attaching or detaching depending on the request. 1094 // Fix : Set the current status to attaching or detaching depending on the request.
1095 if (data->reg_status!= GPRS_ATTACHED) 1095 if (data->reg_status!= GPRS_ATTACHED)
1096 data->status = MMI_GPRS_STATUS_ATTACHING; 1096 data->status = MMI_GPRS_STATUS_ATTACHING;
1097 else 1097 else
1098 data->status = MMI_GPRS_STATUS_DETACHING; 1098 data->status = MMI_GPRS_STATUS_DETACHING;
1099 1099
1100 if (data->display) 1100 if (data->display)
1101 { 1101 {
1102 if (data->reg_status!= GPRS_ATTACHED) 1102 if (data->reg_status!= GPRS_ATTACHED)
1103 { 1103 {
1104 /* Previous please wait will be destroyed and this new message shown */ 1104 /* Previous please wait will be destroyed and this new message shown */
1114 1114
1115 case E_MFW_GPRS_S_ACT: 1115 case E_MFW_GPRS_S_ACT:
1116 trace("GPRS_MfwCb: E_MFW_GPRS_S_ACT"); 1116 trace("GPRS_MfwCb: E_MFW_GPRS_S_ACT");
1117 1117
1118 /* Notify of context activation */ 1118 /* Notify of context activation */
1119 result = GPRS_CONTEXT_ACTIVATE; 1119 result = GPRS_CONTEXT_ACTIVATE;
1120 break; 1120 break;
1121 1121
1122 case E_MFW_GPRS_R_ACT: 1122 case E_MFW_GPRS_R_ACT:
1123 trace("GPRS_MfwCb: E_MFW_GPRS_R_ACT"); 1123 trace("GPRS_MfwCb: E_MFW_GPRS_R_ACT");
1124 1124
1170 trace("GPRS_MfwCb: E_MFW_GPRS_S_EREPG"); 1170 trace("GPRS_MfwCb: E_MFW_GPRS_S_EREPG");
1171 break; 1171 break;
1172 1172
1173 case E_MFW_GPRS_R_EREP_RJ: 1173 case E_MFW_GPRS_R_EREP_RJ:
1174 trace("GPRS_MfwCb: E_MFW_GPRS_R_EREP_RJ"); 1174 trace("GPRS_MfwCb: E_MFW_GPRS_R_EREP_RJ");
1175 1175
1176 /* Notify of context deactivation */ 1176 /* Notify of context deactivation */
1177 1177
1178 result = GPRS_CONTEXT_DEACTIVATE; 1178 result = GPRS_CONTEXT_DEACTIVATE;
1179 break; 1179 break;
1180 1180
1181 case E_MFW_GPRS_R_EREP_ATT: 1181 case E_MFW_GPRS_R_EREP_ATT:
1182 trace("GPRS_MfwCb: E_MFW_GPRS_R_EREP_ATT"); 1182 trace("GPRS_MfwCb: E_MFW_GPRS_R_EREP_ATT");
1183 1183
1184 /* Attach status has changed, display message as appropriate */ 1184 /* Attach status has changed, display message as appropriate */
1185 1185
1186 if (data->display) 1186 if (data->display)
1187 { 1187 {
1188 if (data->reg_status==GPRS_ATTACHED) 1188 if (data->reg_status==GPRS_ATTACHED)
1189 textId = TxtAttached; 1189 textId = TxtAttached;
1190 else 1190 else
1191 textId = TxtNotAttached; 1191 textId = TxtNotAttached;
1192 1192
1193 /* Show result */ 1193 /* Show result */
1194 GPRS_ResultScreen(win, TxtGPRS, textId); 1194 GPRS_ResultScreen(win, TxtGPRS, textId);
1195 } 1195 }
1196 data->status = MMI_GPRS_STATUS_IDLE; 1196 data->status = MMI_GPRS_STATUS_IDLE;
1197 1197
1198 break; 1198 break;
1230 homezoneUpdate(gprs_data->lac, gprs_data->ci, 0); 1230 homezoneUpdate(gprs_data->lac, gprs_data->ci, 0);
1231 //end 30439 1231 //end 30439
1232 #endif 1232 #endif
1233 // Dec 01, 2005 REF: DR OMAPS00048530 x0039928 1233 // Dec 01, 2005 REF: DR OMAPS00048530 x0039928
1234 // Fix : Display GPRS attached only if the request is for attaching. 1234 // Fix : Display GPRS attached only if the request is for attaching.
1235 if(data->status == MMI_GPRS_STATUS_ATTACHING) 1235 if(data->status == MMI_GPRS_STATUS_ATTACHING)
1236 { 1236 {
1237 /* Show result */ 1237 /* Show result */
1238 if (data->display) 1238 if (data->display)
1239 { 1239 {
1240 GPRS_ResultScreen(win, TxtGPRS, TxtAttached); 1240 GPRS_ResultScreen(win, TxtGPRS, TxtAttached);
1241 } 1241 }
1242 } 1242 }
1243 data->status = MMI_GPRS_STATUS_IDLE; 1243 data->status = MMI_GPRS_STATUS_IDLE;
1244 break; 1244 break;
1245 1245
1246 case GPRS_OFF: 1246 case GPRS_OFF:
1247 #ifdef MMI_HOMEZONE_ENABLED 1247 #ifdef MMI_HOMEZONE_ENABLED
1248 //Jun 14, 2005 REF: MMI-FIX-30439 x0018858 1248 //Jun 14, 2005 REF: MMI-FIX-30439 x0018858
1249 //begin 30439 1249 //begin 30439
1250 /* Cell reselection for homezone */ 1250 /* Cell reselection for homezone */
1293 /* Show result */ 1293 /* Show result */
1294 if (data->display) 1294 if (data->display)
1295 { 1295 {
1296 GPRS_ResultScreen(win, TxtGPRS, TxtError); 1296 GPRS_ResultScreen(win, TxtGPRS, TxtError);
1297 } 1297 }
1298 break; 1298 break;
1299 } 1299 }
1300 1300
1301 break; 1301 break;
1302 1302
1303 case E_MFW_GPRS_S_SMSSERV: 1303 case E_MFW_GPRS_S_SMSSERV:
1304 trace("GPRS_MfwCb: E_MFW_GPRS_S_SMSSERV"); 1304 trace("GPRS_MfwCb: E_MFW_GPRS_S_SMSSERV");
1305 trace_P1("Service: %d", data->sms_service); 1305 trace_P1("Service: %d", data->sms_service);
1306 1306
1307 data->status = MMI_GPRS_STATUS_IDLE; 1307 data->status = MMI_GPRS_STATUS_IDLE;
1308 1308
1309 /* Display "Using <service>" */ 1309 /* Display "Using <service>" */
1310 1310
1311 if (data->display) 1311 if (data->display)
1312 { 1312 {
1313 USHORT TxtId2, TxtId1 = TxtUsing; 1313 USHORT TxtId2, TxtId1 = TxtUsing;
1328 default: /* Shouldn't happen, but... */ 1328 default: /* Shouldn't happen, but... */
1329 TxtId1 = TxtFailed; 1329 TxtId1 = TxtFailed;
1330 TxtId2 = TxtNull; 1330 TxtId2 = TxtNull;
1331 break; 1331 break;
1332 } 1332 }
1333 1333
1334 /* Show result */ 1334 /* Show result */
1335 GPRS_ResultScreen(win, TxtId1, TxtId2); 1335 GPRS_ResultScreen(win, TxtId1, TxtId2);
1336 } 1336 }
1337 break; 1337 break;
1338 1338
1339 case E_MFW_GPRS_OK: 1339 case E_MFW_GPRS_OK:
1342 1342
1343 case E_MFW_GPRS_ERROR: 1343 case E_MFW_GPRS_ERROR:
1344 trace("GPRS_MfwCb: E_MFW_GPRS_ERROR"); 1344 trace("GPRS_MfwCb: E_MFW_GPRS_ERROR");
1345 1345
1346 data->status = MMI_GPRS_STATUS_IDLE; 1346 data->status = MMI_GPRS_STATUS_IDLE;
1347 1347
1348 /* Display "GPRS Error" */ 1348 /* Display "GPRS Error" */
1349 1349
1350 if (data->display) 1350 if (data->display)
1351 { 1351 {
1352 /* Delete please wait window */ 1352 /* Delete please wait window */
1353 GPRS_PleaseWaitDestroy(); 1353 GPRS_PleaseWaitDestroy();
1354 1354
1355 /* Show result */ 1355 /* Show result */
1356 GPRS_ResultScreen(win, TxtGPRS, TxtFailed); 1356 GPRS_ResultScreen(win, TxtGPRS, TxtFailed);
1357 } 1357 }
1358 1358
1359 /* Notify of error */ 1359 /* Notify of error */
1360 result = GPRS_ERROR; 1360 result = GPRS_ERROR;
1362 1362
1363 case E_MFW_GPRS_CONNECT: 1363 case E_MFW_GPRS_CONNECT:
1364 trace("GPRS_MfwCb: E_MFW_GPRS_CONNECT"); 1364 trace("GPRS_MfwCb: E_MFW_GPRS_CONNECT");
1365 1365
1366 data->status = MMI_GPRS_STATUS_IDLE; 1366 data->status = MMI_GPRS_STATUS_IDLE;
1367 1367
1368 if (data->display) 1368 if (data->display)
1369 { 1369 {
1370 /* Delete please wait window */ 1370 /* Delete please wait window */
1371 GPRS_PleaseWaitDestroy(); 1371 GPRS_PleaseWaitDestroy();
1372 1372
1373 /* Display "CONNECTED" window */ 1373 /* Display "CONNECTED" window */
1374 info_screen(win, TxtGPRS, TxtConnected, NULL); 1374 info_screen(win, TxtGPRS, TxtConnected, NULL);
1375 } 1375 }
1376 break; 1376 break;
1377 1377
1378 case E_MFW_GPRS_ERR_CONNECT: 1378 case E_MFW_GPRS_ERR_CONNECT:
1379 trace("GPRS_MfwCb: E_MFW_GPRS_ERR_CONNECT"); 1379 trace("GPRS_MfwCb: E_MFW_GPRS_ERR_CONNECT");
1380 1380
1381 data->status = MMI_GPRS_STATUS_IDLE; 1381 data->status = MMI_GPRS_STATUS_IDLE;
1382 1382
1383 /* Display "GPRS No Answer" */ 1383 /* Display "GPRS No Answer" */
1384 if (data->display) 1384 if (data->display)
1385 { 1385 {
1386 /* Show result */ 1386 /* Show result */
1387 GPRS_ResultScreen(win, TxtGPRS, TxtNoAnswer); 1387 GPRS_ResultScreen(win, TxtGPRS, TxtNoAnswer);
1388 } 1388 }
1389 break; 1389 break;
1390 1390
1391 case E_MFW_GPRS_COUNTER: 1391 case E_MFW_GPRS_COUNTER:
1392 trace("GPRS_MfwCb: E_MFW_GPRS_COUNTER"); 1392 trace("GPRS_MfwCb: E_MFW_GPRS_COUNTER");
1393 1393
1394 /* Add values returned from ACI 1394 /* Add values returned from ACI
1395 * to total counter */ 1395 * to total counter */
1396 1396
1397 data->uplink_counter += (ULONG)(gprs_data->counter.octets_uplink); 1397 data->uplink_counter += (ULONG)(gprs_data->counter.octets_uplink);
1398 data->downlink_counter += (ULONG)(gprs_data->counter.octets_downlink); 1398 data->downlink_counter += (ULONG)(gprs_data->counter.octets_downlink);
1399 1399
1400 /* Only display counter if user has requested it */ 1400 /* Only display counter if user has requested it */
1401 1401
1402 if (data->display) 1402 if (data->display)
1403 { 1403 {
1404 data->display = FALSE; 1404 data->display = FALSE;
1405 /* Delete please wait window */ 1405 /* Delete please wait window */
1406 GPRS_PleaseWaitDestroy(); 1406 GPRS_PleaseWaitDestroy();
1407 1407
1408 GPRS_ShowCounter(win); 1408 GPRS_ShowCounter(win);
1409 } 1409 }
1410 break; 1410 break;
1411 1411
1412 default: 1412 default:
1413 trace_P1("GPRS_MfwCb: event = %d", event); 1413 trace_P1("GPRS_MfwCb: event = %d", event);
1414 break; 1414 break;
1415 } 1415 }
1416 1416
1417 /* Send a notification if appropriate */ 1417 /* Send a notification if appropriate */
1418 1418
1419 if (data->callback!=NULL && result!=GPRS_NOTHING) 1419 if (data->callback!=NULL && result!=GPRS_NOTHING)
1420 { 1420 {
1421 data->callback(result); 1421 data->callback(result);
1422 } 1422 }
1423 1423
1424 return TRUE; 1424 return TRUE;
1425 } 1425 }
1426 1426
1427 1427
1428 /******************************************************************************* 1428 /*******************************************************************************
1440 int GPRS_MenuAttach(MfwMnu* m, MfwMnuItem* i) 1440 int GPRS_MenuAttach(MfwMnu* m, MfwMnuItem* i)
1441 { 1441 {
1442 T_MMI_GPRS_DATA *data = GPRS_Data(); 1442 T_MMI_GPRS_DATA *data = GPRS_Data();
1443 T_MFW_HND win = mfw_parent(mfw_header()); 1443 T_MFW_HND win = mfw_parent(mfw_header());
1444 /* int gprsStatus; */ /* Warning Correction */ 1444 /* int gprsStatus; */ /* Warning Correction */
1445 1445
1446 tracefunction("GPRS_MenuAttach()"); 1446 tracefunction("GPRS_MenuAttach()");
1447 1447
1448 if (!data) 1448 if (!data)
1449 { 1449 {
1450 return FALSE; 1450 return FALSE;
1457 data->cid = GPRS_CID_OMITTED; 1457 data->cid = GPRS_CID_OMITTED;
1458 } 1458 }
1459 1459
1460 if (data->reg_status==(int)GPRS_ATTACHED) 1460 if (data->reg_status==(int)GPRS_ATTACHED)
1461 { 1461 {
1462 /* Show result */ 1462 /* Show result */
1463 GPRS_ResultScreen(win, TxtAlreadyAttached, TxtAttached); 1463 GPRS_ResultScreen(win, TxtAlreadyAttached, TxtAttached);
1464 return FALSE; 1464 return FALSE;
1465 } 1465 }
1466 1466
1467 GPRS_Attach(win); 1467 GPRS_Attach(win);
1492 1492
1493 if (!data) 1493 if (!data)
1494 { 1494 {
1495 return FALSE; 1495 return FALSE;
1496 } 1496 }
1497 1497
1498 /* Check to make sure gprs handle exists */ 1498 /* Check to make sure gprs handle exists */
1499 1499
1500 if (!data->mfw_gprs) 1500 if (!data->mfw_gprs)
1501 { 1501 {
1502 /* Show result */ 1502 /* Show result */
1503 GPRS_ResultScreen(win, TxtNotAttached, TxtNull); 1503 GPRS_ResultScreen(win, TxtNotAttached, TxtNull);
1504 return FALSE; 1504 return FALSE;
1505 } 1505 }
1506 1506
1507 if (data->reg_status==(int)GPRS_OFF) 1507 if (data->reg_status==(int)GPRS_OFF)
1517 } 1517 }
1518 1518
1519 /* Try to detach */ 1519 /* Try to detach */
1520 1520
1521 GPRS_Detach(win); 1521 GPRS_Detach(win);
1522 1522
1523 return TRUE; 1523 return TRUE;
1524 } 1524 }
1525 1525
1526 1526
1527 /******************************************************************************* 1527 /*******************************************************************************
1546 1546
1547 if (!data) 1547 if (!data)
1548 { 1548 {
1549 return FALSE; 1549 return FALSE;
1550 } 1550 }
1551 1551
1552 data->counter_type = MMI_GPRS_COUNTER_DOWNLINK; /* SPR#1875 - SH - Now DOWNLINK */ 1552 data->counter_type = MMI_GPRS_COUNTER_DOWNLINK; /* SPR#1875 - SH - Now DOWNLINK */
1553 data->display = TRUE; 1553 data->display = TRUE;
1554 data->status = MMI_GPRS_STATUS_DATA_COUNTER; 1554 data->status = MMI_GPRS_STATUS_DATA_COUNTER;
1555 GPRS_PleaseWait(win, TxtPleaseWait, NULL); /* SPR#1986 */ 1555 GPRS_PleaseWait(win, TxtPleaseWait, NULL); /* SPR#1986 */
1556 1556
1557 /* If a data call is in progress, counter is now reset every 1557 /* If a data call is in progress, counter is now reset every
1558 * time we check it - MMI keeps track of total. 1558 * time we check it - MMI keeps track of total.
1559 * If a data call is not in progress, display current total from MMI */ 1559 * If a data call is not in progress, display current total from MMI */
1560 1560
1561 result = gprs_counter(TRUE); 1561 result = gprs_counter(TRUE);
1562 1562
1563 switch(result) 1563 switch(result)
1564 { 1564 {
1565 /* Waiting for rAT_PercentSNCNT callback, don't update display yet */ 1565 /* Waiting for rAT_PercentSNCNT callback, don't update display yet */
1566 1566
1567 case MFW_RES_OK: 1567 case MFW_RES_OK:
1568 trace("gprs_counter executing, awaiting confirmation."); 1568 trace("gprs_counter executing, awaiting confirmation.");
1569 break; 1569 break;
1570 1570
1571 /* We're not connected - display current total */ 1571 /* We're not connected - display current total */
1572 1572
1573 case MfwResDone: 1573 case MfwResDone:
1574 GPRS_PleaseWaitDestroy(); 1574 GPRS_PleaseWaitDestroy();
1575 data->display = FALSE; 1575 data->display = FALSE;
1576 GPRS_ShowCounter(win); 1576 GPRS_ShowCounter(win);
1577 break; 1577 break;
1578 1578
1579 /* Error has occurred */ 1579 /* Error has occurred */
1580 1580
1581 default: 1581 default:
1582 GPRS_PleaseWaitDestroy(); 1582 GPRS_PleaseWaitDestroy();
1583 data->display = FALSE; 1583 data->display = FALSE;
1584 info_screen(win, TxtGPRS,TxtError, NULL); 1584 info_screen(win, TxtGPRS,TxtError, NULL);
1585 break; 1585 break;
1586 } 1586 }
1587 1587
1588 return TRUE; 1588 return TRUE;
1589 } 1589 }
1590 1590
1591 1591
1592 /******************************************************************************* 1592 /*******************************************************************************
1611 1611
1612 if (!data) 1612 if (!data)
1613 { 1613 {
1614 return FALSE; 1614 return FALSE;
1615 } 1615 }
1616 1616
1617 data->counter_type = MMI_GPRS_COUNTER_UPLINK; /* SPR#1875 - SH - Now UPLINK */ 1617 data->counter_type = MMI_GPRS_COUNTER_UPLINK; /* SPR#1875 - SH - Now UPLINK */
1618 data->display = TRUE; 1618 data->display = TRUE;
1619 data->status = MMI_GPRS_STATUS_DATA_COUNTER; 1619 data->status = MMI_GPRS_STATUS_DATA_COUNTER;
1620 GPRS_PleaseWait(win, TxtPleaseWait, NULL); /* SPR#1986 */ 1620 GPRS_PleaseWait(win, TxtPleaseWait, NULL); /* SPR#1986 */
1621 1621
1622 /* If a data call is in progress, counter is now reset every 1622 /* If a data call is in progress, counter is now reset every
1623 * time we check it - MMI keeps track of total. 1623 * time we check it - MMI keeps track of total.
1624 * If a data call is not in progress, display current total from MMI */ 1624 * If a data call is not in progress, display current total from MMI */
1625 1625
1626 result = gprs_counter(TRUE); 1626 result = gprs_counter(TRUE);
1627 1627
1628 switch(result) 1628 switch(result)
1629 { 1629 {
1630 /* Waiting for rAT_PercentSNCNT callback, don't update display yet */ 1630 /* Waiting for rAT_PercentSNCNT callback, don't update display yet */
1631 1631
1632 case MFW_RES_OK: 1632 case MFW_RES_OK:
1633 trace("gprs_counter executing, awaiting confirmation."); 1633 trace("gprs_counter executing, awaiting confirmation.");
1634 break; 1634 break;
1635 1635
1636 /* We're not connected - display current total */ 1636 /* We're not connected - display current total */
1637 1637
1638 case MfwResDone: 1638 case MfwResDone:
1639 GPRS_PleaseWaitDestroy(); 1639 GPRS_PleaseWaitDestroy();
1640 data->display = FALSE; 1640 data->display = FALSE;
1641 GPRS_ShowCounter(win); 1641 GPRS_ShowCounter(win);
1642 break; 1642 break;
1643 1643
1644 /* Error has occurred */ 1644 /* Error has occurred */
1645 1645
1646 default: 1646 default:
1647 GPRS_PleaseWaitDestroy(); 1647 GPRS_PleaseWaitDestroy();
1648 data->display = FALSE; 1648 data->display = FALSE;
1649 info_screen(win, TxtGPRS,TxtError, NULL); 1649 info_screen(win, TxtGPRS,TxtError, NULL);
1650 break; 1650 break;
1651 } 1651 }
1652 1652
1653 return TRUE; 1653 return TRUE;
1654 } 1654 }
1655 1655
1656 1656
1657 1657
1718 if (!data->mfw_gprs) 1718 if (!data->mfw_gprs)
1719 { 1719 {
1720 TRACE_EVENT("** No MFW gprs **"); 1720 TRACE_EVENT("** No MFW gprs **");
1721 return FALSE; 1721 return FALSE;
1722 } 1722 }
1723 1723
1724 data->display = TRUE; 1724 data->display = TRUE;
1725 1725
1726 if(!GPRS_SetSmsService(menu->lCursor[menu->level])) 1726 if(!GPRS_SetSmsService(menu->lCursor[menu->level]))
1727 { 1727 {
1728 info_screen(win, TxtFailed, NULL, NULL); 1728 info_screen(win, TxtFailed, NULL, NULL);
1729 } 1729 }
1730 1730
1731 return TRUE; 1731 return TRUE;
1732 } 1732 }
1733 1733
1734 1734
1735 /******************************************************************************* 1735 /*******************************************************************************
1756 1756
1757 if (!data) 1757 if (!data)
1758 { 1758 {
1759 return NULL; 1759 return NULL;
1760 } 1760 }
1761 1761
1762 /* Delete any previous window */ 1762 /* Delete any previous window */
1763 GPRS_PleaseWaitDestroy(); 1763 GPRS_PleaseWaitDestroy();
1764 1764
1765 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtCancel, TextId1, TextId2, COLOUR_STATUS); 1765 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtCancel, TextId1, TextId2, COLOUR_STATUS);
1766 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)GPRS_PleaseWaitCb, PLEASEWAIT_TIMEOUT, KEY_HUP | KEY_RIGHT ); 1766 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)GPRS_PleaseWaitCb, PLEASEWAIT_TIMEOUT, KEY_HUP | KEY_RIGHT );
1790 *******************************************************************************/ 1790 *******************************************************************************/
1791 1791
1792 static void GPRS_PleaseWaitCb(T_MFW_HND win, UBYTE identifier, UBYTE reason) 1792 static void GPRS_PleaseWaitCb(T_MFW_HND win, UBYTE identifier, UBYTE reason)
1793 { 1793 {
1794 T_MMI_GPRS_DATA *data = GPRS_Data(); 1794 T_MMI_GPRS_DATA *data = GPRS_Data();
1795 1795
1796 tracefunction("GPRS_PleaseWaitCb()"); 1796 tracefunction("GPRS_PleaseWaitCb()");
1797 1797
1798 if (!data) 1798 if (!data)
1799 { 1799 {
1800 return; 1800 return;
1801 } 1801 }
1802 1802
1803 /* Dialog already destroyed by this point */ 1803 /* Dialog already destroyed by this point */
1804 1804
1805 data->pleasewait_win = NULL; 1805 data->pleasewait_win = NULL;
1806 1806
1807 switch(reason) 1807 switch(reason)
1808 { 1808 {
1809 case INFO_TIMEOUT: 1809 case INFO_TIMEOUT:
1810 1810
1811 /* Delete window */ 1811 /* Delete window */
1812 1812
1813 info_screen(data->menu_win, TxtTimedOut, NULL, NULL); 1813 info_screen(data->menu_win, TxtTimedOut, NULL, NULL);
1814 data->status = MMI_GPRS_STATUS_IDLE; 1814 data->status = MMI_GPRS_STATUS_IDLE;
1815 break; 1815 break;
1816 1816
1817 case INFO_KCD_HUP: 1817 case INFO_KCD_HUP:
1818 case INFO_KCD_RIGHT: 1818 case INFO_KCD_RIGHT:
1819 1819
1820 /*Cancel current operation */ 1820 /*Cancel current operation */
1821 1821
1822 switch(data->status) 1822 switch(data->status)
1823 { 1823 {
1824 case MMI_GPRS_STATUS_ATTACHING: 1824 case MMI_GPRS_STATUS_ATTACHING:
1825 case MMI_GPRS_STATUS_DETACHING: 1825 case MMI_GPRS_STATUS_DETACHING:
1826 gprs_attach_abort(); 1826 gprs_attach_abort();
1833 data->display = FALSE; 1833 data->display = FALSE;
1834 break; 1834 break;
1835 } 1835 }
1836 break; 1836 break;
1837 } 1837 }
1838 1838
1839 return; 1839 return;
1840 } 1840 }
1841 1841
1842 1842
1843 /******************************************************************************* 1843 /*******************************************************************************
1854 *******************************************************************************/ 1854 *******************************************************************************/
1855 1855
1856 static void GPRS_PleaseWaitDestroy(void) 1856 static void GPRS_PleaseWaitDestroy(void)
1857 { 1857 {
1858 T_MMI_GPRS_DATA *data = GPRS_Data(); 1858 T_MMI_GPRS_DATA *data = GPRS_Data();
1859 1859
1860 tracefunction("GPRS_PleaseWaitDestroy()"); 1860 tracefunction("GPRS_PleaseWaitDestroy()");
1861 1861
1862 if (!data) 1862 if (!data)
1863 { 1863 {
1864 return; 1864 return;
1865 } 1865 }
1866 1866
1867 if (data->pleasewait_win) 1867 if (data->pleasewait_win)
1868 { 1868 {
1869 SEND_EVENT(data->pleasewait_win, DIALOG_DESTROY, NULL, NULL); 1869 SEND_EVENT(data->pleasewait_win, DIALOG_DESTROY, NULL, NULL);
1870 data->pleasewait_win = NULL; 1870 data->pleasewait_win = NULL;
1871 } 1871 }
1872 1872
1873 return; 1873 return;
1874 } 1874 }
1875 1875
1876 1876
1877 /******************************************************************************* 1877 /*******************************************************************************
1901 1901
1902 if (!data) 1902 if (!data)
1903 { 1903 {
1904 return; 1904 return;
1905 } 1905 }
1906 1906
1907 /* Destroy old editor if it exists */ 1907 /* Destroy old editor if it exists */
1908 1908
1909 if (data->edit_win) 1909 if (data->edit_win)
1910 { 1910 {
1911 GPRS_DestroyCounter(); 1911 GPRS_DestroyCounter();
1912 } 1912 }
1913 1913
1914 /* Set appropriate title string (corrected) */ 1914 /* Set appropriate title string (corrected) */
1915 1915
1916 switch(data->counter_type) 1916 switch(data->counter_type)
1917 { 1917 {
1918 case MMI_GPRS_COUNTER_DOWNLINK: 1918 case MMI_GPRS_COUNTER_DOWNLINK:
1919 titleId = TxtIncomingData; 1919 titleId = TxtIncomingData;
1920 break; 1920 break;
1921 1921
1922 case MMI_GPRS_COUNTER_UPLINK: 1922 case MMI_GPRS_COUNTER_UPLINK:
1923 titleId = TxtOutgoingData; 1923 titleId = TxtOutgoingData;
1924 break; 1924 break;
1925 1925
1926 default: 1926 default:
1965 editor_data.TextId = titleId; 1965 editor_data.TextId = titleId;
1966 1966
1967 editor_data.editor_attr.text = data->counterstring; 1967 editor_data.editor_attr.text = data->counterstring;
1968 1968
1969 /* Create the dialog handler */ 1969 /* Create the dialog handler */
1970 1970
1971 data->edit_win = editor_start(win, &editor_data); /* start the editor */ 1971 data->edit_win = editor_start(win, &editor_data); /* start the editor */
1972 #endif /* NEW_EDITOR */ 1972 #endif /* NEW_EDITOR */
1973 1973
1974 return; 1974 return;
1975 } 1975 }
1991 1991
1992 static void GPRS_ShowCounterCb(T_MFW_HND win, USHORT identifier, USHORT reason) 1992 static void GPRS_ShowCounterCb(T_MFW_HND win, USHORT identifier, USHORT reason)
1993 { 1993 {
1994 T_MMI_GPRS_DATA *data = GPRS_Data(); 1994 T_MMI_GPRS_DATA *data = GPRS_Data();
1995 T_DISPLAY_DATA display_info; 1995 T_DISPLAY_DATA display_info;
1996 1996
1997 tracefunction("GPRS_ShowCounterCb()"); 1997 tracefunction("GPRS_ShowCounterCb()");
1998 1998
1999 if (!data) 1999 if (!data)
2000 { 2000 {
2001 return; 2001 return;
2002 } 2002 }
2003 2003
2004 switch(reason) 2004 switch(reason)
2005 { 2005 {
2006 /* Prompt whether to reset */ 2006 /* Prompt whether to reset */
2007 2007
2008 case INFO_KCD_LEFT: 2008 case INFO_KCD_LEFT:
2009 dlg_initDisplayData_TextId(&display_info, TxtCancel, TxtReset, TxtDataCounterReset, TxtNull, COLOUR_STATUS); 2009 dlg_initDisplayData_TextId(&display_info, TxtCancel, TxtReset, TxtDataCounterReset, TxtNull, COLOUR_STATUS);
2010 dlg_initDisplayData_events(&display_info, (T_VOID_FUNC) GPRS_ResetCounter, TEN_SECS, KEY_HUP|KEY_CLEAR|KEY_LEFT|KEY_RIGHT ); 2010 dlg_initDisplayData_events(&display_info, (T_VOID_FUNC) GPRS_ResetCounter, TEN_SECS, KEY_HUP|KEY_CLEAR|KEY_LEFT|KEY_RIGHT );
2011 2011
2012 info_dialog(win, &display_info); 2012 info_dialog(win, &display_info);
2031 $Description: Callback from dialogue prompting whether to reset the data counter 2031 $Description: Callback from dialogue prompting whether to reset the data counter
2032 2032
2033 $Returns: None 2033 $Returns: None
2034 2034
2035 $Arguments: Standard callback parameters 2035 $Arguments: Standard callback parameters
2036 2036
2037 *******************************************************************************/ 2037 *******************************************************************************/
2038 2038
2039 static void GPRS_ResetCounter(T_MFW_HND win, UBYTE identifier, UBYTE reason) 2039 static void GPRS_ResetCounter(T_MFW_HND win, UBYTE identifier, UBYTE reason)
2040 { 2040 {
2041 T_MMI_GPRS_DATA *data = GPRS_Data(); 2041 T_MMI_GPRS_DATA *data = GPRS_Data();
2044 2044
2045 if (!data) 2045 if (!data)
2046 { 2046 {
2047 return; 2047 return;
2048 } 2048 }
2049 2049
2050 switch(reason) 2050 switch(reason)
2051 { 2051 {
2052 /* RSK - Reset counter */ 2052 /* RSK - Reset counter */
2053 2053
2054 case INFO_KCD_RIGHT: 2054 case INFO_KCD_RIGHT:
2055 if (data->counter_type==MMI_GPRS_COUNTER_UPLINK) 2055 if (data->counter_type==MMI_GPRS_COUNTER_UPLINK)
2056 { 2056 {
2057 data->uplink_counter = 0; 2057 data->uplink_counter = 0;
2058 } 2058 }
2059 else 2059 else
2060 { 2060 {
2061 data->downlink_counter = 0; 2061 data->downlink_counter = 0;
2062 } 2062 }
2063 2063
2064 GPRS_ShowCounter(win); 2064 GPRS_ShowCounter(win);
2065 break; 2065 break;
2066 2066
2067 /* LSK or HUP - cancel without resetting */ 2067 /* LSK or HUP - cancel without resetting */
2068 2068
2069 case INFO_KCD_LEFT: 2069 case INFO_KCD_LEFT:
2070 case INFO_KCD_HUP: 2070 case INFO_KCD_HUP:
2071 break; 2071 break;
2072 } 2072 }
2073 2073
2074 return; 2074 return;
2075 } 2075 }
2076 2076
2077 2077
2078 /******************************************************************************* 2078 /*******************************************************************************
2082 $Description: Destroy counter display 2082 $Description: Destroy counter display
2083 2083
2084 $Returns: None 2084 $Returns: None
2085 2085
2086 $Arguments: None 2086 $Arguments: None
2087 2087
2088 *******************************************************************************/ 2088 *******************************************************************************/
2089 2089
2090 static void GPRS_DestroyCounter() 2090 static void GPRS_DestroyCounter()
2091 { 2091 {
2092 T_MMI_GPRS_DATA *data = GPRS_Data(); 2092 T_MMI_GPRS_DATA *data = GPRS_Data();
2093 2093
2094 tracefunction("GPRS_DestroyCounter()"); 2094 tracefunction("GPRS_DestroyCounter()");
2095 2095
2096 if (!data) 2096 if (!data)
2097 { 2097 {
2098 return; 2098 return;
2099 } 2099 }
2100 2100
2101 if (data->edit_win) 2101 if (data->edit_win)
2102 { 2102 {
2103 2103
2104 /* New Editor */ 2104 /* New Editor */
2105 2105
2106 #ifdef NEW_EDITOR 2106 #ifdef NEW_EDITOR
2107 AUI_edit_Destroy(data->edit_win); 2107 AUI_edit_Destroy(data->edit_win);
2108 #else 2108 #else
2109 editor_destroy(data->edit_win); 2109 editor_destroy(data->edit_win);
2110 #endif 2110 #endif
2111 FREE_MEMORY((void *)data->counterstring, ULONG_SIZE_IN_DECIMAL); 2111 FREE_MEMORY((void *)data->counterstring, ULONG_SIZE_IN_DECIMAL);
2112 data->counterstring = NULL; 2112 data->counterstring = NULL;
2113 data->edit_win = NULL; 2113 data->edit_win = NULL;
2114 } 2114 }
2115 2115
2116 return; 2116 return;
2117 } 2117 }
2118 2118
2119 /******************************************************************************* 2119 /*******************************************************************************
2120 2120
2137 2137
2138 if (!data) 2138 if (!data)
2139 { 2139 {
2140 return; 2140 return;
2141 } 2141 }
2142 2142
2143 counter = 0; 2143 counter = 0;
2144 2144
2145 switch(data->counter_type) 2145 switch(data->counter_type)
2146 { 2146 {
2147 case MMI_GPRS_COUNTER_UPLINK: 2147 case MMI_GPRS_COUNTER_UPLINK:
2148 counter = data->uplink_counter; 2148 counter = data->uplink_counter;
2149 break; 2149 break;
2150 2150
2151 case MMI_GPRS_COUNTER_DOWNLINK: 2151 case MMI_GPRS_COUNTER_DOWNLINK:
2152 counter = data->downlink_counter; 2152 counter = data->downlink_counter;
2153 break; 2153 break;
2154 } 2154 }
2155 2155