FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiSatClassE.c @ 92:c0052fe355d3
src/ui/bmi/*.[ch]: rm trailing white space
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 08 Nov 2020 06:39:16 +0000 |
parents | 67bfe9f274f6 |
children | d6bc1298a377 |
comparison
equal
deleted
inserted
replaced
91:c3d28a37caad | 92:c0052fe355d3 |
---|---|
157 | 157 |
158 $Function: sat_class_e_create | 158 $Function: sat_class_e_create |
159 | 159 |
160 $Description: Creation of an instance for the SAT Class E dialog. | 160 $Description: Creation of an instance for the SAT Class E dialog. |
161 | 161 |
162 $Returns: mfw window handler | 162 $Returns: mfw window handler |
163 | 163 |
164 $Arguments: parent_window - Parent window handler | 164 $Arguments: parent_window - Parent window handler |
165 | 165 |
166 *******************************************************************************/ | 166 *******************************************************************************/ |
167 T_MFW_HND sat_class_e_create (T_MFW_HND parent_window) | 167 T_MFW_HND sat_class_e_create (T_MFW_HND parent_window) |
168 { | 168 { |
169 T_sat_open_channel * data = (T_sat_open_channel *)ALLOC_MEMORY (sizeof (T_sat_open_channel)); | 169 T_sat_open_channel * data = (T_sat_open_channel *)ALLOC_MEMORY (sizeof (T_sat_open_channel)); |
170 T_MFW_WIN * win; | 170 T_MFW_WIN * win; |
213 | 213 |
214 *******************************************************************************/ | 214 *******************************************************************************/ |
215 static void sat_open_channel_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) | 215 static void sat_open_channel_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) |
216 { | 216 { |
217 TRACE_FUNCTION("sat_open_channel_cb()"); | 217 TRACE_FUNCTION("sat_open_channel_cb()"); |
218 | 218 |
219 if (win EQ NULL) | 219 if (win EQ NULL) |
220 { | 220 { |
221 return; | 221 return; |
222 } | 222 } |
223 | 223 |
224 switch (reason) | 224 switch (reason) |
225 { | 225 { |
226 case INFO_KCD_LEFT: /* user has accepted Open Channel request */ | 226 case INFO_KCD_LEFT: /* user has accepted Open Channel request */ |
227 satAccept(); | 227 satAccept(); |
228 | 228 |
252 | 252 |
253 *******************************************************************************/ | 253 *******************************************************************************/ |
254 static void sat_class_e_dialog_destroy(T_MFW_HND win) | 254 static void sat_class_e_dialog_destroy(T_MFW_HND win) |
255 { | 255 { |
256 | 256 |
257 T_MFW_WIN * win_data; | 257 T_MFW_WIN * win_data; |
258 T_sat_open_channel * data; | 258 T_sat_open_channel * data; |
259 | 259 |
260 TRACE_FUNCTION ("sat_class_e_dialog_destroy()"); | 260 TRACE_FUNCTION ("sat_class_e_dialog_destroy()"); |
261 | 261 |
262 if (win == NULL) | 262 if (win == NULL) |
263 { | 263 { |
264 TRACE_ERROR("ERROR: win is NULL!"); | 264 TRACE_ERROR("ERROR: win is NULL!"); |
265 return; | 265 return; |
266 } | 266 } |
267 | 267 |
272 TRACE_ERROR("ERROR: win_data is NULL!"); | 272 TRACE_ERROR("ERROR: win_data is NULL!"); |
273 return; | 273 return; |
274 } | 274 } |
275 | 275 |
276 data = (T_sat_open_channel *)win_data->user; | 276 data = (T_sat_open_channel *)win_data->user; |
277 | 277 |
278 if (win != NULL) | 278 if (win != NULL) |
279 { | 279 { |
280 if (data) | 280 if (data) |
281 { | 281 { |
282 /* | 282 /* |
305 | 305 |
306 *******************************************************************************/ | 306 *******************************************************************************/ |
307 static void sat_class_e_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) | 307 static void sat_class_e_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) |
308 { | 308 { |
309 TRACE_FUNCTION("sat_class_e_cb()"); | 309 TRACE_FUNCTION("sat_class_e_cb()"); |
310 | 310 |
311 if (win EQ NULL) | 311 if (win EQ NULL) |
312 { | 312 { |
313 return; | 313 return; |
314 } | 314 } |
315 | 315 |
316 switch (reason) | 316 switch (reason) |
317 { | 317 { |
318 case INFO_KCD_LEFT: | 318 case INFO_KCD_LEFT: |
319 case INFO_KCD_RIGHT: | 319 case INFO_KCD_RIGHT: |
320 case INFO_TIMEOUT: | 320 case INFO_TIMEOUT: |
339 event - window event | 339 event - window event |
340 value - unique id | 340 value - unique id |
341 call_setup_parameter - call setup info | 341 call_setup_parameter - call setup info |
342 | 342 |
343 SPR#2321 - DS - Corrected misleading comments. | 343 SPR#2321 - DS - Corrected misleading comments. |
344 | 344 |
345 *******************************************************************************/ | 345 *******************************************************************************/ |
346 void sat_class_e_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command) | 346 void sat_class_e_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command) |
347 { | 347 { |
348 | 348 |
349 T_MFW_WIN * win_data; | 349 T_MFW_WIN * win_data; |
350 T_sat_open_channel * data; | 350 T_sat_open_channel * data; |
351 char* text_string; | 351 char* text_string; |
352 | 352 |
353 T_DISPLAY_DATA display_info; | 353 T_DISPLAY_DATA display_info; |
354 | 354 |
355 TRACE_FUNCTION ("sat_class_e_exec()"); | 355 TRACE_FUNCTION ("sat_class_e_exec()"); |
356 | 356 |
357 if (win == NULL) | 357 if (win == NULL) |
358 { | 358 { |
359 TRACE_ERROR("ERROR: win is NULL!"); | 359 TRACE_ERROR("ERROR: win is NULL!"); |
360 return; | 360 return; |
361 } | 361 } |
362 | 362 |
373 if (data == NULL) | 373 if (data == NULL) |
374 { | 374 { |
375 TRACE_ERROR("ERROR: data is NULL!"); | 375 TRACE_ERROR("ERROR: data is NULL!"); |
376 return; | 376 return; |
377 } | 377 } |
378 | 378 |
379 switch (event) | 379 switch (event) |
380 { | 380 { |
381 case SAT_OPEN_CHANNEL: | 381 case SAT_OPEN_CHANNEL: |
382 | 382 |
383 TRACE_EVENT("SAT_OPEN_CHANNEL"); | 383 TRACE_EVENT("SAT_OPEN_CHANNEL"); |
384 | 384 |
385 /* Start an info screen to accept or reject the Open Channel request */ | 385 /* Start an info screen to accept or reject the Open Channel request */ |
386 data->sat_command = sat_command; | 386 data->sat_command = sat_command; |
387 | 387 |
388 /* Extract the data from the Open Channel sat command */ | 388 /* Extract the data from the Open Channel sat command */ |
389 if (sat_command != NULL) | 389 if (sat_command != NULL) |
390 { | 390 { |
391 | 391 |
392 TRACE_EVENT_P2("dcs: %x, len: %d", sat_command->c.open.alpha_id.code, sat_command->c.open.alpha_id.len); | 392 TRACE_EVENT_P2("dcs: %x, len: %d", sat_command->c.open.alpha_id.code, sat_command->c.open.alpha_id.len); |
393 | 393 |
394 /* Alpha identifier */ | 394 /* Alpha identifier */ |
395 | 395 |
396 /* Check alpha identifier has valid length */ | 396 /* Check alpha identifier has valid length */ |
397 if ( (sat_command->c.open.alpha_id.len > 0) && | 397 if ( (sat_command->c.open.alpha_id.len > 0) && |
398 (sat_command->c.open.alpha_id.len != (U8)-1) ) | 398 (sat_command->c.open.alpha_id.len != (U8)-1) ) |
413 if (data->alpha_id) | 413 if (data->alpha_id) |
414 { | 414 { |
415 text_string = data->alpha_id; | 415 text_string = data->alpha_id; |
416 #ifdef NO_ASCIIZ/*MC SPR 940/2 Add tag to Unicode strings so info dialog displays them correctly*/ | 416 #ifdef NO_ASCIIZ/*MC SPR 940/2 Add tag to Unicode strings so info dialog displays them correctly*/ |
417 sat_add_unicode_tag_if_needed(text_string); | 417 sat_add_unicode_tag_if_needed(text_string); |
418 #endif | 418 #endif |
419 } | 419 } |
420 else | 420 else |
421 { | 421 { |
422 text_string = "Open Channel"; //Need to implement for Chinese | 422 text_string = "Open Channel"; //Need to implement for Chinese |
423 } | 423 } |
424 | 424 |
425 | 425 |
426 dlg_initDisplayData_TextStr( &display_info, TxtAccept, TxtReject, text_string, NULL, COLOUR_STATUS); | 426 dlg_initDisplayData_TextStr( &display_info, TxtAccept, TxtReject, text_string, NULL, COLOUR_STATUS); |
427 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_open_channel_cb, FOREVER, KEY_LEFT|KEY_RIGHT ); | 427 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_open_channel_cb, FOREVER, KEY_LEFT|KEY_RIGHT ); |
428 | 428 |
429 display_info.Identifier = event; | 429 display_info.Identifier = event; |
430 | 430 |
431 /* | 431 /* |
432 * Call Info Screen | 432 * Call Info Screen |
433 */ | 433 */ |
434 info_dialog (win, &display_info); | 434 info_dialog (win, &display_info); |
435 | 435 |
436 break; | 436 break; |
437 | 437 |
438 case SAT_CLOSE_CHANNEL: | 438 case SAT_CLOSE_CHANNEL: |
439 | 439 |
440 TRACE_EVENT("SAT_CLOSE_CHANNEL"); | 440 TRACE_EVENT("SAT_CLOSE_CHANNEL"); |
441 | 441 |
442 /* Start an info screen to inform the user that the SIM is closing the open channel*/ | 442 /* Start an info screen to inform the user that the SIM is closing the open channel*/ |
443 data->sat_command = sat_command; | 443 data->sat_command = sat_command; |
444 | 444 |
445 /* Extract the data from the Close Channel sat command */ | 445 /* Extract the data from the Close Channel sat command */ |
446 if (sat_command != NULL) | 446 if (sat_command != NULL) |
447 { | 447 { |
448 TRACE_EVENT_P2("dcs: %x, len: %d", sat_command->c.close.alpha_id.code, sat_command->c.close.alpha_id.len); | 448 TRACE_EVENT_P2("dcs: %x, len: %d", sat_command->c.close.alpha_id.code, sat_command->c.close.alpha_id.len); |
449 | 449 |
450 /* Alpha identifier */ | 450 /* Alpha identifier */ |
451 | 451 |
452 /* SPR#2321 - DS - Check alpha identifier has valid length */ | 452 /* SPR#2321 - DS - Check alpha identifier has valid length */ |
453 if ( (sat_command->c.close.alpha_id.len > 0) && | 453 if ( (sat_command->c.close.alpha_id.len > 0) && |
454 (sat_command->c.close.alpha_id.len != (U8)-1) ) | 454 (sat_command->c.close.alpha_id.len != (U8)-1) ) |
465 if (data->alpha_id) | 465 if (data->alpha_id) |
466 { | 466 { |
467 text_string = data->alpha_id; | 467 text_string = data->alpha_id; |
468 #ifdef NO_ASCIIZ/*MC SPR 940/2 Add tag to Unicode strings so info dialog displays them correctly*/ | 468 #ifdef NO_ASCIIZ/*MC SPR 940/2 Add tag to Unicode strings so info dialog displays them correctly*/ |
469 sat_add_unicode_tag_if_needed(text_string); | 469 sat_add_unicode_tag_if_needed(text_string); |
470 #endif | 470 #endif |
471 } | 471 } |
472 else | 472 else |
473 { | 473 { |
474 text_string = "Closing Channel"; //Need to implement for Chinese | 474 text_string = "Closing Channel"; //Need to implement for Chinese |
475 } | 475 } |
476 | 476 |
477 | 477 |
478 dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, text_string, NULL, COLOUR_STATUS); | 478 dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, text_string, NULL, COLOUR_STATUS); |
479 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_class_e_cb, THREE_SECS, KEY_LEFT|KEY_RIGHT ); | 479 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_class_e_cb, THREE_SECS, KEY_LEFT|KEY_RIGHT ); |
480 | 480 |
481 display_info.Identifier = event; | 481 display_info.Identifier = event; |
482 | 482 |
483 /* | 483 /* |
484 * Call Info Screen | 484 * Call Info Screen |
485 */ | 485 */ |
486 info_dialog (win, &display_info); | 486 info_dialog (win, &display_info); |
487 | 487 |
488 break; | 488 break; |
489 | 489 |
490 case SAT_SEND_DATA: | 490 case SAT_SEND_DATA: |
491 | 491 |
492 TRACE_EVENT("SAT_SEND_DATA"); | 492 TRACE_EVENT("SAT_SEND_DATA"); |
493 | 493 |
494 /* Start an info screen to inform the user that the SIM is sending data */ | 494 /* Start an info screen to inform the user that the SIM is sending data */ |
495 data->sat_command = sat_command; | 495 data->sat_command = sat_command; |
496 | 496 |
497 /* Extract the data from the Send Data sat command */ | 497 /* Extract the data from the Send Data sat command */ |
498 if (sat_command != NULL) | 498 if (sat_command != NULL) |
499 { | 499 { |
500 TRACE_EVENT_P2("dcs: %x, len: %d", sat_command->c.send.alpha_id.code, sat_command->c.send.alpha_id.len); | 500 TRACE_EVENT_P2("dcs: %x, len: %d", sat_command->c.send.alpha_id.code, sat_command->c.send.alpha_id.len); |
501 | 501 |
502 /* Alpha identifier */ | 502 /* Alpha identifier */ |
503 | 503 |
504 /* SPR#2321 - DS - Check alpha identifier has valid length */ | 504 /* SPR#2321 - DS - Check alpha identifier has valid length */ |
505 if ( (sat_command->c.send.alpha_id.len > 0) && | 505 if ( (sat_command->c.send.alpha_id.len > 0) && |
506 (sat_command->c.send.alpha_id.len != (U8)-1) ) | 506 (sat_command->c.send.alpha_id.len != (U8)-1) ) |
517 if (data->alpha_id) | 517 if (data->alpha_id) |
518 { | 518 { |
519 text_string = data->alpha_id; | 519 text_string = data->alpha_id; |
520 #ifdef NO_ASCIIZ/*MC SPR 940/2 Add tag to Unicode strings so info dialog displays them correctly*/ | 520 #ifdef NO_ASCIIZ/*MC SPR 940/2 Add tag to Unicode strings so info dialog displays them correctly*/ |
521 sat_add_unicode_tag_if_needed(text_string); | 521 sat_add_unicode_tag_if_needed(text_string); |
522 #endif | 522 #endif |
523 } | 523 } |
524 else | 524 else |
525 { | 525 { |
526 text_string = "Sending Data"; //Need to implement for Chinese | 526 text_string = "Sending Data"; //Need to implement for Chinese |
527 } | 527 } |
528 | 528 |
529 dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, text_string, NULL, COLOUR_STATUS); | 529 dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, text_string, NULL, COLOUR_STATUS); |
530 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_class_e_cb, THREE_SECS, KEY_LEFT|KEY_RIGHT ); | 530 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_class_e_cb, THREE_SECS, KEY_LEFT|KEY_RIGHT ); |
531 | 531 |
532 display_info.Identifier = event; | 532 display_info.Identifier = event; |
533 | 533 |
534 /* | 534 /* |
535 * Call Info Screen | 535 * Call Info Screen |
536 */ | 536 */ |
537 info_dialog (win, &display_info); | 537 info_dialog (win, &display_info); |
538 | 538 |
539 break; | 539 break; |
540 | 540 |
541 case SAT_RECEIVE_DATA: | 541 case SAT_RECEIVE_DATA: |
542 | 542 |
543 TRACE_EVENT("SAT_RECEIVE_DATA"); | 543 TRACE_EVENT("SAT_RECEIVE_DATA"); |
547 | 547 |
548 /* Extract the data from the Receive Data sat command */ | 548 /* Extract the data from the Receive Data sat command */ |
549 if (sat_command != NULL) | 549 if (sat_command != NULL) |
550 { | 550 { |
551 TRACE_EVENT_P2("dcs: %x, len: %d", sat_command->c.receive.alpha_id.code, sat_command->c.receive.alpha_id.len); | 551 TRACE_EVENT_P2("dcs: %x, len: %d", sat_command->c.receive.alpha_id.code, sat_command->c.receive.alpha_id.len); |
552 | 552 |
553 /* Alpha identifier */ | 553 /* Alpha identifier */ |
554 | 554 |
555 /* SPR#2321 - DS - Check alpha identifier has valid length */ | 555 /* SPR#2321 - DS - Check alpha identifier has valid length */ |
556 if ( (sat_command->c.receive.alpha_id.len > 0) && | 556 if ( (sat_command->c.receive.alpha_id.len > 0) && |
557 (sat_command->c.receive.alpha_id.len != (U8)-1) ) | 557 (sat_command->c.receive.alpha_id.len != (U8)-1) ) |
568 if (data->alpha_id) | 568 if (data->alpha_id) |
569 { | 569 { |
570 text_string = data->alpha_id; | 570 text_string = data->alpha_id; |
571 #ifdef NO_ASCIIZ/*MC SPR 940/2 Add tag to Unicode strings so info dialog displays them correctly*/ | 571 #ifdef NO_ASCIIZ/*MC SPR 940/2 Add tag to Unicode strings so info dialog displays them correctly*/ |
572 sat_add_unicode_tag_if_needed(text_string); | 572 sat_add_unicode_tag_if_needed(text_string); |
573 #endif | 573 #endif |
574 } | 574 } |
575 else | 575 else |
576 { | 576 { |
577 text_string = "Receiving Data"; //Need to implement for Chinese | 577 text_string = "Receiving Data"; //Need to implement for Chinese |
578 } | 578 } |
579 | 579 |
580 dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, text_string, NULL, COLOUR_STATUS); | 580 dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, text_string, NULL, COLOUR_STATUS); |
581 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_class_e_cb, THREE_SECS, KEY_LEFT|KEY_RIGHT ); | 581 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_class_e_cb, THREE_SECS, KEY_LEFT|KEY_RIGHT ); |
582 | 582 |
583 display_info.Identifier = event; | 583 display_info.Identifier = event; |
584 | 584 |
585 /* | 585 /* |
586 * Call Info Screen | 586 * Call Info Screen |
587 */ | 587 */ |
588 info_dialog (win, &display_info); | 588 info_dialog (win, &display_info); |
589 | 589 |
590 break; | 590 break; |
591 | 591 |
592 default: | 592 default: |
593 TRACE_EVENT("sat_open_channel_exec() unexpected event"); | 593 TRACE_EVENT("sat_open_channel_exec() unexpected event"); |
594 return; | 594 return; |