comparison src/ui/bmi/mmiBtipsVg.c @ 3:67bfe9f274f6

src/ui: import of src/ui3 from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:33:10 +0000
parents
children
comparison
equal deleted inserted replaced
2:3a14ee9a9843 3:67bfe9f274f6
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 #include "me.h"
45
46 #if defined (NEW_FRAME)
47
48 #include "typedefs.h"
49 #include "vsi.h"
50 #include "pei.h"
51 #include "custom.h"
52 #include "gsm.h"
53 #include "prim.h"
54
55 #else
56
57 #include "STDDEFS.H"
58 #include "custom.h"
59 #include "gsm.h"
60 #include "vsi.h"
61
62 #endif
63
64 #include "mfw_mfw.h"
65 #include "mfw_win.h"
66 #include "mfw_icn.h" /* included for mfw_mnu.h */
67 #include "mfw_mnu.h"
68 #include "mfw_tim.h"
69 #include "mfw_kbd.h"
70 #include "mfw_sat.h" /* included for MmiDummy.h, included for MmiMenu.h */
71 #include "MmiBlkLangDB.h"
72 #include "mmiColours.h"
73 #include "MmiDialogs.h"
74 #include "MmiDummy.h" /* included for MmiMenu.h */
75 #include "MmiLists.h"
76 #include "MmiMenu.h"
77 #include "MmiSoftKeys.h"
78 #include "AUIEditor.h"
79 #include "MmiMain.h"
80 #include "Mmiicons.h"
81 #include "MmiWindow.h"
82 #include "MmiCall.h"
83 #include "mmiBookShared.h"
84
85 #include "mfw_BtipsBmg.h"
86 #include "mfw_BtipsVg.h"
87 #include "mmiBtipsBmg.h"
88 #include "mmiBtips.h"
89
90
91 static BD_ADDR selectedDevice;
92 T_MFW_HND vgSrchWin;
93 T_MFW_HND vgConDisconnectWin;
94
95 #ifdef FF_MMI_BTIPS_APP
96
97 int mmi_btips_VgConnect(MfwMnu* m, MfwMnuItem* i)
98 {
99 T_MFW_HND parent_win = mfwParent(mfw_header());
100 mfw_btips_vgConnect (selectedDevice);
101 //win_delete(parent_win);
102 return MFW_EVENT_CONSUMED;
103 }
104
105 USHORT mmi_btips_vgIsDeviceConnected()//(struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi)
106 {
107 if (mfw_btips_vgIsDeviceConnected (selectedDevice) == TRUE)
108 {
109 return TRUE;
110 }
111 else
112 {
113 return FALSE;
114 }
115 }
116
117 int mmi_btips_VgDisconnect(MfwMnu* m, MfwMnuItem* i)
118 {
119 T_MFW_HND parent_win = mfwParent (mfw_header ( ));
120 mfw_btips_vgDisconnect (selectedDevice);
121 //win_delete(parent_win);
122 return MFW_EVENT_CONSUMED;
123 }
124
125 USHORT mmi_btips_vgIsDeviceDisconnected()//(struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi)
126 {
127 if (mfw_btips_vgIsDeviceConnected (selectedDevice) == TRUE)
128 {
129 return FALSE;
130 }
131 else
132 {
133 return TRUE;
134 }
135 return MFW_EVENT_CONSUMED;
136 }
137
138
139 int mmi_BtipsVgSearchCb (BD_ADDR bdAddr)
140 {
141 static char szDevName[128];
142 T_MFW_HND parent = mfwParent(mfw_header());
143 selectedDevice = bdAddr;
144
145 mfw_btips_bmgGetDeviceName (&bdAddr, szDevName);
146 TRACE_FUNCTION_P1 ("mmi_BtipsVgSearchCb with Dev Name %s", szDevName);
147 mmi_btips_app_show_text (0, szDevName, "Selected", NULL);
148 //SEND_EVENT (vgSrchWin, BTIPS_BMG_DEVICES_EXIT_WIN, 0, (void *)NULL);
149 #ifdef FF_MMI_FMRADIO_APP
150 if(FALSE == mfw_fmRadio_isFmOverBT())
151 {
152 vgConDisconnectWin = bookMenuStart (parent, (MfwMnuAttr *)btipsVgSelectedDeviceMenuAttributes(),0);
153 }
154
155 else
156 {
157 #endif
158 /*This request is from FM Radio MMI*/
159 if (FALSE == mfw_btips_vgIsDeviceConnected(selectedDevice))
160 {
161 TRACE_FUNCTION ("mmi_BtipsVgSearchCb: FMOverBT, now make SLC");
162 mfw_btips_vgConnect(selectedDevice);
163 }
164 else if(mfw_btips_vgIsAudioOnPhone())
165 {
166 TRACE_FUNCTION ("mmi_BtipsVgSearchCb: FMOverBT, SLC UP, now create AUDIO connection");
167 mfw_btips_vgTransferAudioToHF();
168 }
169 else
170 {
171 TRACE_FUNCTION ("mmi_BtipsVgSearchCb: FMOverBT, SLC UP, Audio UP, Now Disconnect SLC");
172 mfw_btips_vgDisconnect(selectedDevice);
173 }
174 // }
175 //SEND_EVENT (vgSrchWin, BTIPS_BMG_DEVICES_EXIT_WIN, 0, (void *)NULL);//sundeep
176 return MFW_EVENT_CONSUMED;
177 }
178
179 /*******************************************************************************
180
181 $Function: mmi_BtipsMyHandsfree
182
183 $Description:
184
185 $Returns:
186
187 $Arguments:
188
189 *******************************************************************************/
190 int mmi_BtipsMyHandsfree(MfwMnu* m, MfwMnuItem* i)
191 {
192 /*
193 Create a new window to
194 1. List out the current paired Handsfree Device
195 2. Give an option to search for new Handsfree Devices
196 */
197 T_MFW_HND parent_win = mfwParent(mfw_header());
198
199 TRACE_FUNCTION("mmi_BtipsMyHandsfree");
200
201 vgSrchWin = mmi_btips_bmg_devices_win_create (parent_win, BTIPS_HSHF_DEVICE_SEARCH, mmi_BtipsVgSearchCb);
202
203 return MFW_EVENT_CONSUMED;
204 }
205
206 int mmi_BtipsTransferAudioToPhone (MfwMnu* m, MfwMnuItem* i)
207 {
208 T_MFW_HND parent_win = mfwParent (mfw_header ( ));
209
210 mmi_btips_app_show_info (parent_win, TxtBtipsAudioOnPhone, TxtSelected, ONE_SECS,NULL);
211
212 mfw_btips_vgTransferAudioToPhone ( );
213
214 return MFW_EVENT_CONSUMED;
215 }
216
217 int mmi_BtipsTransferAudioToHF (MfwMnu* m, MfwMnuItem* i)
218 {
219 T_MFW_HND parent_win = mfwParent (mfw_header ( ));
220
221 mmi_btips_app_show_info (parent_win, TxtBtipsAudioOnHeadset, TxtSelected, ONE_SECS,NULL);
222
223 mfw_btips_vgTransferAudioToHF ( );
224
225 return MFW_EVENT_CONSUMED;
226 }
227
228 int mmi_BtipsAudioHandOver (MfwMnu* m, MfwMnuItem* i)
229 {
230 T_MFW_HND parent_win = mfwParent (mfw_header ( ));
231
232 mmi_btips_app_show_info (parent_win, TxtBtipsAudioSwitchToOtherHeadset, TxtSelected, ONE_SECS,NULL);
233 // mfw_btips_vgTransferAudioHandOver ( );
234
235 return MFW_EVENT_CONSUMED;
236
237 }
238
239 USHORT mmi_Btips_is_audio_on_phone (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma,
240 struct MfwMnuItemTag *mi)
241 {
242 if (mfw_btips_vgIsAudioOnPhone ( ) == TRUE)
243 {
244 return TRUE;
245 }
246 else
247 {
248 return FALSE;
249 }
250 }
251
252 USHORT mmi_Btips_is_audio_on_handsfree (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma,
253 struct MfwMnuItemTag *mi)
254 {
255 if (mfw_btips_vgIsAudioOnHF ( ) == TRUE)
256 {
257 return TRUE;
258 }
259 else
260 {
261 return FALSE;
262 }
263
264 }
265
266 USHORT mmi_Btips_is_audio_handover_possible (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma,
267 struct MfwMnuItemTag *mi)
268 {
269 if (mfw_btips_vgIsHandOverPossible ( ) == TRUE)
270 {
271 return FALSE;
272 }
273 else
274 {
275 return TRUE;
276 }
277
278 }
279 #endif