FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiAoc.c @ 136:db101b57af2d
mmiAoc.c: bogotab fixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 14 Nov 2020 03:26:35 +0000 |
parents | c0052fe355d3 |
children |
comparison
equal
deleted
inserted
replaced
135:70ea7526b59e | 136:db101b57af2d |
---|---|
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: Basic MMI | 12 $Project name: Basic MMI |
13 $Project code: BMI (6349) | 13 $Project code: BMI (6349) |
14 $Module: Advice of Charge | 14 $Module: Advice of Charge |
15 $File: MmiVoiceMemo.c | 15 $File: MmiVoiceMemo.c |
16 $Revision: 1.0 | 16 $Revision: 1.0 |
17 | 17 |
18 $Author: Condat(UK) | 18 $Author: Condat(UK) |
19 $Date: 09/04/01 | 19 $Date: 09/04/01 |
20 | 20 |
21 ******************************************************************************** | 21 ******************************************************************************** |
22 | 22 |
23 Description: | 23 Description: |
24 | 24 |
25 This provides the start code for the MMI | 25 This provides the start code for the MMI |
26 | 26 |
27 ******************************************************************************** | 27 ******************************************************************************** |
28 $History: MmiAoc.c | 28 $History: MmiAoc.c |
29 May 26, 2006 ER: OMAPS00079607 x0012849 :Jagannatha M | 29 May 26, 2006 ER: OMAPS00079607 x0012849 :Jagannatha M |
30 Description: CPHS: Display 'charge/Timers' menu based on AOC ( Advice of charge ) | 30 Description: CPHS: Display 'charge/Timers' menu based on AOC ( Advice of charge ) |
31 Solution:Made the following changes | 31 Solution:Made the following changes |
32 1. Based on the value of Aoc_flag it will be decided to disply 'charge/Timers' menu or not. | 32 1. Based on the value of Aoc_flag it will be decided to disply 'charge/Timers' menu or not. |
33 | 33 |
34 June 16, 2005 REF: CRR 31267 x0021334 | 34 June 16, 2005 REF: CRR 31267 x0021334 |
35 Description: Handset ignore the initializtion of the PIN1/PIN2 | 35 Description: Handset ignore the initializtion of the PIN1/PIN2 |
36 Fix: Cheking is done to ascertain if PIN1/PIN2 are initialised. If not, appropriate | 36 Fix: Cheking is done to ascertain if PIN1/PIN2 are initialised. If not, appropriate |
37 message is displayed to the user. | 37 message is displayed to the user. |
38 | 38 |
39 09/04/01 Original Condat(UK) BMI version. | 39 09/04/01 Original Condat(UK) BMI version. |
40 May 25, 2004 REF: CRR MMI-SPR-17588 NISHIKANT KULKARNI | 40 May 25, 2004 REF: CRR MMI-SPR-17588 NISHIKANT KULKARNI |
41 Issue description: On the SIM EF(ACMMax) is defined as 0xFFFFFF, so it should be possible to | 41 Issue description: On the SIM EF(ACMMax) is defined as 0xFFFFFF, so it should be possible to |
42 enter 16777215, but only 999999 is accepted. | 42 enter 16777215, but only 999999 is accepted. |
43 Solution: MAX_ENTER_LIMIT changed from 7 to 9. A check is done to verify that the entered | 43 Solution: MAX_ENTER_LIMIT changed from 7 to 9. A check is done to verify that the entered |
44 ACMmax value is less that 0xFFFFFF. Otherwise "Not Allowed" message is displayed. | 44 ACMmax value is less that 0xFFFFFF. Otherwise "Not Allowed" message is displayed. |
45 | 45 |
46 $End | 46 $End |
47 | 47 |
48 *******************************************************************************/ | 48 *******************************************************************************/ |
49 | |
50 | 49 |
51 | 50 |
52 | 51 |
53 /******************************************************************************* | 52 /******************************************************************************* |
54 | 53 |
137 // Added this BOOL variable to keep track of PIN2 requests. | 136 // Added this BOOL variable to keep track of PIN2 requests. |
138 BOOL pin2Flag = FALSE; | 137 BOOL pin2Flag = FALSE; |
139 | 138 |
140 | 139 |
141 /******************************************************************************* | 140 /******************************************************************************* |
142 Local Data | 141 Local Data |
143 | 142 |
144 *******************************************************************************/ | 143 *******************************************************************************/ |
145 #define PIN_REQUEST_FOR_RATE 700 | 144 #define PIN_REQUEST_FOR_RATE 700 |
146 #define SERVICES_ENTER_CURRENCY 701 | 145 #define SERVICES_ENTER_CURRENCY 701 |
147 #define SERVICES_ONE_UNIT 702 | 146 #define SERVICES_ONE_UNIT 702 |
148 #define SERVICES_RATE_CHANGED 703 | 147 #define SERVICES_RATE_CHANGED 703 |
149 #define SERVICES_CREDIT_REMAINING 704 | 148 #define SERVICES_CREDIT_REMAINING 704 |
150 #define PIN_REQUEST_FOR_LIMIT_CHANGE 705 | 149 #define PIN_REQUEST_FOR_LIMIT_CHANGE 705 |
151 #define PIN_REQUEST_FOR_LIMIT_CANCEL 706 | 150 #define PIN_REQUEST_FOR_LIMIT_CANCEL 706 |
152 #define SERVICES_LIMIT_VIEW 707 | 151 #define SERVICES_LIMIT_VIEW 707 |
153 #define SERVICES_LIMIT_CHANGE 708 | 152 #define SERVICES_LIMIT_CHANGE 708 |
154 #define SERVICES_LIMIT_CANCEL 709 | 153 #define SERVICES_LIMIT_CANCEL 709 |
155 #define SERVICES_LIMIT_CHANGED 710 | 154 #define SERVICES_LIMIT_CHANGED 710 |
156 #define SERVICES_LAST_CHARGE 711 | 155 #define SERVICES_LAST_CHARGE 711 |
157 #define SERVICES_TOTAL_CHARGE 712 | 156 #define SERVICES_TOTAL_CHARGE 712 |
158 #define SERVICES_RESET_CHARGE 713 | 157 #define SERVICES_RESET_CHARGE 713 |
159 #define SERVICES_CHARGE_CHANGED 714 | 158 #define SERVICES_CHARGE_CHANGED 714 |
160 #define SERVICES_OUT_OF_RANGE 715 | 159 #define SERVICES_OUT_OF_RANGE 715 |
161 #define SERVICES_AOC_NOT_SUPPORTED 716 | 160 #define SERVICES_AOC_NOT_SUPPORTED 716 |
162 #define PIN_REQUEST_FOR_RESET_CHARGE 717 | 161 #define PIN_REQUEST_FOR_RESET_CHARGE 717 |
163 | 162 |
164 /* May 25, 2004 REF: CRR MMI-SPR-17588 NISHIKANT KULKARNI | 163 /* May 25, 2004 REF: CRR MMI-SPR-17588 NISHIKANT KULKARNI |
165 MAX_ENTER_LIMIT changed from 7 to 9 to accept "Limit" values till 16777215 (0xFFFFFF) | 164 MAX_ENTER_LIMIT changed from 7 to 9 to accept "Limit" values till 16777215 (0xFFFFFF) |
166 Previously, with MAX_ENTER_LIMIT set to 7, maximum 999999 could be entered as limit. | 165 Previously, with MAX_ENTER_LIMIT set to 7, maximum 999999 could be entered as limit. |
167 Effectively, the limit is MAX_ENTER_LIMIT - 1. The last character used for string termination. | 166 Effectively, the limit is MAX_ENTER_LIMIT - 1. The last character used for string termination. |
168 Also, the maximum value that can be entered (0xFFFFFF) is # defined to MAX_ENTER_VALUE | 167 Also, the maximum value that can be entered (0xFFFFFF) is # defined to MAX_ENTER_VALUE |
169 */ | 168 */ |
170 /* Max. Enter of Character */ | 169 /* Max. Enter of Character */ |
171 #define MAX_ENTER_LIMIT 9 // xnkulkar SPR-17588 | 170 #define MAX_ENTER_LIMIT 9 // xnkulkar SPR-17588 |
172 #define MAX_ENTER_CURRENCY 4 | 171 #define MAX_ENTER_CURRENCY 4 |
173 #define MAX_ENTER_UNIT 6 | 172 #define MAX_ENTER_UNIT 6 |
174 #define MAX_ENTER_VALUE 0xFFFFFF // xnkulkar SPR-17588 | 173 #define MAX_ENTER_VALUE 0xFFFFFF // xnkulkar SPR-17588 |
175 /* */ | 174 /* */ |
176 | 175 |
177 | 176 |
178 | |
179 typedef struct | 177 typedef struct |
180 { | 178 { |
181 T_MMI_CONTROL mmi_control; | 179 T_MMI_CONTROL mmi_control; |
182 T_MFW_HND service_win; /* MFW win handler */ | 180 T_MFW_HND service_win; /* MFW win handler */ |
183 T_MFW_CM_AOC_INFO aocInfo; | 181 T_MFW_CM_AOC_INFO aocInfo; |
184 USHORT Identifier; | 182 USHORT Identifier; |
185 char edt_Buf[30]; /* Editor buffer */ | 183 char edt_Buf[30]; /* Editor buffer */ |
186 } T_SERVICES; | 184 } T_SERVICES; |
187 | |
188 | |
189 | 185 |
190 | 186 |
191 LONG acm_last_call = 0; //accumulated call meter from the last call | 187 LONG acm_last_call = 0; //accumulated call meter from the last call |
192 //later the value should save and read again from PCM | 188 //later the value should save and read again from PCM |
193 | 189 |
195 #ifdef FF_CPHS | 191 #ifdef FF_CPHS |
196 static UBYTE Aoc_flag = FALSE; | 192 static UBYTE Aoc_flag = FALSE; |
197 #endif | 193 #endif |
198 | 194 |
199 /******************************************************************************* | 195 /******************************************************************************* |
200 Local prototypes | 196 Local prototypes |
201 | 197 |
202 *******************************************************************************/ | 198 *******************************************************************************/ |
203 T_MFW_HND service_Init (T_MFW_HND parent_window); | 199 T_MFW_HND service_Init (T_MFW_HND parent_window); |
204 void service_Exit (T_MFW_HND own_window); | 200 void service_Exit (T_MFW_HND own_window); |
205 T_MFW_HND service_create (T_MFW_HND parent_window); | 201 T_MFW_HND service_create (T_MFW_HND parent_window); |
206 void service_destroy (T_MFW_HND own_window); | 202 void service_destroy (T_MFW_HND own_window); |
207 static int service_win_cb (T_MFW_EVENT event, T_MFW_WIN * win); | 203 static int service_win_cb (T_MFW_EVENT event, T_MFW_WIN * win); |
208 void service_dialog_cb (T_MFW_HND win, USHORT identifier, UBYTE reason); | 204 void service_dialog_cb (T_MFW_HND win, USHORT identifier, UBYTE reason); |
209 void service (T_MFW_HND win, USHORT event, SHORT value, void * parameter); | 205 void service (T_MFW_HND win, USHORT event, SHORT value, void * parameter); |
210 /* SPR#1428 - SH - New Editor changes */ | 206 /* SPR#1428 - SH - New Editor changes */ |
211 #ifdef NEW_EDITOR | 207 #ifdef NEW_EDITOR |
212 void service_loadEditDefault (T_AUI_EDITOR_DATA *editor_data); | 208 void service_loadEditDefault (T_AUI_EDITOR_DATA *editor_data); |
213 #else /* NEW_EDITOR */ | 209 #else /* NEW_EDITOR */ |
214 void service_loadEditDefault (T_EDITOR_DATA *editor_data); | 210 void service_loadEditDefault (T_EDITOR_DATA *editor_data); |
215 #endif /* NEW_EDITOR */ | 211 #endif /* NEW_EDITOR */ |
216 void service_calc_balance (T_MFW_HND win,char* line); | 212 void service_calc_balance (T_MFW_HND win,char* line); |
217 void service_calculate (T_MFW_HND win, char* line, long value); | 213 void service_calculate (T_MFW_HND win, char* line, long value); |
218 USHORT service_check_pin_for_aoc (void); | 214 USHORT service_check_pin_for_aoc (void); |
219 //ADDED BY RAVI-29-11-2005 | 215 //ADDED BY RAVI-29-11-2005 |
220 extern T_MFW_HND AUI_calc_Start(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data); | 216 extern T_MFW_HND AUI_calc_Start(T_MFW_HND parent, T_AUI_EDITOR_DATA *editor_data); |
221 // END RAVI | 217 // END RAVI |
222 | 218 |
223 /******************************************************************************* | 219 /******************************************************************************* |
224 Functions | 220 Functions |
225 | 221 |
226 *******************************************************************************/ | 222 *******************************************************************************/ |
227 | 223 |
228 /******************************************************************************* | 224 /******************************************************************************* |
229 | 225 |
230 $Function: aoc_credit_remaining | 226 $Function: aoc_credit_remaining |
231 | 227 |
232 $Description: | 228 $Description: |
233 | 229 |
234 $Returns: | 230 $Returns: |
235 | 231 |
239 | 235 |
240 int aoc_credit_remaining (MfwMnu* m, MfwMnuItem* i) | 236 int aoc_credit_remaining (MfwMnu* m, MfwMnuItem* i) |
241 { | 237 { |
242 T_MFW_HND win = mfw_parent(mfw_header()); | 238 T_MFW_HND win = mfw_parent(mfw_header()); |
243 | 239 |
244 TRACE_FUNCTION("aoc_credit_remaining"); | 240 TRACE_FUNCTION("aoc_credit_remaining"); |
245 | 241 |
246 // create new dynamic dialog for the AOC | 242 // create new dynamic dialog for the AOC |
247 SEND_EVENT (service_Init (win), SERVICES_CREDIT_REMAINING, 0, 0); | 243 SEND_EVENT (service_Init (win), SERVICES_CREDIT_REMAINING, 0, 0); |
248 | 244 |
249 | 245 |
250 return 0; | 246 return 0; |
251 } | 247 } |
252 | 248 |
253 | 249 |
254 | 250 |
255 /******************************************************************************* | 251 /******************************************************************************* |
256 | 252 |
257 $Function: aoc_charge_rate | 253 $Function: aoc_charge_rate |
258 | 254 |
259 $Description: A security code editing screen is opened and Pin 2 requested. | 255 $Description: A security code editing screen is opened and Pin 2 requested. |
260 Once entered successfully, an alpha. editor is opened with the | 256 Once entered successfully, an alpha. editor is opened with the |
261 title "Enter currency".Once entered, an numeric editor is opened | 257 title "Enter currency".Once entered, an numeric editor is opened |
262 with the title "Enter price p. unit". When the user has finished | 258 with the title "Enter price p. unit". When the user has finished |
263 entry the information screen " Rate changed" is displayed for | 259 entry the information screen " Rate changed" is displayed for |
264 3 second and the phone returns to the previous sub-menu | 260 3 second and the phone returns to the previous sub-menu |
265 $Returns: | 261 $Returns: |
266 | 262 |
267 $Arguments: | 263 $Arguments: |
268 | 264 |
269 *******************************************************************************/ | 265 *******************************************************************************/ |
271 | 267 |
272 int aoc_charge_rate (MfwMnu* m, MfwMnuItem* i) | 268 int aoc_charge_rate (MfwMnu* m, MfwMnuItem* i) |
273 { | 269 { |
274 T_MFW_HND win = mfw_parent(mfw_header()); | 270 T_MFW_HND win = mfw_parent(mfw_header()); |
275 | 271 |
276 TRACE_FUNCTION("aoc_charge_rate"); | 272 TRACE_FUNCTION("aoc_charge_rate"); |
277 | 273 |
278 switch (service_check_pin_for_aoc ()) | 274 switch (service_check_pin_for_aoc ()) |
279 { | 275 { |
280 case MFW_SIM_PIN2_REQ: | 276 case MFW_SIM_PIN2_REQ: |
281 // June 16, 2005 REF: CRR 31267 x0021334 | 277 // June 16, 2005 REF: CRR 31267 x0021334 |
282 pin2Flag = TRUE; | 278 pin2Flag = TRUE; |
283 // create new dynamic dialog for the AOC | 279 // create new dynamic dialog for the AOC |
284 SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_RATE, 0, 0); | 280 SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_RATE, 0, 0); |
285 break; | 281 break; |
286 | 282 |
287 case MFW_SIM_PIN_REQ: | 283 case MFW_SIM_PIN_REQ: |
288 case MFW_SIM_NO_PIN: | 284 case MFW_SIM_NO_PIN: |
289 //pin 1 or no pin required, open now the editor for entering the currency | 285 //pin 1 or no pin required, open now the editor for entering the currency |
290 SEND_EVENT (service_Init (win), SERVICES_ENTER_CURRENCY, 0, 0); | 286 SEND_EVENT (service_Init (win), SERVICES_ENTER_CURRENCY, 0, 0); |
291 break; | 287 break; |
292 | 288 |
293 } | 289 } |
294 | 290 |
295 return 0; | 291 return 0; |
296 } | 292 } |
297 | 293 |
298 | 294 |
299 | 295 /******************************************************************************* |
300 /******************************************************************************* | 296 |
301 | 297 $Function: aoc_view_limit |
302 $Function: aoc_view_limit | |
303 | 298 |
304 $Description: | 299 $Description: |
305 | 300 |
306 $Returns: | 301 $Returns: |
307 | 302 |
312 | 307 |
313 int aoc_view_limit (MfwMnu* m, MfwMnuItem* i) | 308 int aoc_view_limit (MfwMnu* m, MfwMnuItem* i) |
314 { | 309 { |
315 T_MFW_HND win = mfw_parent(mfw_header()); | 310 T_MFW_HND win = mfw_parent(mfw_header()); |
316 | 311 |
317 TRACE_FUNCTION("aoc_view_limit");/*SPR2500*/ | 312 TRACE_FUNCTION("aoc_view_limit");/*SPR2500*/ |
318 | 313 |
319 | 314 |
320 // create new dynamic dialog for the AOC | 315 // create new dynamic dialog for the AOC |
321 SEND_EVENT (service_Init (win), SERVICES_LIMIT_VIEW, 0, 0); | 316 SEND_EVENT (service_Init (win), SERVICES_LIMIT_VIEW, 0, 0); |
322 | 317 |
323 return 0; | 318 return 0; |
324 } | 319 } |
325 | 320 |
326 | 321 |
327 /******************************************************************************* | 322 /******************************************************************************* |
328 | 323 |
329 $Function: aoc_change_limit | 324 $Function: aoc_change_limit |
330 | 325 |
331 $Description: | 326 $Description: |
332 | 327 |
333 $Returns: | 328 $Returns: |
334 | 329 |
339 | 334 |
340 int aoc_change_limit (MfwMnu* m, MfwMnuItem* i) | 335 int aoc_change_limit (MfwMnu* m, MfwMnuItem* i) |
341 { | 336 { |
342 T_MFW_HND win = mfw_parent(mfw_header()); | 337 T_MFW_HND win = mfw_parent(mfw_header()); |
343 | 338 |
344 TRACE_FUNCTION("aoc_change_limit"); | 339 TRACE_FUNCTION("aoc_change_limit"); |
345 | 340 |
346 /*SPR#1904 - DS - Added call to service_check_pin_for_aoc() to check if | 341 /*SPR#1904 - DS - Added call to service_check_pin_for_aoc() to check if |
347 *PIN2 entry is required. | 342 *PIN2 entry is required. |
348 */ | 343 */ |
349 switch (service_check_pin_for_aoc ()) | 344 switch (service_check_pin_for_aoc ()) |
350 { | 345 { |
351 case MFW_SIM_PIN2_REQ: | 346 case MFW_SIM_PIN2_REQ: |
352 // June 16, 2005 REF: CRR 31267 x0021334 | 347 // June 16, 2005 REF: CRR 31267 x0021334 |
353 pin2Flag = TRUE; | 348 pin2Flag = TRUE; |
354 // create new dynamic dialog for the AOC | 349 // create new dynamic dialog for the AOC |
355 SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_LIMIT_CHANGE, 0, 0); | 350 SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_LIMIT_CHANGE, 0, 0); |
356 break; | 351 break; |
357 | 352 |
358 case MFW_SIM_PIN_REQ: | 353 case MFW_SIM_PIN_REQ: |
359 case MFW_SIM_NO_PIN: | 354 case MFW_SIM_NO_PIN: |
360 //pin 1 or no pin required, open now the editor for entering the currency | 355 //pin 1 or no pin required, open now the editor for entering the currency |
361 SEND_EVENT (service_Init (win), SERVICES_LIMIT_CHANGE, 0, 0); | 356 SEND_EVENT (service_Init (win), SERVICES_LIMIT_CHANGE, 0, 0); |
362 break; | 357 break; |
363 | 358 |
364 } | 359 } |
365 | 360 |
366 return 0; | 361 return 0; |
367 } | 362 } |
368 | 363 |
369 | 364 |
370 /******************************************************************************* | 365 /******************************************************************************* |
371 | 366 |
372 $Function: aoc_cancel_limit | 367 $Function: aoc_cancel_limit |
373 | 368 |
374 $Description: | 369 $Description: |
375 | 370 |
376 $Returns: | 371 $Returns: |
377 | 372 |
382 | 377 |
383 int aoc_cancel_limit (MfwMnu* m, MfwMnuItem* i) | 378 int aoc_cancel_limit (MfwMnu* m, MfwMnuItem* i) |
384 { | 379 { |
385 T_MFW_HND win = mfw_parent(mfw_header()); | 380 T_MFW_HND win = mfw_parent(mfw_header()); |
386 | 381 |
387 TRACE_FUNCTION("aoc_charge_rate"); | 382 TRACE_FUNCTION("aoc_charge_rate"); |
388 | 383 |
389 /*SPR#1904 - DS - Added call to service_check_pin_for_aoc() to check if | 384 /*SPR#1904 - DS - Added call to service_check_pin_for_aoc() to check if |
390 *PIN2 entry is required. | 385 *PIN2 entry is required. |
391 */ | 386 */ |
392 switch (service_check_pin_for_aoc ()) | 387 switch (service_check_pin_for_aoc ()) |
393 { | 388 { |
394 case MFW_SIM_PIN2_REQ: | 389 case MFW_SIM_PIN2_REQ: |
395 // June 16, 2005 REF: CRR 31267 x0021334 | 390 // June 16, 2005 REF: CRR 31267 x0021334 |
396 pin2Flag = TRUE; | 391 pin2Flag = TRUE; |
397 // create new dynamic dialog for the AOC | 392 // create new dynamic dialog for the AOC |
398 SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_LIMIT_CANCEL, 0, 0); | 393 SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_LIMIT_CANCEL, 0, 0); |
399 break; | 394 break; |
400 | 395 |
401 case MFW_SIM_PIN_REQ: | 396 case MFW_SIM_PIN_REQ: |
402 case MFW_SIM_NO_PIN: | 397 case MFW_SIM_NO_PIN: |
403 //pin 1 or no pin required, open now the editor for entering the currency | 398 //pin 1 or no pin required, open now the editor for entering the currency |
404 SEND_EVENT (service_Init (win), SERVICES_LIMIT_CANCEL, 0, 0); | 399 SEND_EVENT (service_Init (win), SERVICES_LIMIT_CANCEL, 0, 0); |
405 break; | 400 break; |
406 | 401 |
407 } | 402 } |
408 | 403 |
409 return 0; | 404 return 0; |
410 } | 405 } |
411 | 406 |
412 /******************************************************************************* | 407 /******************************************************************************* |
413 | 408 |
414 $Function: aoc_last_charge | 409 $Function: aoc_last_charge |
415 | 410 |
416 $Description: Dispays the charge for the last call in the currency or in units | 411 $Description: Dispays the charge for the last call in the currency or in units |
417 if no currency information has been entered | 412 if no currency information has been entered |
418 | 413 |
419 $Returns: | 414 $Returns: |
420 | 415 |
421 $Arguments: | 416 $Arguments: |
425 | 420 |
426 int aoc_last_charge (MfwMnu* m, MfwMnuItem* i) | 421 int aoc_last_charge (MfwMnu* m, MfwMnuItem* i) |
427 { | 422 { |
428 T_MFW_HND win = mfw_parent(mfw_header()); | 423 T_MFW_HND win = mfw_parent(mfw_header()); |
429 | 424 |
430 TRACE_FUNCTION("aoc_last_charge"); /*SPR2500*/ | 425 TRACE_FUNCTION("aoc_last_charge"); /*SPR2500*/ |
431 | 426 |
432 // create new dynamic dialog for the AOC | 427 // create new dynamic dialog for the AOC |
433 SEND_EVENT (service_Init (win), SERVICES_LAST_CHARGE, 0, 0); | 428 SEND_EVENT (service_Init (win), SERVICES_LAST_CHARGE, 0, 0); |
434 | 429 |
435 | 430 |
436 return 0; | 431 return 0; |
437 } | 432 } |
438 | 433 |
439 /******************************************************************************* | 434 /******************************************************************************* |
440 | 435 |
441 $Function: aoc_total_charge | 436 $Function: aoc_total_charge |
442 | 437 |
443 $Description: Displays the charge for all calls since the chage counter was last reset | 438 $Description: Displays the charge for all calls since the chage counter was last reset |
444 | 439 |
445 $Returns: | 440 $Returns: |
446 | 441 |
447 $Arguments: | 442 $Arguments: |
448 | 443 |
451 | 446 |
452 int aoc_total_charge (MfwMnu* m, MfwMnuItem* i) | 447 int aoc_total_charge (MfwMnu* m, MfwMnuItem* i) |
453 { | 448 { |
454 T_MFW_HND win = mfw_parent(mfw_header()); | 449 T_MFW_HND win = mfw_parent(mfw_header()); |
455 | 450 |
456 TRACE_FUNCTION("aoc_total_charge");/*SPR2500*/ | 451 TRACE_FUNCTION("aoc_total_charge");/*SPR2500*/ |
457 | 452 |
458 | 453 |
459 // create new dynamic dialog for the AOC | 454 // create new dynamic dialog for the AOC |
460 SEND_EVENT (service_Init (win), SERVICES_TOTAL_CHARGE, 0, 0); | 455 SEND_EVENT (service_Init (win), SERVICES_TOTAL_CHARGE, 0, 0); |
461 | 456 |
462 | 457 |
463 return 0; | 458 return 0; |
464 } | 459 } |
465 /******************************************************************************* | 460 /******************************************************************************* |
466 | 461 |
467 $Function: aoc_reset_charge | 462 $Function: aoc_reset_charge |
468 | 463 |
469 $Description: Resets the charge counter for all calls | 464 $Description: Resets the charge counter for all calls |
470 | 465 |
471 $Returns: | 466 $Returns: |
472 | 467 |
473 $Arguments: | 468 $Arguments: |
474 | 469 |
477 | 472 |
478 int aoc_reset_charge (MfwMnu* m, MfwMnuItem* i) | 473 int aoc_reset_charge (MfwMnu* m, MfwMnuItem* i) |
479 { | 474 { |
480 T_MFW_HND win = mfw_parent(mfw_header()); | 475 T_MFW_HND win = mfw_parent(mfw_header()); |
481 | 476 |
482 TRACE_FUNCTION("aoc_reset_charge");/*SPR2500*/ | 477 TRACE_FUNCTION("aoc_reset_charge");/*SPR2500*/ |
483 | 478 |
484 | 479 |
485 switch (service_check_pin_for_aoc ()) | 480 switch (service_check_pin_for_aoc ()) |
486 { | 481 { |
487 case MFW_SIM_PIN2_REQ: | 482 case MFW_SIM_PIN2_REQ: |
488 // June 16, 2005 REF: CRR 31267 x0021334 | 483 // June 16, 2005 REF: CRR 31267 x0021334 |
489 pin2Flag = TRUE; | 484 pin2Flag = TRUE; |
490 // create new dynamic dialog for the AOC | 485 // create new dynamic dialog for the AOC |
491 SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_RESET_CHARGE, 0, 0); | 486 SEND_EVENT (service_Init (win), PIN_REQUEST_FOR_RESET_CHARGE, 0, 0); |
492 break; | 487 break; |
493 | 488 |
494 case MFW_SIM_PIN_REQ: | 489 case MFW_SIM_PIN_REQ: |
497 SEND_EVENT (service_Init (win), SERVICES_RESET_CHARGE, 0, 0); | 492 SEND_EVENT (service_Init (win), SERVICES_RESET_CHARGE, 0, 0); |
498 | 493 |
499 break; | 494 break; |
500 } | 495 } |
501 | 496 |
502 return 0; | 497 return 0; |
503 } | 498 } |
504 | 499 |
505 | 500 |
506 | 501 /******************************************************************************* |
507 | 502 |
508 | 503 $Function: service_Init |
509 | |
510 /******************************************************************************* | |
511 | |
512 $Function: service_Init | |
513 | 504 |
514 $Description: | 505 $Description: |
515 | 506 |
516 $Returns: | 507 $Returns: |
517 | 508 |
524 } | 515 } |
525 | 516 |
526 | 517 |
527 /******************************************************************************* | 518 /******************************************************************************* |
528 | 519 |
529 $Function: service_Exit | 520 $Function: service_Exit |
530 | 521 |
531 $Description: | 522 $Description: |
532 | 523 |
533 $Returns: | 524 $Returns: |
534 | 525 |
539 { | 530 { |
540 | 531 |
541 T_MFW_WIN * win_data = ((T_MFW_HDR *)own_window)->data; | 532 T_MFW_WIN * win_data = ((T_MFW_HDR *)own_window)->data; |
542 T_SERVICES * data = (T_SERVICES *)win_data->user; | 533 T_SERVICES * data = (T_SERVICES *)win_data->user; |
543 | 534 |
544 TRACE_FUNCTION("service_Exit"); | 535 TRACE_FUNCTION("service_Exit"); |
545 /*SPR 2500, check valid window pointer before destruction*/ | 536 /*SPR 2500, check valid window pointer before destruction*/ |
546 if ((own_window) && | 537 if ((own_window) && |
547 (win_data) && | 538 (win_data) && |
548 (data) && | 539 (data) && |
549 (data->service_win)) | 540 (data->service_win)) |
550 { | 541 { |
551 service_destroy (data->service_win); | 542 service_destroy (data->service_win); |
552 } | 543 } |
553 else | 544 else |
554 { | 545 { |
555 TRACE_ERROR("service_Exit : Invalid Pointer passed"); | 546 TRACE_ERROR("service_Exit : Invalid Pointer passed"); |
556 } | 547 } |
557 | 548 |
558 return; | 549 return; |
559 | 550 |
560 } | 551 } |
561 | 552 |
562 /******************************************************************************* | 553 /******************************************************************************* |
563 | 554 |
564 $Function: service_create | 555 $Function: service_create |
565 | 556 |
566 $Description: | 557 $Description: |
567 | 558 |
568 $Returns: | 559 $Returns: |
569 | 560 |
599 return data->service_win; | 590 return data->service_win; |
600 } | 591 } |
601 | 592 |
602 /******************************************************************************* | 593 /******************************************************************************* |
603 | 594 |
604 $Function: service_destroy | 595 $Function: service_destroy |
605 | 596 |
606 $Description: | 597 $Description: |
607 | 598 |
608 $Returns: | 599 $Returns: |
609 | 600 |
629 * Delete WIN handler | 620 * Delete WIN handler |
630 */ | 621 */ |
631 win_delete (data->service_win); | 622 win_delete (data->service_win); |
632 data->service_win = 0; | 623 data->service_win = 0; |
633 | 624 |
634 FREE_MEMORY ((void *)data, sizeof (T_SERVICES)); | 625 FREE_MEMORY ((void *)data, sizeof (T_SERVICES)); |
635 | 626 |
636 } | 627 } |
637 } | 628 } |
638 } | 629 } |
639 /******************************************************************************* | 630 /******************************************************************************* |
640 | 631 |
641 $Function: service_win_cb | 632 $Function: service_win_cb |
642 | 633 |
643 $Description: | 634 $Description: |
644 | 635 |
645 $Returns: | 636 $Returns: |
646 | 637 |
655 return 1; | 646 return 1; |
656 } | 647 } |
657 | 648 |
658 /******************************************************************************* | 649 /******************************************************************************* |
659 | 650 |
660 $Function: service_dialog_cb | 651 $Function: service_dialog_cb |
661 | 652 |
662 $Description: | 653 $Description: |
663 | 654 |
664 $Returns: | 655 $Returns: |
665 | 656 |
666 $Arguments: | 657 $Arguments: |
667 | 658 |
668 *******************************************************************************/ | 659 *******************************************************************************/ |
669 void service_dialog_cb(T_MFW_HND win, USHORT identifier, UBYTE reason) | 660 void service_dialog_cb(T_MFW_HND win, USHORT identifier, UBYTE reason) |
670 { | 661 { |
671 TRACE_FUNCTION ("service_dialog_cb()"); | 662 TRACE_FUNCTION ("service_dialog_cb()"); |
672 | 663 |
673 switch (reason) | 664 switch (reason) |
674 { | 665 { |
675 case INFO_KCD_LEFT: | 666 case INFO_KCD_LEFT: |
676 /* no break; */ | 667 /* no break; */ |
680 /* no break; */ | 671 /* no break; */ |
681 case INFO_KCD_RIGHT: | 672 case INFO_KCD_RIGHT: |
682 /* no break; */ | 673 /* no break; */ |
683 case INFO_KCD_CLEAR: | 674 case INFO_KCD_CLEAR: |
684 | 675 |
685 TRACE_EVENT_P1("identifier: %d", identifier); | 676 TRACE_EVENT_P1("identifier: %d", identifier); |
686 | 677 |
687 if (identifier EQ SERVICES_OUT_OF_RANGE) | 678 if (identifier EQ SERVICES_OUT_OF_RANGE) |
688 { | 679 { |
689 TRACE_EVENT ("SERVICES_OUT_OF_RANGE"); | 680 TRACE_EVENT ("SERVICES_OUT_OF_RANGE"); |
690 SEND_EVENT (win, SERVICES_ONE_UNIT, 0, 0); | 681 SEND_EVENT (win, SERVICES_ONE_UNIT, 0, 0); |
691 } | 682 } |
692 else | 683 else |
693 { | 684 { |
694 TRACE_EVENT (" destroy "); | 685 TRACE_EVENT (" destroy "); |
695 service_Exit(win); | 686 service_Exit(win); |
696 } | 687 } |
697 break; | 688 break; |
698 } | 689 } |
699 } | 690 } |
700 | 691 |
701 /******************************************************************************* | 692 /******************************************************************************* |
702 | 693 |
703 $Function: service_editor_cb | 694 $Function: service_editor_cb |
704 | 695 |
705 $Description: | 696 $Description: |
706 | 697 |
707 $Returns: | 698 $Returns: |
708 | 699 |
710 | 701 |
711 *******************************************************************************/ | 702 *******************************************************************************/ |
712 | 703 |
713 static void service_editor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason) | 704 static void service_editor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason) |
714 { | 705 { |
715 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | 706 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; |
716 T_SERVICES * data = (T_SERVICES *)win_data->user; | 707 T_SERVICES * data = (T_SERVICES *)win_data->user; |
717 | 708 |
718 | 709 |
719 UBYTE PWD[16], i; | 710 UBYTE PWD[16], i; |
720 int result; | 711 int result; |
721 | 712 |
722 TRACE_FUNCTION ("service_editor_cb()"); | 713 TRACE_FUNCTION ("service_editor_cb()"); |
723 /*SPR 2500, check pointers valid*/ | 714 /*SPR 2500, check pointers valid*/ |
724 if ((!win) || | 715 if ((!win) || |
725 (!win_data) || | 716 (!win_data) || |
726 (!data)) | 717 (!data)) |
727 { | 718 { |
728 TRACE_ERROR("service_editor_cb : Invalid Pointer passed"); | 719 TRACE_ERROR("service_editor_cb : Invalid Pointer passed"); |
729 return; | 720 return; |
730 } | 721 } |
731 | 722 |
732 if ((!win) || | 723 if ((!win) || |
733 (!win_data) || | 724 (!win_data) || |
734 (!data)) | 725 (!data)) |
735 { | 726 { |
736 TRACE_ERROR("service_editor_cb : Invalid Pointer passed"); | 727 TRACE_ERROR("service_editor_cb : Invalid Pointer passed"); |
737 return; | 728 return; |
738 } | 729 } |
739 | 730 |
740 memset(PWD, 0x00, 16); | 731 memset(PWD, 0x00, 16); |
741 | 732 |
742 switch (reason) | 733 switch (reason) |
743 { | 734 { |
744 case INFO_KCD_LEFT: | 735 case INFO_KCD_LEFT: |
745 switch (Identifier) | 736 switch (Identifier) |
746 { | 737 { |
747 case SERVICES_ENTER_CURRENCY: | 738 case SERVICES_ENTER_CURRENCY: |
748 TRACE_EVENT ("SERVICES_ENTER_CURRENCY"); | 739 TRACE_EVENT ("SERVICES_ENTER_CURRENCY"); |
749 TRACE_EVENT ("pressed left"); | 740 TRACE_EVENT ("pressed left"); |
750 | 741 |
751 | 742 |
752 // clear old current currency before overwrite it | 743 // clear old current currency before overwrite it |
753 memset(data->aocInfo.cur, 0x80, sizeof(data->aocInfo.cur)); | 744 memset(data->aocInfo.cur, 0x80, sizeof(data->aocInfo.cur)); |
754 | 745 |
755 if(strlen(data->edt_Buf) NEQ 0) | 746 if(strlen(data->edt_Buf) NEQ 0) |
756 { | 747 { |
757 memcpy(data->aocInfo.cur, data->edt_Buf, MAX_ENTER_CURRENCY); | 748 memcpy(data->aocInfo.cur, data->edt_Buf, MAX_ENTER_CURRENCY); |
758 } | 749 } |
759 | 750 |
760 //termination from ASCII to GSM default | 751 //termination from ASCII to GSM default |
761 for (i=0; i< MAX_ENTER_CURRENCY-1; i++) | 752 for (i=0; i< MAX_ENTER_CURRENCY-1; i++) |
762 { | 753 { |
763 if (data->aocInfo.cur[i] EQ '\0') | 754 if (data->aocInfo.cur[i] EQ '\0') |
764 data->aocInfo.cur[i] = 0x80; | 755 data->aocInfo.cur[i] = 0x80; |
765 } | 756 } |
766 | 757 |
767 | 758 |
768 // open the next editor for entering the price per unit | 759 // open the next editor for entering the price per unit |
769 SEND_EVENT (win, SERVICES_ONE_UNIT, 0, 0); | 760 SEND_EVENT (win, SERVICES_ONE_UNIT, 0, 0); |
770 break; | 761 break; |
771 | 762 |
772 case SERVICES_ONE_UNIT: | 763 case SERVICES_ONE_UNIT: |
773 TRACE_EVENT ("SERVICES_ONE_UNIT"); | 764 TRACE_EVENT ("SERVICES_ONE_UNIT"); |
774 TRACE_EVENT ("pressed left"); | 765 TRACE_EVENT ("pressed left"); |
775 | 766 |
776 // clear old current ppu before overwrite it | 767 // clear old current ppu before overwrite it |
777 memset(data->aocInfo.ppu, '\0', sizeof(data->aocInfo.ppu)); | 768 memset(data->aocInfo.ppu, '\0', sizeof(data->aocInfo.ppu)); |
778 | 769 |
779 if(strlen(data->edt_Buf) NEQ 0) | 770 if(strlen(data->edt_Buf) NEQ 0) |
780 { | 771 { |
781 memcpy(data->aocInfo.ppu, data->edt_Buf, strlen(data->edt_Buf)); | 772 memcpy(data->aocInfo.ppu, data->edt_Buf, strlen(data->edt_Buf)); |
782 } | 773 } |
783 | 774 |
784 | 775 |
785 // Password not necessary, Pin2 scenario done | 776 // Password not necessary, Pin2 scenario done |
786 memset(PWD, 0x00, 16); | 777 memset(PWD, 0x00, 16); |
787 | 778 |
788 // write cur and ppu in AOC | 779 // write cur and ppu in AOC |
789 result = cm_set_aoc_value(CM_AOC_PUCT, &data->aocInfo, PWD); | 780 result = cm_set_aoc_value(CM_AOC_PUCT, &data->aocInfo, PWD); |
790 | 781 |
791 | 782 |
792 TRACE_EVENT_P1("PPU : %s", data->aocInfo.ppu); | 783 TRACE_EVENT_P1("PPU : %s", data->aocInfo.ppu); |
793 TRACE_EVENT_P1("CUR : %s", data->aocInfo.cur); | 784 TRACE_EVENT_P1("CUR : %s", data->aocInfo.cur); |
794 TRACE_EVENT_P1("result : %d", result); | 785 TRACE_EVENT_P1("result : %d", result); |
795 | 786 |
796 if(result EQ CM_OK) | 787 if(result EQ CM_OK) |
797 { | 788 { |
798 SEND_EVENT (win, SERVICES_RATE_CHANGED, 0, 0); | 789 SEND_EVENT (win, SERVICES_RATE_CHANGED, 0, 0); |
799 } | 790 } |
800 else | 791 else |
801 { | 792 { |
802 SEND_EVENT (win, SERVICES_OUT_OF_RANGE, 0, 0); | 793 SEND_EVENT (win, SERVICES_OUT_OF_RANGE, 0, 0); |
803 } | 794 } |
804 | 795 |
805 break; | 796 break; |
806 | 797 |
807 case SERVICES_LIMIT_CHANGE: | 798 case SERVICES_LIMIT_CHANGE: |
808 | 799 |
809 // string => long | 800 // string => long |
810 data->aocInfo.acm_max = atol(data->edt_Buf); | 801 data->aocInfo.acm_max = atol(data->edt_Buf); |
811 | 802 |
812 // Password not necessary, Pin2 scenario done | 803 // Password not necessary, Pin2 scenario done |
813 memset(PWD, 0x00, 16); | 804 memset(PWD, 0x00, 16); |
814 | 805 |
815 // May 25, 2004 REF: CRR MMI-SPR-17588 NISHIKANT KULKARNI | 806 // May 25, 2004 REF: CRR MMI-SPR-17588 NISHIKANT KULKARNI |
816 | 807 |
817 // If the ACMmax value entered by the user is more than 16777215 (0xFFFFFF), | 808 // If the ACMmax value entered by the user is more than 16777215 (0xFFFFFF), |
818 // display a "Not Allowed" message. | 809 // display a "Not Allowed" message. |
819 if(data->aocInfo.acm_max > MAX_ENTER_VALUE) | 810 if(data->aocInfo.acm_max > MAX_ENTER_VALUE) |
820 { | 811 { |
821 // Send event to display a "Not Allowed" message. | 812 // Send event to display a "Not Allowed" message. |
822 SEND_EVENT (win, SERVICES_AOC_NOT_SUPPORTED, 0, 0); | 813 SEND_EVENT (win, SERVICES_AOC_NOT_SUPPORTED, 0, 0); |
823 } | 814 } |
824 | 815 |
825 // Else set the ACMmax value in AoC. | 816 // Else set the ACMmax value in AoC. |
826 else | 817 else |
827 { | 818 { |
828 result = cm_set_aoc_value(CM_AOC_ACMMAX, &data->aocInfo, PWD); /* save ACMmax in AOC */ | 819 result = cm_set_aoc_value(CM_AOC_ACMMAX, &data->aocInfo, PWD); /* save ACMmax in AOC */ |
829 | 820 |
830 TRACE_EVENT_P1("%ld", data->aocInfo.acm_max); | 821 TRACE_EVENT_P1("%ld", data->aocInfo.acm_max); |
831 TRACE_EVENT_P1("result of set aoc %d", result); | 822 TRACE_EVENT_P1("result of set aoc %d", result); |
832 | 823 |
833 // Send event to display a "Limit Changed" message. | 824 // Send event to display a "Limit Changed" message. |
834 SEND_EVENT (win, SERVICES_LIMIT_CHANGED, 0, 0); | 825 SEND_EVENT (win, SERVICES_LIMIT_CHANGED, 0, 0); |
835 } | 826 } |
836 | 827 |
837 break; | 828 break; |
838 case SERVICES_RESET_CHARGE: | 829 case SERVICES_RESET_CHARGE: |
839 /* MC 12/04/02: Changed ACMMAX to ACM (should fix "broken" SIM problem)*/ | 830 /* MC 12/04/02: Changed ACMMAX to ACM (should fix "broken" SIM problem)*/ |
840 | 831 |
841 result = cm_set_aoc_value(CM_AOC_ACM, &data->aocInfo, PWD); /* save ACMmax in AOC */ | 832 result = cm_set_aoc_value(CM_AOC_ACM, &data->aocInfo, PWD); /* save ACMmax in AOC */ |
842 | 833 |
843 } | 834 } |
844 break; | 835 break; |
845 | 836 |
846 case INFO_KCD_RIGHT: | 837 case INFO_KCD_RIGHT: |
847 case INFO_KCD_CLEAR: | 838 case INFO_KCD_CLEAR: |
848 | 839 |
849 TRACE_EVENT ("INFO_KCD_RIGHT pressed"); | 840 TRACE_EVENT ("INFO_KCD_RIGHT pressed"); |
850 | 841 |
851 switch (Identifier) | 842 switch (Identifier) |
852 { | 843 { |
853 | 844 |
854 case SERVICES_LIMIT_CHANGE: | 845 case SERVICES_LIMIT_CHANGE: |
855 case SERVICES_ENTER_CURRENCY: | 846 case SERVICES_ENTER_CURRENCY: |
856 | 847 |
857 //go back to the previous screen | 848 //go back to the previous screen |
858 service_Exit (win); | 849 service_Exit (win); |
859 break; | 850 break; |
860 case SERVICES_ONE_UNIT: | 851 case SERVICES_ONE_UNIT: |
861 | 852 |
862 //go back to the previous screen | 853 //go back to the previous screen |
863 SEND_EVENT (win, SERVICES_ENTER_CURRENCY, 0, 0); | 854 SEND_EVENT (win, SERVICES_ENTER_CURRENCY, 0, 0); |
864 break; | 855 break; |
865 | 856 |
866 | 857 |
867 default: | 858 default: |
868 break; | 859 break; |
869 } | 860 } |
870 default: | 861 default: |
871 break; | 862 break; |
872 } | 863 } |
873 } | 864 } |
874 | 865 |
875 | 866 |
876 /******************************************************************************* | 867 /******************************************************************************* |
877 | 868 |
878 $Function: createAOCDialog | 869 $Function: createAOCDialog |
879 | 870 |
880 $Description: Creates a dialog from 4 input parameters | 871 $Description: Creates a dialog from 4 input parameters |
881 | 872 |
882 $Returns: | 873 $Returns: |
883 | 874 |
884 $Arguments: | 875 $Arguments: |
885 | 876 |
886 *******************************************************************************/ | 877 *******************************************************************************/ |
887 static void createAOCDialog( T_MFW_HND win, USHORT txtId1, USHORT txtId2, char *str2, USHORT event ) | 878 static void createAOCDialog( T_MFW_HND win, USHORT txtId1, USHORT txtId2, char *str2, USHORT event ) |
888 { | 879 { |
889 T_DISPLAY_DATA display_info; | 880 T_DISPLAY_DATA display_info; |
890 | 881 |
891 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, txtId1, txtId2, COLOUR_AOC); | 882 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, txtId1, txtId2, COLOUR_AOC); |
892 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)service_dialog_cb, THREE_SECS, KEY_CLEAR | KEY_RIGHT | KEY_LEFT ); | 883 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)service_dialog_cb, THREE_SECS, KEY_CLEAR | KEY_RIGHT | KEY_LEFT ); |
893 display_info.Identifier = event; | 884 display_info.Identifier = event; |
894 display_info.TextString2 = str2; | 885 display_info.TextString2 = str2; |
895 info_dialog (win, &display_info); | 886 info_dialog (win, &display_info); |
896 } | 887 } |
897 /******************************************************************************* | 888 /******************************************************************************* |
898 | 889 |
899 $Function: service | 890 $Function: service |
900 | 891 |
901 $Description: | 892 $Description: |
902 | 893 |
903 $Returns: | 894 $Returns: |
904 | 895 |
905 $Arguments: | 896 $Arguments: |
906 | 897 |
907 *******************************************************************************/ | 898 *******************************************************************************/ |
908 void service (T_MFW_HND win, USHORT event, SHORT value, void * parameter) | 899 void service (T_MFW_HND win, USHORT event, SHORT value, void * parameter) |
909 { | 900 { |
910 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | 901 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; |
911 T_SERVICES * data = (T_SERVICES *)win_data->user; | 902 T_SERVICES * data = (T_SERVICES *)win_data->user; |
912 | 903 |
913 /* CQ13428 - NDH - Use dynamically allocated memory to prevent MMI Stack Overflow */ | 904 /* CQ13428 - NDH - Use dynamically allocated memory to prevent MMI Stack Overflow */ |
914 #ifdef NEW_EDITOR | 905 #ifdef NEW_EDITOR |
915 /* SPR#1428 - SH - New Editor data */ | 906 /* SPR#1428 - SH - New Editor data */ |
916 T_AUI_EDITOR_DATA *editor_data = (T_AUI_EDITOR_DATA *)ALLOC_MEMORY (sizeof (T_AUI_EDITOR_DATA)); | 907 T_AUI_EDITOR_DATA *editor_data = (T_AUI_EDITOR_DATA *)ALLOC_MEMORY (sizeof (T_AUI_EDITOR_DATA)); |
917 #else | 908 #else |
918 T_EDITOR_DATA *editor_data = (T_EDITOR_DATA *)ALLOC_MEMORY (sizeof (T_EDITOR_DATA)); | 909 T_EDITOR_DATA *editor_data = (T_EDITOR_DATA *)ALLOC_MEMORY (sizeof (T_EDITOR_DATA)); |
919 #endif | 910 #endif |
920 // T_MFW_SIM_PIN_STATUS status; // RAVI | 911 // T_MFW_SIM_PIN_STATUS status; // RAVI |
921 | 912 |
922 UBYTE i, result; | 913 UBYTE i, result; |
923 UBYTE PWD[16]; | 914 UBYTE PWD[16]; |
924 static char line[MAX_LINE]; | 915 static char line[MAX_LINE]; |
925 | 916 |
926 TRACE_FUNCTION("service()"); | 917 TRACE_FUNCTION("service()"); |
927 | 918 |
928 if (!editor_data) | 919 if (!editor_data) |
929 { | 920 { |
930 TRACE_ERROR("service : Failed to allocate memory for the Editor Data"); | 921 TRACE_ERROR("service : Failed to allocate memory for the Editor Data"); |
931 return; | 922 return; |
932 } | 923 } |
933 if ((!win) || | 924 if ((!win) || |
934 (!win_data) || | 925 (!win_data) || |
935 (!data)) | 926 (!data)) |
936 { | 927 { |
937 TRACE_ERROR("service : Invalid Pointer passed"); | 928 TRACE_ERROR("service : Invalid Pointer passed"); |
938 /* CQ13428 - NDH - Use dynamically allocated memory to prevent MMI Stack Overflow */ | 929 /* CQ13428 - NDH - Use dynamically allocated memory to prevent MMI Stack Overflow */ |
939 #ifdef NEW_EDITOR | 930 #ifdef NEW_EDITOR |
940 FREE_MEMORY((void *)editor_data, sizeof (T_AUI_EDITOR_DATA)); | 931 FREE_MEMORY((void *)editor_data, sizeof (T_AUI_EDITOR_DATA)); |
941 #else | 932 #else |
942 FREE_MEMORY((void *)editor_data, sizeof (T_EDITOR_DATA)); | 933 FREE_MEMORY((void *)editor_data, sizeof (T_EDITOR_DATA)); |
943 #endif | 934 #endif |
944 return; | 935 return; |
945 } | 936 } |
946 | 937 |
947 memset(PWD, 0x00, 16); | 938 memset(PWD, 0x00, 16); |
948 switch (event) | 939 switch (event) |
949 { | 940 { |
950 | 941 |
951 case SERVICES_CREDIT_REMAINING: | 942 case SERVICES_CREDIT_REMAINING: |
952 | 943 |
953 memset(line,'\0',sizeof(line)); | 944 memset(line,'\0',sizeof(line)); |
954 | 945 |
955 //Get the ACM MAX | 946 //Get the ACM MAX |
956 cm_get_aoc_value(CM_AOC_ACMMAX,&data->aocInfo); | 947 cm_get_aoc_value(CM_AOC_ACMMAX,&data->aocInfo); |
957 | 948 |
958 //Get ACM | 949 //Get ACM |
959 cm_get_aoc_value(CM_AOC_ACM,&data->aocInfo); | 950 cm_get_aoc_value(CM_AOC_ACM,&data->aocInfo); |
960 | 951 |
961 //Get currency and price per unit | 952 //Get currency and price per unit |
962 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); | 953 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); |
963 | 954 |
964 | 955 |
965 TRACE_EVENT_P1("ACMMAX: %ld", data->aocInfo.acm_max); | 956 TRACE_EVENT_P1("ACMMAX: %ld", data->aocInfo.acm_max); |
966 TRACE_EVENT_P1("ACM: %ld", data->aocInfo.acm); | 957 TRACE_EVENT_P1("ACM: %ld", data->aocInfo.acm); |
967 TRACE_EVENT_P1("PPU:%s", data->aocInfo.ppu); | 958 TRACE_EVENT_P1("PPU:%s", data->aocInfo.ppu); |
968 TRACE_EVENT_P1("CUR:%s", data->aocInfo.cur); | 959 TRACE_EVENT_P1("CUR:%s", data->aocInfo.cur); |
969 | 960 |
970 | 961 |
971 if ((data->aocInfo.acm_max NEQ '\0') && (data->aocInfo.acm NEQ '\0')) | 962 if ((data->aocInfo.acm_max NEQ '\0') && (data->aocInfo.acm NEQ '\0')) |
972 { | 963 { |
973 /* special case: It is not possible to have ACM > ACMMAX */ | 964 /* special case: It is not possible to have ACM > ACMMAX */ |
1002 /* show only ACMAX */ | 993 /* show only ACMAX */ |
1003 TRACE_EVENT ("CREDIT :ACMMAX !=0 and PPU ==0"); | 994 TRACE_EVENT ("CREDIT :ACMMAX !=0 and PPU ==0"); |
1004 sprintf(line, "%ld", data->aocInfo.acm_max - data->aocInfo.acm); /* */ | 995 sprintf(line, "%ld", data->aocInfo.acm_max - data->aocInfo.acm); /* */ |
1005 } | 996 } |
1006 | 997 |
1007 if (data->aocInfo.acm EQ '\0') | 998 if (data->aocInfo.acm EQ '\0') |
1008 strcpy ((char *)line, "0"); | 999 strcpy ((char *)line, "0"); |
1009 | 1000 |
1010 //from ASCII to GSM default | 1001 //from ASCII to GSM default |
1011 for (i=0; i< MAX_LINE; i++) | 1002 for (i=0; i< MAX_LINE; i++) |
1012 { | 1003 { |
1013 if (line[i] EQ (char)0x80 OR line[i] EQ (char)0xFF ) /* x0039928 - Lint warning fix */ | 1004 if (line[i] EQ (char)0x80 OR line[i] EQ (char)0xFF ) /* x0039928 - Lint warning fix */ |
1014 line[i] = '\0'; | 1005 line[i] = '\0'; |
1015 } | 1006 } |
1016 | 1007 |
1017 | 1008 |
1018 if (data->aocInfo.acm_max EQ 0) | 1009 if (data->aocInfo.acm_max EQ 0) |
1019 { | 1010 { |
1020 createAOCDialog( win, TxtCost, TxtNull, line, event); | 1011 createAOCDialog( win, TxtCost, TxtNull, line, event); |
1021 } | 1012 } |
1022 else | 1013 else |
1023 { | 1014 { |
1024 createAOCDialog( win, TxtBalance, TxtNull, line, event); | 1015 createAOCDialog( win, TxtBalance, TxtNull, line, event); |
1025 } | 1016 } |
1026 break; | 1017 break; |
1027 | 1018 |
1028 | 1019 |
1029 | 1020 case PIN_REQUEST_FOR_RATE: |
1030 | 1021 //save the status |
1031 case PIN_REQUEST_FOR_RATE: | 1022 data->Identifier = SERVICES_ENTER_CURRENCY; |
1032 //save the status | 1023 |
1033 data->Identifier = SERVICES_ENTER_CURRENCY; | 1024 //PIN2 is requested to change the Rate |
1034 | |
1035 //PIN2 is requested to change the Rate | |
1036 pin2_check (data->service_win); | 1025 pin2_check (data->service_win); |
1037 | 1026 |
1038 break; | 1027 break; |
1039 | 1028 |
1040 case PIN_REQUEST_FOR_LIMIT_CHANGE: | 1029 case PIN_REQUEST_FOR_LIMIT_CHANGE: |
1041 | 1030 |
1042 //PIN2 is requested to change the Rate | 1031 //PIN2 is requested to change the Rate |
1043 pin2_check (data->service_win); | 1032 pin2_check (data->service_win); |
1044 | 1033 |
1045 //save the status | 1034 //save the status |
1046 data->Identifier = SERVICES_LIMIT_CHANGE; | 1035 data->Identifier = SERVICES_LIMIT_CHANGE; |
1047 break; | 1036 break; |
1048 | 1037 |
1049 case PIN_REQUEST_FOR_LIMIT_CANCEL: | 1038 case PIN_REQUEST_FOR_LIMIT_CANCEL: |
1050 | 1039 |
1051 //PIN2 is requested to change the Rate | 1040 //PIN2 is requested to change the Rate |
1052 pin2_check (data->service_win); | 1041 pin2_check (data->service_win); |
1053 | 1042 |
1054 //save the status | 1043 //save the status |
1055 data->Identifier = SERVICES_LIMIT_CANCEL; | 1044 data->Identifier = SERVICES_LIMIT_CANCEL; |
1056 break; | 1045 break; |
1057 | 1046 |
1058 case PIN_REQUEST_FOR_RESET_CHARGE: | 1047 case PIN_REQUEST_FOR_RESET_CHARGE: |
1059 //save the status | 1048 //save the status |
1060 data->Identifier = SERVICES_RESET_CHARGE; | 1049 data->Identifier = SERVICES_RESET_CHARGE; |
1061 | 1050 |
1063 pin2_check (data->service_win); | 1052 pin2_check (data->service_win); |
1064 | 1053 |
1065 break; | 1054 break; |
1066 | 1055 |
1067 | 1056 |
1068 //it calls from MMI PINS | 1057 //it calls from MMI PINS |
1069 case PIN2_OK: | 1058 case PIN2_OK: |
1070 TRACE_EVENT("PIN2_OK"); | 1059 TRACE_EVENT("PIN2_OK"); |
1071 | 1060 |
1072 switch (data->Identifier) | 1061 switch (data->Identifier) |
1073 { | 1062 { |
1074 case SERVICES_ENTER_CURRENCY: | 1063 case SERVICES_ENTER_CURRENCY: |
1075 | 1064 |
1076 //pin was ok, open now the editor for entering the currency | 1065 //pin was ok, open now the editor for entering the currency |
1077 SEND_EVENT (win, data->Identifier, 0, 0); | 1066 SEND_EVENT (win, data->Identifier, 0, 0); |
1078 break; | 1067 break; |
1079 case SERVICES_LIMIT_CHANGE: | 1068 case SERVICES_LIMIT_CHANGE: |
1080 | 1069 |
1081 //pin was ok, open now the editor for entering the currency | 1070 //pin was ok, open now the editor for entering the currency |
1082 SEND_EVENT (win, data->Identifier, 0, 0); | 1071 SEND_EVENT (win, data->Identifier, 0, 0); |
1083 break; | 1072 break; |
1084 case SERVICES_LIMIT_CANCEL: | 1073 case SERVICES_LIMIT_CANCEL: |
1085 | 1074 |
1086 //pin was ok, open now the editor for entering the currency | 1075 //pin was ok, open now the editor for entering the currency |
1087 SEND_EVENT (win, data->Identifier, 0, 0); | 1076 SEND_EVENT (win, data->Identifier, 0, 0); |
1088 break; | 1077 break; |
1089 case SERVICES_RESET_CHARGE: | 1078 case SERVICES_RESET_CHARGE: |
1090 | 1079 |
1091 //pin was ok, open now the editor for entering the currency | 1080 //pin was ok, open now the editor for entering the currency |
1092 SEND_EVENT (win, data->Identifier, 0, 0); | 1081 SEND_EVENT (win, data->Identifier, 0, 0); |
1093 break; | 1082 break; |
1094 | 1083 |
1095 | 1084 |
1096 | 1085 } |
1097 } | 1086 break; |
1098 break; | |
1099 | 1087 |
1100 case PIN2_ABORT: | 1088 case PIN2_ABORT: |
1101 createAOCDialog( win, TxtFailed, TxtNull, line, event ); | 1089 createAOCDialog( win, TxtFailed, TxtNull, line, event ); |
1102 break; | 1090 break; |
1103 | 1091 |
1104 case SERVICES_ENTER_CURRENCY: | 1092 case SERVICES_ENTER_CURRENCY: |
1105 | 1093 |
1106 | 1094 |
1107 //save the status | 1095 //save the status |
1108 data->Identifier = SERVICES_ENTER_CURRENCY; | 1096 data->Identifier = SERVICES_ENTER_CURRENCY; |
1109 | 1097 |
1110 | 1098 |
1111 //PUCT (currency and price per unit) is requested | 1099 //PUCT (currency and price per unit) is requested |
1112 result = cm_get_aoc_value(CM_AOC_PUCT, &data->aocInfo); | 1100 result = cm_get_aoc_value(CM_AOC_PUCT, &data->aocInfo); |
1113 | 1101 |
1114 TRACE_EVENT_P1("result %d", result); | 1102 TRACE_EVENT_P1("result %d", result); |
1115 | 1103 |
1116 //fill up editor-sttribut with default | 1104 //fill up editor-sttribut with default |
1117 service_loadEditDefault (editor_data); | 1105 service_loadEditDefault (editor_data); |
1118 | 1106 |
1119 //clear the editor-buffer | 1107 //clear the editor-buffer |
1120 memset(data->edt_Buf,'\0',sizeof(data->edt_Buf)); | 1108 memset(data->edt_Buf,'\0',sizeof(data->edt_Buf)); |
1121 | 1109 |
1122 // let to show the current currency, before the user change it */ | 1110 // let to show the current currency, before the user change it */ |
1123 memcpy(data->edt_Buf, data->aocInfo.cur, MAX_ENTER_CURRENCY); | 1111 memcpy(data->edt_Buf, data->aocInfo.cur, MAX_ENTER_CURRENCY); |
1124 | 1112 |
1125 | 1113 |
1126 for (i=0; i< MAX_ENTER_CURRENCY-1; i++) | 1114 for (i=0; i< MAX_ENTER_CURRENCY-1; i++) |
1127 { | 1115 { |
1128 if (data->edt_Buf[i] EQ (char)0x80 OR data->edt_Buf[i] EQ (char)0xFF ) | 1116 if (data->edt_Buf[i] EQ (char)0x80 OR data->edt_Buf[i] EQ (char)0xFF ) |
1129 data->edt_Buf[i] = '\0'; | 1117 data->edt_Buf[i] = '\0'; |
1130 } | 1118 } |
1131 | 1119 |
1132 /* SPR#1428 - SH - New Editor changes */ | 1120 /* SPR#1428 - SH - New Editor changes */ |
1133 | 1121 |
1134 #ifdef NEW_EDITOR | 1122 #ifdef NEW_EDITOR |
1135 AUI_edit_SetBuffer(editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_Buf, MAX_ENTER_CURRENCY); | 1123 AUI_edit_SetBuffer(editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_Buf, MAX_ENTER_CURRENCY); |
1136 AUI_edit_SetTextStr(editor_data, TxtSoftOK, TxtDelete, TxtEnterCurrency, NULL); | 1124 AUI_edit_SetTextStr(editor_data, TxtSoftOK, TxtDelete, TxtEnterCurrency, NULL); |
1137 AUI_edit_SetEvents(editor_data, data->Identifier, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); | 1125 AUI_edit_SetEvents(editor_data, data->Identifier, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); |
1138 AUI_edit_SetMode(editor_data, ED_MODE_ALPHA, ED_CURSOR_BAR); | 1126 AUI_edit_SetMode(editor_data, ED_MODE_ALPHA, ED_CURSOR_BAR); |
1139 | 1127 |
1140 AUI_edit_Start(data->service_win, editor_data); | 1128 AUI_edit_Start(data->service_win, editor_data); |
1141 #else /* NEW_EDITOR */ | 1129 #else /* NEW_EDITOR */ |
1142 editor_data->editor_attr.text = data->edt_Buf; /* buffer to be edited */ | 1130 editor_data->editor_attr.text = data->edt_Buf; /* buffer to be edited */ |
1143 editor_data->editor_attr.size = MAX_ENTER_CURRENCY;/* limit to 3 letters */ | 1131 editor_data->editor_attr.size = MAX_ENTER_CURRENCY;/* limit to 3 letters */ |
1144 editor_data->LeftSoftKey = TxtSoftOK; | 1132 editor_data->LeftSoftKey = TxtSoftOK; |
1145 editor_data->RightSoftKey = TxtDelete; | 1133 editor_data->RightSoftKey = TxtDelete; |
1146 editor_data->TextId = TxtEnterCurrency; | 1134 editor_data->TextId = TxtEnterCurrency; |
1147 editor_data->Identifier = data->Identifier; | 1135 editor_data->Identifier = data->Identifier; |
1148 editor_data->mode = ALPHA_MODE; | 1136 editor_data->mode = ALPHA_MODE; |
1149 editor_data->AlternateLeftSoftKey = TxtNull; | 1137 editor_data->AlternateLeftSoftKey = TxtNull; |
1150 editor_data->min_enter = 1; | 1138 editor_data->min_enter = 1; |
1151 | 1139 |
1152 /* create the dialog handler */ | 1140 /* create the dialog handler */ |
1153 editor_start(data->service_win, editor_data); /* start the editor */ | 1141 editor_start(data->service_win, editor_data); /* start the editor */ |
1154 #endif /* NEW_EDITOR */ | 1142 #endif /* NEW_EDITOR */ |
1155 break; | 1143 break; |
1156 | |
1157 | 1144 |
1158 | 1145 |
1159 case SERVICES_ONE_UNIT: | 1146 case SERVICES_ONE_UNIT: |
1160 | 1147 |
1161 //save the status | 1148 //save the status |
1162 data->Identifier = SERVICES_ONE_UNIT; | 1149 data->Identifier = SERVICES_ONE_UNIT; |
1163 | 1150 |
1164 //fill up editor-sttribut with default | 1151 //fill up editor-sttribut with default |
1165 service_loadEditDefault (editor_data); | 1152 service_loadEditDefault (editor_data); |
1166 | 1153 |
1167 //clear the editor-buffer | 1154 //clear the editor-buffer |
1168 memset(data->edt_Buf,'\0',sizeof(data->edt_Buf)); | 1155 memset(data->edt_Buf,'\0',sizeof(data->edt_Buf)); |
1169 | 1156 |
1170 /* let to show the current price per unit, before the user change it */ | 1157 /* let to show the current price per unit, before the user change it */ |
1171 memcpy(data->edt_Buf, data->aocInfo.ppu, sizeof(data->aocInfo.ppu)); | 1158 memcpy(data->edt_Buf, data->aocInfo.ppu, sizeof(data->aocInfo.ppu)); |
1172 | 1159 |
1173 for (i=0; i< MAX_ENTER_UNIT-1; i++) | 1160 for (i=0; i< MAX_ENTER_UNIT-1; i++) |
1174 { | 1161 { |
1175 if (data->edt_Buf[i] EQ (char)0x80 OR data->edt_Buf[i] EQ (char)0xFF ) | 1162 if (data->edt_Buf[i] EQ (char)0x80 OR data->edt_Buf[i] EQ (char)0xFF ) |
1176 data->edt_Buf[i] = '\0'; | 1163 data->edt_Buf[i] = '\0'; |
1177 } | 1164 } |
1178 | 1165 |
1179 /* SPR#1428 - SH - New Editor changes */ | 1166 /* SPR#1428 - SH - New Editor changes */ |
1180 #ifdef NEW_EDITOR | 1167 #ifdef NEW_EDITOR |
1181 AUI_edit_SetBuffer(editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_Buf, MAX_ENTER_UNIT); | 1168 AUI_edit_SetBuffer(editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_Buf, MAX_ENTER_UNIT); |
1182 AUI_edit_SetTextStr(editor_data, TxtSoftOK, TxtDelete, Txt1Unit, NULL); | 1169 AUI_edit_SetTextStr(editor_data, TxtSoftOK, TxtDelete, Txt1Unit, NULL); |
1183 AUI_edit_SetEvents(editor_data, data->Identifier, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); | 1170 AUI_edit_SetEvents(editor_data, data->Identifier, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); |
1184 AUI_edit_SetMode(editor_data, 0, ED_CURSOR_BAR); | 1171 AUI_edit_SetMode(editor_data, 0, ED_CURSOR_BAR); |
1185 | 1172 |
1186 AUI_calc_Start(data->service_win, editor_data); | 1173 AUI_calc_Start(data->service_win, editor_data); |
1187 #else /* NEW_EDITOR */ | 1174 #else /* NEW_EDITOR */ |
1188 editor_data->editor_attr.text = data->edt_Buf; /* buffer to be edited */ | 1175 editor_data->editor_attr.text = data->edt_Buf; /* buffer to be edited */ |
1189 editor_data->editor_attr.size = MAX_ENTER_UNIT;/* limit to 5 numerics */ | 1176 editor_data->editor_attr.size = MAX_ENTER_UNIT;/* limit to 5 numerics */ |
1190 editor_data->LeftSoftKey = TxtSoftOK; | 1177 editor_data->LeftSoftKey = TxtSoftOK; |
1191 editor_data->RightSoftKey = TxtDelete; | 1178 editor_data->RightSoftKey = TxtDelete; |
1192 editor_data->TextId = Txt1Unit; | 1179 editor_data->TextId = Txt1Unit; |
1193 editor_data->Identifier = data->Identifier; | 1180 editor_data->Identifier = data->Identifier; |
1194 editor_data->mode = CALC_MODE; | 1181 editor_data->mode = CALC_MODE; |
1195 editor_data->AlternateLeftSoftKey = TxtNull; | 1182 editor_data->AlternateLeftSoftKey = TxtNull; |
1196 editor_data->min_enter = 1; | 1183 editor_data->min_enter = 1; |
1197 | 1184 |
1198 /* create the dialog handler */ | 1185 /* create the dialog handler */ |
1199 editor_start(data->service_win, editor_data); /* start the editor */ | 1186 editor_start(data->service_win, editor_data); /* start the editor */ |
1200 #endif /* NEW_EDITOR */ | 1187 #endif /* NEW_EDITOR */ |
1201 break; | 1188 break; |
1202 | 1189 |
1203 | 1190 |
1204 case SERVICES_RATE_CHANGED: | 1191 case SERVICES_RATE_CHANGED: |
1205 createAOCDialog( win, TxtRate, TxtChanged, NULL, event); | 1192 createAOCDialog( win, TxtRate, TxtChanged, NULL, event); |
1206 break; | 1193 break; |
1207 | 1194 |
1208 case SERVICES_LIMIT_VIEW: | 1195 case SERVICES_LIMIT_VIEW: |
1209 | 1196 |
1210 memset(line,'\0',sizeof(line)); | 1197 memset(line,'\0',sizeof(line)); |
1211 | 1198 |
1212 cm_get_aoc_value(CM_AOC_ACMMAX,&data->aocInfo); /* Get the ACM MAX */ | 1199 cm_get_aoc_value(CM_AOC_ACMMAX,&data->aocInfo); /* Get the ACM MAX */ |
1213 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ | 1200 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ |
1218 TRACE_EVENT_P1("CUR:%s", data->aocInfo.cur); | 1205 TRACE_EVENT_P1("CUR:%s", data->aocInfo.cur); |
1219 | 1206 |
1220 if((strlen((char*)data->aocInfo.ppu) EQ 0) && data->aocInfo.acm_max NEQ '\0') | 1207 if((strlen((char*)data->aocInfo.ppu) EQ 0) && data->aocInfo.acm_max NEQ '\0') |
1221 { | 1208 { |
1222 sprintf(line, "%ld", data->aocInfo.acm_max); /* Show only ACMmax */ | 1209 sprintf(line, "%ld", data->aocInfo.acm_max); /* Show only ACMmax */ |
1223 TRACE_EVENT ("get only :ACMMAX ; PPU ==0 and ACMMAX!=0"); | 1210 TRACE_EVENT ("get only :ACMMAX ; PPU ==0 and ACMMAX!=0"); |
1224 } | 1211 } |
1225 if((strlen((char*)data->aocInfo.ppu) NEQ 0) && data->aocInfo.acm_max NEQ '\0') | 1212 if((strlen((char*)data->aocInfo.ppu) NEQ 0) && data->aocInfo.acm_max NEQ '\0') |
1226 { | 1213 { |
1227 service_calculate (win, (char*)line, data->aocInfo.acm_max); | 1214 service_calculate (win, (char*)line, data->aocInfo.acm_max); |
1228 | 1215 |
1229 TRACE_EVENT ("calculate ACMMAX * PPU; PPU !=0 and ACMMAX!=0"); | 1216 TRACE_EVENT ("calculate ACMMAX * PPU; PPU !=0 and ACMMAX!=0"); |
1230 } | 1217 } |
1231 | 1218 |
1232 for (i=0; i< MAX_LINE; i++) | 1219 for (i=0; i< MAX_LINE; i++) |
1233 { | 1220 { |
1234 if (line[i] EQ (char)0x80 OR line[i] EQ (char)0xFF ) | 1221 if (line[i] EQ (char)0x80 OR line[i] EQ (char)0xFF ) |
1235 line[i] = '\0'; | 1222 line[i] = '\0'; |
1236 } | 1223 } |
1237 | 1224 |
1238 if(data->aocInfo.acm_max NEQ '\0') | 1225 if(data->aocInfo.acm_max NEQ '\0') |
1239 { | 1226 { |
1240 createAOCDialog( win, TxtLimitEq, TxtNull, line, event); | 1227 createAOCDialog( win, TxtLimitEq, TxtNull, line, event); |
1241 } | 1228 } |
1242 else | 1229 else |
1243 { | 1230 { |
1244 createAOCDialog( win, TxtNo, TxtLimit, NULL, event); | 1231 createAOCDialog( win, TxtNo, TxtLimit, NULL, event); |
1245 } | 1232 } |
1246 | 1233 |
1247 /* | 1234 /* |
1248 * Call Info Screen | 1235 * Call Info Screen |
1249 */ | 1236 */ |
1250 | 1237 |
1251 break; | 1238 break; |
1252 | 1239 |
1253 case SERVICES_LIMIT_CHANGE: | 1240 case SERVICES_LIMIT_CHANGE: |
1254 | 1241 |
1255 //fill up editor-sttribut with default | 1242 //fill up editor-sttribut with default |
1256 service_loadEditDefault (editor_data); | 1243 service_loadEditDefault (editor_data); |
1257 | 1244 |
1258 //clear the editor-buffer | 1245 //clear the editor-buffer |
1259 memset(data->edt_Buf,'\0',sizeof(data->edt_Buf)); | 1246 memset(data->edt_Buf,'\0',sizeof(data->edt_Buf)); |
1260 | 1247 |
1261 data->Identifier = SERVICES_LIMIT_CHANGE; /*SPR 2500*/ | 1248 data->Identifier = SERVICES_LIMIT_CHANGE; /*SPR 2500*/ |
1262 | 1249 |
1263 | 1250 |
1264 data->Identifier = SERVICES_LIMIT_CHANGE; | 1251 data->Identifier = SERVICES_LIMIT_CHANGE; |
1265 | 1252 |
1266 /* SPR#1428 - SH - New Editor changes */ | 1253 /* SPR#1428 - SH - New Editor changes */ |
1267 #ifdef NEW_EDITOR | 1254 #ifdef NEW_EDITOR |
1268 | 1255 |
1269 AUI_edit_SetBuffer(editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_Buf, MAX_ENTER_LIMIT); | 1256 AUI_edit_SetBuffer(editor_data, ATB_DCS_ASCII, (UBYTE *)data->edt_Buf, MAX_ENTER_LIMIT); |
1270 AUI_edit_SetTextStr(editor_data, TxtSoftOK, TxtDelete, TxtEnterLimit, NULL); | 1257 AUI_edit_SetTextStr(editor_data, TxtSoftOK, TxtDelete, TxtEnterLimit, NULL); |
1271 AUI_edit_SetEvents(editor_data, data->Identifier, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); | 1258 AUI_edit_SetEvents(editor_data, data->Identifier, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); |
1272 AUI_edit_SetMode(editor_data, 0, ED_CURSOR_BAR); | 1259 AUI_edit_SetMode(editor_data, 0, ED_CURSOR_BAR); |
1273 | 1260 |
1274 AUI_calc_Start(data->service_win, editor_data); | 1261 AUI_calc_Start(data->service_win, editor_data); |
1275 #else /* NEW_EDITOR */ | 1262 #else /* NEW_EDITOR */ |
1276 editor_data->editor_attr.text = data->edt_Buf; /* buffer to be edited */ | 1263 editor_data->editor_attr.text = data->edt_Buf; /* buffer to be edited */ |
1277 editor_data->editor_attr.size = MAX_ENTER_LIMIT; /* limit to 6 terms of units */ | 1264 editor_data->editor_attr.size = MAX_ENTER_LIMIT; /* limit to 6 terms of units */ |
1278 editor_data->LeftSoftKey = TxtSoftOK; | 1265 editor_data->LeftSoftKey = TxtSoftOK; |
1279 editor_data->RightSoftKey = TxtDelete; | 1266 editor_data->RightSoftKey = TxtDelete; |
1280 editor_data->TextId = TxtEnterLimit; | 1267 editor_data->TextId = TxtEnterLimit; |
1281 editor_data->Identifier = data->Identifier; | 1268 editor_data->Identifier = data->Identifier; |
1282 editor_data->mode = CALC_MODE; | 1269 editor_data->mode = CALC_MODE; |
1283 editor_data->AlternateLeftSoftKey = TxtNull; | 1270 editor_data->AlternateLeftSoftKey = TxtNull; |
1284 editor_data->min_enter = 1; | 1271 editor_data->min_enter = 1; |
1285 | 1272 |
1286 /* create the dialog handler */ | 1273 /* create the dialog handler */ |
1287 editor_start(data->service_win, editor_data); /* start the editor */ | 1274 editor_start(data->service_win, editor_data); /* start the editor */ |
1288 #endif /* NEW_EDITOR */ | 1275 #endif /* NEW_EDITOR */ |
1289 | 1276 |
1290 break; | 1277 break; |
1291 case SERVICES_LIMIT_CANCEL: | 1278 case SERVICES_LIMIT_CANCEL: |
1292 | 1279 |
1293 // clear the limit | 1280 // clear the limit |
1294 data->aocInfo.acm_max = 0; | 1281 data->aocInfo.acm_max = 0; |
1295 | 1282 |
1296 // Password not necessary, Pin2 scenario done | 1283 // Password not necessary, Pin2 scenario done |
1297 memset(PWD, 0x00, 16); | 1284 memset(PWD, 0x00, 16); |
1298 | 1285 |
1299 cm_set_aoc_value(CM_AOC_ACMMAX, &data->aocInfo, PWD); /* save ACMmax in AOC */ | 1286 cm_set_aoc_value(CM_AOC_ACMMAX, &data->aocInfo, PWD); /* save ACMmax in AOC */ |
1300 | 1287 |
1301 TRACE_EVENT_P1("%ld", data->aocInfo.acm_max); | 1288 TRACE_EVENT_P1("%ld", data->aocInfo.acm_max); |
1302 | 1289 |
1303 SEND_EVENT (win, SERVICES_LIMIT_CHANGED, 0, 0); | 1290 SEND_EVENT (win, SERVICES_LIMIT_CHANGED, 0, 0); |
1304 | 1291 |
1305 break; | 1292 break; |
1306 | 1293 |
1307 case SERVICES_LIMIT_CHANGED: | 1294 case SERVICES_LIMIT_CHANGED: |
1308 createAOCDialog( win, TxtLimit, TxtChanged, NULL, event); | 1295 createAOCDialog( win, TxtLimit, TxtChanged, NULL, event); |
1309 | 1296 |
1310 break; | 1297 break; |
1311 | 1298 |
1312 case SERVICES_LAST_CHARGE: | 1299 case SERVICES_LAST_CHARGE: |
1313 | 1300 |
1314 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ | 1301 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ |
1315 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ | 1302 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ |
1316 | 1303 |
1317 if ( strlen((char*)data->aocInfo.ppu) EQ 0 ) | 1304 if ( strlen((char*)data->aocInfo.ppu) EQ 0 ) |
1330 } | 1317 } |
1331 | 1318 |
1332 if (acm_last_call EQ '\0') | 1319 if (acm_last_call EQ '\0') |
1333 strcpy ((char *)line, "0"); | 1320 strcpy ((char *)line, "0"); |
1334 | 1321 |
1335 createAOCDialog( win, TxtLastCharge, TxtNull, line, event); | 1322 createAOCDialog( win, TxtLastCharge, TxtNull, line, event); |
1336 break; | 1323 break; |
1337 | 1324 |
1338 case SERVICES_TOTAL_CHARGE: | 1325 case SERVICES_TOTAL_CHARGE: |
1339 | 1326 |
1340 memset(line,'\0',sizeof(line)); | 1327 memset(line,'\0',sizeof(line)); |
1341 | 1328 |
1342 cm_get_aoc_value(CM_AOC_ACM,&data->aocInfo); /* Get the ACM */ | 1329 cm_get_aoc_value(CM_AOC_ACM,&data->aocInfo); /* Get the ACM */ |
1343 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ | 1330 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ |
1344 | 1331 |
1345 | 1332 |
1346 /* nm test only set the default */ | 1333 /* nm test only set the default */ |
1347 | 1334 |
1348 TRACE_EVENT_P1("ACM: %ld", data->aocInfo.acm); | 1335 TRACE_EVENT_P1("ACM: %ld", data->aocInfo.acm); |
1349 TRACE_EVENT_P1("PPU:%s", data->aocInfo.ppu); | 1336 TRACE_EVENT_P1("PPU:%s", data->aocInfo.ppu); |
1350 TRACE_EVENT_P1("CUR:%s", data->aocInfo.cur); | 1337 TRACE_EVENT_P1("CUR:%s", data->aocInfo.cur); |
1351 | 1338 |
1352 | 1339 |
1353 if((strlen((char*)data->aocInfo.ppu) EQ 0) && data->aocInfo.acm NEQ '\0') | 1340 if((strlen((char*)data->aocInfo.ppu) EQ 0) && data->aocInfo.acm NEQ '\0') |
1354 { | 1341 { |
1355 //show only the units ACM | 1342 //show only the units ACM |
1356 sprintf(line, "%ld", data->aocInfo.acm); | 1343 sprintf(line, "%ld", data->aocInfo.acm); |
1357 TRACE_EVENT ("get only :ACM ; PPU ==0 and ACM!=0"); | 1344 TRACE_EVENT ("get only :ACM ; PPU ==0 and ACM!=0"); |
1358 | 1345 |
1359 } | 1346 } |
1360 if((strlen((char*)data->aocInfo.ppu) NEQ 0) && data->aocInfo.acm NEQ '\0') | 1347 if((strlen((char*)data->aocInfo.ppu) NEQ 0) && data->aocInfo.acm NEQ '\0') |
1368 #endif | 1355 #endif |
1369 | 1356 |
1370 TRACE_EVENT ("calculate ACM * PPU; PPU !=0 and ACM!=0"); | 1357 TRACE_EVENT ("calculate ACM * PPU; PPU !=0 and ACM!=0"); |
1371 } | 1358 } |
1372 | 1359 |
1373 if (data->aocInfo.acm EQ '\0') | 1360 if (data->aocInfo.acm EQ '\0') |
1374 strcpy ((char *)line, "0"); | 1361 strcpy ((char *)line, "0"); |
1375 | 1362 |
1376 createAOCDialog( win, TxtTotalCharge, TxtNull, line, event); | 1363 createAOCDialog( win, TxtTotalCharge, TxtNull, line, event); |
1377 | 1364 |
1378 break; | 1365 break; |
1379 | 1366 |
1380 case SERVICES_RESET_CHARGE: | 1367 case SERVICES_RESET_CHARGE: |
1381 | 1368 |
1382 // clear the charge counter for all calls | 1369 // clear the charge counter for all calls |
1383 data->aocInfo.acm = 0; | 1370 data->aocInfo.acm = 0; |
1384 acm_last_call = 0; | 1371 acm_last_call = 0; |
1385 | 1372 |
1386 (void)cm_set_aoc_value(CM_AOC_ACM, &data->aocInfo, PWD); /* save ACM in AOC */ | 1373 (void)cm_set_aoc_value(CM_AOC_ACM, &data->aocInfo, PWD); /* save ACM in AOC */ |
1387 | 1374 |
1388 TRACE_EVENT_P1("%ld", data->aocInfo.acm); | 1375 TRACE_EVENT_P1("%ld", data->aocInfo.acm); |
1389 | 1376 |
1390 SEND_EVENT (win, SERVICES_CHARGE_CHANGED, 0, 0); | 1377 SEND_EVENT (win, SERVICES_CHARGE_CHANGED, 0, 0); |
1391 | 1378 |
1392 break; | 1379 break; |
1393 | 1380 |
1394 case SERVICES_CHARGE_CHANGED: | 1381 case SERVICES_CHARGE_CHANGED: |
1395 createAOCDialog( win, TxtResetCharge, TxtNull, NULL, event); | 1382 createAOCDialog( win, TxtResetCharge, TxtNull, NULL, event); |
1396 break; | 1383 break; |
1397 case SERVICES_OUT_OF_RANGE: | 1384 case SERVICES_OUT_OF_RANGE: |
1398 | 1385 |
1399 TRACE_EVENT("SERVICES_OUT_OF_RANGE"); | 1386 TRACE_EVENT("SERVICES_OUT_OF_RANGE"); |
1400 createAOCDialog( win, TxtOutofRange, TxtNull, NULL, event); | 1387 createAOCDialog( win, TxtOutofRange, TxtNull, NULL, event); |
1401 break; | 1388 break; |
1402 | 1389 |
1403 case SERVICES_AOC_NOT_SUPPORTED: | 1390 case SERVICES_AOC_NOT_SUPPORTED: |
1404 TRACE_EVENT("SERVICES_NOT_ALLOWED"); | 1391 TRACE_EVENT("SERVICES_NOT_ALLOWED"); |
1405 createAOCDialog( win, TxtNotAllowed, TxtNull, NULL, event); | 1392 createAOCDialog( win, TxtNotAllowed, TxtNull, NULL, event); |
1406 break; | 1393 break; |
1407 | 1394 |
1408 | 1395 |
1409 } | 1396 } |
1410 | 1397 |
1411 /* CQ13428 - NDH - Use dynamically allocated memory to prevent MMI Stack Overflow */ | 1398 /* CQ13428 - NDH - Use dynamically allocated memory to prevent MMI Stack Overflow */ |
1412 #ifdef NEW_EDITOR | 1399 #ifdef NEW_EDITOR |
1413 FREE_MEMORY((void *)editor_data, sizeof (T_AUI_EDITOR_DATA)); | 1400 FREE_MEMORY((void *)editor_data, sizeof (T_AUI_EDITOR_DATA)); |
1414 #else | 1401 #else |
1418 } | 1405 } |
1419 | 1406 |
1420 | 1407 |
1421 /******************************************************************************* | 1408 /******************************************************************************* |
1422 | 1409 |
1423 $Function: service_loadEditDefault | 1410 $Function: service_loadEditDefault |
1424 | 1411 |
1425 $Description: fill up editor-sttribut with default | 1412 $Description: fill up editor-sttribut with default |
1426 | 1413 |
1427 $Returns: | 1414 $Returns: |
1428 | 1415 |
1429 $Arguments: | 1416 $Arguments: |
1430 | 1417 |
1431 *******************************************************************************/ | 1418 *******************************************************************************/ |
1432 #ifdef NEW_EDITOR | 1419 #ifdef NEW_EDITOR |
1433 /* SPR#1428 - SH - New Editor changes */ | 1420 /* SPR#1428 - SH - New Editor changes */ |
1434 void service_loadEditDefault (T_AUI_EDITOR_DATA *editor_data) | 1421 void service_loadEditDefault (T_AUI_EDITOR_DATA *editor_data) |
1435 { | 1422 { |
1436 TRACE_FUNCTION ("service_loadEditDefault()"); | 1423 TRACE_FUNCTION ("service_loadEditDefault()"); |
1437 | 1424 |
1438 AUI_edit_SetDefault(editor_data); | 1425 AUI_edit_SetDefault(editor_data); |
1439 AUI_edit_SetDisplay(editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT); | 1426 AUI_edit_SetDisplay(editor_data, ZONE_FULL_SK_TITLE, COLOUR_EDITOR, EDITOR_FONT); |
1440 AUI_edit_SetEvents(editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); | 1427 AUI_edit_SetEvents(editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)service_editor_cb); |
1441 AUI_edit_SetTextStr(editor_data, TxtSoftSelect, TxtSoftBack, TxtNull, NULL); | 1428 AUI_edit_SetTextStr(editor_data, TxtSoftSelect, TxtSoftBack, TxtNull, NULL); |
1442 AUI_edit_SetMode(editor_data, 0, ED_CURSOR_UNDERLINE); | 1429 AUI_edit_SetMode(editor_data, 0, ED_CURSOR_UNDERLINE); |
1443 AUI_edit_SetAltTextStr(editor_data, 1, TxtNull, FALSE, TxtNull); | 1430 AUI_edit_SetAltTextStr(editor_data, 1, TxtNull, FALSE, TxtNull); |
1444 return; | 1431 return; |
1445 } | 1432 } |
1446 #else /* NEW_EDITOR */ | 1433 #else /* NEW_EDITOR */ |
1447 void service_loadEditDefault (T_EDITOR_DATA *editor_data) | 1434 void service_loadEditDefault (T_EDITOR_DATA *editor_data) |
1448 { | 1435 { |
1449 TRACE_FUNCTION ("service_loadEditDefault()"); | 1436 TRACE_FUNCTION ("service_loadEditDefault()"); |
1450 | 1437 |
1451 editor_attr_init(&editor_data->editor_attr, ZONE_SMALL_EDITOR, edtCurBar1, NULL, NULL, 0, COLOUR_EDITOR); | 1438 editor_attr_init(&editor_data->editor_attr, ZONE_SMALL_EDITOR, edtCurBar1, NULL, NULL, 0, COLOUR_EDITOR); |
1452 editor_data->editor_attr.font = 0; | 1439 editor_data->editor_attr.font = 0; |
1453 | 1440 |
1454 editor_data_init( editor_data, (T_EDIT_CB)service_editor_cb, TxtSoftSelect, TxtSoftBack, TxtNull, 1, DIGITS_MODE, FOREVER); | 1441 editor_data_init( editor_data, (T_EDIT_CB)service_editor_cb, TxtSoftSelect, TxtSoftBack, TxtNull, 1, DIGITS_MODE, FOREVER); |
1455 editor_data->hide = FALSE; | 1442 editor_data->hide = FALSE; |
1456 editor_data->destroyEditor = TRUE; | 1443 editor_data->destroyEditor = TRUE; |
1457 editor_data->AlternateLeftSoftKey = TxtNull; | 1444 editor_data->AlternateLeftSoftKey = TxtNull; |
1458 } | 1445 } |
1459 #endif /* NEW_EDITOR */ | 1446 #endif /* NEW_EDITOR */ |
1460 | 1447 |
1461 /******************************************************************************* | 1448 /******************************************************************************* |
1462 | 1449 |
1463 $Function: service_calc_balance | 1450 $Function: service_calc_balance |
1464 | 1451 |
1465 $Description: Calculate the Credit remaining | 1452 $Description: Calculate the Credit remaining |
1466 | 1453 |
1467 $Returns: | 1454 $Returns: |
1468 | 1455 |
1469 $Arguments: | 1456 $Arguments: |
1470 | 1457 |
1471 *******************************************************************************/ | 1458 *******************************************************************************/ |
1472 void service_calc_balance (T_MFW_HND win,char* line) | 1459 void service_calc_balance (T_MFW_HND win,char* line) |
1473 { | 1460 { |
1474 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | 1461 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; |
1475 T_SERVICES * data = (T_SERVICES *)win_data->user; | 1462 T_SERVICES * data = (T_SERVICES *)win_data->user; |
1476 | 1463 |
1477 | 1464 |
1478 char line2[MAX_LINE]; | 1465 char line2[MAX_LINE]; |
1479 char *pdest,*src,*dst,*POINT; | 1466 char *pdest,*src,*dst,*POINT; |
1480 LONG result; | 1467 LONG result; |
1481 int ch = '.'; | 1468 int ch = '.'; |
1482 UBYTE counter=0; | 1469 UBYTE counter=0; |
1483 if ((!win) || | 1470 if ((!win) || |
1484 (!win_data) || | 1471 (!win_data) || |
1485 (!data)) | 1472 (!data)) |
1486 { | 1473 { |
1487 TRACE_ERROR("service_calc_balance : Invalid Pointer passed"); | 1474 TRACE_ERROR("service_calc_balance : Invalid Pointer passed"); |
1488 return; | 1475 return; |
1489 } | 1476 } |
1490 | 1477 |
1491 /*SPR 2500, chack validity of pointers before continuing*/ | 1478 /*SPR 2500, chack validity of pointers before continuing*/ |
1492 if ((!win) || | 1479 if ((!win) || |
1493 (!win_data) || | 1480 (!win_data) || |
1494 (!data)) | 1481 (!data)) |
1495 { | 1482 { |
1496 TRACE_ERROR("service_calc_balance : Invalid Pointer passed"); | 1483 TRACE_ERROR("service_calc_balance : Invalid Pointer passed"); |
1497 return; | 1484 return; |
1498 } | 1485 } |
1499 | 1486 |
1500 memset(line2,'\0',sizeof(line2)); | 1487 memset(line2,'\0',sizeof(line2)); |
1501 | 1488 |
1502 cm_get_aoc_value(CM_AOC_ACMMAX,&data->aocInfo); /* Get the ACM MAX */ | 1489 cm_get_aoc_value(CM_AOC_ACMMAX,&data->aocInfo); /* Get the ACM MAX */ |
1503 cm_get_aoc_value(CM_AOC_ACM,&data->aocInfo); /* Get ACM */ | 1490 cm_get_aoc_value(CM_AOC_ACM,&data->aocInfo); /* Get ACM */ |
1504 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ | 1491 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ |
1505 | |
1506 | 1492 |
1507 | 1493 |
1508 /* Search for '.' */ | 1494 /* Search for '.' */ |
1509 pdest =(char *) strchr((char*) data->aocInfo.ppu, ch ); | 1495 pdest =(char *) strchr((char*) data->aocInfo.ppu, ch ); |
1510 | 1496 |
1574 } | 1560 } |
1575 | 1561 |
1576 | 1562 |
1577 /******************************************************************************* | 1563 /******************************************************************************* |
1578 | 1564 |
1579 $Function: service_calculate | 1565 $Function: service_calculate |
1580 | 1566 |
1581 $Description: Calculate the value with price per unit and currency. | 1567 $Description: Calculate the value with price per unit and currency. |
1582 | 1568 |
1583 "value * PPU" @ currency | 1569 "value * PPU" @ currency |
1584 | 1570 |
1585 $Returns: | 1571 $Returns: |
1586 | 1572 |
1587 $Arguments: | 1573 $Arguments: |
1588 | 1574 |
1590 | 1576 |
1591 | 1577 |
1592 void service_calculate (T_MFW_HND win, char* line, long value) | 1578 void service_calculate (T_MFW_HND win, char* line, long value) |
1593 { | 1579 { |
1594 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; | 1580 T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; |
1595 T_SERVICES * data = (T_SERVICES *)win_data->user; | 1581 T_SERVICES * data = (T_SERVICES *)win_data->user; |
1596 | 1582 |
1597 char line2[MAX_LINE]; | 1583 char line2[MAX_LINE]; |
1598 char *pdest,*src,*dst,*POINT; | 1584 char *pdest,*src,*dst,*POINT; |
1599 LONG result; | 1585 LONG result; |
1600 int ch = '.'; | 1586 int ch = '.'; |
1601 UBYTE counter=0; | 1587 UBYTE counter=0; |
1602 | 1588 |
1603 /*SPR2500, check validity of pinters before continuing*/ | 1589 /*SPR2500, check validity of pinters before continuing*/ |
1604 if ((!win) || | 1590 if ((!win) || |
1605 (!win_data) || | 1591 (!win_data) || |
1606 (!data)) | 1592 (!data)) |
1607 { | 1593 { |
1608 TRACE_ERROR("service_calculate : Invalid Pointer passed"); | 1594 TRACE_ERROR("service_calculate : Invalid Pointer passed"); |
1609 return; | 1595 return; |
1610 } | 1596 } |
1611 | 1597 |
1612 memset(line2,'\0',sizeof(line2)); | 1598 memset(line2,'\0',sizeof(line2)); |
1613 | 1599 |
1614 cm_get_aoc_value(CM_AOC_ACM,&data->aocInfo); /* Get ACM */ | 1600 cm_get_aoc_value(CM_AOC_ACM,&data->aocInfo); /* Get ACM */ |
1615 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ | 1601 cm_get_aoc_value(CM_AOC_PUCT,&data->aocInfo); /* Get currency and price per unit */ |
1685 | 1671 |
1686 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS | 1672 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS |
1687 #ifdef FF_CPHS | 1673 #ifdef FF_CPHS |
1688 /******************************************************************************* | 1674 /******************************************************************************* |
1689 | 1675 |
1690 $Function: setAOCflag | 1676 $Function: setAOCflag |
1691 | 1677 |
1692 $Description: set the value to Aoc_flag variable | 1678 $Description: set the value to Aoc_flag variable |
1693 | 1679 |
1694 $Returns: | 1680 $Returns: |
1695 | 1681 |
1702 } | 1688 } |
1703 | 1689 |
1704 | 1690 |
1705 /******************************************************************************* | 1691 /******************************************************************************* |
1706 | 1692 |
1707 $Function: getAOCflag | 1693 $Function: getAOCflag |
1708 | 1694 |
1709 $Description: Rturns the value of variable Aoc_flag. | 1695 $Description: Rturns the value of variable Aoc_flag. |
1710 | 1696 |
1711 $Returns: value of Aoc_flag. | 1697 $Returns: value of Aoc_flag. |
1712 | 1698 |
1720 #endif | 1706 #endif |
1721 | 1707 |
1722 | 1708 |
1723 /******************************************************************************* | 1709 /******************************************************************************* |
1724 | 1710 |
1725 $Function: service_check_pin_for_aoc | 1711 $Function: service_check_pin_for_aoc |
1726 | 1712 |
1727 $Description: this function check the PIN 2 requirement & availability of AOC | 1713 $Description: this function check the PIN 2 requirement & availability of AOC |
1728 | 1714 |
1729 $Returns: | 1715 $Returns: |
1730 | 1716 |
1731 $Arguments: | 1717 $Arguments: |
1732 | 1718 |
1733 *******************************************************************************/ | 1719 *******************************************************************************/ |
1734 USHORT service_check_pin_for_aoc (void) | 1720 USHORT service_check_pin_for_aoc (void) |
1735 { | 1721 { |
1736 T_MFW_AOC_ACCESS access; | 1722 T_MFW_AOC_ACCESS access; |
1737 | 1723 |
1738 /* check PIN 2 requirement & availability of AOC */ | 1724 /* check PIN 2 requirement & availability of AOC */ |
1739 sim_configuration (NULL, NULL, NULL, NULL, NULL, &access); | 1725 sim_configuration (NULL, NULL, NULL, NULL, NULL, &access); |
1740 | 1726 |
1741 TRACE_EVENT_P3("acm:%d acmmax:%d,puct:%d", access.access_acm,access.access_acmmax,access.access_puct); | 1727 TRACE_EVENT_P3("acm:%d acmmax:%d,puct:%d", access.access_acm,access.access_acmmax,access.access_puct); |
1742 #ifdef FF_CPHS | 1728 #ifdef FF_CPHS |
1743 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS | 1729 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS |
1744 //The 'Charge/Timers' menu should be displayed if CPHS is not supported. | 1730 //The 'Charge/Timers' menu should be displayed if CPHS is not supported. |
1745 if (CphsPresent() != TRUE) | 1731 if (CphsPresent() != TRUE) |
1746 { | 1732 { |
1747 TRACE_EVENT("CPHS is not present in this SIM"); | 1733 TRACE_EVENT("CPHS is not present in this SIM"); |
1748 setAOCflag(TRUE); | 1734 setAOCflag(TRUE); |
1749 } | 1735 } |
1750 TRACE_EVENT_P1("Values: Aoc_flag = %d - 1 Indicates AOC is set in the CSP", getAOCflag()); | 1736 TRACE_EVENT_P1("Values: Aoc_flag = %d - 1 Indicates AOC is set in the CSP", getAOCflag()); |
1751 TRACE_EVENT_P1("status : cphs_status = %d ", CphsPresent()); | 1737 TRACE_EVENT_P1("status : cphs_status = %d ", CphsPresent()); |
1752 #endif | 1738 #endif |
1753 | 1739 |
1754 if (access.access_acm EQ MFW_SIM_PIN2 && | 1740 if (access.access_acm EQ MFW_SIM_PIN2 && |
1755 access.access_acmmax EQ MFW_SIM_PIN2 && | 1741 access.access_acmmax EQ MFW_SIM_PIN2 && |
1756 access.access_puct EQ MFW_SIM_PIN2) | 1742 access.access_puct EQ MFW_SIM_PIN2) |
1757 { | 1743 { |
1758 TRACE_EVENT("PIN 2 required"); | 1744 TRACE_EVENT("PIN 2 required"); |
1759 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS | 1745 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS |
1760 #ifdef FF_CPHS | 1746 #ifdef FF_CPHS |
1761 if (getAOCflag()) | 1747 if (getAOCflag()) |
1762 return MFW_SIM_PIN2_REQ; | 1748 return MFW_SIM_PIN2_REQ; |
1763 else | 1749 else |
1764 return MFW_SIM_NO_AOC; | 1750 return MFW_SIM_NO_AOC; |
1765 #else | 1751 #else |
1766 return MFW_SIM_PIN2_REQ; | 1752 return MFW_SIM_PIN2_REQ; |
1767 #endif | 1753 #endif |
1768 } | 1754 } |
1769 else if (access.access_acm EQ MFW_SIM_PIN1 && | 1755 else if (access.access_acm EQ MFW_SIM_PIN1 && |
1770 access.access_acmmax EQ MFW_SIM_PIN1 && | 1756 access.access_acmmax EQ MFW_SIM_PIN1 && |
1771 access.access_puct EQ MFW_SIM_PIN1) | 1757 access.access_puct EQ MFW_SIM_PIN1) |
1772 { | 1758 { |
1773 TRACE_EVENT("PIN 1 required"); | 1759 TRACE_EVENT("PIN 1 required"); |
1774 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS | 1760 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS |
1775 #ifdef FF_CPHS | 1761 #ifdef FF_CPHS |
1776 if (getAOCflag()) | 1762 if (getAOCflag()) |
1777 return MFW_SIM_PIN_REQ; | 1763 return MFW_SIM_PIN_REQ; |
1778 else | 1764 else |
1779 return MFW_SIM_NO_AOC; | 1765 return MFW_SIM_NO_AOC; |
1780 #else | 1766 #else |
1781 return MFW_SIM_PIN_REQ; | 1767 return MFW_SIM_PIN_REQ; |
1782 #endif | 1768 #endif |
1783 } | 1769 } |
1784 else if (access.access_acm EQ MFW_SIM_NO_PIN && | 1770 else if (access.access_acm EQ MFW_SIM_NO_PIN && |
1785 access.access_acmmax EQ MFW_SIM_NO_PIN && | 1771 access.access_acmmax EQ MFW_SIM_NO_PIN && |
1786 access.access_puct EQ MFW_SIM_NO_PIN) | 1772 access.access_puct EQ MFW_SIM_NO_PIN) |
1787 { | 1773 { |
1788 TRACE_EVENT("No PIN required"); | 1774 TRACE_EVENT("No PIN required"); |
1789 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS | 1775 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS |
1790 #ifdef FF_CPHS | 1776 #ifdef FF_CPHS |
1791 if (getAOCflag()) | 1777 if (getAOCflag()) |
1792 return MFW_SIM_NO_PIN; | 1778 return MFW_SIM_NO_PIN; |
1793 else | 1779 else |
1794 return MFW_SIM_NO_AOC; | 1780 return MFW_SIM_NO_AOC; |
1795 #else | 1781 #else |
1796 return MFW_SIM_NO_PIN; | 1782 return MFW_SIM_NO_PIN; |
1797 #endif | 1783 #endif |
1798 } | 1784 } |
1799 else if (access.access_acm EQ MFW_SIM_UNKNOWN && | 1785 else if (access.access_acm EQ MFW_SIM_UNKNOWN && |
1800 access.access_acmmax EQ MFW_SIM_UNKNOWN && | 1786 access.access_acmmax EQ MFW_SIM_UNKNOWN && |
1801 access.access_puct EQ MFW_SIM_UNKNOWN) | 1787 access.access_puct EQ MFW_SIM_UNKNOWN) |
1802 { | 1788 { |
1803 TRACE_EVENT("AOC not supported"); | 1789 TRACE_EVENT("AOC not supported"); |
1804 return MFW_SIM_FAILURE; | 1790 return MFW_SIM_FAILURE; |
1805 } | 1791 } |
1806 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS | 1792 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS |
1807 #ifdef FF_CPHS | 1793 #ifdef FF_CPHS |
1808 else | 1794 else |
1809 { | 1795 { |
1810 TRACE_EVENT("AOC Else part"); | 1796 TRACE_EVENT("AOC Else part"); |
1811 if (getAOCflag()) | 1797 if (getAOCflag()) |
1812 return MFW_SIM_NO_PIN; | 1798 return MFW_SIM_NO_PIN; |
1813 else | 1799 else |
1814 return MFW_SIM_NO_AOC; | 1800 return MFW_SIM_NO_AOC; |
1815 } | 1801 } |
1816 #endif | 1802 #endif |
1817 | 1803 |
1818 } | 1804 } |
1819 | 1805 |
1820 /******************************************************************************* | 1806 /******************************************************************************* |
1821 | 1807 |
1822 $Function: service_check_aoc | 1808 $Function: service_check_aoc |
1823 | 1809 |
1824 $Description: If there is no support for AOC on SIM card | 1810 $Description: If there is no support for AOC on SIM card |
1825 the item "Charge Timers" will not Appear on the menulist | 1811 the item "Charge Timers" will not Appear on the menulist |
1826 | 1812 |
1827 $Returns: | 1813 $Returns: |
1828 | 1814 |
1829 $Arguments: | 1815 $Arguments: |
1830 | 1816 |
1831 *******************************************************************************/ | 1817 *******************************************************************************/ |
1832 USHORT service_check_aoc (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi) | 1818 USHORT service_check_aoc (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi) |
1833 { | 1819 { |
1834 TRACE_FUNCTION("service_check_aoc"); | 1820 TRACE_FUNCTION("service_check_aoc"); |
1835 | 1821 |
1836 switch (service_check_pin_for_aoc ()) | 1822 switch (service_check_pin_for_aoc ()) |
1837 { | 1823 { |
1838 case MFW_SIM_PIN2_REQ: | 1824 case MFW_SIM_PIN2_REQ: |
1839 case MFW_SIM_PIN_REQ: | 1825 case MFW_SIM_PIN_REQ: |
1840 case MFW_SIM_NO_PIN: | 1826 case MFW_SIM_NO_PIN: |
1841 TRACE_EVENT("AOC item visible"); | 1827 TRACE_EVENT("AOC item visible"); |
1842 return 0; | 1828 return 0; |
1843 /*break;*/ | 1829 /*break;*/ |
1844 | 1830 |
1845 case MFW_SIM_FAILURE: | 1831 case MFW_SIM_FAILURE: |
1846 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS | 1832 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS |
1847 #ifdef FF_CPHS | 1833 #ifdef FF_CPHS |
1848 case MFW_SIM_NO_AOC: | 1834 case MFW_SIM_NO_AOC: |
1849 TRACE_EVENT("service_check_aoc - AOC item not visible"); | 1835 TRACE_EVENT("service_check_aoc - AOC item not visible"); |
1850 #endif | 1836 #endif |
1851 return 1; | 1837 return 1; |
1852 /*break;*/ | 1838 /*break;*/ |
1853 } | 1839 } |
1854 return 1; | 1840 return 1; |
1855 } | 1841 } |
1856 | |
1857 |