comparison g23m/condat/ms/src/bmi/mmiBluetooth.h @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 /*
2 +-------------------------------------------------------------------+
3 | PROJECT: MMI-Framework (8445) $Workfile:: mmiBluetooth.h $|
4 | $Author:: NDH $Revision:: 1 $|
5 | CREATED: 26.04.04 $Modtime:: 26.04.04 10:48 $|
6 | STATE : code |
7 +-------------------------------------------------------------------+
8
9
10 MODULE : MFW_BT
11
12 PURPOSE : This module contains the definitions for MFW Bluetooth Management
13
14 */
15
16 #ifndef DEF_MMI_BLUETOOTH_HEADER
17 #define DEF_MMI_BLUETOOTH_HEADER
18
19 #include "mfw_mfw.h"
20 #include "mfw_mnu.h"
21
22 #define BLUETOOTH_TEST 0
23
24 #ifdef BLUETOOTH_TEST
25 /*
26 ** Module Test Function Prototypes
27 */
28 void bluetoothTestDevMngr(void);
29 void bluetoothTestDevMngrSrch(void);
30 void bluetoothTestDevMngrSec(void);
31 void bluetoothTestDataGw(void);
32 void bluetoothTestAudioGw(void);
33 void bluetoothTestObjPush(void);
34 void bluetoothTestFileTxfr(void);
35 void bluetoothTestClient(void);
36 void bluetoothTestServer(void);
37
38 GLOBAL int mmi_bluetooth_test_single_msg(MfwMnu * mnu, MfwMnuItem * item);
39 GLOBAL int mmi_bluetooth_test_multi_msg(MfwMnu * mnu, MfwMnuItem * item);
40 GLOBAL int mmi_bluetooth_test_buf_ovrflow(MfwMnu * mnu, MfwMnuItem * item);
41 #endif
42
43 /*
44 ** Type Definitions
45 */
46 typedef enum
47 {
48 /*
49 ** Events generatede Internally, or from Menus
50 */
51 BT_BLUETOOTH_ON,
52 BT_BLUETOOTH_OFF,
53 BT_DISCOVERABLE_ON,
54 BT_DISCOVERABLE_TIMED,
55 BT_DISCOVERABLE_OFF,
56 BT_LIST_KNOWN_DEVICES,
57 BT_DEVICE_SEARCH,
58 BT_PAIR_DEVICE,
59 BT_SHOW_DEV_SERVICES,
60 BT_DISABLE_BLUETOOTH,
61 BT_DISABLE_SEARCH,
62 BT_EDITOR_CANCEL,
63 BT_EDITOR_SELECT,
64 BT_SET_REM_DEV_NAME, /* CQ21843 : Internal Event to trigger the process of assigning a Friendly Name to a remote device */
65
66 /*
67 ** Bluetooth Events handled by the Root Window
68 */
69 BT_ENABLE_COMPLETE,
70 BT_DISABLE_COMPLETE,
71 BT_DEV_NAME_REQ,
72 BT_PIN_REQ,
73 BT_AUTHORIZE_REQ,
74 BT_LINK_UP,
75 BT_LINK_DOWN,
76
77 /*
78 ** Bluetooth Events handled by both the Root and Search Windows
79 */
80 BT_AUTH_COMPLETE,
81
82 /*
83 ** Bluetooth Events handled by the Search Window
84 */
85 BT_INQUIRY_COMPLETE,
86 BT_DISCOVER_RESULT,
87 BT_DISCOVER_COMPLETE
88 } T_BT_EVENT;
89
90 typedef enum
91 {
92 BT_MNU_INIT
93 } T_BT_MNU_EVENT;
94
95 typedef enum
96 {
97 BT_DEV_NAME_EDITOR,
98 BT_REM_DEV_NAME_EDITOR, /* CQ21843 : Identifier for Editor Process for assigning a Friendly Name to a remote device */
99 BT_PIN_REQ_EDITOR,
100 BT_PAIRING_EDITOR
101 } T_BT_IDENTIFIER;
102
103 typedef enum
104 {
105 BT_NOT_EXPECTED, /* Authentication result not expected */
106 BT_NO_RESP, /* No Response Required - No Dialog Shown */
107 BT_SUCCESS_FAIL_RESP, /* Display a dialog indicating Success or Failure */
108 BT_PAIRED_NOT_RESP /* Display a dialog indicating Paired or Not Paired */
109 } T_BT_REQ_RESP;
110
111 typedef enum
112 {
113 BT_MODE_NO_SEARCH, /* No Search is under way */
114 BT_MODE_KNOWN_DEVICES, /* Just getting a list of known devices */
115 BT_MODE_LOCAL_SEARCH, /* Doing a full search for any peer devices */
116 BT_MODE_LOCAL_SEARCH_CANCEL, /* User Canceled Search before All devices were reported */
117 BT_MODE_LIST_COMPLETE
118 } T_BT_SEARCH_MODE;
119
120 /*
121 ** Menu Status Functions
122 */
123 USHORT isBluetoothActive( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
124 USHORT isBluetoothInactive( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
125 USHORT isBtDevicePaired( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
126 USHORT isBtDeviceUnPaired( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
127 USHORT isBtDeviceKnown( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
128 USHORT isBtDeviceUnknown( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi );
129
130 /*
131 ** Menu Action Functions
132 */
133 GLOBAL int mmi_bluetooth_on(MfwMnu * mnu, MfwMnuItem * item);
134 GLOBAL int mmi_bluetooth_automatic(MfwMnu * mnu, MfwMnuItem * item);
135 GLOBAL int mmi_bluetooth_off(MfwMnu * mnu, MfwMnuItem * item);
136 GLOBAL int mmi_bluetooth_change_name(MfwMnu * mnu, MfwMnuItem * item);
137 GLOBAL int mmi_bluetooth_set_discoverable_on(MfwMnu * mnu, MfwMnuItem * item);
138 GLOBAL int mmi_bluetooth_set_discoverable_off(MfwMnu * mnu, MfwMnuItem * item);
139 GLOBAL int mmi_bluetooth_set_discoverable_timed(MfwMnu * mnu, MfwMnuItem * item);
140 GLOBAL int mmi_bluetooth_device_search(MfwMnu * mnu, MfwMnuItem * item);
141 GLOBAL int mmi_bluetooth_list_known_devices(MfwMnu * mnu, MfwMnuItem * item);
142 GLOBAL int mmi_bluetooth_clear_all_stored_devices(MfwMnu * mnu, MfwMnuItem * item);
143
144 /*
145 ** Bluetooth MMI Functions
146 */
147 void mmi_bt_exit (void);
148 void mmi_bt_init (void);
149
150 T_MFW_HND mmi_bt_pin_request_create(T_MFW_HND parent);
151 MfwRes mmi_bt_pin_request_destroy(T_MFW_HND win);
152
153 T_MFW_HND mmi_bt_dev_name_create(T_MFW_HND parent);
154 MfwRes mmi_bt_dev_name_destroy(T_MFW_HND win);
155
156 T_MFW_HND mmi_bt_authorize_create(T_MFW_HND parent);
157 MfwRes mmi_bt_authorize_destroy(T_MFW_HND win);
158
159 BOOL mmi_bt_search_create(T_MFW_HND parent);
160 GLOBAL void mmi_bt_search_destroy (void);
161
162 void mmi_bt_pin_req_cntrl (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
163 void mmi_bt_dev_name_cntrl(T_MFW_HND win, USHORT event, SHORT value, void * parameter);
164 void mmi_bt_authorize_cntrl(T_MFW_HND win, USHORT event, SHORT value, void * parameter);
165 void mmi_bt_search_cntrl (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
166
167 int mmi_bluetooth_win_cb(MfwEvt evt, MfwHnd win);
168
169 void mmi_bt_authorize_dlg_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason);
170
171
172 #endif
173