Merge branch 'master' into tizen_2.1
[platform/core/connectivity/bluetooth-frwk.git] / include / bt-internal-types.h
1 /*
2  * bluetooth-frwk
3  *
4  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *              http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef _BT_INTERNAL_TYPES_H_
21 #define _BT_INTERNAL_TYPES_H_
22
23 #include <sys/types.h>
24 #include <libintl.h>
25
26 #include <dlog.h>
27
28 #include "bluetooth-api.h"
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33
34 typedef enum {
35         BT_NO_SERVER,
36         BT_NATIVE_SERVER,
37         BT_CUSTOM_SERVER,
38         BT_FTP_SERVER,
39 } bt_server_type_t;
40
41 typedef enum {
42         BT_SYNC_REQ,
43         BT_ASYNC_REQ
44 } bt_req_type_t;
45
46 typedef enum {
47         BT_MANAGER_EVENT = 0x01,
48         BT_ADAPTER_EVENT,
49         BT_DEVICE_EVENT,
50         BT_HID_EVENT,
51         BT_NETWORK_EVENT,
52         BT_HEADSET_EVENT,
53         BT_AVRCP_EVENT,
54         BT_OPP_CLIENT_EVENT,
55         BT_OPP_SERVER_EVENT,
56         BT_RFCOMM_CLIENT_EVENT,
57         BT_RFCOMM_SERVER_EVENT,
58         BT_AGENT_EVENT,
59         /* Will be added */
60 } bt_event_type_t;
61
62 typedef enum {
63         BT_BLUEZ_SERVICE = 0x00,
64         BT_OBEX_SERVICE,
65         BT_AGENT_SERVICE,
66 } bt_service_type_t;
67
68 typedef enum {
69         BT_RFCOMM_UUID = 0x00,
70         BT_RFCOMM_CHANNEL,
71 } bt_rfcomm_connect_type_t;
72
73 #define BT_ADDRESS_STR_LEN 18
74 #define BT_DBUS_TIMEOUT_MAX 50000
75 #define BT_SERVER_ACCEPT_TIMEOUT 2000 /* 2 seconds */
76 #define BT_FILE_PATH_MAX 256
77 #define BT_NAME_MAX 256
78
79 #define BT_HFP_AUDIO_GATEWAY_UUID "0000111f-0000-1000-8000-00805f9b34fb"
80 #define BT_A2DP_UUID "0000110D-0000-1000-8000-00805F9B34FB"
81 #define BT_AVRCP_TARGET_UUID "0000110c-0000-1000-8000-00805f9b34fb"
82 #define BT_OPP_UUID "00001105-0000-1000-8000-00805f9b34fb"
83 #define BT_FTP_UUID "00001106-0000-1000-8000-00805f9b34fb"
84 #define BT_SPP_UUID "00001101-0000-1000-8000-00805f9b34fb"
85 #define BT_HID_UUID "00001124-0000-1000-8000-00805f9b34fb"
86 #define BT_PAN_PANU_UUID "00001115-0000-1000-8000-00805f9b34fb"
87 #define BT_PAN_NAP_UUID "00001116-0000-1000-8000-00805f9b34fb"
88 #define BT_PAN_GN_UUID "00001117-0000-1000-8000-00805f9b34fb"
89
90 #define BT_FUNC_BASE ((int)(0x0000))
91 #define BT_FUNC_DEVICE_BASE ((int)(BT_FUNC_BASE + 0x0050))
92 #define BT_FUNC_HID_BASE ((int)(BT_FUNC_DEVICE_BASE + 0x0020))
93 #define BT_FUNC_NETWORK_BASE ((int)(BT_FUNC_HID_BASE + 0x0020))
94 #define BT_FUNC_AUDIO_BASE ((int)(BT_FUNC_NETWORK_BASE + 0x0020))
95 #define BT_FUNC_OOB_BASE ((int)(BT_FUNC_AUDIO_BASE + 0x0020))
96 #define BT_FUNC_AVRCP_BASE ((int)(BT_FUNC_OOB_BASE + 0x0020))
97 #define BT_FUNC_OPP_BASE ((int)(BT_FUNC_AVRCP_BASE + 0x0020))
98 #define BT_FUNC_RFCOMM_BASE ((int)(BT_FUNC_OPP_BASE + 0x0020))
99
100 typedef enum {
101         BT_CHECK_ADAPTER = BT_FUNC_BASE,
102         BT_ENABLE_ADAPTER,
103         BT_DISABLE_ADAPTER,
104         BT_SET_DISCOVERABLE_TIME,
105         BT_GET_DISCOVERABLE_TIME,
106         BT_IGNORE_AUTO_PAIRING,
107         BT_GET_LOCAL_ADDRESS,
108         BT_GET_LOCAL_NAME,
109         BT_SET_LOCAL_NAME,
110         BT_IS_SERVICE_USED,
111         BT_GET_DISCOVERABLE_MODE,
112         BT_SET_DISCOVERABLE_MODE,
113         BT_START_DISCOVERY,
114         BT_CANCEL_DISCOVERY,
115         BT_IS_DISCOVERYING,
116         BT_GET_BONDED_DEVICES,
117         BT_RESET_ADAPTER,
118         BT_BOND_DEVICE = BT_FUNC_DEVICE_BASE,
119         BT_CANCEL_BONDING,
120         BT_UNBOND_DEVICE,
121         BT_SEARCH_SERVICE,
122         BT_CANCEL_SEARCH_SERVICE,
123         BT_GET_BONDED_DEVICE,
124         BT_SET_ALIAS,
125         BT_SET_AUTHORIZATION,
126         BT_IS_DEVICE_CONNECTED,
127         BT_HID_CONNECT = BT_FUNC_HID_BASE,
128         BT_HID_DISCONNECT,
129         BT_NETWORK_ACTIVATE = BT_FUNC_NETWORK_BASE,
130         BT_NETWORK_DEACTIVATE,
131         BT_NETWORK_CONNECT,
132         BT_NETWORK_DISCONNECT,
133         BT_AUDIO_CONNECT = BT_FUNC_AUDIO_BASE,
134         BT_AUDIO_DISCONNECT,
135         BT_AG_CONNECT,
136         BT_AG_DISCONNECT,
137         BT_AV_CONNECT,
138         BT_AV_DISCONNECT,
139         BT_GET_SPEAKER_GAIN,
140         BT_SET_SPEAKER_GAIN,
141         BT_OOB_READ_LOCAL_DATA = BT_FUNC_OOB_BASE,
142         BT_OOB_ADD_REMOTE_DATA,
143         BT_OOB_REMOVE_REMOTE_DATA,
144         BT_AVRCP_SET_TRACK_INFO = BT_FUNC_AVRCP_BASE,
145         BT_AVRCP_SET_PROPERTY,
146         BT_AVRCP_SET_PROPERTIES,
147         BT_OPP_PUSH_FILES = BT_FUNC_OPP_BASE,
148         BT_OPP_CANCEL_PUSH,
149         BT_OPP_IS_PUSHING_FILES,
150         BT_OBEX_SERVER_ALLOCATE,
151         BT_OBEX_SERVER_DEALLOCATE,
152         BT_OBEX_SERVER_IS_ACTIVATED,
153         BT_OBEX_SERVER_ACCEPT_CONNECTION,
154         BT_OBEX_SERVER_REJECT_CONNECTION,
155         BT_OBEX_SERVER_ACCEPT_FILE,
156         BT_OBEX_SERVER_REJECT_FILE,
157         BT_OBEX_SERVER_SET_PATH,
158         BT_OBEX_SERVER_SET_ROOT,
159         BT_OBEX_SERVER_CANCEL_TRANSFER,
160         BT_OBEX_SERVER_CANCEL_ALL_TRANSFERS,
161         BT_OBEX_SERVER_IS_RECEIVING,
162         BT_RFCOMM_CLIENT_CONNECT = BT_FUNC_RFCOMM_BASE,
163         BT_RFCOMM_CLIENT_CANCEL_CONNECT,
164         BT_RFCOMM_CLIENT_IS_CONNECTED,
165         BT_RFCOMM_SOCKET_DISCONNECT,
166         BT_RFCOMM_SOCKET_WRITE,
167         BT_RFCOMM_CREATE_SOCKET,
168         BT_RFCOMM_REMOVE_SOCKET,
169         BT_RFCOMM_LISTEN,
170         BT_RFCOMM_IS_UUID_AVAILABLE,
171         BT_RFCOMM_ACCEPT_CONNECTION,
172         BT_RFCOMM_REJECT_CONNECTION,
173
174 } bt_function_t;
175
176 typedef struct {
177         char title[BT_NAME_MAX];
178         char artist[BT_NAME_MAX];
179         char album[BT_NAME_MAX];
180         char genre[BT_NAME_MAX];
181         unsigned int total_tracks;
182         unsigned int number;
183         unsigned int duration;
184 } media_metadata_t;
185
186 #define BT_COMMON_PKG "ug-setting-bluetooth-efl"
187
188 /* Need to convert the design ID */
189 #define BT_STR_NOT_SUPPORT "Not support"
190
191 #ifndef __TIZEN_OPEN__
192 #define BT_MDM_LIMITED_VISIBLE_TIMEOUT 120
193
194 #define BT_STR_DISABLED_RESTRICTS \
195         dgettext(BT_COMMON_PKG, "IDS_BT_BODY_SECURITY_POLICY_RESTRICTS_USE_OF_BLUETOOTH_CONNECTION")
196
197 #define BT_STR_HANDS_FREE_RESTRICTS \
198         dgettext(BT_COMMON_PKG, "IDS_BT_BODY_SECURITY_POLICY_RESTRICTS_USE_OF_BLUETOOTH_CONNECTION_TO_HANDS_FREE_FEATURES_ONLY")
199 #endif
200
201 #define BT_FILE_VISIBLE_TIME "file/private/libug-setting-bluetooth-efl/visibility_time"
202 #define BT_OFF_DUE_TO_FLIGHT_MODE "file/private/bt-service/flight_mode_deactivated"
203
204 #define BT_EVENT_SERVICE "org.projectx.bt_event"
205
206 #define BT_ADAPTER_PATH "/org/projectx/bt/adapter"
207 #define BT_DEVICE_PATH "/org/projectx/bt/device"
208 #define BT_HID_PATH "/org/projectx/bt/hid"
209 #define BT_HEADSET_PATH "/org/projectx/bt/headset"
210 #define BT_AVRCP_PATH "/org/projectx/bt/avrcp"
211 #define BT_NETWORK_PATH "/org/projectx/bt/newtork"
212 #define BT_OPP_CLIENT_PATH "/org/projectx/bt/opp_client"
213 #define BT_OPP_SERVER_PATH "/org/projectx/bt/opp_server"
214 #define BT_RFCOMM_CLIENT_PATH "/org/projectx/bt/rfcomm_client"
215 #define BT_RFCOMM_SERVER_PATH "/org/projectx/bt/rfcomm_server"
216
217
218 #define BT_ENABLED "Enabled"
219 #define BT_DISABLED "Disabled"
220 #define BT_DISCOVERABLE_MODE_CHANGED "DiscoverableModeChanged"
221 #define BT_DISCOVERABLE_TIMEOUT_CHANGED "DiscoverableTimeoutChanged"
222 #define BT_ADAPTER_NAME_CHANGED "AdapterNameChanged"
223 #define BT_DISCOVERY_STARTED "DiscoveryStarted"
224 #define BT_DISCOVERY_FINISHED "DiscoveryFinished"
225 #define BT_DEVICE_FOUND "DeviceFound"
226 #define BT_DEVICE_CONNECTED "DeviceConnected"
227 #define BT_DEVICE_DISCONNECTED "DeviceDisconnected"
228 #define BT_BOND_CREATED "BondCreated"
229 #define BT_BOND_DESTROYED "BondDestroyed"
230 #define BT_SERVICE_SEARCHED "ServiceSearched"
231 #define BT_INPUT_CONNECTED "InputConnected"
232 #define BT_INPUT_DISCONNECTED "InputDisconnected"
233 #define BT_HEADSET_CONNECTED "HeadsetConnected"
234 #define BT_HEADSET_DISCONNECTED "HeadsetDisconnected"
235 #define BT_STEREO_HEADSET_CONNECTED "StereoHeadsetConnected"
236 #define BT_STEREO_HEADSET_DISCONNECTED "StereoHeadsetDisconnected"
237 #define BT_SCO_CONNECTED "ScoConnected"
238 #define BT_SCO_DISCONNECTED "ScoDisconnected"
239 #define BT_SPEAKER_GAIN "SpeakerGain"
240 #define BT_MICROPHONE_GAIN "MicrophoneGain"
241 #define BT_NETWORK_CONNECTED "NetworkConnected"
242 #define BT_NETWORK_DISCONNECTED "NetworkDisconnected"
243 #define BT_NETWORK_SERVER_CONNECTED "NetworkServerConnected"
244 #define BT_NETWORK_SERVER_DISCONNECTED "NetworkServerDisconnected"
245 #define BT_OPP_CONNECTED "OppConnected"
246 #define BT_OPP_DISCONNECTED "OppDisconnected"
247 #define BT_TRANSFER_STARTED "TransferStarted"
248 #define BT_TRANSFER_PROGRESS "TransferProgress"
249 #define BT_TRANSFER_COMPLETED "TransferCompleted"
250 #define BT_TRANSFER_AUTHORIZED "TransferAuthorized"
251 #define BT_CONNECTION_AUTHORIZED "ConnectionAuthorized"
252 #define BT_RFCOMM_SERVER_REMOVED "RfcommServerRemoved"
253 #define BT_RFCOMM_DATA_RECEIVED "RfcommDataReceived"
254 #define BT_RFCOMM_CONNECTED "RfcommConnected"
255 #define BT_RFCOMM_DISCONNECTED "RfcommDisconnected"
256 #define BT_MEDIA_SHUFFLE_STATUS "MediaShuffleStatus"
257 #define BT_MEDIA_EQUALIZER_STATUS "MediaEqualizerStatus"
258 #define BT_MEDIA_REPEAT_STATUS "MediaRepeatStatus"
259 #define BT_MEDIA_SCAN_STATUS "MediaScanStatus"
260
261 #ifdef __cplusplus
262 }
263 #endif /* __cplusplus */
264 #endif /*_BT_INTERNAL_TYPES_H_*/
265