FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiSatInfo.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 | b89fc69b96e1 |
comparison
equal
deleted
inserted
replaced
91:c3d28a37caad | 92:c0052fe355d3 |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 | 2 |
3 CONDAT (UK) | 3 CONDAT (UK) |
4 | 4 |
5 ******************************************************************************** | 5 ******************************************************************************** |
6 | 6 |
7 This software product is the property of Condat (UK) Ltd and may not be | 7 This software product is the property of Condat (UK) Ltd and may not be |
8 disclosed to any third party without the express permission of the owner. | 8 disclosed to any third party without the express permission of the owner. |
9 | 9 |
10 ******************************************************************************** | 10 ******************************************************************************** |
11 | 11 |
12 $Project name: Basic MMI | 12 $Project name: Basic MMI |
13 $Project code: BMI | 13 $Project code: BMI |
14 $Module: SMS | 14 $Module: SMS |
15 $File: mmiSatInfo.c | 15 $File: mmiSatInfo.c |
16 $Revision: 1.0 | 16 $Revision: 1.0 |
17 | 17 |
18 $Author: Condat(UK) | 18 $Author: Condat(UK) |
19 $Date: 25/10/00 | 19 $Date: 25/10/00 |
20 | 20 |
21 ******************************************************************************** | 21 ******************************************************************************** |
22 | 22 |
23 Description: | 23 Description: |
24 | 24 |
25 Implementation of MMI SIM Application Toolkit (SAT) | 25 Implementation of MMI SIM Application Toolkit (SAT) |
26 | 26 |
27 ******************************************************************************** | 27 ******************************************************************************** |
28 | 28 |
29 $History: mmiSatInfo.c | 29 $History: mmiSatInfo.c |
30 | 30 |
31 July 26, 2005 REF: SPR 29520 x0018858 | 31 July 26, 2005 REF: SPR 29520 x0018858 |
32 Issue: 27.22.4.5 Proactive SIM Command: PLAY TONE fails | 32 Issue: 27.22.4.5 Proactive SIM Command: PLAY TONE fails |
33 Solution: The window which used to come up "Please wait" was not getting destroyed. | 33 Solution: The window which used to come up "Please wait" was not getting destroyed. |
34 Care has been taken to check this. | 34 Care has been taken to check this. |
35 | 35 |
36 25/10/00 Original Condat(UK) BMI version. | 36 25/10/00 Original Condat(UK) BMI version. |
37 21/02/03 removed all calls to function sat_add_unicode_tag_if_needed() | 37 21/02/03 removed all calls to function sat_add_unicode_tag_if_needed() |
38 $End | 38 $End |
39 | 39 |
40 *******************************************************************************/ | 40 *******************************************************************************/ |
41 | 41 |
42 #define ENTITY_MFW | 42 #define ENTITY_MFW |
127 * | 127 * |
128 *********************************************************************/ | 128 *********************************************************************/ |
129 /* | 129 /* |
130 * Tone Definitions | 130 * Tone Definitions |
131 */ | 131 */ |
132 #define SAT_TONE_DIAL 1 | 132 #define SAT_TONE_DIAL 1 |
133 #define SAT_TONE_CALL_SUB_BUSY 2 | 133 #define SAT_TONE_CALL_SUB_BUSY 2 |
134 #define SAT_TONE_CONGESTION 3 | 134 #define SAT_TONE_CONGESTION 3 |
135 #define SAT_TONE_RADIO_PATH_ACK 4 | 135 #define SAT_TONE_RADIO_PATH_ACK 4 |
136 #define SAT_TONE_RADIO_PATH_NOT 5 | 136 #define SAT_TONE_RADIO_PATH_NOT 5 |
137 #define SAT_TONE_ERROR 6 | 137 #define SAT_TONE_ERROR 6 |
138 #define SAT_TONE_CALL_WAITING 7 | 138 #define SAT_TONE_CALL_WAITING 7 |
139 #define SAT_TONE_RINGING_TONE 8 | 139 #define SAT_TONE_RINGING_TONE 8 |
140 #define SAT_TONE_GENERAL_BEEP 0x10 | 140 #define SAT_TONE_GENERAL_BEEP 0x10 |
141 #define SAT_TONE_POSITIV_ACK 0x11 | 141 #define SAT_TONE_POSITIV_ACK 0x11 |
142 #define SAT_TONE_NEGATIV_ACK 0x12 | 142 #define SAT_TONE_NEGATIV_ACK 0x12 |
172 | 172 |
173 $Function: sat_play_tone_create | 173 $Function: sat_play_tone_create |
174 | 174 |
175 $Description: Creation of an instance for the SAT PLAY TONE dialog. Window must | 175 $Description: Creation of an instance for the SAT PLAY TONE dialog. Window must |
176 be available after reception of SAT command, only one instance. | 176 be available after reception of SAT command, only one instance. |
177 | 177 |
178 $Returns: window handle | 178 $Returns: window handle |
179 | 179 |
180 $Arguments: own_window - window handler | 180 $Arguments: own_window - window handler |
181 | 181 |
182 *******************************************************************************/ | 182 *******************************************************************************/ |
183 | 183 |
184 T_MFW_HND sat_play_tone_create (T_MFW_HND parent_window) | 184 T_MFW_HND sat_play_tone_create (T_MFW_HND parent_window) |
185 { | 185 { |
186 T_sat_play_tone * data = (T_sat_play_tone *)ALLOC_MEMORY (sizeof (T_sat_play_tone)); | 186 T_sat_play_tone * data = (T_sat_play_tone *)ALLOC_MEMORY (sizeof (T_sat_play_tone)); |
199 data->parent_win = parent_window; | 199 data->parent_win = parent_window; |
200 win = ((T_MFW_HDR *)data->win)->data; | 200 win = ((T_MFW_HDR *)data->win)->data; |
201 win->user = (MfwUserDataPtr)data; | 201 win->user = (MfwUserDataPtr)data; |
202 | 202 |
203 data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */ | 203 data->kbd = kbdCreate( data->win, KEY_ALL, (T_MFW_CB) sat_kbd_cb); /* sbh - add keyboard handler */ |
204 | 204 |
205 /* | 205 /* |
206 * return window handle | 206 * return window handle |
207 */ | 207 */ |
208 win_show(data->win); | 208 win_show(data->win); |
209 return data->win; | 209 return data->win; |
213 | 213 |
214 $Function: sat_play_tone_destroy | 214 $Function: sat_play_tone_destroy |
215 | 215 |
216 $Description: Destroy the sat play tone dialog. | 216 $Description: Destroy the sat play tone dialog. |
217 | 217 |
218 | 218 |
219 $Returns: none | 219 $Returns: none |
220 | 220 |
221 $Arguments: own_window - window handler | 221 $Arguments: own_window - window handler |
222 | 222 |
223 *******************************************************************************/ | 223 *******************************************************************************/ |
224 static void sat_play_tone_destroy (T_MFW_HND own_window) | 224 static void sat_play_tone_destroy (T_MFW_HND own_window) |
225 { | 225 { |
226 T_MFW_WIN * win_data = ((T_MFW_HDR *)own_window)->data; | 226 T_MFW_WIN * win_data = ((T_MFW_HDR *)own_window)->data; |
227 T_sat_play_tone * data = (T_sat_play_tone *)win_data->user; | 227 T_sat_play_tone * data = (T_sat_play_tone *)win_data->user; |
256 | 256 |
257 $Arguments: win - window handler | 257 $Arguments: win - window handler |
258 event -window event | 258 event -window event |
259 value - unique id | 259 value - unique id |
260 sat_command - Sat Command. | 260 sat_command - Sat Command. |
261 | 261 |
262 *******************************************************************************/ | 262 *******************************************************************************/ |
263 static void sat_play_tone_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command) | 263 static void sat_play_tone_exec (T_MFW_HND win, USHORT event, SHORT value, T_SAT_CMD * sat_command) |
264 { | 264 { |
265 | 265 |
266 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 266 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
267 T_sat_play_tone * data = (T_sat_play_tone *)win_data->user; | 267 T_sat_play_tone * data = (T_sat_play_tone *)win_data->user; |
268 | 268 |
269 T_SAT_TXT * txt; | 269 T_SAT_TXT * txt; |
270 ULONG time = 0; /* x0039928 - Lint warning fix */ | 270 ULONG time = 0; /* x0039928 - Lint warning fix */ |
271 e_TONE_DURATION res; | 271 e_TONE_DURATION res; |
272 T_SAT_RES sat_res; | 272 T_SAT_RES sat_res; |
273 | 273 |
274 T_DISPLAY_DATA display_info; | 274 T_DISPLAY_DATA display_info; |
275 | 275 |
276 TRACE_FUNCTION ("sat_play_tone_exec()"); | 276 TRACE_FUNCTION ("sat_play_tone_exec()"); |
277 | 277 |
278 switch (event) | 278 switch (event) |
279 { | 279 { |
280 case SAT_PLAY_TONE: | 280 case SAT_PLAY_TONE: |
281 TRACE_EVENT("SAT_PLAY_TONE"); | 281 TRACE_EVENT("SAT_PLAY_TONE"); |
282 data->sat_command = sat_command; /* save a pointer to the parameter for later use in callbacks */ | 282 data->sat_command = sat_command; /* save a pointer to the parameter for later use in callbacks */ |
315 } | 315 } |
316 else | 316 else |
317 { | 317 { |
318 /* to be stopped by timer */ | 318 /* to be stopped by timer */ |
319 data->tim = tim_create (win, time, (T_MFW_CB)sat_play_tone_tim_cb); | 319 data->tim = tim_create (win, time, (T_MFW_CB)sat_play_tone_tim_cb); |
320 tim_start (data->tim); | 320 tim_start (data->tim); |
321 audio_PlaySoundID(data->device_id, data->sound_id , data->volume, AUDIO_PLAY_INFINITE); | 321 audio_PlaySoundID(data->device_id, data->sound_id , data->volume, AUDIO_PLAY_INFINITE); |
322 } | 322 } |
323 break; | 323 break; |
324 } | 324 } |
325 | 325 |
327 * --> display alpha identifier (if any) | 327 * --> display alpha identifier (if any) |
328 */ | 328 */ |
329 txt = &sat_command->c.tone.alpha; | 329 txt = &sat_command->c.tone.alpha; |
330 | 330 |
331 /*SPR#2340 - DS - Handle cases where no alpha id and/or duration is present */ | 331 /*SPR#2340 - DS - Handle cases where no alpha id and/or duration is present */ |
332 | 332 |
333 if (txt->len > 0) /* alpha id supplied in command */ | 333 if (txt->len > 0) /* alpha id supplied in command */ |
334 { | 334 { |
335 int timer=0; | 335 int timer=0; |
336 | 336 |
337 if (time EQ 0) /* no duration supplied, destroy info_dialog after timeout */ | 337 if (time EQ 0) /* no duration supplied, destroy info_dialog after timeout */ |
338 timer = TEN_SECS; | 338 timer = TEN_SECS; |
339 else /* duration supplied, info_dialog destroyed when audio timer expires */ | 339 else /* duration supplied, info_dialog destroyed when audio timer expires */ |
340 timer = FOREVER; | 340 timer = FOREVER; |
341 | 341 |
342 data->TextString = sat_create_TEXT_ASCIIZ (txt); | 342 data->TextString = sat_create_TEXT_ASCIIZ (txt); |
343 | 343 |
344 //July 26, 2005 REF: SPR 29520 x0018858 | 344 //July 26, 2005 REF: SPR 29520 x0018858 |
345 //Function call modified to pass the string as a differant argument(initially 4th arg but now as the 5th arg). | 345 //Function call modified to pass the string as a differant argument(initially 4th arg but now as the 5th arg). |
346 dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtCancel, NULL, data->TextString, COLOUR_STATUS); | 346 dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtCancel, NULL, data->TextString, COLOUR_STATUS); |
347 | 347 |
348 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_info_cb, timer, KEY_LEFT | KEY_RIGHT | KEY_HUP); | 348 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)sat_info_cb, timer, KEY_LEFT | KEY_RIGHT | KEY_HUP); |
349 display_info.Identifier = event; | 349 display_info.Identifier = event; |
350 //July 26, 2005 REF: SPR 29520 x0018858 | 350 //July 26, 2005 REF: SPR 29520 x0018858 |
351 //wrapping enabled for the display. | 351 //wrapping enabled for the display. |
352 display_info.WrapStrings=WRAP_STRING_2; | 352 display_info.WrapStrings=WRAP_STRING_2; |
353 | 353 |
354 /* | 354 /* |
355 * Call Info Screen | 355 * Call Info Screen |
356 */ | 356 */ |
357 data->info = info_dialog (win, &display_info); | 357 data->info = info_dialog (win, &display_info); |
358 /* destroy when dialog times out */ | 358 /* destroy when dialog times out */ |
359 display_info.TextString = data->TextString; | 359 display_info.TextString = data->TextString; |
360 } | 360 } |
361 else if (txt->text EQ 0 && res NEQ SINGLE_TONE) | 361 else if (txt->text EQ 0 && res NEQ SINGLE_TONE) |
362 { | 362 { |
363 /* no alpha id supplied - show default text */ | 363 /* no alpha id supplied - show default text */ |
374 display_info.Identifier = event; | 374 display_info.Identifier = event; |
375 /* | 375 /* |
376 * Call Info Screen | 376 * Call Info Screen |
377 */ | 377 */ |
378 data->info = info_dialog (win, &display_info); | 378 data->info = info_dialog (win, &display_info); |
379 /* destroy when dialog times out */ | 379 /* destroy when dialog times out */ |
380 display_info.TextString = data->TextString; | 380 display_info.TextString = data->TextString; |
381 } | 381 } |
382 else if (res EQ SINGLE_TONE) | 382 else if (res EQ SINGLE_TONE) |
383 { | 383 { |
384 /* destroy immediately, if SINGLE_TONE and no info */ | 384 /* destroy immediately, if SINGLE_TONE and no info */ |
385 sat_res[SAT_ERR_INDEX] = SatResSuccess; | 385 sat_res[SAT_ERR_INDEX] = SatResSuccess; |
386 sat_res[SAT_AI_INDEX] = SatResAiNoCause; | 386 sat_res[SAT_AI_INDEX] = SatResAiNoCause; |
387 sat_done (sat_command, sat_res); | 387 sat_done (sat_command, sat_res); |
393 case SAT_DESTROY_WINDOW: | 393 case SAT_DESTROY_WINDOW: |
394 TRACE_EVENT("SAT_DESTROY_WINDOW"); | 394 TRACE_EVENT("SAT_DESTROY_WINDOW"); |
395 sat_play_tone_destroy (win); | 395 sat_play_tone_destroy (win); |
396 break; | 396 break; |
397 /* ...sbh */ | 397 /* ...sbh */ |
398 | 398 |
399 default: | 399 default: |
400 TRACE_EVENT ("sat_play_tone_exec() unexpected event"); | 400 TRACE_EVENT ("sat_play_tone_exec() unexpected event"); |
401 break; | 401 break; |
402 } | 402 } |
403 } | 403 } |
405 /******************************************************************************* | 405 /******************************************************************************* |
406 | 406 |
407 $Function: sat_play_tone_tim_cb | 407 $Function: sat_play_tone_tim_cb |
408 | 408 |
409 $Description: Callback function for the play tone timer. | 409 $Description: Callback function for the play tone timer. |
410 | 410 |
411 $Returns: Execution status | 411 $Returns: Execution status |
412 | 412 |
413 $Arguments: event -window event | 413 $Arguments: event -window event |
414 tc - timer info | 414 tc - timer info |
415 | 415 |
416 *******************************************************************************/ | 416 *******************************************************************************/ |
417 | 417 |
418 static int sat_play_tone_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc) | 418 static int sat_play_tone_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc) |
419 { | 419 { |
420 T_MFW_HND win = mfw_parent (mfw_header()); | 420 T_MFW_HND win = mfw_parent (mfw_header()); |
421 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 421 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
422 T_sat_play_tone * data = (T_sat_play_tone *)win_data->user; | 422 T_sat_play_tone * data = (T_sat_play_tone *)win_data->user; |
423 T_SAT_RES sat_res; | 423 T_SAT_RES sat_res; |
424 | 424 |
425 if ((win EQ NULL) || (win_data EQ NULL) || (data EQ NULL)) | 425 if ((win EQ NULL) || (win_data EQ NULL) || (data EQ NULL)) |
426 return MFW_EVENT_CONSUMED; /* we have been interrupted by user action */ | 426 return MFW_EVENT_CONSUMED; /* we have been interrupted by user action */ |
427 | 427 |
428 TRACE_FUNCTION("sat_play_tone_tim_cb()"); | 428 TRACE_FUNCTION("sat_play_tone_tim_cb()"); |
429 | 429 |
430 /* timer elapsed */ | 430 /* timer elapsed */ |
431 | 431 |
432 sat_res[SAT_ERR_INDEX] = SatResSuccess; | 432 sat_res[SAT_ERR_INDEX] = SatResSuccess; |
433 sat_res[SAT_AI_INDEX] = SatResAiNoCause; | 433 sat_res[SAT_AI_INDEX] = SatResAiNoCause; |
434 sat_done (data->sat_command, sat_res); | 434 sat_done (data->sat_command, sat_res); |
435 data->sat_command = NULL; /* signal response issued to info */ | 435 data->sat_command = NULL; /* signal response issued to info */ |
436 | 436 |
437 /* the last one has to destroy the window */ | 437 /* the last one has to destroy the window */ |
438 data->tim = NULL; /* signal end of timer to info */ | 438 data->tim = NULL; /* signal end of timer to info */ |
439 | 439 |
440 /* API/DSM - 04/09/03 - SPR2491 - Add a call to stop the play of the continuous AUDIO sound*/ | 440 /* API/DSM - 04/09/03 - SPR2491 - Add a call to stop the play of the continuous AUDIO sound*/ |
441 audio_StopSoundbyID(data->device_id, data->sound_id); | 441 audio_StopSoundbyID(data->device_id, data->sound_id); |
442 /* API/DSM - 04/09/03 - SPR2491 - END */ | 442 /* API/DSM - 04/09/03 - SPR2491 - END */ |
443 | 443 |
444 | 444 |
445 /* SPR#2340 - DS - If timer has expired, destroy info_dialog if necessary */ | 445 /* SPR#2340 - DS - If timer has expired, destroy info_dialog if necessary */ |
446 if (data->info NEQ NULL) | 446 if (data->info NEQ NULL) |
447 { | 447 { |
448 /* timer has expired therefore destroy info dialog */ | 448 /* timer has expired therefore destroy info dialog */ |
449 TRACE_EVENT("Destroy Play Tone dialog and data"); | 449 TRACE_EVENT("Destroy Play Tone dialog and data"); |
450 // July 26, 2005 REF: SPR 29520 x0018858 | 450 // July 26, 2005 REF: SPR 29520 x0018858 |
451 //The wndow displaying "Please wait was not getting destroyed. | 451 //The wndow displaying "Please wait was not getting destroyed. |
452 //Destroyed the window and initialized to NULL. | 452 //Destroyed the window and initialized to NULL. |
453 //Begin 29520 | 453 //Begin 29520 |
454 //sat_play_tone_destroy(data->info); | 454 //sat_play_tone_destroy(data->info); |
455 dialog_info_destroy(data->info); | 455 dialog_info_destroy(data->info); |
456 data->info = NULL; | 456 data->info = NULL; |
457 //End 29520 | 457 //End 29520 |
458 } | 458 } |
459 | 459 |
460 if (data->info EQ NULL) | 460 if (data->info EQ NULL) |
461 { | 461 { |
462 /* no info window or info window timed out: we are the last */ | 462 /* no info window or info window timed out: we are the last */ |
469 /******************************************************************************* | 469 /******************************************************************************* |
470 | 470 |
471 $Function: sat_calculate_time | 471 $Function: sat_calculate_time |
472 | 472 |
473 $Description: Calculate timeout value | 473 $Description: Calculate timeout value |
474 | 474 |
475 $Returns: time out in ms | 475 $Returns: time out in ms |
476 | 476 |
477 $Arguments: unit - number of units | 477 $Arguments: unit - number of units |
478 value - unit value. | 478 value - unit value. |
479 | 479 |
480 *******************************************************************************/ | 480 *******************************************************************************/ |
481 static ULONG sat_calculate_time (UBYTE unit, UBYTE value) | 481 static ULONG sat_calculate_time (UBYTE unit, UBYTE value) |
482 { | 482 { |
483 ULONG result = (ULONG)value; | 483 ULONG result = (ULONG)value; |
484 | 484 |
503 /******************************************************************************* | 503 /******************************************************************************* |
504 | 504 |
505 $Function: sat_set_selected_sound | 505 $Function: sat_set_selected_sound |
506 | 506 |
507 $Description: Choose the Sound IDīs, return appropriate duration and support info | 507 $Description: Choose the Sound IDīs, return appropriate duration and support info |
508 | 508 |
509 $Returns: time out | 509 $Returns: time out |
510 | 510 |
511 $Arguments: tone_tag - tone name | 511 $Arguments: tone_tag - tone name |
512 data - tone info | 512 data - tone info |
513 | 513 |
514 *******************************************************************************/ | 514 *******************************************************************************/ |
515 | 515 |
516 | 516 |
517 static e_TONE_DURATION sat_set_selected_sound (SatTone tone_tag, T_sat_play_tone * data) | 517 static e_TONE_DURATION sat_set_selected_sound (SatTone tone_tag, T_sat_play_tone * data) |
518 | 518 |
519 { | 519 { |
520 e_TONE_DURATION ret; | 520 e_TONE_DURATION ret; |
521 | 521 |
522 TRACE_FUNCTION("sat_set_selected_sound()"); | 522 TRACE_FUNCTION("sat_set_selected_sound()"); |
523 | 523 |
524 /* SPR#2340 - DS - Removed code that set ret to NOT_SUPPORTED if durUnit equals zero (i.e. Minutes) */ | 524 /* SPR#2340 - DS - Removed code that set ret to NOT_SUPPORTED if durUnit equals zero (i.e. Minutes) */ |
525 | 525 |
526 /* SPR#2340 - DS - Corrected sound Ids. Use defns rather than magic no.s */ | 526 /* SPR#2340 - DS - Corrected sound Ids. Use defns rather than magic no.s */ |
557 data->sound_id = TONES_KEYBEEP /*0x26*/; | 557 data->sound_id = TONES_KEYBEEP /*0x26*/; |
558 break; | 558 break; |
559 } | 559 } |
560 | 560 |
561 ret = DURATION; | 561 ret = DURATION; |
562 | 562 |
563 TRACE_EVENT_P2("tone %d, sound_id %x", tone_tag.tone, data->sound_id); | 563 TRACE_EVENT_P2("tone %d, sound_id %x", tone_tag.tone, data->sound_id); |
564 | 564 |
565 return ret; | 565 return ret; |
566 } | 566 } |
567 | 567 |
568 /******************************************************************************* | 568 /******************************************************************************* |
569 | 569 |
570 $Function: sat_info_cb | 570 $Function: sat_info_cb |
571 | 571 |
572 $Description: Callback function information dialog. | 572 $Description: Callback function information dialog. |
573 | 573 |
574 $Returns: none | 574 $Returns: none |
575 | 575 |
576 $Arguments: win - window | 576 $Arguments: win - window |
577 identifier - unique id | 577 identifier - unique id |
578 reason - event | 578 reason - event |
579 | 579 |
580 *******************************************************************************/ | 580 *******************************************************************************/ |
581 | 581 |
582 static void sat_info_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) | 582 static void sat_info_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) |
583 { | 583 { |
584 /* PLAY TONE */ | 584 /* PLAY TONE */ |
585 T_MFW_WIN * play_win_data = ((T_MFW_HDR *)win)->data; | 585 T_MFW_WIN * play_win_data = ((T_MFW_HDR *)win)->data; |
586 T_sat_play_tone * play_data = (T_sat_play_tone *)play_win_data->user; | 586 T_sat_play_tone * play_data = (T_sat_play_tone *)play_win_data->user; |
587 T_SAT_RES sat_res; | 587 T_SAT_RES sat_res; |
588 | 588 |
589 if (win EQ NULL) | 589 if (win EQ NULL) |
590 return; | 590 return; |
591 | 591 |
592 TRACE_FUNCTION("sat_info_cb()"); | 592 TRACE_FUNCTION("sat_info_cb()"); |
593 | 593 |
605 switch (reason) | 605 switch (reason) |
606 { | 606 { |
607 case INFO_TIMEOUT: | 607 case INFO_TIMEOUT: |
608 if (play_data->tim NEQ NULL) | 608 if (play_data->tim NEQ NULL) |
609 { | 609 { |
610 /* NOP on short info timeout && infinite: | 610 /* NOP on short info timeout && infinite: |
611 * tone will be stopped and SUCCESS will be signalled by sat_play_tone_tim_cb() | 611 * tone will be stopped and SUCCESS will be signalled by sat_play_tone_tim_cb() |
612 */ | 612 */ |
613 play_data->info = NULL; /* signal the end of info to timer */ | 613 play_data->info = NULL; /* signal the end of info to timer */ |
614 } | 614 } |
615 else | 615 else |
616 { | 616 { |
617 /* no timer (single tone) or timer timed out: we are the last */ | 617 /* no timer (single tone) or timer timed out: we are the last */ |
618 if (play_data->sat_command NEQ NULL) | 618 if (play_data->sat_command NEQ NULL) |
619 { | 619 { |
620 /* response not yet issued, i.e single tone with info */ | 620 /* response not yet issued, i.e single tone with info */ |
621 sat_res[SAT_ERR_INDEX] = SatResSuccess; | 621 sat_res[SAT_ERR_INDEX] = SatResSuccess; |
622 sat_res[SAT_AI_INDEX] = SatResAiNoCause; | 622 sat_res[SAT_AI_INDEX] = SatResAiNoCause; |
623 sat_done (play_data->sat_command, sat_res); | 623 sat_done (play_data->sat_command, sat_res); |
624 } | 624 } |
625 | 625 |
626 /* the last one has to destroy the window */ | 626 /* the last one has to destroy the window */ |
633 if (play_data->tim NEQ NULL) | 633 if (play_data->tim NEQ NULL) |
634 { | 634 { |
635 /* timer has not yet elapsed, stop it */ | 635 /* timer has not yet elapsed, stop it */ |
636 tim_stop (play_data->tim); | 636 tim_stop (play_data->tim); |
637 } | 637 } |
638 | 638 |
639 /* API/DSM - 04/09/03 - SPR2491 - Add a call to stop the play of the continuous AUDIO sound*/ | 639 /* API/DSM - 04/09/03 - SPR2491 - Add a call to stop the play of the continuous AUDIO sound*/ |
640 audio_StopSoundbyID(play_data->device_id, play_data->sound_id); | 640 audio_StopSoundbyID(play_data->device_id, play_data->sound_id); |
641 /* API/DSM - 04/09/03 - SPR2491 - END */ | 641 /* API/DSM - 04/09/03 - SPR2491 - END */ |
642 | 642 |
643 if (play_data->sat_command NEQ NULL) | 643 if (play_data->sat_command NEQ NULL) |
649 } | 649 } |
650 sat_play_tone_destroy (win); | 650 sat_play_tone_destroy (win); |
651 break; | 651 break; |
652 } | 652 } |
653 break; | 653 break; |
654 | 654 |
655 default: | 655 default: |
656 TRACE_EVENT("sat_info_cb(): unexp. event"); | 656 TRACE_EVENT("sat_info_cb(): unexp. event"); |
657 break; | 657 break; |
658 } | 658 } |
659 } | 659 } |