comparison src/ui/mfw/mfw_bt_api.h @ 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 * *
3 * TEXAS INSTRUMENTS ISRAEL PROPRIETARY AND CONFIDENTIAL INFORMATION *
4 * *
5 * LEGAL NOTE: THE TRANSFER OF THE TECHNICAL INFORMATION IS BEING MADE *
6 * UNDER AN EXPORT LICENSE ISSUED BY THE ISRAELI GOVERNMENT AND THAT THE *
7 * APPLICABLE EXPORT LICENSE DOES NOT ALLOW THE TECHNICAL INFORMATION TO *
8 * BE USED FOR THE MODIFICATION OF THE BT ENCRYPTION OR THE DEVELOPMENT *
9 * OF ANY NEW ENCRYPTION. THE INFORMATION CAN BE USED FOR THE INTERNAL *
10 * DESIGN AND MANUFACTURE OF TI PRODUCTS THAT WILL CONTAIN THE BT IC. *
11 * *
12 \*******************************************************************************/
13 /*******************************************************************************\
14 *
15 * FILE NAME: mfw_bt_api.h
16 *
17 * DESCRIPTION: This file defines the API between BMI (MMI) and BT applications
18 *
19 * AUTHOR: Uzi Doron
20 *
21 * Rev 0.2
22 *
23 \*******************************************************************************/
24
25
26 #ifndef __MFW_BT_API
27 #define __MFW_BT_API
28 /**********************************************/
29 /* */
30 /* */
31 /* from here on - events from BMI to BT */
32 /* */
33 /* */
34 /**********************************************/
35
36 /*-------------------------------------------------------------------------------
37 * BmiAvEvent type
38 *
39 * Defines Audio/Video events initiated by MMI side.
40 * These events will be sent from BMI to BT
41 *
42 */
43 typedef enum
44 {
45 BMI_EVENT_USER_PLAY = 0x0001, /* user pressed Play on handset */
46 BMI_EVENT_USER_STOP, /* user pressed Stop on handset */
47 BMI_EVENT_USER_PAUSE, /* user pressed Pause on handset */
48 BMI_EVENT_USER_RESUME, /* user pressed Resume on handset */
49 BMI_EVENT_TRACK_START, /* a track is starting to play */
50 BMI_EVENT_TRACK_END /* a track ended playing */
51 }BmiAvEvent;
52
53 /*-------------------------------------------------------------------------------
54 * BmiEventCallback type
55 *
56 * A callback function, implemented at BT application, that will be called by
57 * BMI to send events (of type BmiAvEvent) to BT. BMI will be able to send events
58 * after BT has registered such an event callback function
59 *
60 * At BT side the function prototype will look like:
61 * void BT_NotifyBmiEvent(BmiAvEvent event);
62 *
63 * NOTE: Since the callback is called from BMI context, the BT application should
64 * not spend considerable time in this function. In case significant processing
65 * time and/or asynchronous activity is required as a result of calling this function,
66 * the BT application should switch to its own context to perform this activity.
67 * It must not block the BMI application.
68 */
69 typedef void (*BmiEventCallback)(BmiAvEvent event);
70
71 /*-------------------------------------------------------------------------------
72 * BMI_RegisterEventCallback()
73 *
74 * BT application will call this function to register an event callback
75 * function with BMI.
76 *
77 * Parameters:
78 * eventCallback [in] - pointer of the callback function. if this parameter is
79 * NULL (0), BMI should not try to make callbacks.
80 *
81 * Returns:
82 * void
83 *
84 */
85 void BMI_RegisterEventCallback(BmiEventCallback eventCallback);
86
87
88
89 /**********************************************/
90 /* */
91 /* */
92 /* from here on - events from BT to BMI */
93 /* */
94 /* */
95 /**********************************************/
96
97 /*-------------------------------------------------------------------------------
98 * BtAppEvent type
99 *
100 * Defines events initiated by BT side.
101 * These events will be sent from BT to BMI
102 */
103 typedef enum
104 {
105 BT_EVENT_USER_PLAY = 0x0044, /* user pressed Play on BT headset */
106 BT_EVENT_USER_STOP, /* user pressed Stop on BT headset */
107 BT_EVENT_USER_PAUSE /* user pressed Pause on BT headset */
108 }BtAppEvent;
109
110 /*-------------------------------------------------------------------------------
111 * BMI_NotifyBtEvent()
112 *
113 * Notify the BMI about an A/V event initiated at BT side.
114 * This function is implemented in the BMI application and used by the BT application.
115 *
116 * NOTE: Since it is called from BT context, the BMI application should not spend
117 * considerable time in this function. In case significant processing time and/or
118 * asynchronous activity is required as a result of calling this function, the BMI
119 * application should switch to its own context to perform this activity. It must
120 * not block the BT application.
121 *
122 * Parameters:
123 * event [in] - the reported event
124 *
125 * Returns:
126 * void
127 *
128 */
129 void BMI_NotifyBtEvent(BtAppEvent event);
130
131 /*-------------------------------------------------------------------------------
132 * BMI_SwitchAudioToBtHeadset()
133 *
134 * Connect or disconnect the audio output to BT headset.
135 * BT will call this function to let BMI know an A2DP link to a wireless headset
136 * has been connected (and is in Open state), or disconnected.
137 *
138 * When link is connected, BMI will decide whether it wants to
139 * direct the audio output to the wireless headset.
140 *
141 * Parameters:
142 * connected [in] - whether the link has just been connected or disconnected:
143 * TRUE - connected
144 * FALSE - disconnected
145 *
146 * Returns:
147 * when connect parameter is TRUE:
148 * - return TRUE when BMI approves and will use A2DP headset as the audio output
149 * - return FALSE when BMI rejects using A2DP headset as the audio output
150 *
151 * when connect parameter is FALSE - returned value is ignored
152 *
153 */
154 BOOL BMI_SwitchAudioToBtHeadset(BOOL connected);
155 #endif /* __MFWE_BT_API */
156