# HG changeset patch # User Mychaela Falconia # Date 1605324395 0 # Node ID db101b57af2d7a3c9932081977d94bb1dd47e251 # Parent 70ea7526b59e83c41c5d8b66f52b257140e93fd6 mmiAoc.c: bogotab fixes diff -r 70ea7526b59e -r db101b57af2d src/ui/bmi/mmiAoc.c --- a/src/ui/bmi/mmiAoc.c Sat Nov 14 03:18:11 2020 +0000 +++ b/src/ui/bmi/mmiAoc.c Sat Nov 14 03:26:35 2020 +0000 @@ -1,6 +1,6 @@ /******************************************************************************* - CONDAT (UK) + CONDAT (UK) ******************************************************************************** @@ -9,14 +9,14 @@ ******************************************************************************** - $Project name: Basic MMI - $Project code: BMI (6349) - $Module: Advice of Charge - $File: MmiVoiceMemo.c - $Revision: 1.0 + $Project name: Basic MMI + $Project code: BMI (6349) + $Module: Advice of Charge + $File: MmiVoiceMemo.c + $Revision: 1.0 - $Author: Condat(UK) - $Date: 09/04/01 + $Author: Condat(UK) + $Date: 09/04/01 ******************************************************************************** @@ -26,22 +26,22 @@ ******************************************************************************** $History: MmiAoc.c - May 26, 2006 ER: OMAPS00079607 x0012849 :Jagannatha M - Description: CPHS: Display 'charge/Timers' menu based on AOC ( Advice of charge ) - Solution:Made the following changes - 1. Based on the value of Aoc_flag it will be decided to disply 'charge/Timers' menu or not. + May 26, 2006 ER: OMAPS00079607 x0012849 :Jagannatha M + Description: CPHS: Display 'charge/Timers' menu based on AOC ( Advice of charge ) + Solution:Made the following changes + 1. Based on the value of Aoc_flag it will be decided to disply 'charge/Timers' menu or not. - June 16, 2005 REF: CRR 31267 x0021334 - Description: Handset ignore the initializtion of the PIN1/PIN2 - Fix: Cheking is done to ascertain if PIN1/PIN2 are initialised. If not, appropriate - message is displayed to the user. + June 16, 2005 REF: CRR 31267 x0021334 + Description: Handset ignore the initializtion of the PIN1/PIN2 + Fix: Cheking is done to ascertain if PIN1/PIN2 are initialised. If not, appropriate + message is displayed to the user. - 09/04/01 Original Condat(UK) BMI version. - May 25, 2004 REF: CRR MMI-SPR-17588 NISHIKANT KULKARNI - Issue description: On the SIM EF(ACMMax) is defined as 0xFFFFFF, so it should be possible to - enter 16777215, but only 999999 is accepted. - Solution: MAX_ENTER_LIMIT changed from 7 to 9. A check is done to verify that the entered - ACMmax value is less that 0xFFFFFF. Otherwise "Not Allowed" message is displayed. + 09/04/01 Original Condat(UK) BMI version. + May 25, 2004 REF: CRR MMI-SPR-17588 NISHIKANT KULKARNI + Issue description: On the SIM EF(ACMMax) is defined as 0xFFFFFF, so it should be possible to + enter 16777215, but only 999999 is accepted. + Solution: MAX_ENTER_LIMIT changed from 7 to 9. A check is done to verify that the entered + ACMmax value is less that 0xFFFFFF. Otherwise "Not Allowed" message is displayed. $End @@ -49,7 +49,6 @@ - /******************************************************************************* Include files @@ -139,55 +138,52 @@ /******************************************************************************* - Local Data + Local Data *******************************************************************************/ -#define PIN_REQUEST_FOR_RATE 700 -#define SERVICES_ENTER_CURRENCY 701 -#define SERVICES_ONE_UNIT 702 -#define SERVICES_RATE_CHANGED 703 -#define SERVICES_CREDIT_REMAINING 704 -#define PIN_REQUEST_FOR_LIMIT_CHANGE 705 -#define PIN_REQUEST_FOR_LIMIT_CANCEL 706 -#define SERVICES_LIMIT_VIEW 707 -#define SERVICES_LIMIT_CHANGE 708 -#define SERVICES_LIMIT_CANCEL 709 -#define SERVICES_LIMIT_CHANGED 710 -#define SERVICES_LAST_CHARGE 711 -#define SERVICES_TOTAL_CHARGE 712 -#define SERVICES_RESET_CHARGE 713 -#define SERVICES_CHARGE_CHANGED 714 -#define SERVICES_OUT_OF_RANGE 715 -#define SERVICES_AOC_NOT_SUPPORTED 716 -#define PIN_REQUEST_FOR_RESET_CHARGE 717 +#define PIN_REQUEST_FOR_RATE 700 +#define SERVICES_ENTER_CURRENCY 701 +#define SERVICES_ONE_UNIT 702 +#define SERVICES_RATE_CHANGED 703 +#define SERVICES_CREDIT_REMAINING 704 +#define PIN_REQUEST_FOR_LIMIT_CHANGE 705 +#define PIN_REQUEST_FOR_LIMIT_CANCEL 706 +#define SERVICES_LIMIT_VIEW 707 +#define SERVICES_LIMIT_CHANGE 708 +#define SERVICES_LIMIT_CANCEL 709 +#define SERVICES_LIMIT_CHANGED 710 +#define SERVICES_LAST_CHARGE 711 +#define SERVICES_TOTAL_CHARGE 712 +#define SERVICES_RESET_CHARGE 713 +#define SERVICES_CHARGE_CHANGED 714 +#define SERVICES_OUT_OF_RANGE 715 +#define SERVICES_AOC_NOT_SUPPORTED 716 +#define PIN_REQUEST_FOR_RESET_CHARGE 717 -/* May 25, 2004 REF: CRR MMI-SPR-17588 NISHIKANT KULKARNI - MAX_ENTER_LIMIT changed from 7 to 9 to accept "Limit" values till 16777215 (0xFFFFFF) - Previously, with MAX_ENTER_LIMIT set to 7, maximum 999999 could be entered as limit. - Effectively, the limit is MAX_ENTER_LIMIT - 1. The last character used for string termination. - Also, the maximum value that can be entered (0xFFFFFF) is # defined to MAX_ENTER_VALUE +/* May 25, 2004 REF: CRR MMI-SPR-17588 NISHIKANT KULKARNI + MAX_ENTER_LIMIT changed from 7 to 9 to accept "Limit" values till 16777215 (0xFFFFFF) + Previously, with MAX_ENTER_LIMIT set to 7, maximum 999999 could be entered as limit. + Effectively, the limit is MAX_ENTER_LIMIT - 1. The last character used for string termination. + Also, the maximum value that can be entered (0xFFFFFF) is # defined to MAX_ENTER_VALUE */ /* Max. Enter of Character */ -#define MAX_ENTER_LIMIT 9 // xnkulkar SPR-17588 +#define MAX_ENTER_LIMIT 9 // xnkulkar SPR-17588 #define MAX_ENTER_CURRENCY 4 #define MAX_ENTER_UNIT 6 -#define MAX_ENTER_VALUE 0xFFFFFF // xnkulkar SPR-17588 +#define MAX_ENTER_VALUE 0xFFFFFF // xnkulkar SPR-17588 /* */ - typedef struct { - T_MMI_CONTROL mmi_control; - T_MFW_HND service_win; /* MFW win handler */ - T_MFW_CM_AOC_INFO aocInfo; - USHORT Identifier; - char edt_Buf[30]; /* Editor buffer */ + T_MMI_CONTROL mmi_control; + T_MFW_HND service_win; /* MFW win handler */ + T_MFW_CM_AOC_INFO aocInfo; + USHORT Identifier; + char edt_Buf[30]; /* Editor buffer */ } T_SERVICES; - - LONG acm_last_call = 0; //accumulated call meter from the last call //later the value should save and read again from PCM @@ -197,37 +193,37 @@ #endif /******************************************************************************* - Local prototypes + Local prototypes *******************************************************************************/ -T_MFW_HND service_Init (T_MFW_HND parent_window); -void service_Exit (T_MFW_HND own_window); -T_MFW_HND service_create (T_MFW_HND parent_window); -void service_destroy (T_MFW_HND own_window); -static int service_win_cb (T_MFW_EVENT event, T_MFW_WIN * win); -void service_dialog_cb (T_MFW_HND win, USHORT identifier, UBYTE reason); -void service (T_MFW_HND win, USHORT event, SHORT value, void * parameter); +T_MFW_HND service_Init (T_MFW_HND parent_window); +void service_Exit (T_MFW_HND own_window); +T_MFW_HND service_create (T_MFW_HND parent_window); +void service_destroy (T_MFW_HND own_window); +static int service_win_cb (T_MFW_EVENT event, T_MFW_WIN * win); +void service_dialog_cb (T_MFW_HND win, USHORT identifier, UBYTE reason); +void service (T_MFW_HND win, USHORT event, SHORT value, void * parameter); /* SPR#1428 - SH - New Editor changes */ #ifdef NEW_EDITOR -void service_loadEditDefault (T_AUI_EDITOR_DATA *editor_data); +void service_loadEditDefault (T_AUI_EDITOR_DATA *editor_data); #else /* NEW_EDITOR */ -void service_loadEditDefault (T_EDITOR_DATA *editor_data); +void service_loadEditDefault (T_EDITOR_DATA *editor_data); #endif /* NEW_EDITOR */ -void service_calc_balance (T_MFW_HND win,char* line); -void service_calculate (T_MFW_HND win, char* line, long value); -USHORT service_check_pin_for_aoc (void); +void service_calc_balance (T_MFW_HND win,char* line); +void service_calculate (T_MFW_HND win, char* line, long value); +USHORT service_check_pin_for_aoc (void); //ADDED BY RAVI-29-11-2005 -extern T_MFW_HND AUI_calc_Start(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data); +extern T_MFW_HND AUI_calc_Start(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data); // END RAVI /******************************************************************************* - Functions + Functions *******************************************************************************/ /******************************************************************************* - $Function: aoc_credit_remaining + $Function: aoc_credit_remaining $Description: @@ -241,27 +237,27 @@ { T_MFW_HND win = mfw_parent(mfw_header()); - TRACE_FUNCTION("aoc_credit_remaining"); + TRACE_FUNCTION("aoc_credit_remaining"); - // create new dynamic dialog for the AOC + // create new dynamic dialog for the AOC SEND_EVENT (service_Init (win), SERVICES_CREDIT_REMAINING, 0, 0); - return 0; + return 0; } /******************************************************************************* - $Function: aoc_charge_rate + $Function: aoc_charge_rate - $Description: A security code editing screen is opened and Pin 2 requested. - Once entered successfully, an alpha. editor is opened with the - title "Enter currency".Once entered, an numeric editor is opened - with the title "Enter price p. unit". When the user has finished - entry the information screen " Rate changed" is displayed for - 3 second and the phone returns to the previous sub-menu + $Description: A security code editing screen is opened and Pin 2 requested. + Once entered successfully, an alpha. editor is opened with the + title "Enter currency".Once entered, an numeric editor is opened + with the title "Enter price p. unit". When the user has finished + entry the information screen " Rate changed" is displayed for + 3 second and the phone returns to the previous sub-menu $Returns: $Arguments: @@ -273,33 +269,32 @@ { T_MFW_HND win = mfw_parent(mfw_header()); - TRACE_FUNCTION("aoc_charge_rate"); + TRACE_FUNCTION("aoc_charge_rate"); - switch (service_check_pin_for_aoc ()) - { - case MFW_SIM_PIN2_REQ: - // June 16, 2005 REF: CRR 31267 x0021334 - pin2Flag = TRUE; - // create new dynamic dialog for the AOC - SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_RATE, 0, 0); - break; + switch (service_check_pin_for_aoc ()) + { + case MFW_SIM_PIN2_REQ: + // June 16, 2005 REF: CRR 31267 x0021334 + pin2Flag = TRUE; + // create new dynamic dialog for the AOC + SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_RATE, 0, 0); + break; - case MFW_SIM_PIN_REQ: - case MFW_SIM_NO_PIN: - //pin 1 or no pin required, open now the editor for entering the currency - SEND_EVENT (service_Init (win), SERVICES_ENTER_CURRENCY, 0, 0); - break; + case MFW_SIM_PIN_REQ: + case MFW_SIM_NO_PIN: + //pin 1 or no pin required, open now the editor for entering the currency + SEND_EVENT (service_Init (win), SERVICES_ENTER_CURRENCY, 0, 0); + break; - } + } - return 0; + return 0; } - /******************************************************************************* - $Function: aoc_view_limit + $Function: aoc_view_limit $Description: @@ -314,19 +309,19 @@ { T_MFW_HND win = mfw_parent(mfw_header()); - TRACE_FUNCTION("aoc_view_limit");/*SPR2500*/ + TRACE_FUNCTION("aoc_view_limit");/*SPR2500*/ - // create new dynamic dialog for the AOC + // create new dynamic dialog for the AOC SEND_EVENT (service_Init (win), SERVICES_LIMIT_VIEW, 0, 0); - return 0; + return 0; } /******************************************************************************* - $Function: aoc_change_limit + $Function: aoc_change_limit $Description: @@ -341,35 +336,35 @@ { T_MFW_HND win = mfw_parent(mfw_header()); - TRACE_FUNCTION("aoc_change_limit"); + TRACE_FUNCTION("aoc_change_limit"); /*SPR#1904 - DS - Added call to service_check_pin_for_aoc() to check if *PIN2 entry is required. */ - switch (service_check_pin_for_aoc ()) - { - case MFW_SIM_PIN2_REQ: - // June 16, 2005 REF: CRR 31267 x0021334 - pin2Flag = TRUE; - // create new dynamic dialog for the AOC - SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_LIMIT_CHANGE, 0, 0); - break; + switch (service_check_pin_for_aoc ()) + { + case MFW_SIM_PIN2_REQ: + // June 16, 2005 REF: CRR 31267 x0021334 + pin2Flag = TRUE; + // create new dynamic dialog for the AOC + SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_LIMIT_CHANGE, 0, 0); + break; - case MFW_SIM_PIN_REQ: - case MFW_SIM_NO_PIN: - //pin 1 or no pin required, open now the editor for entering the currency - SEND_EVENT (service_Init (win), SERVICES_LIMIT_CHANGE, 0, 0); - break; + case MFW_SIM_PIN_REQ: + case MFW_SIM_NO_PIN: + //pin 1 or no pin required, open now the editor for entering the currency + SEND_EVENT (service_Init (win), SERVICES_LIMIT_CHANGE, 0, 0); + break; - } + } - return 0; + return 0; } /******************************************************************************* - $Function: aoc_cancel_limit + $Function: aoc_cancel_limit $Description: @@ -384,36 +379,36 @@ { T_MFW_HND win = mfw_parent(mfw_header()); - TRACE_FUNCTION("aoc_charge_rate"); + TRACE_FUNCTION("aoc_charge_rate"); /*SPR#1904 - DS - Added call to service_check_pin_for_aoc() to check if *PIN2 entry is required. */ - switch (service_check_pin_for_aoc ()) - { - case MFW_SIM_PIN2_REQ: - // June 16, 2005 REF: CRR 31267 x0021334 - pin2Flag = TRUE; - // create new dynamic dialog for the AOC - SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_LIMIT_CANCEL, 0, 0); - break; + switch (service_check_pin_for_aoc ()) + { + case MFW_SIM_PIN2_REQ: + // June 16, 2005 REF: CRR 31267 x0021334 + pin2Flag = TRUE; + // create new dynamic dialog for the AOC + SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_LIMIT_CANCEL, 0, 0); + break; - case MFW_SIM_PIN_REQ: - case MFW_SIM_NO_PIN: - //pin 1 or no pin required, open now the editor for entering the currency - SEND_EVENT (service_Init (win), SERVICES_LIMIT_CANCEL, 0, 0); - break; + case MFW_SIM_PIN_REQ: + case MFW_SIM_NO_PIN: + //pin 1 or no pin required, open now the editor for entering the currency + SEND_EVENT (service_Init (win), SERVICES_LIMIT_CANCEL, 0, 0); + break; - } + } - return 0; + return 0; } /******************************************************************************* - $Function: aoc_last_charge + $Function: aoc_last_charge - $Description: Dispays the charge for the last call in the currency or in units + $Description: Dispays the charge for the last call in the currency or in units if no currency information has been entered $Returns: @@ -427,20 +422,20 @@ { T_MFW_HND win = mfw_parent(mfw_header()); - TRACE_FUNCTION("aoc_last_charge"); /*SPR2500*/ + TRACE_FUNCTION("aoc_last_charge"); /*SPR2500*/ - // create new dynamic dialog for the AOC + // create new dynamic dialog for the AOC SEND_EVENT (service_Init (win), SERVICES_LAST_CHARGE, 0, 0); - return 0; + return 0; } /******************************************************************************* - $Function: aoc_total_charge + $Function: aoc_total_charge - $Description: Displays the charge for all calls since the chage counter was last reset + $Description: Displays the charge for all calls since the chage counter was last reset $Returns: @@ -453,20 +448,20 @@ { T_MFW_HND win = mfw_parent(mfw_header()); - TRACE_FUNCTION("aoc_total_charge");/*SPR2500*/ + TRACE_FUNCTION("aoc_total_charge");/*SPR2500*/ - // create new dynamic dialog for the AOC + // create new dynamic dialog for the AOC SEND_EVENT (service_Init (win), SERVICES_TOTAL_CHARGE, 0, 0); - return 0; + return 0; } /******************************************************************************* - $Function: aoc_reset_charge + $Function: aoc_reset_charge - $Description: Resets the charge counter for all calls + $Description: Resets the charge counter for all calls $Returns: @@ -479,14 +474,14 @@ { T_MFW_HND win = mfw_parent(mfw_header()); - TRACE_FUNCTION("aoc_reset_charge");/*SPR2500*/ + TRACE_FUNCTION("aoc_reset_charge");/*SPR2500*/ switch (service_check_pin_for_aoc ()) { case MFW_SIM_PIN2_REQ: - // June 16, 2005 REF: CRR 31267 x0021334 - pin2Flag = TRUE; + // June 16, 2005 REF: CRR 31267 x0021334 + pin2Flag = TRUE; // create new dynamic dialog for the AOC SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_RESET_CHARGE, 0, 0); break; @@ -499,17 +494,13 @@ break; } - return 0; + return 0; } - - - - /******************************************************************************* - $Function: service_Init + $Function: service_Init $Description: @@ -526,7 +517,7 @@ /******************************************************************************* - $Function: service_Exit + $Function: service_Exit $Description: @@ -541,27 +532,27 @@ T_MFW_WIN * win_data = ((T_MFW_HDR *)own_window)->data; T_SERVICES * data = (T_SERVICES *)win_data->user; - TRACE_FUNCTION("service_Exit"); - /*SPR 2500, check valid window pointer before destruction*/ - if ((own_window) && - (win_data) && - (data) && - (data->service_win)) - { - service_destroy (data->service_win); - } - else - { - TRACE_ERROR("service_Exit : Invalid Pointer passed"); - } + TRACE_FUNCTION("service_Exit"); + /*SPR 2500, check valid window pointer before destruction*/ + if ((own_window) && + (win_data) && + (data) && + (data->service_win)) + { + service_destroy (data->service_win); + } + else + { + TRACE_ERROR("service_Exit : Invalid Pointer passed"); + } - return; + return; } /******************************************************************************* - $Function: service_create + $Function: service_create $Description: @@ -601,7 +592,7 @@ /******************************************************************************* - $Function: service_destroy + $Function: service_destroy $Description: @@ -631,14 +622,14 @@ win_delete (data->service_win); data->service_win = 0; - FREE_MEMORY ((void *)data, sizeof (T_SERVICES)); + FREE_MEMORY ((void *)data, sizeof (T_SERVICES)); } } } /******************************************************************************* - $Function: service_win_cb + $Function: service_win_cb $Description: @@ -657,7 +648,7 @@ /******************************************************************************* - $Function: service_dialog_cb + $Function: service_dialog_cb $Description: @@ -668,7 +659,7 @@ *******************************************************************************/ void service_dialog_cb(T_MFW_HND win, USHORT identifier, UBYTE reason) { - TRACE_FUNCTION ("service_dialog_cb()"); + TRACE_FUNCTION ("service_dialog_cb()"); switch (reason) { @@ -682,25 +673,25 @@ /* no break; */ case INFO_KCD_CLEAR: - TRACE_EVENT_P1("identifier: %d", identifier); + TRACE_EVENT_P1("identifier: %d", identifier); - if (identifier EQ SERVICES_OUT_OF_RANGE) - { - TRACE_EVENT ("SERVICES_OUT_OF_RANGE"); - SEND_EVENT (win, SERVICES_ONE_UNIT, 0, 0); - } - else - { - TRACE_EVENT (" destroy "); - service_Exit(win); - } + if (identifier EQ SERVICES_OUT_OF_RANGE) + { + TRACE_EVENT ("SERVICES_OUT_OF_RANGE"); + SEND_EVENT (win, SERVICES_ONE_UNIT, 0, 0); + } + else + { + TRACE_EVENT (" destroy "); + service_Exit(win); + } break; } } /******************************************************************************* - $Function: service_editor_cb + $Function: service_editor_cb $Description: @@ -712,44 +703,44 @@ static void service_editor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason) { - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_SERVICES * data = (T_SERVICES *)win_data->user; + T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; + T_SERVICES * data = (T_SERVICES *)win_data->user; - UBYTE PWD[16], i; + UBYTE PWD[16], i; int result; - TRACE_FUNCTION ("service_editor_cb()"); - /*SPR 2500, check pointers valid*/ - if ((!win) || - (!win_data) || - (!data)) - { - TRACE_ERROR("service_editor_cb : Invalid Pointer passed"); - return; - } + TRACE_FUNCTION ("service_editor_cb()"); + /*SPR 2500, check pointers valid*/ + if ((!win) || + (!win_data) || + (!data)) + { + TRACE_ERROR("service_editor_cb : Invalid Pointer passed"); + return; + } - if ((!win) || - (!win_data) || - (!data)) - { - TRACE_ERROR("service_editor_cb : Invalid Pointer passed"); - return; - } + if ((!win) || + (!win_data) || + (!data)) + { + TRACE_ERROR("service_editor_cb : Invalid Pointer passed"); + return; + } - memset(PWD, 0x00, 16); + memset(PWD, 0x00, 16); - switch (reason) - { - case INFO_KCD_LEFT: - switch (Identifier) - { - case SERVICES_ENTER_CURRENCY: - TRACE_EVENT ("SERVICES_ENTER_CURRENCY"); - TRACE_EVENT ("pressed left"); + switch (reason) + { + case INFO_KCD_LEFT: + switch (Identifier) + { + case SERVICES_ENTER_CURRENCY: + TRACE_EVENT ("SERVICES_ENTER_CURRENCY"); + TRACE_EVENT ("pressed left"); - // clear old current currency before overwrite it + // clear old current currency before overwrite it memset(data->aocInfo.cur, 0x80, sizeof(data->aocInfo.cur)); if(strlen(data->edt_Buf) NEQ 0) @@ -757,127 +748,127 @@ memcpy(data->aocInfo.cur, data->edt_Buf, MAX_ENTER_CURRENCY); } - //termination from ASCII to GSM default - for (i=0; i< MAX_ENTER_CURRENCY-1; i++) - { - if (data->aocInfo.cur[i] EQ '\0') - data->aocInfo.cur[i] = 0x80; - } + //termination from ASCII to GSM default + for (i=0; i< MAX_ENTER_CURRENCY-1; i++) + { + if (data->aocInfo.cur[i] EQ '\0') + data->aocInfo.cur[i] = 0x80; + } - // open the next editor for entering the price per unit - SEND_EVENT (win, SERVICES_ONE_UNIT, 0, 0); - break; + // open the next editor for entering the price per unit + SEND_EVENT (win, SERVICES_ONE_UNIT, 0, 0); + break; - case SERVICES_ONE_UNIT: - TRACE_EVENT ("SERVICES_ONE_UNIT"); - TRACE_EVENT ("pressed left"); + case SERVICES_ONE_UNIT: + TRACE_EVENT ("SERVICES_ONE_UNIT"); + TRACE_EVENT ("pressed left"); // clear old current ppu before overwrite it memset(data->aocInfo.ppu, '\0', sizeof(data->aocInfo.ppu)); - if(strlen(data->edt_Buf) NEQ 0) + if(strlen(data->edt_Buf) NEQ 0) { memcpy(data->aocInfo.ppu, data->edt_Buf, strlen(data->edt_Buf)); - } + } // Password not necessary, Pin2 scenario done memset(PWD, 0x00, 16); - // write cur and ppu in AOC - result = cm_set_aoc_value(CM_AOC_PUCT, &data->aocInfo, PWD); + // write cur and ppu in AOC + result = cm_set_aoc_value(CM_AOC_PUCT, &data->aocInfo, PWD); - TRACE_EVENT_P1("PPU : %s", data->aocInfo.ppu); - TRACE_EVENT_P1("CUR : %s", data->aocInfo.cur); - TRACE_EVENT_P1("result : %d", result); + TRACE_EVENT_P1("PPU : %s", data->aocInfo.ppu); + TRACE_EVENT_P1("CUR : %s", data->aocInfo.cur); + TRACE_EVENT_P1("result : %d", result); - if(result EQ CM_OK) - { - SEND_EVENT (win, SERVICES_RATE_CHANGED, 0, 0); - } - else - { - SEND_EVENT (win, SERVICES_OUT_OF_RANGE, 0, 0); - } + if(result EQ CM_OK) + { + SEND_EVENT (win, SERVICES_RATE_CHANGED, 0, 0); + } + else + { + SEND_EVENT (win, SERVICES_OUT_OF_RANGE, 0, 0); + } - break; + break; - case SERVICES_LIMIT_CHANGE: + case SERVICES_LIMIT_CHANGE: - // string => long + // string => long data->aocInfo.acm_max = atol(data->edt_Buf); - // Password not necessary, Pin2 scenario done + // Password not necessary, Pin2 scenario done memset(PWD, 0x00, 16); - // May 25, 2004 REF: CRR MMI-SPR-17588 NISHIKANT KULKARNI + // May 25, 2004 REF: CRR MMI-SPR-17588 NISHIKANT KULKARNI - // If the ACMmax value entered by the user is more than 16777215 (0xFFFFFF), - // display a "Not Allowed" message. - if(data->aocInfo.acm_max > MAX_ENTER_VALUE) - { - // Send event to display a "Not Allowed" message. - SEND_EVENT (win, SERVICES_AOC_NOT_SUPPORTED, 0, 0); - } + // If the ACMmax value entered by the user is more than 16777215 (0xFFFFFF), + // display a "Not Allowed" message. + if(data->aocInfo.acm_max > MAX_ENTER_VALUE) + { + // Send event to display a "Not Allowed" message. + SEND_EVENT (win, SERVICES_AOC_NOT_SUPPORTED, 0, 0); + } - // Else set the ACMmax value in AoC. - else - { - result = cm_set_aoc_value(CM_AOC_ACMMAX, &data->aocInfo, PWD); /* save ACMmax in AOC */ + // Else set the ACMmax value in AoC. + else + { + result = cm_set_aoc_value(CM_AOC_ACMMAX, &data->aocInfo, PWD); /* save ACMmax in AOC */ - TRACE_EVENT_P1("%ld", data->aocInfo.acm_max); - TRACE_EVENT_P1("result of set aoc %d", result); + TRACE_EVENT_P1("%ld", data->aocInfo.acm_max); + TRACE_EVENT_P1("result of set aoc %d", result); - // Send event to display a "Limit Changed" message. - SEND_EVENT (win, SERVICES_LIMIT_CHANGED, 0, 0); - } + // Send event to display a "Limit Changed" message. + SEND_EVENT (win, SERVICES_LIMIT_CHANGED, 0, 0); + } - break; + break; case SERVICES_RESET_CHARGE: - /* MC 12/04/02: Changed ACMMAX to ACM (should fix "broken" SIM problem)*/ + /* MC 12/04/02: Changed ACMMAX to ACM (should fix "broken" SIM problem)*/ - result = cm_set_aoc_value(CM_AOC_ACM, &data->aocInfo, PWD); /* save ACMmax in AOC */ + result = cm_set_aoc_value(CM_AOC_ACM, &data->aocInfo, PWD); /* save ACMmax in AOC */ - } - break; + } + break; - case INFO_KCD_RIGHT: - case INFO_KCD_CLEAR: + case INFO_KCD_RIGHT: + case INFO_KCD_CLEAR: - TRACE_EVENT ("INFO_KCD_RIGHT pressed"); + TRACE_EVENT ("INFO_KCD_RIGHT pressed"); - switch (Identifier) - { + switch (Identifier) + { - case SERVICES_LIMIT_CHANGE: - case SERVICES_ENTER_CURRENCY: + case SERVICES_LIMIT_CHANGE: + case SERVICES_ENTER_CURRENCY: - //go back to the previous screen - service_Exit (win); - break; - case SERVICES_ONE_UNIT: + //go back to the previous screen + service_Exit (win); + break; + case SERVICES_ONE_UNIT: - //go back to the previous screen - SEND_EVENT (win, SERVICES_ENTER_CURRENCY, 0, 0); - break; + //go back to the previous screen + SEND_EVENT (win, SERVICES_ENTER_CURRENCY, 0, 0); + break; - default: - break; - } + default: + break; + } default: - break; - } + break; + } } /******************************************************************************* - $Function: createAOCDialog + $Function: createAOCDialog - $Description: Creates a dialog from 4 input parameters + $Description: Creates a dialog from 4 input parameters $Returns: @@ -886,17 +877,17 @@ *******************************************************************************/ static void createAOCDialog( T_MFW_HND win, USHORT txtId1, USHORT txtId2, char *str2, USHORT event ) { - T_DISPLAY_DATA display_info; + T_DISPLAY_DATA display_info; - dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, txtId1, txtId2, COLOUR_AOC); - dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)service_dialog_cb, THREE_SECS, KEY_CLEAR | KEY_RIGHT | KEY_LEFT ); - display_info.Identifier = event; - display_info.TextString2 = str2; - info_dialog (win, &display_info); + dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, txtId1, txtId2, COLOUR_AOC); + dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)service_dialog_cb, THREE_SECS, KEY_CLEAR | KEY_RIGHT | KEY_LEFT ); + display_info.Identifier = event; + display_info.TextString2 = str2; + info_dialog (win, &display_info); } /******************************************************************************* - $Function: service + $Function: service $Description: @@ -907,65 +898,65 @@ *******************************************************************************/ void service (T_MFW_HND win, USHORT event, SHORT value, void * parameter) { - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_SERVICES * data = (T_SERVICES *)win_data->user; + T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; + T_SERVICES * data = (T_SERVICES *)win_data->user; /* CQ13428 - NDH - Use dynamically allocated memory to prevent MMI Stack Overflow */ #ifdef NEW_EDITOR /* SPR#1428 - SH - New Editor data */ - T_AUI_EDITOR_DATA *editor_data = (T_AUI_EDITOR_DATA *)ALLOC_MEMORY (sizeof (T_AUI_EDITOR_DATA)); + T_AUI_EDITOR_DATA *editor_data = (T_AUI_EDITOR_DATA *)ALLOC_MEMORY (sizeof (T_AUI_EDITOR_DATA)); #else - T_EDITOR_DATA *editor_data = (T_EDITOR_DATA *)ALLOC_MEMORY (sizeof (T_EDITOR_DATA)); + T_EDITOR_DATA *editor_data = (T_EDITOR_DATA *)ALLOC_MEMORY (sizeof (T_EDITOR_DATA)); #endif - // T_MFW_SIM_PIN_STATUS status; // RAVI + // T_MFW_SIM_PIN_STATUS status; // RAVI - UBYTE i, result; - UBYTE PWD[16]; + UBYTE i, result; + UBYTE PWD[16]; static char line[MAX_LINE]; - TRACE_FUNCTION("service()"); + TRACE_FUNCTION("service()"); - if (!editor_data) - { - TRACE_ERROR("service : Failed to allocate memory for the Editor Data"); - return; - } - if ((!win) || - (!win_data) || - (!data)) - { - TRACE_ERROR("service : Invalid Pointer passed"); + if (!editor_data) + { + TRACE_ERROR("service : Failed to allocate memory for the Editor Data"); + return; + } + if ((!win) || + (!win_data) || + (!data)) + { + TRACE_ERROR("service : Invalid Pointer passed"); /* CQ13428 - NDH - Use dynamically allocated memory to prevent MMI Stack Overflow */ #ifdef NEW_EDITOR FREE_MEMORY((void *)editor_data, sizeof (T_AUI_EDITOR_DATA)); #else FREE_MEMORY((void *)editor_data, sizeof (T_EDITOR_DATA)); #endif - return; - } + return; + } - memset(PWD, 0x00, 16); - switch (event) - { + memset(PWD, 0x00, 16); + switch (event) + { - case SERVICES_CREDIT_REMAINING: + case SERVICES_CREDIT_REMAINING: memset(line,'\0',sizeof(line)); - //Get the ACM MAX + //Get the ACM MAX cm_get_aoc_value(CM_AOC_ACMMAX,&data->aocInfo); - //Get ACM + //Get ACM cm_get_aoc_value(CM_AOC_ACM,&data->aocInfo); - //Get currency and price per unit + //Get currency and price per unit cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); - TRACE_EVENT_P1("ACMMAX: %ld", data->aocInfo.acm_max); - TRACE_EVENT_P1("ACM: %ld", data->aocInfo.acm); - TRACE_EVENT_P1("PPU:%s", data->aocInfo.ppu); - TRACE_EVENT_P1("CUR:%s", data->aocInfo.cur); + TRACE_EVENT_P1("ACMMAX: %ld", data->aocInfo.acm_max); + TRACE_EVENT_P1("ACM: %ld", data->aocInfo.acm); + TRACE_EVENT_P1("PPU:%s", data->aocInfo.ppu); + TRACE_EVENT_P1("CUR:%s", data->aocInfo.cur); if ((data->aocInfo.acm_max NEQ '\0') && (data->aocInfo.acm NEQ '\0')) @@ -1004,56 +995,54 @@ sprintf(line, "%ld", data->aocInfo.acm_max - data->aocInfo.acm); /* */ } - if (data->aocInfo.acm EQ '\0') - strcpy ((char *)line, "0"); + if (data->aocInfo.acm EQ '\0') + strcpy ((char *)line, "0"); - //from ASCII to GSM default - for (i=0; i< MAX_LINE; i++) - { - if (line[i] EQ (char)0x80 OR line[i] EQ (char)0xFF ) /* x0039928 - Lint warning fix */ - line[i] = '\0'; - } + //from ASCII to GSM default + for (i=0; i< MAX_LINE; i++) + { + if (line[i] EQ (char)0x80 OR line[i] EQ (char)0xFF ) /* x0039928 - Lint warning fix */ + line[i] = '\0'; + } if (data->aocInfo.acm_max EQ 0) { - createAOCDialog( win, TxtCost, TxtNull, line, event); + createAOCDialog( win, TxtCost, TxtNull, line, event); } else { - createAOCDialog( win, TxtBalance, TxtNull, line, event); + createAOCDialog( win, TxtBalance, TxtNull, line, event); } - break; - + break; + case PIN_REQUEST_FOR_RATE: + //save the status + data->Identifier = SERVICES_ENTER_CURRENCY; - case PIN_REQUEST_FOR_RATE: - //save the status - data->Identifier = SERVICES_ENTER_CURRENCY; - - //PIN2 is requested to change the Rate + //PIN2 is requested to change the Rate pin2_check (data->service_win); - break; + break; - case PIN_REQUEST_FOR_LIMIT_CHANGE: + case PIN_REQUEST_FOR_LIMIT_CHANGE: - //PIN2 is requested to change the Rate + //PIN2 is requested to change the Rate pin2_check (data->service_win); - //save the status - data->Identifier = SERVICES_LIMIT_CHANGE; - break; + //save the status + data->Identifier = SERVICES_LIMIT_CHANGE; + break; - case PIN_REQUEST_FOR_LIMIT_CANCEL: + case PIN_REQUEST_FOR_LIMIT_CANCEL: - //PIN2 is requested to change the Rate + //PIN2 is requested to change the Rate pin2_check (data->service_win); - //save the status - data->Identifier = SERVICES_LIMIT_CANCEL; - break; + //save the status + data->Identifier = SERVICES_LIMIT_CANCEL; + break; case PIN_REQUEST_FOR_RESET_CHARGE: //save the status @@ -1065,27 +1054,27 @@ break; - //it calls from MMI PINS + //it calls from MMI PINS case PIN2_OK: - TRACE_EVENT("PIN2_OK"); + TRACE_EVENT("PIN2_OK"); - switch (data->Identifier) - { - case SERVICES_ENTER_CURRENCY: + switch (data->Identifier) + { + case SERVICES_ENTER_CURRENCY: - //pin was ok, open now the editor for entering the currency - SEND_EVENT (win, data->Identifier, 0, 0); - break; - case SERVICES_LIMIT_CHANGE: + //pin was ok, open now the editor for entering the currency + SEND_EVENT (win, data->Identifier, 0, 0); + break; + case SERVICES_LIMIT_CHANGE: - //pin was ok, open now the editor for entering the currency - SEND_EVENT (win, data->Identifier, 0, 0); - break; - case SERVICES_LIMIT_CANCEL: + //pin was ok, open now the editor for entering the currency + SEND_EVENT (win, data->Identifier, 0, 0); + break; + case SERVICES_LIMIT_CANCEL: - //pin was ok, open now the editor for entering the currency - SEND_EVENT (win, data->Identifier, 0, 0); - break; + //pin was ok, open now the editor for entering the currency + SEND_EVENT (win, data->Identifier, 0, 0); + break; case SERVICES_RESET_CHARGE: //pin was ok, open now the editor for entering the currency @@ -1093,119 +1082,117 @@ break; - - } - break; + } + break; case PIN2_ABORT: - createAOCDialog( win, TxtFailed, TxtNull, line, event ); - break; + createAOCDialog( win, TxtFailed, TxtNull, line, event ); + break; case SERVICES_ENTER_CURRENCY: - //save the status - data->Identifier = SERVICES_ENTER_CURRENCY; + //save the status + data->Identifier = SERVICES_ENTER_CURRENCY; - //PUCT (currency and price per unit) is requested - result = cm_get_aoc_value(CM_AOC_PUCT, &data->aocInfo); + //PUCT (currency and price per unit) is requested + result = cm_get_aoc_value(CM_AOC_PUCT, &data->aocInfo); - TRACE_EVENT_P1("result %d", result); + TRACE_EVENT_P1("result %d", result); - //fill up editor-sttribut with default - service_loadEditDefault (editor_data); + //fill up editor-sttribut with default + service_loadEditDefault (editor_data); - //clear the editor-buffer - memset(data->edt_Buf,'\0',sizeof(data->edt_Buf)); + //clear the editor-buffer + memset(data->edt_Buf,'\0',sizeof(data->edt_Buf)); - // let to show the current currency, before the user change it */ - memcpy(data->edt_Buf, data->aocInfo.cur, MAX_ENTER_CURRENCY); + // let to show the current currency, before the user change it */ + memcpy(data->edt_Buf, data->aocInfo.cur, MAX_ENTER_CURRENCY); - for (i=0; i< MAX_ENTER_CURRENCY-1; i++) - { - if (data->edt_Buf[i] EQ (char)0x80 OR data->edt_Buf[i] EQ (char)0xFF ) - data->edt_Buf[i] = '\0'; - } + for (i=0; i< MAX_ENTER_CURRENCY-1; i++) + { + if (data->edt_Buf[i] EQ (char)0x80 OR data->edt_Buf[i] EQ (char)0xFF ) + data->edt_Buf[i] = '\0'; + } /* SPR#1428 - SH - New Editor changes */ #ifdef NEW_EDITOR - AUI_edit_SetBuffer(editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_Buf, MAX_ENTER_CURRENCY); - AUI_edit_SetTextStr(editor_data, TxtSoftOK, TxtDelete, TxtEnterCurrency, NULL); - AUI_edit_SetEvents(editor_data, data->Identifier, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); - AUI_edit_SetMode(editor_data, ED_MODE_ALPHA, ED_CURSOR_BAR); + AUI_edit_SetBuffer(editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_Buf, MAX_ENTER_CURRENCY); + AUI_edit_SetTextStr(editor_data, TxtSoftOK, TxtDelete, TxtEnterCurrency, NULL); + AUI_edit_SetEvents(editor_data, data->Identifier, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); + AUI_edit_SetMode(editor_data, ED_MODE_ALPHA, ED_CURSOR_BAR); - AUI_edit_Start(data->service_win, editor_data); + AUI_edit_Start(data->service_win, editor_data); #else /* NEW_EDITOR */ - editor_data->editor_attr.text = data->edt_Buf; /* buffer to be edited */ - editor_data->editor_attr.size = MAX_ENTER_CURRENCY;/* limit to 3 letters */ - editor_data->LeftSoftKey = TxtSoftOK; - editor_data->RightSoftKey = TxtDelete; - editor_data->TextId = TxtEnterCurrency; - editor_data->Identifier = data->Identifier; - editor_data->mode = ALPHA_MODE; - editor_data->AlternateLeftSoftKey = TxtNull; - editor_data->min_enter = 1; + editor_data->editor_attr.text = data->edt_Buf; /* buffer to be edited */ + editor_data->editor_attr.size = MAX_ENTER_CURRENCY;/* limit to 3 letters */ + editor_data->LeftSoftKey = TxtSoftOK; + editor_data->RightSoftKey = TxtDelete; + editor_data->TextId = TxtEnterCurrency; + editor_data->Identifier = data->Identifier; + editor_data->mode = ALPHA_MODE; + editor_data->AlternateLeftSoftKey = TxtNull; + editor_data->min_enter = 1; - /* create the dialog handler */ - editor_start(data->service_win, editor_data); /* start the editor */ + /* create the dialog handler */ + editor_start(data->service_win, editor_data); /* start the editor */ #endif /* NEW_EDITOR */ - break; - + break; case SERVICES_ONE_UNIT: - //save the status - data->Identifier = SERVICES_ONE_UNIT; + //save the status + data->Identifier = SERVICES_ONE_UNIT; - //fill up editor-sttribut with default - service_loadEditDefault (editor_data); + //fill up editor-sttribut with default + service_loadEditDefault (editor_data); - //clear the editor-buffer - memset(data->edt_Buf,'\0',sizeof(data->edt_Buf)); + //clear the editor-buffer + memset(data->edt_Buf,'\0',sizeof(data->edt_Buf)); /* let to show the current price per unit, before the user change it */ memcpy(data->edt_Buf, data->aocInfo.ppu, sizeof(data->aocInfo.ppu)); - for (i=0; i< MAX_ENTER_UNIT-1; i++) - { - if (data->edt_Buf[i] EQ (char)0x80 OR data->edt_Buf[i] EQ (char)0xFF ) - data->edt_Buf[i] = '\0'; - } + for (i=0; i< MAX_ENTER_UNIT-1; i++) + { + if (data->edt_Buf[i] EQ (char)0x80 OR data->edt_Buf[i] EQ (char)0xFF ) + data->edt_Buf[i] = '\0'; + } /* SPR#1428 - SH - New Editor changes */ #ifdef NEW_EDITOR - AUI_edit_SetBuffer(editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_Buf, MAX_ENTER_UNIT); - AUI_edit_SetTextStr(editor_data, TxtSoftOK, TxtDelete, Txt1Unit, NULL); - AUI_edit_SetEvents(editor_data, data->Identifier, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); - AUI_edit_SetMode(editor_data, 0, ED_CURSOR_BAR); + AUI_edit_SetBuffer(editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_Buf, MAX_ENTER_UNIT); + AUI_edit_SetTextStr(editor_data, TxtSoftOK, TxtDelete, Txt1Unit, NULL); + AUI_edit_SetEvents(editor_data, data->Identifier, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); + AUI_edit_SetMode(editor_data, 0, ED_CURSOR_BAR); - AUI_calc_Start(data->service_win, editor_data); + AUI_calc_Start(data->service_win, editor_data); #else /* NEW_EDITOR */ - editor_data->editor_attr.text = data->edt_Buf; /* buffer to be edited */ - editor_data->editor_attr.size = MAX_ENTER_UNIT;/* limit to 5 numerics */ - editor_data->LeftSoftKey = TxtSoftOK; - editor_data->RightSoftKey = TxtDelete; - editor_data->TextId = Txt1Unit; - editor_data->Identifier = data->Identifier; - editor_data->mode = CALC_MODE; - editor_data->AlternateLeftSoftKey = TxtNull; - editor_data->min_enter = 1; + editor_data->editor_attr.text = data->edt_Buf; /* buffer to be edited */ + editor_data->editor_attr.size = MAX_ENTER_UNIT;/* limit to 5 numerics */ + editor_data->LeftSoftKey = TxtSoftOK; + editor_data->RightSoftKey = TxtDelete; + editor_data->TextId = Txt1Unit; + editor_data->Identifier = data->Identifier; + editor_data->mode = CALC_MODE; + editor_data->AlternateLeftSoftKey = TxtNull; + editor_data->min_enter = 1; - /* create the dialog handler */ - editor_start(data->service_win, editor_data); /* start the editor */ + /* create the dialog handler */ + editor_start(data->service_win, editor_data); /* start the editor */ #endif /* NEW_EDITOR */ - break; + break; - case SERVICES_RATE_CHANGED: - createAOCDialog( win, TxtRate, TxtChanged, NULL, event); - break; + case SERVICES_RATE_CHANGED: + createAOCDialog( win, TxtRate, TxtChanged, NULL, event); + break; - case SERVICES_LIMIT_VIEW: + case SERVICES_LIMIT_VIEW: memset(line,'\0',sizeof(line)); @@ -1220,96 +1207,96 @@ if((strlen((char*)data->aocInfo.ppu) EQ 0) && data->aocInfo.acm_max NEQ '\0') { sprintf(line, "%ld", data->aocInfo.acm_max); /* Show only ACMmax */ - TRACE_EVENT ("get only :ACMMAX ; PPU ==0 and ACMMAX!=0"); + TRACE_EVENT ("get only :ACMMAX ; PPU ==0 and ACMMAX!=0"); } if((strlen((char*)data->aocInfo.ppu) NEQ 0) && data->aocInfo.acm_max NEQ '\0') { - service_calculate (win, (char*)line, data->aocInfo.acm_max); + service_calculate (win, (char*)line, data->aocInfo.acm_max); TRACE_EVENT ("calculate ACMMAX * PPU; PPU !=0 and ACMMAX!=0"); } - for (i=0; i< MAX_LINE; i++) - { - if (line[i] EQ (char)0x80 OR line[i] EQ (char)0xFF ) - line[i] = '\0'; - } + for (i=0; i< MAX_LINE; i++) + { + if (line[i] EQ (char)0x80 OR line[i] EQ (char)0xFF ) + line[i] = '\0'; + } if(data->aocInfo.acm_max NEQ '\0') { - createAOCDialog( win, TxtLimitEq, TxtNull, line, event); + createAOCDialog( win, TxtLimitEq, TxtNull, line, event); } else { - createAOCDialog( win, TxtNo, TxtLimit, NULL, event); + createAOCDialog( win, TxtNo, TxtLimit, NULL, event); } - /* - * Call Info Screen - */ + /* + * Call Info Screen + */ - break; + break; - case SERVICES_LIMIT_CHANGE: + case SERVICES_LIMIT_CHANGE: - //fill up editor-sttribut with default - service_loadEditDefault (editor_data); + //fill up editor-sttribut with default + service_loadEditDefault (editor_data); - //clear the editor-buffer - memset(data->edt_Buf,'\0',sizeof(data->edt_Buf)); + //clear the editor-buffer + memset(data->edt_Buf,'\0',sizeof(data->edt_Buf)); - data->Identifier = SERVICES_LIMIT_CHANGE; /*SPR 2500*/ + data->Identifier = SERVICES_LIMIT_CHANGE; /*SPR 2500*/ - data->Identifier = SERVICES_LIMIT_CHANGE; + data->Identifier = SERVICES_LIMIT_CHANGE; /* SPR#1428 - SH - New Editor changes */ #ifdef NEW_EDITOR - AUI_edit_SetBuffer(editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_Buf, MAX_ENTER_LIMIT); - AUI_edit_SetTextStr(editor_data, TxtSoftOK, TxtDelete, TxtEnterLimit, NULL); - AUI_edit_SetEvents(editor_data, data->Identifier, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); - AUI_edit_SetMode(editor_data, 0, ED_CURSOR_BAR); + AUI_edit_SetBuffer(editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_Buf, MAX_ENTER_LIMIT); + AUI_edit_SetTextStr(editor_data, TxtSoftOK, TxtDelete, TxtEnterLimit, NULL); + AUI_edit_SetEvents(editor_data, data->Identifier, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); + AUI_edit_SetMode(editor_data, 0, ED_CURSOR_BAR); - AUI_calc_Start(data->service_win, editor_data); + AUI_calc_Start(data->service_win, editor_data); #else /* NEW_EDITOR */ - editor_data->editor_attr.text = data->edt_Buf; /* buffer to be edited */ - editor_data->editor_attr.size = MAX_ENTER_LIMIT; /* limit to 6 terms of units */ - editor_data->LeftSoftKey = TxtSoftOK; - editor_data->RightSoftKey = TxtDelete; - editor_data->TextId = TxtEnterLimit; - editor_data->Identifier = data->Identifier; - editor_data->mode = CALC_MODE; - editor_data->AlternateLeftSoftKey = TxtNull; - editor_data->min_enter = 1; + editor_data->editor_attr.text = data->edt_Buf; /* buffer to be edited */ + editor_data->editor_attr.size = MAX_ENTER_LIMIT; /* limit to 6 terms of units */ + editor_data->LeftSoftKey = TxtSoftOK; + editor_data->RightSoftKey = TxtDelete; + editor_data->TextId = TxtEnterLimit; + editor_data->Identifier = data->Identifier; + editor_data->mode = CALC_MODE; + editor_data->AlternateLeftSoftKey = TxtNull; + editor_data->min_enter = 1; - /* create the dialog handler */ - editor_start(data->service_win, editor_data); /* start the editor */ + /* create the dialog handler */ + editor_start(data->service_win, editor_data); /* start the editor */ #endif /* NEW_EDITOR */ - break; - case SERVICES_LIMIT_CANCEL: + break; + case SERVICES_LIMIT_CANCEL: - // clear the limit - data->aocInfo.acm_max = 0; + // clear the limit + data->aocInfo.acm_max = 0; - // Password not necessary, Pin2 scenario done - memset(PWD, 0x00, 16); + // Password not necessary, Pin2 scenario done + memset(PWD, 0x00, 16); - cm_set_aoc_value(CM_AOC_ACMMAX, &data->aocInfo, PWD); /* save ACMmax in AOC */ + cm_set_aoc_value(CM_AOC_ACMMAX, &data->aocInfo, PWD); /* save ACMmax in AOC */ - TRACE_EVENT_P1("%ld", data->aocInfo.acm_max); + TRACE_EVENT_P1("%ld", data->aocInfo.acm_max); - SEND_EVENT (win, SERVICES_LIMIT_CHANGED, 0, 0); + SEND_EVENT (win, SERVICES_LIMIT_CHANGED, 0, 0); - break; + break; - case SERVICES_LIMIT_CHANGED: - createAOCDialog( win, TxtLimit, TxtChanged, NULL, event); + case SERVICES_LIMIT_CHANGED: + createAOCDialog( win, TxtLimit, TxtChanged, NULL, event); - break; + break; - case SERVICES_LAST_CHARGE: + case SERVICES_LAST_CHARGE: cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ @@ -1332,10 +1319,10 @@ if (acm_last_call EQ '\0') strcpy ((char *)line, "0"); - createAOCDialog( win, TxtLastCharge, TxtNull, line, event); + createAOCDialog( win, TxtLastCharge, TxtNull, line, event); break; - case SERVICES_TOTAL_CHARGE: + case SERVICES_TOTAL_CHARGE: memset(line,'\0',sizeof(line)); @@ -1343,16 +1330,16 @@ cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ - /* nm test only set the default */ + /* nm test only set the default */ - TRACE_EVENT_P1("ACM: %ld", data->aocInfo.acm); - TRACE_EVENT_P1("PPU:%s", data->aocInfo.ppu); - TRACE_EVENT_P1("CUR:%s", data->aocInfo.cur); + TRACE_EVENT_P1("ACM: %ld", data->aocInfo.acm); + TRACE_EVENT_P1("PPU:%s", data->aocInfo.ppu); + TRACE_EVENT_P1("CUR:%s", data->aocInfo.cur); if((strlen((char*)data->aocInfo.ppu) EQ 0) && data->aocInfo.acm NEQ '\0') { - //show only the units ACM + //show only the units ACM sprintf(line, "%ld", data->aocInfo.acm); TRACE_EVENT ("get only :ACM ; PPU ==0 and ACM!=0"); @@ -1370,43 +1357,43 @@ TRACE_EVENT ("calculate ACM * PPU; PPU !=0 and ACM!=0"); } - if (data->aocInfo.acm EQ '\0') - strcpy ((char *)line, "0"); + if (data->aocInfo.acm EQ '\0') + strcpy ((char *)line, "0"); - createAOCDialog( win, TxtTotalCharge, TxtNull, line, event); + createAOCDialog( win, TxtTotalCharge, TxtNull, line, event); - break; + break; - case SERVICES_RESET_CHARGE: + case SERVICES_RESET_CHARGE: - // clear the charge counter for all calls + // clear the charge counter for all calls data->aocInfo.acm = 0; - acm_last_call = 0; + acm_last_call = 0; - (void)cm_set_aoc_value(CM_AOC_ACM, &data->aocInfo, PWD); /* save ACM in AOC */ + (void)cm_set_aoc_value(CM_AOC_ACM, &data->aocInfo, PWD); /* save ACM in AOC */ - TRACE_EVENT_P1("%ld", data->aocInfo.acm); + TRACE_EVENT_P1("%ld", data->aocInfo.acm); SEND_EVENT (win, SERVICES_CHARGE_CHANGED, 0, 0); - break; + break; - case SERVICES_CHARGE_CHANGED: - createAOCDialog( win, TxtResetCharge, TxtNull, NULL, event); - break; - case SERVICES_OUT_OF_RANGE: + case SERVICES_CHARGE_CHANGED: + createAOCDialog( win, TxtResetCharge, TxtNull, NULL, event); + break; + case SERVICES_OUT_OF_RANGE: - TRACE_EVENT("SERVICES_OUT_OF_RANGE"); - createAOCDialog( win, TxtOutofRange, TxtNull, NULL, event); - break; + TRACE_EVENT("SERVICES_OUT_OF_RANGE"); + createAOCDialog( win, TxtOutofRange, TxtNull, NULL, event); + break; - case SERVICES_AOC_NOT_SUPPORTED: - TRACE_EVENT("SERVICES_NOT_ALLOWED"); - createAOCDialog( win, TxtNotAllowed, TxtNull, NULL, event); - break; + case SERVICES_AOC_NOT_SUPPORTED: + TRACE_EVENT("SERVICES_NOT_ALLOWED"); + createAOCDialog( win, TxtNotAllowed, TxtNull, NULL, event); + break; - } + } /* CQ13428 - NDH - Use dynamically allocated memory to prevent MMI Stack Overflow */ #ifdef NEW_EDITOR @@ -1420,9 +1407,9 @@ /******************************************************************************* - $Function: service_loadEditDefault + $Function: service_loadEditDefault - $Description: fill up editor-sttribut with default + $Description: fill up editor-sttribut with default $Returns: @@ -1433,36 +1420,36 @@ /* SPR#1428 - SH - New Editor changes */ void service_loadEditDefault (T_AUI_EDITOR_DATA *editor_data) { - TRACE_FUNCTION ("service_loadEditDefault()"); + TRACE_FUNCTION ("service_loadEditDefault()"); - AUI_edit_SetDefault(editor_data); - AUI_edit_SetDisplay(editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT); - AUI_edit_SetEvents(editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); - AUI_edit_SetTextStr(editor_data, TxtSoftSelect, TxtSoftBack, TxtNull, NULL); - AUI_edit_SetMode(editor_data, 0, ED_CURSOR_UNDERLINE); - AUI_edit_SetAltTextStr(editor_data, 1, TxtNull, FALSE, TxtNull); - return; + AUI_edit_SetDefault(editor_data); + AUI_edit_SetDisplay(editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT); + AUI_edit_SetEvents(editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); + AUI_edit_SetTextStr(editor_data, TxtSoftSelect, TxtSoftBack, TxtNull, NULL); + AUI_edit_SetMode(editor_data, 0, ED_CURSOR_UNDERLINE); + AUI_edit_SetAltTextStr(editor_data, 1, TxtNull, FALSE, TxtNull); + return; } #else /* NEW_EDITOR */ void service_loadEditDefault (T_EDITOR_DATA *editor_data) { - TRACE_FUNCTION ("service_loadEditDefault()"); + TRACE_FUNCTION ("service_loadEditDefault()"); - editor_attr_init(&editor_data->editor_attr, ZONE_SMALL_EDITOR, edtCurBar1, NULL, NULL, 0, COLOUR_EDITOR); - editor_data->editor_attr.font = 0; + editor_attr_init(&editor_data->editor_attr, ZONE_SMALL_EDITOR, edtCurBar1, NULL, NULL, 0, COLOUR_EDITOR); + editor_data->editor_attr.font = 0; - editor_data_init( editor_data, (T_EDIT_CB)service_editor_cb, TxtSoftSelect, TxtSoftBack, TxtNull, 1, DIGITS_MODE, FOREVER); - editor_data->hide = FALSE; - editor_data->destroyEditor = TRUE; - editor_data->AlternateLeftSoftKey = TxtNull; + editor_data_init( editor_data, (T_EDIT_CB)service_editor_cb, TxtSoftSelect, TxtSoftBack, TxtNull, 1, DIGITS_MODE, FOREVER); + editor_data->hide = FALSE; + editor_data->destroyEditor = TRUE; + editor_data->AlternateLeftSoftKey = TxtNull; } #endif /* NEW_EDITOR */ /******************************************************************************* - $Function: service_calc_balance + $Function: service_calc_balance - $Description: Calculate the Credit remaining + $Description: Calculate the Credit remaining $Returns: @@ -1472,7 +1459,7 @@ void service_calc_balance (T_MFW_HND win,char* line) { T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_SERVICES * data = (T_SERVICES *)win_data->user; + T_SERVICES * data = (T_SERVICES *)win_data->user; char line2[MAX_LINE]; @@ -1480,22 +1467,22 @@ LONG result; int ch = '.'; UBYTE counter=0; - if ((!win) || - (!win_data) || - (!data)) - { - TRACE_ERROR("service_calc_balance : Invalid Pointer passed"); - return; - } + if ((!win) || + (!win_data) || + (!data)) + { + TRACE_ERROR("service_calc_balance : Invalid Pointer passed"); + return; + } /*SPR 2500, chack validity of pointers before continuing*/ - if ((!win) || - (!win_data) || - (!data)) - { - TRACE_ERROR("service_calc_balance : Invalid Pointer passed"); - return; - } + if ((!win) || + (!win_data) || + (!data)) + { + TRACE_ERROR("service_calc_balance : Invalid Pointer passed"); + return; + } memset(line2,'\0',sizeof(line2)); @@ -1504,7 +1491,6 @@ cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ - /* Search for '.' */ pdest =(char *) strchr((char*) data->aocInfo.ppu, ch ); @@ -1576,11 +1562,11 @@ /******************************************************************************* - $Function: service_calculate + $Function: service_calculate - $Description: Calculate the value with price per unit and currency. + $Description: Calculate the value with price per unit and currency. - "value * PPU" @ currency + "value * PPU" @ currency $Returns: @@ -1592,7 +1578,7 @@ void service_calculate (T_MFW_HND win, char* line, long value) { T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_SERVICES * data = (T_SERVICES *)win_data->user; + T_SERVICES * data = (T_SERVICES *)win_data->user; char line2[MAX_LINE]; char *pdest,*src,*dst,*POINT; @@ -1601,13 +1587,13 @@ UBYTE counter=0; /*SPR2500, check validity of pinters before continuing*/ - if ((!win) || - (!win_data) || - (!data)) - { - TRACE_ERROR("service_calculate : Invalid Pointer passed"); - return; - } + if ((!win) || + (!win_data) || + (!data)) + { + TRACE_ERROR("service_calculate : Invalid Pointer passed"); + return; + } memset(line2,'\0',sizeof(line2)); @@ -1687,7 +1673,7 @@ #ifdef FF_CPHS /******************************************************************************* - $Function: setAOCflag + $Function: setAOCflag $Description: set the value to Aoc_flag variable @@ -1704,7 +1690,7 @@ /******************************************************************************* - $Function: getAOCflag + $Function: getAOCflag $Description: Rturns the value of variable Aoc_flag. @@ -1722,7 +1708,7 @@ /******************************************************************************* - $Function: service_check_pin_for_aoc + $Function: service_check_pin_for_aoc $Description: this function check the PIN 2 requirement & availability of AOC @@ -1733,96 +1719,96 @@ *******************************************************************************/ USHORT service_check_pin_for_aoc (void) { - T_MFW_AOC_ACCESS access; + T_MFW_AOC_ACCESS access; - /* check PIN 2 requirement & availability of AOC */ - sim_configuration (NULL, NULL, NULL, NULL, NULL, &access); + /* check PIN 2 requirement & availability of AOC */ + sim_configuration (NULL, NULL, NULL, NULL, NULL, &access); - TRACE_EVENT_P3("acm:%d acmmax:%d,puct:%d", access.access_acm,access.access_acmmax,access.access_puct); + TRACE_EVENT_P3("acm:%d acmmax:%d,puct:%d", access.access_acm,access.access_acmmax,access.access_puct); #ifdef FF_CPHS //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS //The 'Charge/Timers' menu should be displayed if CPHS is not supported. - if (CphsPresent() != TRUE) - { + if (CphsPresent() != TRUE) + { TRACE_EVENT("CPHS is not present in this SIM"); setAOCflag(TRUE); - } + } TRACE_EVENT_P1("Values: Aoc_flag = %d - 1 Indicates AOC is set in the CSP", getAOCflag()); TRACE_EVENT_P1("status : cphs_status = %d ", CphsPresent()); #endif - if (access.access_acm EQ MFW_SIM_PIN2 && - access.access_acmmax EQ MFW_SIM_PIN2 && - access.access_puct EQ MFW_SIM_PIN2) - { - TRACE_EVENT("PIN 2 required"); + if (access.access_acm EQ MFW_SIM_PIN2 && + access.access_acmmax EQ MFW_SIM_PIN2 && + access.access_puct EQ MFW_SIM_PIN2) + { + TRACE_EVENT("PIN 2 required"); //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS #ifdef FF_CPHS - if (getAOCflag()) - return MFW_SIM_PIN2_REQ; - else - return MFW_SIM_NO_AOC; - #else - return MFW_SIM_PIN2_REQ; + if (getAOCflag()) + return MFW_SIM_PIN2_REQ; + else + return MFW_SIM_NO_AOC; + #else + return MFW_SIM_PIN2_REQ; #endif - } - else if (access.access_acm EQ MFW_SIM_PIN1 && - access.access_acmmax EQ MFW_SIM_PIN1 && - access.access_puct EQ MFW_SIM_PIN1) - { - TRACE_EVENT("PIN 1 required"); + } + else if (access.access_acm EQ MFW_SIM_PIN1 && + access.access_acmmax EQ MFW_SIM_PIN1 && + access.access_puct EQ MFW_SIM_PIN1) + { + TRACE_EVENT("PIN 1 required"); //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS #ifdef FF_CPHS - if (getAOCflag()) - return MFW_SIM_PIN_REQ; - else - return MFW_SIM_NO_AOC; - #else - return MFW_SIM_PIN_REQ; + if (getAOCflag()) + return MFW_SIM_PIN_REQ; + else + return MFW_SIM_NO_AOC; + #else + return MFW_SIM_PIN_REQ; #endif - } - else if (access.access_acm EQ MFW_SIM_NO_PIN && - access.access_acmmax EQ MFW_SIM_NO_PIN && - access.access_puct EQ MFW_SIM_NO_PIN) - { - TRACE_EVENT("No PIN required"); + } + else if (access.access_acm EQ MFW_SIM_NO_PIN && + access.access_acmmax EQ MFW_SIM_NO_PIN && + access.access_puct EQ MFW_SIM_NO_PIN) + { + TRACE_EVENT("No PIN required"); //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS #ifdef FF_CPHS - if (getAOCflag()) - return MFW_SIM_NO_PIN; - else - return MFW_SIM_NO_AOC; - #else - return MFW_SIM_NO_PIN; + if (getAOCflag()) + return MFW_SIM_NO_PIN; + else + return MFW_SIM_NO_AOC; + #else + return MFW_SIM_NO_PIN; #endif - } - else if (access.access_acm EQ MFW_SIM_UNKNOWN && - access.access_acmmax EQ MFW_SIM_UNKNOWN && - access.access_puct EQ MFW_SIM_UNKNOWN) - { - TRACE_EVENT("AOC not supported"); - return MFW_SIM_FAILURE; - } + } + else if (access.access_acm EQ MFW_SIM_UNKNOWN && + access.access_acmmax EQ MFW_SIM_UNKNOWN && + access.access_puct EQ MFW_SIM_UNKNOWN) + { + TRACE_EVENT("AOC not supported"); + return MFW_SIM_FAILURE; + } //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS #ifdef FF_CPHS - else - { - TRACE_EVENT("AOC Else part"); - if (getAOCflag()) - return MFW_SIM_NO_PIN; - else - return MFW_SIM_NO_AOC; - } - #endif + else + { + TRACE_EVENT("AOC Else part"); + if (getAOCflag()) + return MFW_SIM_NO_PIN; + else + return MFW_SIM_NO_AOC; + } + #endif } /******************************************************************************* - $Function: service_check_aoc + $Function: service_check_aoc $Description: If there is no support for AOC on SIM card - the item "Charge Timers" will not Appear on the menulist + the item "Charge Timers" will not Appear on the menulist $Returns: @@ -1831,27 +1817,25 @@ *******************************************************************************/ USHORT service_check_aoc (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi) { - TRACE_FUNCTION("service_check_aoc"); + TRACE_FUNCTION("service_check_aoc"); - switch (service_check_pin_for_aoc ()) - { - case MFW_SIM_PIN2_REQ: - case MFW_SIM_PIN_REQ: - case MFW_SIM_NO_PIN: - TRACE_EVENT("AOC item visible"); - return 0; - /*break;*/ + switch (service_check_pin_for_aoc ()) + { + case MFW_SIM_PIN2_REQ: + case MFW_SIM_PIN_REQ: + case MFW_SIM_NO_PIN: + TRACE_EVENT("AOC item visible"); + return 0; + /*break;*/ - case MFW_SIM_FAILURE: + case MFW_SIM_FAILURE: //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS - #ifdef FF_CPHS - case MFW_SIM_NO_AOC: - TRACE_EVENT("service_check_aoc - AOC item not visible"); + #ifdef FF_CPHS + case MFW_SIM_NO_AOC: + TRACE_EVENT("service_check_aoc - AOC item not visible"); #endif - return 1; - /*break;*/ - } - return 1; + return 1; + /*break;*/ + } + return 1; } - -