FreeCalypso > hg > fc-magnetite
comparison src/ui3/bmi/mmiBtips.c @ 420:e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 21 Jan 2018 03:09:00 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
419:59143cd42ec7 | 420:e8ddbb0837ed |
---|---|
1 /* ========================================================= | |
2 * Texas Instruments OMAP(TM) Platform Software | |
3 * (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. | |
4 * | |
5 * Use of this software is controlled by the terms and conditions found | |
6 * in the license agreement under which this software has been supplied. | |
7 * ========================================================== */ | |
8 /* | |
9 $Project name: Basic Bluetooth MMI | |
10 $Project code: | |
11 $Module: Bluetooth BMG APPlication | |
12 $File: MmiBtipsBmg.c | |
13 $Revision: 1.0 | |
14 $Author: Texas Instruments | |
15 $Date: 26/06/07 | |
16 | |
17 ******************************************************************************** | |
18 | |
19 Description: | |
20 | |
21 This module provides the BTIPS BMG APPlication functionality. | |
22 | |
23 ******************************************************************************** | |
24 $History: MmiBtipsBmg.c | |
25 | |
26 26/06/07 Sasken original version | |
27 | |
28 $End | |
29 | |
30 *******************************************************************************/ | |
31 | |
32 | |
33 | |
34 | |
35 /******************************************************************************* | |
36 | |
37 Include files | |
38 | |
39 *******************************************************************************/ | |
40 | |
41 #define ENTITY_MFW | |
42 | |
43 #include <string.h> | |
44 | |
45 /* BTIPS Includes */ | |
46 #include "me.h" | |
47 | |
48 #if defined (NEW_FRAME) | |
49 | |
50 #include "typedefs.h" | |
51 #include "vsi.h" | |
52 #include "pei.h" | |
53 #include "custom.h" | |
54 #include "gsm.h" | |
55 #include "prim.h" | |
56 | |
57 #else | |
58 | |
59 #include "STDDEFS.H" | |
60 #include "custom.h" | |
61 #include "gsm.h" | |
62 #include "vsi.h" | |
63 | |
64 #endif | |
65 | |
66 #include "mfw_mfw.h" | |
67 #include "mfw_win.h" | |
68 #include "mfw_icn.h" /* included for mfw_mnu.h */ | |
69 #include "mfw_mnu.h" | |
70 #include "mfw_tim.h" | |
71 #include "mfw_kbd.h" | |
72 #include "mfw_sat.h" /* included for MmiDummy.h, included for MmiMenu.h */ | |
73 #include "MmiBlkLangDB.h" | |
74 #include "mmiColours.h" | |
75 #include "MmiDialogs.h" | |
76 #include "MmiDummy.h" /* included for MmiMenu.h */ | |
77 #include "MmiLists.h" | |
78 #include "MmiMenu.h" | |
79 #include "MmiSoftKeys.h" | |
80 #include "AUIEditor.h" | |
81 #include "MmiMain.h" | |
82 #include "Mmiicons.h" | |
83 #include "MmiWindow.h" | |
84 #include "MmiCall.h" | |
85 #include "mmiBookShared.h" | |
86 | |
87 /* GPF Includes */ | |
88 #include "typedefs.h" | |
89 #include "vsi.h" | |
90 | |
91 #include "Mfw_Btips.h" | |
92 #include "Mfw_BtipsBmg.h" | |
93 #include "mmiBtips.h" | |
94 #include "mmiBtipsBmg.h" | |
95 | |
96 #ifdef FF_MMI_BTIPS_APP | |
97 EXTERN char BTStr[20]; | |
98 | |
99 T_MFW_HND mmi_btips_app_win_create(T_MFW_HND parent); | |
100 static int mmi_btips_app_win_cb (MfwEvt evt, MfwWin *win); | |
101 static int mmi_btips_app_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); | |
102 static void mmi_btips_app_exit (T_MFW_HND win); | |
103 static void mmi_btips_win_exit (T_MFW_HND win); | |
104 | |
105 MMI_Btips_data g_btipsData = {0}; | |
106 T_MFW_HND g_win_infodialog; | |
107 | |
108 void mmi_btips_init(void) | |
109 { | |
110 TRACE_FUNCTION("mmiBtipsInit: Starting Bluetooth Initialization"); | |
111 if(0 == g_btipsData.ipBtipsHandle) | |
112 g_btipsData.ipBtipsHandle = aci_create(btipsPrimHandler,NULL); | |
113 mfw_btips_init(); | |
114 } | |
115 | |
116 | |
117 /******************************************************************************* | |
118 | |
119 $Function: mmi_btips_radioOnStatus | |
120 | |
121 $Description: Create the window which is going to have | |
122 the viewfinder bitmaps displayed on top of it. | |
123 | |
124 $Returns: Always returns MFW_EVENT_CONSUMED (1) | |
125 | |
126 $Arguments: m : pointer to the mnu data for the menu which caused this function to be called. | |
127 i : pointer to the item data from the menu. | |
128 | |
129 *******************************************************************************/ | |
130 USHORT mmi_btipsRadioOnStatus(struct MfwMnuTag *m, | |
131 struct MfwMnuAttrTag *ma, | |
132 struct MfwMnuItemTag *mi) | |
133 { | |
134 if(mfw_btips_getRadioStatus()) | |
135 return TRUE; | |
136 else | |
137 return FALSE; | |
138 } | |
139 | |
140 /******************************************************************************* | |
141 | |
142 $Function: mmi_btips_radioOffStatus | |
143 | |
144 $Description: Create the window which is going to have | |
145 the viewfinder bitmaps displayed on top of it. | |
146 | |
147 $Returns: Always returns MFW_EVENT_CONSUMED (1) | |
148 | |
149 $Arguments: m : pointer to the mnu data for the menu which caused this function to be called. | |
150 i : pointer to the item data from the menu. | |
151 | |
152 *******************************************************************************/ | |
153 USHORT mmi_btipsRadioOffStatus(struct MfwMnuTag *m, | |
154 struct MfwMnuAttrTag *ma, | |
155 struct MfwMnuItemTag *mi) | |
156 { | |
157 if(mfw_btips_getRadioStatus()) | |
158 return FALSE; | |
159 else | |
160 return TRUE; | |
161 } | |
162 | |
163 /******************************************************************************* | |
164 | |
165 $Function: mmi_btips_radioOn | |
166 | |
167 $Description: Create the window which is going to have | |
168 the viewfinder bitmaps displayed on top of it. | |
169 | |
170 $Returns: Always returns MFW_EVENT_CONSUMED (1) | |
171 | |
172 $Arguments: m : pointer to the mnu data for the menu which caused this function to be called. | |
173 i : pointer to the item data from the menu. | |
174 | |
175 *******************************************************************************/ | |
176 int mmi_btipsRadioOn(MfwMnu* m, MfwMnuItem* i) | |
177 { | |
178 T_MFW_HND parent_win = mfwParent(mfw_header()); | |
179 | |
180 TRACE_FUNCTION ("mmi_btipsRadioOn()"); | |
181 return mfw_btips_radioOn(); | |
182 } | |
183 | |
184 /******************************************************************************* | |
185 | |
186 $Function: mmi_btips_radioOff | |
187 | |
188 $Description: Create the window which is going to have | |
189 the viewfinder bitmaps displayed on top of it. | |
190 | |
191 $Returns: Always returns MFW_EVENT_CONSUMED (1) | |
192 | |
193 $Arguments: m : pointer to the mnu data for the menu which caused this function to be called. | |
194 i : pointer to the item data from the menu. | |
195 | |
196 *******************************************************************************/ | |
197 GLOBAL int mmi_btipsRadioOff(void) | |
198 { | |
199 TRACE_FUNCTION ("mmi_btipsRadioOff()"); | |
200 | |
201 return mfw_btips_radioOff(); | |
202 } | |
203 | |
204 | |
205 /****************************************************************************** | |
206 MFW Window Module (Creation, Deletion, Callbacks for MFW, Keyboard, etc) | |
207 ******************************************************************************/ | |
208 | |
209 | |
210 void mmi_btips_app_incoming_pairing_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) | |
211 { | |
212 | |
213 TRACE_FUNCTION("mmi_btips_app_incoming_pairing_cb"); | |
214 | |
215 switch (reason) | |
216 { | |
217 case INFO_KCD_LEFT: | |
218 /*Launch the editor for taking pin-code request, with the parent as btips_main window, not this dialog*/ | |
219 g_btipsData.pinCode_editor = mmi_btips_bmg_pinCode_editor_create(win); | |
220 SEND_EVENT(g_btipsData.pinCode_editor, BTIPS_BMG_LOCAL_EDITOR_INIT, 0, 0); | |
221 break; | |
222 case INFO_KCD_HUP: | |
223 case INFO_KCD_RIGHT: | |
224 /*Reject the pairing operatio*/ | |
225 mfw_btips_bmgSendPin(&g_btipsData.bd_addr_incomingPinReq, NULL, 0); | |
226 break; | |
227 case INFO_KCD_CLEAR: | |
228 break; | |
229 default: | |
230 break; | |
231 } | |
232 } | |
233 /****************************************************************************** | |
234 MFW Window Module (Creation, Deletion, Callbacks for MFW, Keyboard, etc) | |
235 ******************************************************************************/ | |
236 static void mmi_btips_app_push_pull_event_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) | |
237 { | |
238 TRACE_FUNCTION("mmi_btips_app_push_pull_event_cb"); | |
239 | |
240 switch (reason) | |
241 { | |
242 case INFO_KCD_LEFT: | |
243 mfw_btips_oppsAcceptObjectRequest(TRUE); | |
244 break; | |
245 | |
246 case INFO_KCD_HUP: | |
247 case INFO_KCD_RIGHT: | |
248 mfw_btips_oppsAcceptObjectRequest(FALSE); | |
249 break; | |
250 | |
251 case INFO_KCD_CLEAR: | |
252 /* Do nothing */ | |
253 break; | |
254 | |
255 default: | |
256 | |
257 break; | |
258 } | |
259 } | |
260 | |
261 static void mmi_btips_app_ftp_accept_cb (T_MFW_HND win, UBYTE identifier, UBYTE reason) | |
262 { | |
263 TRACE_FUNCTION("mmi_btips_app_ftp_accept_cb"); | |
264 | |
265 switch (reason) | |
266 { | |
267 case INFO_KCD_LEFT: | |
268 TRACE_FUNCTION("mmi_btips_app_ftp_accept_cb: KCD LEFT"); | |
269 mfw_btips_ftpsAcceptObjectRequest (TRUE); | |
270 break; | |
271 | |
272 case INFO_KCD_HUP: | |
273 case INFO_KCD_RIGHT: | |
274 /*Reject the pairing operatio*/ | |
275 TRACE_FUNCTION("mmi_btips_app_ftp_accept_cb: KCD RIGHT"); | |
276 mfw_btips_ftpsAcceptObjectRequest (FALSE); | |
277 break; | |
278 case INFO_KCD_CLEAR: | |
279 break; | |
280 default: | |
281 break; | |
282 } | |
283 } | |
284 | |
285 static char ftpRequest[256]; | |
286 | |
287 /******************************************************************************* | |
288 | |
289 $Function: mmi_btips_app_root_cb | |
290 | |
291 $Description: This function is the notification from MFW to MMI for the BT Stack events that needs | |
292 updation on the BTIPS Main Window | |
293 | |
294 $Returns: None | |
295 | |
296 $Arguments: | |
297 | |
298 *******************************************************************************/ | |
299 int mmi_btips_app_root_cb(T_MFW_EVENT evnt, void *para) | |
300 { | |
301 T_MFW_HND win = mfw_parent(mfw_header()); | |
302 MfwBtBmgEvent bmgBtEvent; | |
303 | |
304 TRACE_FUNCTION ("mmi_btips_app_root_cb()"); | |
305 TRACE_EVENT_P1("mmi_btips_app_root_cb - %d", evnt); | |
306 | |
307 | |
308 if(para != NULL) | |
309 { | |
310 bmgBtEvent = ((T_BTIPS_MMI_IND * )para)->data.bmgBtEvent; | |
311 } | |
312 switch (evnt) | |
313 { | |
314 case E_BTIPS_POWERON_SUCCESS: | |
315 TRACE_EVENT("E_BTIPS_POWERON_SUCCESS"); | |
316 mmi_btips_app_show_info(0,TxtBtipsApp,TxtBtipsOn,ONE_SECS,NULL); | |
317 break; | |
318 | |
319 case E_BTIPS_POWERON_FAILURE: | |
320 TRACE_EVENT("E_BTIPS_POWERON_FAILURE"); | |
321 mmi_btips_app_show_info(0,TxtBtipsApp,TxtBtipsFailed,ONE_SECS,NULL); | |
322 break; | |
323 | |
324 case E_BTIPS_BT_NOT_ON: | |
325 TRACE_EVENT("E_BTIPS_BT_NOT_ON"); | |
326 mmi_btips_app_show_info(0,TxtBtipsApp,TxtBtipsNotOn,ONE_SECS,NULL); | |
327 break; | |
328 | |
329 | |
330 case E_BTIPS_POWEROFF_SUCCESS: | |
331 TRACE_EVENT("E_BTIPS_POWEROFF_SUCCESS"); | |
332 mmi_btips_app_show_info(0,TxtBtipsApp,TxtBtipsOff,ONE_SECS,NULL); | |
333 break; | |
334 | |
335 case E_BTIPS_BMG_NAME_RESULT: | |
336 TRACE_EVENT("E_BTIPS_BMG_NAME_RESULT : mmibtips"); | |
337 if(TRUE == g_btipsData.incomingPinRequestState) | |
338 { | |
339 | |
340 //if(OS_MemCmp((U8*)&g_btipsData.bd_addr_incomingPinReq, sizeof(BD_ADDR), (U8*)&bmgBtEvent.bdAddr, sizeof(BD_ADDR))) | |
341 //{ | |
342 strcpy(g_btipsData.deviceName, bmgBtEvent.p.deviceName); | |
343 mmi_btips_app_ask_info(0, "Allow connection with", g_btipsData.deviceName, mmi_btips_app_incoming_pairing_cb); | |
344 | |
345 #if 0 | |
346 else | |
347 { | |
348 g_btipsData.incomingPinRequestState = FALSE; | |
349 //This case should not happen. | |
350 TRACE_ERROR("INCORRECT NAME RECEIVED FOR PIN_REQ"); | |
351 return MFW_EVENT_REJECTED; | |
352 } | |
353 #endif | |
354 } | |
355 else | |
356 { | |
357 return MFW_EVENT_REJECTED; | |
358 } | |
359 | |
360 break; | |
361 case E_BTIPS_INCOMING_PIN_REQ: | |
362 { | |
363 MfwBtBmgEvent bmgBtEvent = ((T_BTIPS_MMI_IND * )para)->data.bmgBtEvent; | |
364 TRACE_EVENT("E_BTIPS_INCOMING_PIN_REQ"); | |
365 OS_MemSet(g_btipsData.deviceName, 0, BT_MAX_REM_DEV_NAME); | |
366 OS_MemCopy((U8*)&g_btipsData.bd_addr_incomingPinReq, (U8*)&bmgBtEvent.bdAddr, sizeof(BD_ADDR)); | |
367 g_btipsData.incomingPinRequestState = TRUE; | |
368 } | |
369 break; | |
370 case E_BTIPS_BMG_PAIRING_COMPLETE: | |
371 { | |
372 MfwBtBmgEvent bmgBtEvent = ((T_BTIPS_MMI_IND * )para)->data.bmgBtEvent; | |
373 TRACE_EVENT("E_BTIPS_INCOMING_PIN_REQ"); | |
374 mfw_btips_bmgGetDeviceName(&bmgBtEvent.bdAddr, g_btipsData.deviceName); | |
375 mmi_btips_app_show_text(0, g_btipsData.deviceName, "Paired",NULL); | |
376 break; | |
377 } | |
378 | |
379 case E_BTIPS_FTPS_PUT_EVENT: | |
380 { | |
381 MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; | |
382 TRACE_EVENT("E_BTIPS_FTPS_PUT_EVENT"); | |
383 // sprintf (ftpRequest, "FTP Put %s", event.p.ftpPutRequest.objectName); | |
384 // mmi_btips_app_ask_info(0, ftpRequest, event.p.ftpPutRequest.deviceName, mmi_btips_app_ftp_accept_cb); | |
385 mmi_btips_app_ask_info(0, "FTP", "PUT", mmi_btips_app_ftp_accept_cb); | |
386 } | |
387 break; | |
388 | |
389 case E_BTIPS_FTPS_GET_EVENT: | |
390 { | |
391 MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; | |
392 TRACE_EVENT("E_BTIPS_FTPS_GET_EVENT"); | |
393 //sprintf (ftpRequest, "FTP Get %s", event.p.ftpGetRequest.objectName); | |
394 //mmi_btips_app_ask_info(0, ftpRequest, event.p.ftpGetRequest.deviceName, mmi_btips_app_ftp_accept_cb); | |
395 mmi_btips_app_ask_info(0, "FTP", " Get", mmi_btips_app_ftp_accept_cb);//sundeep | |
396 } | |
397 break; | |
398 | |
399 case E_BTIPS_FTPS_DELETE_EVENT: | |
400 { | |
401 MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; | |
402 TRACE_EVENT("E_BTIPS_FTPS_DELETE_EVENT"); | |
403 // sprintf (ftpRequest, "FTP Delete %s", event.p.ftpDeleteRequest.objectName); | |
404 // mmi_btips_app_ask_info(0, ftpRequest, event.p.ftpDeleteRequest.deviceName, mmi_btips_app_ftp_accept_cb); | |
405 mmi_btips_app_ask_info(0, "FTP", "DELETE", mmi_btips_app_ftp_accept_cb); | |
406 } | |
407 break; | |
408 /*case E_BTIPS_FTPS_COMPLETE_EVENT: | |
409 { | |
410 MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; | |
411 TRACE_EVENT("E_BTIPS_FTPS_COMPLETE_EVENT"); | |
412 //BTStr =GoepOpName1(event->ftpsEvent->oper); | |
413 mmi_btips_app_show_text(0, BTStr, "Completed",NULL); | |
414 break; | |
415 }*/ | |
416 case E_BTIPS_FTPS_CONNECT_EVENT: | |
417 { | |
418 MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; | |
419 TRACE_EVENT("E_BTIPS_FTPS_CONNECT_EVENT"); | |
420 mmi_btips_app_show_text(0, 0, "Connected",NULL); | |
421 } | |
422 break; | |
423 case E_BTIPS_FTPS_DISCONNECT_EVENT: | |
424 { | |
425 MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; | |
426 TRACE_EVENT("E_BTIPS_FTPS_DISCONNECT_EVENT"); | |
427 mmi_btips_app_show_text(0, 0, "Disconnected",NULL); | |
428 } | |
429 break; | |
430 case E_BTIPS_FTPS_ABORTED_EVENT: | |
431 { | |
432 MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; | |
433 TRACE_EVENT("E_BTIPS_FTPS_ABORTED_EVENT"); | |
434 mmi_btips_app_show_text(0, 0, "Aborted",NULL); | |
435 } | |
436 break; | |
437 case E_BTIPS_FTPS_PUT_COMP_EVENT: | |
438 { | |
439 MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; | |
440 TRACE_EVENT("E_BTIPS_FTPS_PUT_COMP_EVENT"); | |
441 mmi_btips_app_show_text(0, "PUT", "Completed",NULL); | |
442 } | |
443 break; | |
444 /*case E_BTIPS_FTPS_GET_COMP_EVENT: | |
445 { | |
446 MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; | |
447 TRACE_EVENT("E_BTIPS_FTPS_GET_COMP_EVENT"); | |
448 mmi_btips_app_show_text(0, "GET", "Completed",NULL); | |
449 } | |
450 break;*/ | |
451 case E_BTIPS_FTPS_DELETE_COMP_EVENT: | |
452 { | |
453 MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; | |
454 TRACE_EVENT("E_BTIPS_FTPS_DELETE_COMP_EVENT"); | |
455 mmi_btips_app_show_text(0, "DELETE", "Completed",NULL); | |
456 } | |
457 break; | |
458 case E_BTIPS_VG_CONNECT_EVENT: | |
459 { | |
460 MfwBtVgEvent event = ((T_BTIPS_MMI_IND * )para)->data.vgBtEvent; | |
461 mmi_btips_app_show_text (win, event.deviceName, "connected", NULL); | |
462 } | |
463 break; | |
464 | |
465 case E_BTIPS_VG_DISCONNECT_EVENT: | |
466 { | |
467 MfwBtVgEvent event = ((T_BTIPS_MMI_IND * )para)->data.vgBtEvent; | |
468 mmi_btips_app_show_text (win, "HF", "disconnected", NULL); | |
469 } | |
470 break; | |
471 | |
472 case E_BTIPS_VG_AUDIO_CONNECT_EVENT: | |
473 { | |
474 MfwBtVgEvent event = ((T_BTIPS_MMI_IND * )para)->data.vgBtEvent; | |
475 mmi_btips_app_show_text (win, "Audio", "connected", NULL); | |
476 } | |
477 break; | |
478 | |
479 case E_BTIPS_VG_AUDIO_DISCONNECT_EVENT: | |
480 { | |
481 MfwBtVgEvent event = ((T_BTIPS_MMI_IND * )para)->data.vgBtEvent; | |
482 mmi_btips_app_show_text (win, "Audio", "disconnected", NULL); | |
483 } | |
484 break; | |
485 case E_BTIPS_OPPS_PUSH_EVENT: | |
486 { | |
487 MfwBtOppsEvent oppsBtEvent = ((T_BTIPS_MMI_IND * )para)->data.oppsBtEvent; | |
488 U8 tempString1[256]; | |
489 TRACE_EVENT("E_BTIPS_OPPS_PUSH_EVENT"); | |
490 sprintf(tempString1, "Receive VCard %s from %s", oppsBtEvent.p.opps.oppObjectName, oppsBtEvent.p.opps.deviceName); | |
491 mmi_btips_app_ask_info(0, tempString1, oppsBtEvent.p.opps.deviceName, mmi_btips_app_push_pull_event_cb); | |
492 break; | |
493 } | |
494 | |
495 case E_BTIPS_OPPS_PULL_EVENT: | |
496 { | |
497 MfwBtOppsEvent oppsBtEvent = ((T_BTIPS_MMI_IND * )para)->data.oppsBtEvent; | |
498 U8 tempString1[256]; | |
499 TRACE_EVENT("E_BTIPS_OPPS_PULL_EVENT"); | |
500 sprintf(tempString1, "Send default VCard to %s", oppsBtEvent.p.opps.deviceName); | |
501 mmi_btips_app_ask_info(0, tempString1, oppsBtEvent.p.opps.deviceName, mmi_btips_app_push_pull_event_cb); | |
502 break; | |
503 } | |
504 | |
505 //#if 0 | |
506 case E_BTIPS_OPPS_PULL_COMP_EVENT: | |
507 { | |
508 MfwBtOppsEvent oppsBtEvent = ((T_BTIPS_MMI_IND * )para)->data.oppsBtEvent; | |
509 //mmi_btips_app_show_text(0, oppsBtEvent.p.opps.deviceName, "PULL Complete",NULL); | |
510 mmi_btips_app_show_text(0, "Sent", "VCard",NULL); | |
511 break; | |
512 } | |
513 | |
514 case E_BTIPS_OPPS_PUSH_COMP_EVENT: | |
515 { | |
516 MfwBtOppsEvent oppsBtEvent = ((T_BTIPS_MMI_IND * )para)->data.oppsBtEvent; | |
517 //mmi_btips_app_show_text(0, oppsBtEvent.p.opps.deviceName, "PUSH Complete",NULL); | |
518 mmi_btips_app_show_text(0, "Recived", "VCard",NULL); | |
519 break; | |
520 } | |
521 | |
522 //#endif | |
523 default: | |
524 TRACE_EVENT_P1("E_BTIPS_DEFAULT %d", evnt); | |
525 return MFW_EVENT_REJECTED; | |
526 } | |
527 dspl_Enable(1); | |
528 return MFW_EVENT_CONSUMED; | |
529 } | |
530 | |
531 /******************************************************************************* | |
532 | |
533 $Function: mmi_btips_app_show_info | |
534 | |
535 $Description: Displays the dialog box | |
536 | |
537 $Returns: Dialog window | |
538 | |
539 $Arguments: parent -parent window for dialog | |
540 str1- String to be displayed in dialog | |
541 str2 -String to be displayed in dialog | |
542 callback- Callback function | |
543 | |
544 *******************************************************************************/ | |
545 MfwHnd mmi_btips_app_show_info(T_MFW_HND parent, int str1, int str2, int timer,T_VOID_FUNC callback) | |
546 { | |
547 T_DISPLAY_DATA display_info; | |
548 T_MFW_HND win; | |
549 | |
550 TRACE_FUNCTION ("mmi_btips_app_show_info()"); | |
551 | |
552 /* | |
553 ** Create a timed dialog to display the Message . | |
554 */ | |
555 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, str1, str2, COLOUR_STATUS); | |
556 dlg_initDisplayData_events( &display_info, callback, timer, KEY_LEFT|KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
557 | |
558 win = info_dialog(parent, &display_info); | |
559 return win; | |
560 } | |
561 | |
562 | |
563 /******************************************************************************* | |
564 | |
565 $Function: mmi_fmRadio_app_show_info | |
566 | |
567 $Description: Displays the dialog box | |
568 | |
569 $Returns: Dialog window | |
570 | |
571 $Arguments: parent -parent window for dialog | |
572 str1- String to be displayed in dialog | |
573 str2 -String to be displayed in dialog | |
574 callback- Callback function | |
575 | |
576 *******************************************************************************/ | |
577 MfwHnd mmi_btips_app_show_text(T_MFW_HND parent, char * str1, char * str2, T_VOID_FUNC callback) | |
578 { | |
579 T_DISPLAY_DATA display_info; | |
580 T_MFW_HND win; | |
581 /* | |
582 ** Create a timed dialog to display the Message . | |
583 */ | |
584 dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, str1, str2, COLOUR_STATUS); | |
585 dlg_initDisplayData_events( &display_info, callback, ONE_SECS, KEY_LEFT|KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
586 | |
587 win = info_dialog(parent, &display_info); | |
588 return win; | |
589 } | |
590 | |
591 T_MFW_HND mmi_btips_app_ask_info(T_MFW_HND parent, char * str1, char * str2, T_VOID_FUNC callback) | |
592 { | |
593 T_DISPLAY_DATA display_info; | |
594 | |
595 TRACE_FUNCTION("mmi_btips_app_ask_info"); | |
596 dlg_initDisplayData_TextStr( &display_info, TxtYes, TxtNo, str1, str2, COLOUR_STATUS); | |
597 dlg_initDisplayData_events( &display_info, callback, FOREVER, KEY_LEFT|KEY_RIGHT | KEY_CLEAR | KEY_HUP); | |
598 return info_dialog(parent,&display_info); | |
599 } | |
600 | |
601 GLOBAL int mmi_btips_services(MfwMnu* m, MfwMnuItem* i) | |
602 { | |
603 T_MFW_HND parent_win = mfw_parent(mfw_header()); | |
604 | |
605 BOOL discoverServices = FALSE ; | |
606 | |
607 BOOL status; | |
608 | |
609 TRACE_EVENT_P1 ("mmi_btips_services() %d",discoverServices); | |
610 | |
611 status = mmi_btips_bmgDeviceShowServices(parent_win, discoverServices); | |
612 | |
613 if(status == SERVICESMASK_EMPTY) | |
614 { | |
615 discoverServices = TRUE; | |
616 g_win_infodialog = mmi_btips_app_show_info(0,TxtBtipsRefreshing,NULL,TEN_SECS,NULL); | |
617 mmi_btips_bmgDeviceShowServices(parent_win, discoverServices); | |
618 } | |
619 | |
620 return MFW_EVENT_CONSUMED; | |
621 } | |
622 | |
623 #endif |