tizen 2.3.1 release
[framework/connectivity/bluetooth-frwk.git] / include / bluetooth-api.h
1 /*
2  * Bluetooth-frwk
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:  Hocheol Seo <hocheol.seo@samsung.com>
7  *               Girishashok Joshi <girish.joshi@samsung.com>
8  *               Chanyeol Park <chanyeol.park@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *              http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */
23
24 #ifndef _BLUETOOTH_API_H_
25 #define _BLUETOOTH_API_H_
26
27 #include <stdlib.h>
28 #include <unistd.h>
29 #include <glib.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif                          /* __cplusplus */
34
35 /**
36  * @defgroup BLUETOOTHFW BluetoothFW
37  *
38  * A base library for bluetooth framework
39  *
40  * @addtogroup BLUETOOTHFW
41  * @{
42  */
43
44 #define BLUETOOTH_ADDRESS_LENGTH            6 /**< This specifies bluetooth device address length */
45 #define BLUETOOTH_VERSION_LENGTH_MAX       30 /**< This specifies bluetooth device version length */
46 #define BLUETOOTH_INTERFACE_NAME_LENGTH        16
47 #define BLUETOOTH_DEVICE_NAME_LENGTH_MAX       248 /**< This specifies maximum device name length */
48 #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX   31 /**< This specifies maximum AD data length */
49 #define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX     31 /**< This specifies maximum LE Scan response data length */
50 #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX  240 /**< This specifies maximum manufacturer data length */
51
52 #define BLUETOOTH_MAX_SERVICES_FOR_DEVICE       40  /**< This specifies maximum number of services
53                                                         a device can support */
54
55 #define BLUETOOTH_UUID_STRING_MAX 50
56 #define BLUETOOTH_PATH_STRING 50
57
58 #define BLUETOOTH_OOB_DATA_LENGTH               16
59 /**
60  * This is Bluetooth Connected event role
61  */
62 #define RFCOMM_ROLE_SERVER 1
63 #define RFCOMM_ROLE_CLIENT 2
64
65 /**
66  * This is RFCOMM default Channel Value
67  */
68 #define RFCOMM_DEFAULT_PROFILE_CHANNEL 0
69
70 /**
71  * This is maximum length for search value string for PBAP Phonebook Search
72  */
73 #define BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH 100
74
75
76 /**
77  * This is Bluetooth error code
78  */
79 #define BLUETOOTH_ERROR_BASE                   ((int)0)         /**< Error code base */
80
81 #define BLUETOOTH_ERROR_NONE                   ((int)0)         /**< No error #0 */
82 #define BLUETOOTH_ERROR_CANCEL                 ((int)BLUETOOTH_ERROR_BASE - 0x01)
83                                                                 /**< cancelled */
84 #define BLUETOOTH_ERROR_INVALID_CALLBACK       ((int)BLUETOOTH_ERROR_BASE - 0x02)
85                                                                 /**< Callback error */
86 #define BLUETOOTH_ERROR_INVALID_PARAM          ((int)BLUETOOTH_ERROR_BASE - 0x03)
87                                                                 /**< invalid paramerror */
88 #define BLUETOOTH_ERROR_INVALID_DATA           ((int)BLUETOOTH_ERROR_BASE - 0x04)
89                                                                 /**< invalid data error */
90 #define BLUETOOTH_ERROR_MEMORY_ALLOCATION      ((int)BLUETOOTH_ERROR_BASE - 0x05)
91                                                                 /**< Memory allocation error */
92 #define BLUETOOTH_ERROR_OUT_OF_MEMORY          ((int)BLUETOOTH_ERROR_BASE - 0x06)
93                                                                 /**< out of memory error */
94 #define BLUETOOTH_ERROR_TIMEOUT                ((int)BLUETOOTH_ERROR_BASE - 0x07)
95                                                                 /**< timeout error */
96 #define BLUETOOTH_ERROR_NO_RESOURCES           ((int)BLUETOOTH_ERROR_BASE - 0x08)
97                                                                 /**< No resource error */
98 #define BLUETOOTH_ERROR_INTERNAL               ((int)BLUETOOTH_ERROR_BASE - 0x09)
99                                                                 /**< internal error */
100 #define BLUETOOTH_ERROR_NOT_SUPPORT            ((int)BLUETOOTH_ERROR_BASE - 0x0a)
101                                                                 /**< Not supported error */
102 #define BLUETOOTH_ERROR_DEVICE_NOT_ENABLED     ((int)BLUETOOTH_ERROR_BASE - 0x0b)
103                                                                 /**< Operation is failed because
104                                                                 of not enabled BT Adapter */
105 #define BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED  ((int)BLUETOOTH_ERROR_BASE - 0x0c)
106                                                                 /**< Enabling is failed because of
107                                                                 already enabled BT Adapter */
108 #define BLUETOOTH_ERROR_DEVICE_BUSY            ((int)BLUETOOTH_ERROR_BASE - 0x0d)
109                                                                 /**< Operation is failed because of
110                                                                 other on going operation */
111 #define BLUETOOTH_ERROR_ACCESS_DENIED          ((int)BLUETOOTH_ERROR_BASE - 0x0e)
112                                                                 /**< access denied error */
113 #define BLUETOOTH_ERROR_MAX_CLIENT             ((int)BLUETOOTH_ERROR_BASE - 0x0f)
114                                                                 /**< max client error */
115 #define BLUETOOTH_ERROR_NOT_FOUND              ((int)BLUETOOTH_ERROR_BASE - 0x10)
116                                                                 /**< not found error */
117 #define BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR   ((int)BLUETOOTH_ERROR_BASE - 0x11)
118                                                                 /**< service search fail */
119 #define BLUETOOTH_ERROR_PARING_FAILED          ((int)BLUETOOTH_ERROR_BASE - 0x12)
120                                                                 /**< pairing failed error */
121 #define BLUETOOTH_ERROR_NOT_PAIRED             ((int)BLUETOOTH_ERROR_BASE - 0x13)
122                                                                 /**< Not paired error */
123 #define BLUETOOTH_ERROR_SERVICE_NOT_FOUND      ((int)BLUETOOTH_ERROR_BASE - 0x14)
124                                                                 /**< no service error */
125 #define BLUETOOTH_ERROR_NOT_CONNECTED          ((int)BLUETOOTH_ERROR_BASE - 0x15)
126                                                                 /**< no connection error */
127 #define BLUETOOTH_ERROR_ALREADY_CONNECT        ((int)BLUETOOTH_ERROR_BASE - 0x16)
128                                                                 /**< alread connected error */
129 #define BLUETOOTH_ERROR_CONNECTION_BUSY        ((int)BLUETOOTH_ERROR_BASE - 0x17)
130                                                                 /**< connection busy error */
131 #define BLUETOOTH_ERROR_CONNECTION_ERROR       ((int)BLUETOOTH_ERROR_BASE - 0x18)
132                                                                 /**< connection error */
133 #define BLUETOOTH_ERROR_MAX_CONNECTION         ((int)BLUETOOTH_ERROR_BASE - 0x19)
134                                                                 /**< max connection error*/
135 #define BLUETOOTH_ERROR_NOT_IN_OPERATION       ((int)BLUETOOTH_ERROR_BASE - 0x1a)
136                                                                 /**< Not in operation */
137 #define BLUETOOTH_ERROR_CANCEL_BY_USER         ((int)BLUETOOTH_ERROR_BASE - 0x1b)
138                                                                 /**< Cancelled by user */
139 #define BLUETOOTH_ERROR_REGISTRATION_FAILED    ((int)BLUETOOTH_ERROR_BASE - 0x1c)
140                                                                 /**< Service record registration failed */
141 #define BLUETOOTH_ERROR_IN_PROGRESS            ((int)BLUETOOTH_ERROR_BASE - 0x1d)
142                                                                 /**< Operation in progress */
143 #define BLUETOOTH_ERROR_AUTHENTICATION_FAILED  ((int)BLUETOOTH_ERROR_BASE - 0x1e)
144                                                                 /**< authentication failed error when paring*/
145 #define BLUETOOTH_ERROR_HOST_DOWN              ((int)BLUETOOTH_ERROR_BASE - 0x1f)
146                                                                 /**< Remote host is down */
147 #define BLUETOOTH_ERROR_END_OF_DEVICE_LIST     ((int)BLUETOOTH_ERROR_BASE - 0x20)
148                                                                 /**< End of device list */
149
150 #define BLUETOOTH_ERROR_AGENT_ALREADY_EXIST      ((int)BLUETOOTH_ERROR_BASE - 0x21)
151                                                                 /**< Obex agent already exists */
152 #define BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST    ((int)BLUETOOTH_ERROR_BASE - 0x22)
153                                                                 /**< Obex agent does not exist */
154
155 #define BLUETOOTH_ERROR_ALREADY_INITIALIZED    ((int)BLUETOOTH_ERROR_BASE - 0x23)
156                                                                 /**< Already initialized */
157
158 #define BLUETOOTH_ERROR_PERMISSION_DEINED    ((int)BLUETOOTH_ERROR_BASE - 0x24)
159                                                                 /**< Permission deined */
160
161 #define BLUETOOTH_ERROR_ALREADY_DEACTIVATED    ((int)BLUETOOTH_ERROR_BASE - 0x25)
162                                                                 /**< Nap already done */
163
164 #define BLUETOOTH_ERROR_NOT_INITIALIZED    ((int)BLUETOOTH_ERROR_BASE - 0x26)
165                                                                 /**< Not initialized */
166
167 /**
168 * Device disconnect reason
169 */
170 typedef enum {
171         BLUETOOTH_DEVICE_DISCONNECT_UNKNOWN,
172         BLUETOOTH_DEVICE_DISCONNECT_TIMEOUT,
173         BLUETOOTH_DEVICE_DISCONNECT_LOCAL_HOST,
174         BLUETOOTH_DEVICE_DISCONNECT_REMOTE,
175 } bluetooth_device_disconnect_reason_t;
176
177 /**
178  * This is Bluetooth device address type, fixed to 6 bytes ##:##:##:##:##:##
179  */
180 typedef struct {
181         unsigned char addr[BLUETOOTH_ADDRESS_LENGTH];
182 } bluetooth_device_address_t;
183
184 /**
185  * This is Bluetooth device address type
186  */
187 typedef enum
188 {
189         BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00,
190         BLUETOOTH_DEVICE_RANDOM_ADDRESS
191 } bluetooth_device_address_type_t;
192
193 /**
194  * This is Bluetooth version
195  */
196 typedef struct {
197         char version[BLUETOOTH_VERSION_LENGTH_MAX + 1];
198 } bluetooth_version_t;
199
200 /**
201  * This is Bluetooth device name type, maximum size of Bluetooth device name is 248 bytes
202  */
203 typedef struct {
204         char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX + 1];
205 } bluetooth_device_name_t;
206
207 /**
208  * This is Bluetooth manufacturer specific data, maximum size of data is 240 bytes
209  */
210 typedef struct {
211         int data_len;           /**< manafacturer specific data length */
212         char data[BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX];
213 } bluetooth_manufacturer_data_t;
214
215 /**
216  * Adapter state
217  */
218 typedef enum {
219         BLUETOOTH_ADAPTER_DISABLED,         /**< Bluetooth adapter is disabled */
220         BLUETOOTH_ADAPTER_ENABLED,          /**< Bluetooth adapter is enabled */
221         BLUETOOTH_ADAPTER_CHANGING_ENABLE,  /**< Bluetooth adapter is currently enabling */
222         BLUETOOTH_ADAPTER_CHANGING_DISABLE, /**< Bluetooth adapter is currently disabling */
223 } bluetooth_adapter_state_t;
224
225 /**
226  * Adapter state
227  */
228 typedef enum {
229         BLUETOOTH_ADAPTER_LE_DISABLED,      /**< Bluetooth adapter le is disabled */
230         BLUETOOTH_ADAPTER_LE_ENABLED,       /**< Bluetooth adapter le is enabled */
231         BLUETOOTH_ADAPTER_LE_CHANGING_ENABLE,  /**< Bluetooth adapter le is currently enabling */
232         BLUETOOTH_ADAPTER_LE_CHANGING_DISABLE, /**< Bluetooth adapter le is currently disabling */
233 } bluetooth_adapter_le_state_t;
234
235 /**
236  * Discoverable mode
237  */
238 typedef enum {
239         BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE,         /**< Non discoverable mode */
240         /*Changed the order to make it compatable with old method */
241         BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE,/**< Discoverable mode */
242         BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE,
243                                                          /**< Discoverable mode with time limit
244                                                         After specific timeout, it is changed
245                                                                 to non discoverable mode */
246 } bluetooth_discoverable_mode_t;
247
248 /**
249  * Network connect mode
250  */
251 typedef enum {
252         BLUETOOTH_NETWORK_PANU_ROLE,
253                                  /**< PAN user */
254         BLUETOOTH_NETWORK_NAP_ROLE,/**< Network Access Point */
255         BLUETOOTH_NETWORK_GN_ROLE,  /**< Group ad-hoc Network */
256         BLUETOOTH_NETWORK_CUSTOM_UUID, /**< Custom role */
257 } bluetooth_network_role_t;
258
259 /**
260  * Service type
261  */
262 typedef enum {
263         BLUETOOTH_RFCOMM_SERVICE = 0x01,
264         BLUETOOTH_A2DP_SERVICE = 0x02,
265         BLUETOOTH_HSP_SERVICE = 0x04,
266         BLUETOOTH_HID_SERVICE = 0x08,
267         BLUETOOTH_NAP_SERVICE = 0x10,
268         BLUETOOTH_HFG_SERVICE = 0x20,
269         BLUETOOTH_GATT_SERVICE = 0x40,
270         BLUETOOTH_NAP_SERVER_SERVICE = 0x80,
271 } bluetooth_service_type_t;
272
273 /**
274  * Service type
275  */
276 typedef enum {
277         BLUETOOTH_DEV_CONN_DEFAULT = 0xFF, /* represents that connection
278                                         * type can both BR/EDR and LE */
279         BLUETOOTH_DEV_CONN_BREDR = 0x00,
280         BLUETOOTH_DEV_CONN_LE = 0x01,
281 } bluetooth_conn_type_t;
282
283 /**
284  * Service type
285  */
286 typedef enum {
287         BLUETOOTH_CODEC_ID_CVSD = 0x01,
288         BLUETOOTH_CODEC_ID_MSBC = 0x02,
289 } bluetooth_codec_type_t;
290
291 /**
292  * Service type
293  */
294 typedef enum {
295         BLUETOOTH_HF_AUDIO_DISCONNECTED = 0x00,
296         BLUETOOTH_HF_AUDIO_CONNECTED = 0x01,
297 } bluetooth_hf_audio_connected_type_t;
298
299 /**
300  * Advertising data
301  */
302 typedef struct {
303         guint8 data[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];
304 } bluetooth_advertising_data_t;
305
306 /**
307  * Scan response data
308  */
309 typedef struct {
310         guint8 data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
311 } bluetooth_scan_resp_data_t;
312
313 /**
314  * Advertising filter policy
315  */
316 typedef enum {
317         BLUETOOTH_ALLOW_SCAN_CONN_ALL = 0x00,
318         BLUETOOTH_ALLOW_CONN_ALL_SCAN_WHITE_LIST = 0x01,
319         BLUETOOTH_ALLOW_SCAN_ALL_CONN_WHITE_LIST = 0x02,
320         BLUETOOTH_ALLOW_SCAN_CONN_WHITE_LIST = 0x03,
321 } bluetooth_advertising_filter_policy_t;
322
323 /**
324  * Advertising type
325  */
326 typedef enum {
327         BLUETOOTH_ADV_CONNECTABLE = 0x00, /* ADV_IND */
328         BLUETOOTH_ADV_CONNECTABLE_DIRECT_HIGH = 0x01, /* ADV_DIRECT_IND, high duty cycle */
329         BLUETOOTH_ADV_SCANNABLE = 0x02, /* ADV_SCAN_IND */
330         BLUETOOTH_ADV_NON_CONNECTABLE = 0x03, /* ADV_NONCOND_IND */
331         BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */
332 } bluetooth_advertising_type_t;
333
334 typedef enum
335 {
336         BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01,
337         BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02,
338         BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04,
339         BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE = 0x08,
340         BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_NOTIFY = 0x10,
341         BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_INDICATE = 0x20,
342         BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE = 0x40,
343         BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0x80
344 }bt_gatt_characteristic_property_t;
345
346 /**
347 * Advertising parameters
348 */
349 typedef struct {
350         float interval_min;
351         float interval_max;
352         guint8 filter_policy;
353         guint8 type;
354 } bluetooth_advertising_params_t;
355
356 /**
357 * LE Scan parameters
358 */
359 typedef struct {
360         int type;  /**< passive 0, active 1 */
361         float interval;  /**< LE scan interval */
362         float window;  /**< LE scan window */
363 } bluetooth_le_scan_params_t;
364
365 /*
366         LE Connection Update
367  */
368 typedef struct {
369         guint16 interval_min;
370         guint16 interval_max;
371         guint16 latency;
372         guint16 time_out;
373 } bluetooth_le_conn_update_t;
374
375 /**
376  * Samsung XSAT Vendor dependent command
377  */
378 typedef struct {
379         gint app_id;
380         char *message;
381 } bluetooth_vendor_dep_at_cmd_t;
382
383
384 #define BLUETOOTH_EVENT_BASE            ((int)(0x0000))         /**< No event */
385 #define BLUETOOTH_EVENT_GAP_BASE        ((int)(BLUETOOTH_EVENT_BASE + 0x0010))
386                                                                 /**< Base ID for GAP Event */
387 #define BLUETOOTH_EVENT_SDP_BASE        ((int)(BLUETOOTH_EVENT_GAP_BASE + 0x0020))
388                                                                 /**< Base ID for SDP events */
389 #define BLUETOOTH_EVENT_RFCOMM_BASE     ((int)(BLUETOOTH_EVENT_SDP_BASE + 0x0020))
390                                                                 /**< Base ID for RFCOMM events */
391 #define BLUETOOTH_EVENT_NETWORK_BASE     ((int)(BLUETOOTH_EVENT_RFCOMM_BASE + 0x0020))
392                                                                 /**< Base ID for NETWORK events */
393 #define BLUETOOTH_EVENT_HDP_BASE     ((int)(BLUETOOTH_EVENT_NETWORK_BASE + 0x0020))
394                                                                 /**< Base ID for HDP events */
395 #define BLUETOOTH_EVENT_OPC_BASE  ((int)(BLUETOOTH_EVENT_HDP_BASE + 0x0020))
396                                                                 /**< Base ID for OPC events */
397 #define BLUETOOTH_EVENT_OBEX_SERVER_BASE ((int)(BLUETOOTH_EVENT_OPC_BASE + 0x0020))
398                                                                 /**< Base ID for Obex Server events */
399 #define BLUETOOTH_EVENT_GATT_BASE ((int)(BLUETOOTH_EVENT_OBEX_SERVER_BASE + 0x0020))
400                                                                 /**< Base ID for GATT events */
401
402 #define BLUETOOTH_EVENT_AUDIO_BASE ((int)(BLUETOOTH_EVENT_GATT_BASE + 0x0020))
403                                                                 /**< Base ID for Audio events */
404 #define BLUETOOTH_EVENT_HID_BASE ((int)(BLUETOOTH_EVENT_AUDIO_BASE + 0x0030))
405                                                                 /**< Base ID for HID events */
406 #define BLUETOOTH_EVENT_ADVERTISING_BASE ((int)(BLUETOOTH_EVENT_HID_BASE + 0x0020))
407                                                                 /**< Base ID for Advertising events */
408 #define BLUETOOTH_EVENT_PBAP_CLIENT_BASE ((int)(BLUETOOTH_EVENT_ADVERTISING_BASE + 0x0020))
409                                                                 /**< Base ID for PBAP Client events */
410 #define BLUETOOTH_EVENT_AVRCP_CONTROL_BASE ((int)(BLUETOOTH_EVENT_PBAP_CLIENT_BASE + 0x0020))
411                                                                 /**< Base ID for AVRCP events */
412
413 /**
414  * Bluetooth event type
415  */
416 typedef enum {
417         BLUETOOTH_EVENT_NONE = BLUETOOTH_EVENT_BASE,/**< No event */
418
419         BLUETOOTH_EVENT_ENABLED,                    /**< Bluetooth event adpater enabled */
420         BLUETOOTH_EVENT_DISABLED,                   /**< Bluetooth event adpater disabled */
421         BLUETOOTH_EVENT_LE_ENABLED,                 /**< Bluetooth event adpater enabled */
422         BLUETOOTH_EVENT_LE_DISABLED,                /**< Bluetooth event adpater disabled */
423         BLUETOOTH_EVENT_LOCAL_NAME_CHANGED,         /**< Bluetooth event local name changed*/
424         BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_REQUESTED,
425                                         /**< Bluetooth event Discoverable timeout requested*/
426         BLUETOOTH_EVENT_DISCOVERABLE_MODE_CHANGED,  /**< Bluetooth event mode changed */
427         BLUETOOTH_EVENT_DISCOVERY_OPTION_REQUESTED, /**< Bluetooth event discovery option */
428         BLUETOOTH_EVENT_DISCOVERY_STARTED,          /**< Bluetooth event discovery started */
429         BLUETOOTH_EVENT_DISCOVERY_FINISHED,         /**< Bluetooth event discovery finished */
430         BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND,        /**< Bluetooth event remote deice found */
431         BLUETOOTH_EVENT_LE_DISCOVERY_STARTED,           /**< Bluetooth event LE discovery started */
432         BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED,  /**< Bluetooth event LE discovery finished */
433         BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND,     /**< Bluetooth event remote deice found (LE dev) */
434         BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/
435         BLUETOOTH_EVENT_BONDING_FINISHED,           /**< Bluetooth event bonding completed */
436         BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED,      /**< Bluetooth event bonding removed */
437         BLUETOOTH_EVENT_BONDED_DEVICE_FOUND,        /**< Bluetooth event paired device found */
438         BLUETOOTH_EVENT_REMOTE_DEVICE_READ,         /**< Bluetooth event read remote device */
439         BLUETOOTH_EVENT_DEVICE_AUTHORIZED,          /**< Bluetooth event authorize device */
440         BLUETOOTH_EVENT_DEVICE_UNAUTHORIZED,        /**< Bluetooth event unauthorize device */
441         BLUETOOTH_EVENT_DISCOVERABLE_TIMEOUT_CHANGED,  /**< Bluetooth event mode changed */
442         BLUETOOTH_EVENT_CONNECTABLE_CHANGED,        /**< Bluetooth event connectable changed */
443
444         BLUETOOTH_EVENT_RSSI_ENABLED,           /**< Bluetooth event RSSI monitoring enabled */
445         BLUETOOTH_EVENT_RSSI_ALERT,                             /**< Bluetooth event RSSI Alert */
446         BLUETOOTH_EVENT_RAW_RSSI,                               /**< Bluetooth event Raw RSSI */
447
448         BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE,
449                                                     /**< Bluetooth event serice search base id */
450         BLUETOOTH_EVENT_SERVICE_SEARCH_CANCELLED,   /**< Bluetooth event service search cancelled */
451         BLUETOOTH_EVENT_RFCOMM_DATA_RECEIVED = BLUETOOTH_EVENT_RFCOMM_BASE,
452                                                         /**< RFCOMM data receive event */
453         BLUETOOTH_EVENT_RFCOMM_CONNECTED,               /**< Rfcomm server incomming connection */
454         BLUETOOTH_EVENT_RFCOMM_DISCONNECTED,            /**< Rfcomm server/client disconnect */
455
456         BLUETOOTH_EVENT_RFCOMM_AUTHORIZE,
457
458         BLUETOOTH_EVENT_DEVICE_CONNECTED,           /**< Bluetooth event device connected */
459         BLUETOOTH_EVENT_DEVICE_DISCONNECTED,        /**< Bluetooth event device disconnected */
460
461         BLUETOOTH_EVENT_RFCOMM_SERVER_REMOVED,
462
463         BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED = BLUETOOTH_EVENT_NETWORK_BASE,
464                                                                 /**< Bluetooth Network event */
465         BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED, /**< Network server deactivated */
466         BLUETOOTH_EVENT_NETWORK_SERVER_CONNECTED,     /**< Network connected event in server */
467         BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED,
468                                                    /**< Network disconnected evnet in server */
469
470         BLUETOOTH_EVENT_NETWORK_CONNECTED,              /**< Network connected event in client*/
471         BLUETOOTH_EVENT_NETWORK_DISCONNECTED,           /**< Network disconnected evnet in client*/
472
473         BLUETOOTH_EVENT_HDP_CONNECTED
474                         = BLUETOOTH_EVENT_HDP_BASE,                /**<HDP Connect>*/
475         BLUETOOTH_EVENT_HDP_DISCONNECTED,          /**<HDP Disconnect>*/
476         BLUETOOTH_EVENT_HDP_DATA_RECEIVED,         /**<HDP Data Indication>*/
477
478         BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE,
479                                                                 /* OPC Connected event */
480         BLUETOOTH_EVENT_OPC_DISCONNECTED,               /* OPC Disonnected event */
481         BLUETOOTH_EVENT_OPC_TRANSFER_STARTED,   /* OPC Transfer started event */
482         BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS,  /* OPC Transfer progress event */
483         BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE,  /* OPC Transfer Complete event */
484
485         BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
486                                                                 /* Obex server authorize event*/
487         BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED,   /* Obex Server transfer started event*/
488         BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_PROGRESS,/* Obex Server transfer progress event*/
489         BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_COMPLETED,/* Obex Server transfer complete event*/
490         BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE,
491         BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_CONNECTED, /* Obex Transfer connected event */
492         BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_DISCONNECTED, /* Obex Transfer disconnected event */
493
494         BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED = BLUETOOTH_EVENT_GATT_BASE,
495                                 /**<Discovered GATT service characteristics event*/
496         BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
497                                 /**<Remote GATT charateristic value changed event*/
498         BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID,
499         BLUETOOTH_EVENT_GATT_READ_CHAR, /**<Gatt Read Characteristic Value */
500         BLUETOOTH_EVENT_GATT_WRITE_CHAR, /**<Gatt Write Characteristic Value */
501         BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
502         BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
503         BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
504         BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
505         BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
506         BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
507         BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
508
509         BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
510         BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
511         BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
512         BLUETOOTH_EVENT_AG_MIC_GAIN, /**<Mic gain request event*/
513         BLUETOOTH_EVENT_AG_AUDIO_CONNECTED, /**<AV & AG service connected event*/
514         BLUETOOTH_EVENT_AG_AUDIO_DISCONNECTED,  /**<AV & AG service disconnected event*/
515         BLUETOOTH_EVENT_AV_CONNECTED, /**<AV service connected event*/
516         BLUETOOTH_EVENT_AV_DISCONNECTED, /**<AV service disconnected event*/
517         BLUETOOTH_EVENT_AV_SOURCE_CONNECTED, /**<AV Source device connected event */
518         BLUETOOTH_EVENT_AV_SOURCE_DISCONNECTED, /**<AV Source device disconnected event */
519         BLUETOOTH_EVENT_AVRCP_CONNECTED, /**<AVRCP service connected event*/
520         BLUETOOTH_EVENT_AVRCP_DISCONNECTED, /**<AVRCP service disconnected event*/
521         BLUETOOTH_EVENT_AVRCP_SETTING_SHUFFLE_STATUS, /**<AVRCP service player suffle  status event*/
522         BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
523         BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
524         BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
525         BLUETOOTH_EVENT_HF_CONNECTED,
526         BLUETOOTH_EVENT_HF_DISCONNECTED,
527         BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
528         BLUETOOTH_EVENT_HF_AUDIO_DISCONNECTED,
529         BLUETOOTH_EVENT_HF_RING_INDICATOR,
530         BLUETOOTH_EVENT_HF_CALL_WAITING,
531         BLUETOOTH_EVENT_HF_CALL_TERMINATED,
532         BLUETOOTH_EVENT_HF_CALL_STARTED,
533         BLUETOOTH_EVENT_HF_CALL_ENDED,
534         BLUETOOTH_EVENT_HF_CALL_UNHOLD,
535         BLUETOOTH_EVENT_HF_CALL_SWAPPED,
536         BLUETOOTH_EVENT_HF_CALL_ON_HOLD,
537         BLUETOOTH_EVENT_HF_CALL_STATUS,
538         BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_ENABLED,
539         BLUETOOTH_EVENT_HF_VOICE_RECOGNITION_DISABLED,
540         BLUETOOTH_EVENT_HF_VOLUME_SPEAKER,
541         BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD,
542
543         BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
544         BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
545
546         BLUETOOTH_EVENT_ADVERTISING_STARTED = BLUETOOTH_EVENT_ADVERTISING_BASE, /**< Advertising started event */
547         BLUETOOTH_EVENT_ADVERTISING_STOPPED, /**< Advertising stopped event */
548         BLUETOOTH_EVENT_ADVERTISING_MANUFACTURER_DATA_CHANGED, /**< Advertising manufacturer data changed event */
549         BLUETOOTH_EVENT_SCAN_RESPONSE_MANUFACTURER_DATA_CHANGED, /**< Scan response manufacturer data changed event */
550         BLUETOOTH_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed event */
551         BLUETOOTH_EVENT_DEVICE_ERROR, /**< Hardware error */
552         BLUETOOTH_EVENT_TX_TIMEOUT_ERROR, /** TX Timeout Error*/
553         BLUETOOTH_EVENT_MAX, /**< Bluetooth event Max value */
554
555         BLUETOOTH_PBAP_CONNECTED = BLUETOOTH_EVENT_PBAP_CLIENT_BASE, /**< PBAP connected event*/
556         BLUETOOTH_PBAP_DISCONNECTED, /**< PBAP disconnectd event*/
557         BLUETOOTH_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size event*/
558         BLUETOOTH_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull event*/
559         BLUETOOTH_PBAP_VCARD_LIST, /**< PBAP vCard List event*/
560         BLUETOOTH_PBAP_VCARD_PULL, /**< PBAP vCard Pull event*/
561         BLUETOOTH_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search event*/
562
563         BLUETOOTH_EVENT_AVRCP_CONTROL_CONNECTED = BLUETOOTH_EVENT_AVRCP_CONTROL_BASE, /**<AVRCP service connected event*/
564         BLUETOOTH_EVENT_AVRCP_CONTROL_DISCONNECTED, /**<AVRCP service disconnected event*/
565         BLUETOOTH_EVENT_AVRCP_CONTROL_SHUFFLE_STATUS, /**<AVRCP control suffle  status event*/
566         BLUETOOTH_EVENT_AVRCP_CONTROL_EQUALIZER_STATUS, /**<AVRCP control equalizer status event*/
567         BLUETOOTH_EVENT_AVRCP_CONTROL_REPEAT_STATUS, /**<AVRCP control repeat status event*/
568         BLUETOOTH_EVENT_AVRCP_CONTROL_SCAN_STATUS, /**<AVRCP control scan status event*/
569         BLUETOOTH_EVENT_AVRCP_SONG_POSITION_STATUS, /**<AVRCP control play Postion status event*/
570         BLUETOOTH_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**<AVRCP control play status event*/
571         BLUETOOTH_EVENT_AVRCP_TRACK_CHANGED, /**<AVRCP control song metadata event*/
572 } bluetooth_event_type_t;
573
574  /**
575  * This bt_service_uuid_list_t  enum  indicates service uuid list .
576  * This values is stored the service_list_array in bt_sdp_info_t and bluetooth_device_info_t.
577  */
578
579 typedef enum {
580         BLUETOOTH_SPP_PROFILE_UUID = ((unsigned short)0x1101),                  /**<SPP*/
581         BLUETOOTH_LAP_PROFILE_UUID = ((unsigned short)0x1102),                  /**<LAP*/
582         BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103),                  /**<DUN*/
583         BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104),      /**<OBEX IR MC SYNC*/
584         BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105),     /**<OPP*/
585         BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106),           /**<FTP*/
586         BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107),            /**<IRMC SYNC COMMAND*/
587         BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108),                   /**<HS*/
588         BLUETOOTH_CTP_PROFILE_UUID = ((unsigned short)0x1109),                  /**<CTP*/
589         BLUETOOTH_AUDIO_SOURCE_UUID = ((unsigned short)0x110A),                 /**<AUDIO SOURCE*/
590         BLUETOOTH_AUDIO_SINK_UUID = ((unsigned short)0x110B),                   /**<AUDIO SINK*/
591         BLUETOOTH_AV_REMOTE_CONTROL_TARGET_UUID = ((unsigned short)0x110C),     /**<AV REMOTE CONTROL
592                                                                                 TARGET*/
593         BLUETOOTH_ADVANCED_AUDIO_PROFILE_UUID = ((unsigned short)0x110D),       /**<A2DP*/
594         BLUETOOTH_AV_REMOTE_CONTROL_UUID = ((unsigned short)0x110E),            /**<AV REMOTE CONTROL UUID*/
595         BLUETOOTH_AV_REMOTE_CONTROL_CONTROLLER_UUID = ((unsigned short)0x110F), /**<AV REMOTE CONTROLLER UUID*/
596         BLUETOOTH_ICP_PROFILE_UUID = ((unsigned short)0x1110),                  /**<ICP*/
597         BLUETOOTH_FAX_PROFILE_UUID = ((unsigned short)0x1111),                  /**<FAX*/
598         BLUETOOTH_HEADSET_AG_SERVICE_UUID = ((unsigned short)0x1112),           /**<HS AG */
599         BLUETOOTH_PAN_PANU_PROFILE_UUID = ((unsigned short)0x1115),             /**<PAN*/
600         BLUETOOTH_PAN_NAP_PROFILE_UUID = ((unsigned short)0x1116),              /**<PAN*/
601         BLUETOOTH_PAN_GN_PROFILE_UUID = ((unsigned short)0x1117),               /**<PAN*/
602         BLUETOOTH_DIRECT_PRINTING = ((unsigned short)0x1118),
603         BLUETOOTH_OBEX_BPPS_PROFILE_UUID = ((unsigned short)0x1118),            /**<OBEX BPPS*/ /* Will be removed */
604         BLUETOOTH_REFERENCE_PRINTING = ((unsigned short)0x1119),
605         BLUETOOTH_OBEX_IMAGING_UUID = ((unsigned short)0x111A),                 /**<OBEX_IMAGING*/
606         BLUETOOTH_OBEX_IMAGING_RESPONDER_UUID = ((unsigned short)0x111B),       /**<OBEX_IMAGING
607                                                                                 RESPONDER*/
608         BLUETOOTH_IMAGING_AUTOMATIC_ARCHIVE_UUID = ((unsigned short)0x111C),    /**<IMAGING AUTOMATIC ARCHIVE*/
609         BLUETOOTH_IMAGING_REFERENCED_OBJECTS_UUID = ((unsigned short)0x111D),   /**<IMAGING REFERENCED OBJECTS*/
610         BLUETOOTH_HF_PROFILE_UUID = ((unsigned short)0x111E),                   /**<HF*/
611         BLUETOOTH_HFG_PROFILE_UUID = ((unsigned short)0x111F),                  /**<HFG*/
612         BLUETOOTH_DIRECT_PRINTING_REFERENCE_OBJ_UUID = ((unsigned short)0x1120),
613                                                                         /**<DIRECT PRINTING*/
614         BLUETOOTH_REFLECTED_UI = ((unsigned short)0x1121),              /**<REFLECTED UI*/
615         BLUETOOTH_BASIC_PRINTING = ((unsigned short)0x1122),            /**<BASIC PRINTING*/
616         BLUETOOTH_PRINTING_STATUS = ((unsigned short)0x1123),           /**<PRINTING  STATUS*/
617         BLUETOOTH_OBEX_PRINTING_STATUS_UUID = ((unsigned short)0x1123), /**<OBEX PRINTING STATUS*/ /* Will be removed */
618         BLUETOOTH_HID_PROFILE_UUID = ((unsigned short)0x1124),          /**<HID*/
619         BLUETOOTH_HCR_PROFILE_UUID = ((unsigned short)0x1125),          /**<HCRP*/
620         BLUETOOTH_HCR_PRINT_UUID = ((unsigned short)0x1126),            /**<HCR PRINT*/
621         BLUETOOTH_HCR_SCAN_UUID = ((unsigned short)0x1127),             /**<HCR SCAN*/
622         BLUETOOTH_SIM_ACCESS_PROFILE_UUID = ((unsigned short)0x112D),   /**<SIM ACCESS PROFILE*/
623         BLUETOOTH_PBAP_PCE_UUID = ((unsigned short)0x112E),             /**<PBAP - PCE*/
624         BLUETOOTH_PBAP_PSE_UUID = ((unsigned short)0x112F),             /**<OBEX PBA*/
625         BLUETOOTH_OBEX_PBA_PROFILE_UUID = ((unsigned short)0x112F),     /**<OBEX PBA*/ /* Will be removed */
626         BLUETOOTH_OBEX_PBAP_UUID = ((unsigned short)0x1130),            /**<OBEX PBA*/
627         BLUETOOTH_HEADSET_HS_UUID = ((unsigned short)0x1131),           /**<HEADSET HS*/
628         BLUETOOTH_MESSAGE_ACCESS_SERVER_UUID = ((unsigned short)0x1132),/**<MESSAGE ACCESS SERVER*/
629         BLUETOOTH_MESSAGE_NOTIFICATION_SERVER_UUID = ((unsigned short)0x1133),/**<MESSAGE NOTIFICATION SERVER*/
630         BLUETOOTH_MESSAGE_ACCESS_PROFILE_UUID = ((unsigned short)0x1134),/**<MESSAGE ACCESS PROFILE*/
631         BLUETOOTH_PNP_INFORMATION_UUID = ((unsigned short)0x1200),      /**<PNP*/
632         BLUETOOTH_GENERIC_NETWORKING_UUID = ((unsigned short)0x1201),   /**<GENERIC NETWORKING*/
633         BLUETOOTH_GENERIC_FILE_TRANSFER_UUID = ((unsigned short)0x1202),/**<GENERIC FILE TRANSFER*/
634         BLUETOOTH_GENERIC_AUDIO_UUID = ((unsigned short)0x1203),        /**<GENERIC AUDIO*/
635         BLUETOOTH_GENERIC_TELEPHONY_UUID = ((unsigned short)0x1204),    /**<GENERIC TELEPHONY*/
636         BLUETOOTH_VIDEO_SOURCE_UUID = ((unsigned short)0x1303),         /**<VEDIO SOURCE*/
637         BLUETOOTH_VIDEO_SINK_UUID = ((unsigned short)0x1304),           /**<VEDIO SINK*/
638         BLUETOOTH_VIDEO_DISTRIBUTION_UUID = ((unsigned short)0x1305),   /**<VEDIO DISTRIBUTION*/
639         BLUETOOTH_HDP_UUID = ((unsigned short)0x1400),                  /**<HDP*/
640         BLUETOOTH_HDP_SOURCE_UUID = ((unsigned short)0x1401),           /**<HDP SOURCE*/
641         BLUETOOTH_HDP_SINK_UUID = ((unsigned short)0x1402),             /**<HDP SINK*/
642         BLUETOOTH_OBEX_SYNCML_TRANSFER_UUID = ((unsigned short)0x0000)  /**<OBEX_SYNC*/ /* Will be removed */
643 } bluetooth_service_uuid_list_t;
644
645 /**
646 * Service class part of class of device returned from device discovery
647 */
648 typedef enum {
649         BLUETOOTH_DEVICE_SERVICE_CLASS_LIMITED_DISCOVERABLE_MODE = 0x002000,
650         BLUETOOTH_DEVICE_SERVICE_CLASS_POSITIONING = 0x010000,                  /**<  */
651         BLUETOOTH_DEVICE_SERVICE_CLASS_NETWORKING = 0x020000,                   /**<  */
652         BLUETOOTH_DEVICE_SERVICE_CLASS_RENDERING = 0x040000,                    /**<  */
653         BLUETOOTH_DEVICE_SERVICE_CLASS_CAPTURING = 0x080000,                    /**<  */
654         BLUETOOTH_DEVICE_SERVICE_CLASS_OBJECT_TRANSFER = 0x100000,              /**<  */
655         BLUETOOTH_DEVICE_SERVICE_CLASS_AUDIO = 0x200000,                        /**<  */
656         BLUETOOTH_DEVICE_SERVICE_CLASS_TELEPHONY = 0x400000,                    /**<  */
657         BLUETOOTH_DEVICE_SERVICE_CLASS_INFORMATION = 0x800000,                  /**<  */
658 } bluetooth_device_service_class_t;
659
660
661 /**
662  * Major device mask (For device discovery)
663  */
664 typedef enum {
665         BLUETOOTH_DEVICE_MAJOR_MASK_MISC = 0x00,
666         BLUETOOTH_DEVICE_MAJOR_MASK_COMPUTER = 0x0001,
667         BLUETOOTH_DEVICE_MAJOR_MASK_PHONE = 0x0002,
668         BLUETOOTH_DEVICE_MAJOR_MASK_LAN_ACCESS_POINT = 0x0004,
669         BLUETOOTH_DEVICE_MAJOR_MASK_AUDIO = 0x0008,
670         BLUETOOTH_DEVICE_MAJOR_MASK_PERIPHERAL = 0x0010,
671         BLUETOOTH_DEVICE_MAJOR_MASK_IMAGING = 0x0020,
672         BLUETOOTH_DEVICE_MAJOR_MASK_WEARABLE = 0x0040,
673         BLUETOOTH_DEVICE_MAJOR_MASK_TOY = 0x0080,
674         BLUETOOTH_DEVICE_MAJOR_MASK_HEALTH = 0x0100,
675 } bluetooth_device_major_mask_t;
676
677
678 /**
679  * Major device class (part of Class of Device)
680  */
681 typedef enum {
682         BLUETOOTH_DEVICE_MAJOR_CLASS_MISC = 0x00,       /**< Miscellaneous major device class*/
683         BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER = 0x01,           /**< Computer major device class*/
684         BLUETOOTH_DEVICE_MAJOR_CLASS_PHONE = 0x02,              /**< Phone major device class*/
685         BLUETOOTH_DEVICE_MAJOR_CLASS_LAN_ACCESS_POINT = 0x03,   /**< LAN major device class*/
686         BLUETOOTH_DEVICE_MAJOR_CLASS_AUDIO = 0x04,              /**< AUDIO major device class*/
687         BLUETOOTH_DEVICE_MAJOR_CLASS_PERIPHERAL = 0x05,         /**< Peripheral major device class*/
688         BLUETOOTH_DEVICE_MAJOR_CLASS_IMAGING = 0x06,            /**< Imaging major device class*/
689         BLUETOOTH_DEVICE_MAJOR_CLASS_WEARABLE = 0x07,           /**< Wearable device class*/
690         BLUETOOTH_DEVICE_MAJOR_CLASS_TOY = 0x08,                /**< Toy device class*/
691         BLUETOOTH_DEVICE_MAJOR_CLASS_HEALTH = 0x09,             /**< Health device class*/
692         BLUETOOTH_DEVICE_MAJOR_CLASS_UNCLASSIFIED = 0x1F        /**< Unknown major device class*/
693 } bluetooth_device_major_class_t;
694
695 typedef enum {
696         BLUETOOTH_DEVICE_MINOR_CLASS_UNCLASSIFIED = 0x00,       /**< unclassified minor class */
697
698         /* About Computer Major class */
699         BLUETOOTH_DEVICE_MINOR_CLASS_DESKTOP_WORKSTATION = 0x04,        /**< desktop workstation
700                                                                         minor class */
701         BLUETOOTH_DEVICE_MINOR_CLASS_SERVER_CLASS_COMPUTER = 0x08,      /**< server minor class */
702         BLUETOOTH_DEVICE_MINOR_CLASS_LAPTOP = 0x0C,                     /**< laptop minor class */
703         BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_PC_OR_PDA = 0x10,         /**< PDA minor class */
704         BLUETOOTH_DEVICE_MINOR_CLASS_PALM_SIZED_PC_OR_PDA = 0x14,       /**< PALM minor class */
705         BLUETOOTH_DEVICE_MINOR_CLASS_WEARABLE_COMPUTER = 0x18,  /**< Wearable PC minor class */
706
707         /* About Phone Major class */
708         BLUETOOTH_DEVICE_MINOR_CLASS_CELLULAR = 0x04,                   /**< Cellular minor class */
709         BLUETOOTH_DEVICE_MINOR_CLASS_CORDLESS = 0x08,                   /**< cordless minor class */
710         BLUETOOTH_DEVICE_MINOR_CLASS_SMART_PHONE = 0x0C,        /**< smart phone minor class */
711         BLUETOOTH_DEVICE_MINOR_CLASS_WIRED_MODEM_OR_VOICE_GATEWAY = 0x10,
712                                                                 /**< voice gateway minor class */
713         BLUETOOTH_DEVICE_MINOR_CLASS_COMMON_ISDN_ACCESS = 0x14,         /**< ISDN minor class */
714
715         /* About LAN/Network Access Point Major class */
716         BLUETOOTH_DEVICE_MINOR_CLASS_FULLY_AVAILABLE = 0x04,            /**< Fully available minor class */
717         BLUETOOTH_DEVICE_MINOR_CLASS_1_TO_17_PERCENT_UTILIZED = 0x20,   /**< 1-17% utilized minor class */
718         BLUETOOTH_DEVICE_MINOR_CLASS_17_TO_33_PERCENT_UTILIZED = 0x40,  /**< 17-33% utilized minor class */
719         BLUETOOTH_DEVICE_MINOR_CLASS_33_TO_50_PERCENT_UTILIZED = 0x60,  /**< 33-50% utilized minor class */
720         BLUETOOTH_DEVICE_MINOR_CLASS_50_to_67_PERCENT_UTILIZED = 0x80,  /**< 50-67% utilized minor class */
721         BLUETOOTH_DEVICE_MINOR_CLASS_67_TO_83_PERCENT_UTILIZED = 0xA0,  /**< 67-83% utilized minor class */
722         BLUETOOTH_DEVICE_MINOR_CLASS_83_TO_99_PERCENT_UTILIZED = 0xC0,  /**< 83-99% utilized minor class */
723         BLUETOOTH_DEVICE_MINOR_CLASS_NO_SERVICE_AVAILABLE = 0xE0,               /**< No service available minor class */
724
725         /* About Audio/Video Major class */
726         BLUETOOTH_DEVICE_MINOR_CLASS_HEADSET_PROFILE = 0x04,            /**< Headset minor class */
727         BLUETOOTH_DEVICE_MINOR_CLASS_HANDSFREE = 0x08,                  /**< Handsfree minor class*/
728
729         BLUETOOTH_DEVICE_MINOR_CLASS_MICROPHONE = 0x10,         /**< Microphone minor class */
730         BLUETOOTH_DEVICE_MINOR_CLASS_LOUD_SPEAKER = 0x14,       /**< Loud Speaker minor class */
731         BLUETOOTH_DEVICE_MINOR_CLASS_HEADPHONES = 0x18,         /**< Headphones minor class */
732         BLUETOOTH_DEVICE_MINOR_CLASS_PORTABLE_AUDIO = 0x1C,     /**< Portable Audio minor class */
733         BLUETOOTH_DEVICE_MINOR_CLASS_CAR_AUDIO = 0x20,           /**< Car Audio minor class */
734         BLUETOOTH_DEVICE_MINOR_CLASS_SET_TOP_BOX = 0x24,        /**< Set top box minor class */
735         BLUETOOTH_DEVICE_MINOR_CLASS_HIFI_AUDIO_DEVICE = 0x28,  /**< Hifi minor class */
736         BLUETOOTH_DEVICE_MINOR_CLASS_VCR = 0x2C,                /**< VCR minor class */
737         BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CAMERA = 0x30,       /**< Video Camera minor class */
738         BLUETOOTH_DEVICE_MINOR_CLASS_CAM_CORDER = 0x34,         /**< CAM Corder minor class */
739         BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_MONITOR = 0x38,      /**<Video Monitor minor class */
740         BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_DISPLAY_AND_LOUD_SPEAKER = 0x3C,
741                                                                         /**< Video Display and Loud
742                                                                         Speaker minor class */
743         BLUETOOTH_DEVICE_MINOR_CLASS_VIDEO_CONFERENCING = 0x40, /**< Video Conferencing minor
744                                                                 class */
745
746         BLUETOOTH_DEVICE_MINOR_CLASS_GAMING_OR_TOY = 0x48,      /**< Gaming or toy minor class */
747
748         /* About Peripheral Major class */
749         BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD = 0x40,          /**< Key board minor class */
750         BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE = 0x80,    /**< Pointing Device minor class */
751         BLUETOOTH_DEVICE_MINOR_CLASS_COMBO_KEYBOARD_OR_POINTING_DEVICE = 0xC0,
752                                                                 /**< Combo Keyboard or pointing
753                                                                 device minorclass */
754
755         BLUETOOTH_DEVICE_MINOR_CLASS_JOYSTICK = 0x04,           /**< JoyStick minor class */
756         BLUETOOTH_DEVICE_MINOR_CLASS_GAME_PAD = 0x08,           /**< Game Pad minor class */
757         BLUETOOTH_DEVICE_MINOR_CLASS_REMOTE_CONTROL = 0x0C,     /**< Remote Control minor class */
758         BLUETOOTH_DEVICE_MINOR_CLASS_SENSING_DEVICE = 0x10,     /**< Sensing Device minor class */
759         BLUETOOTH_DEVICE_MINOR_CLASS_DIGITIZER_TABLET = 0x14,   /**< Digitizer minor class */
760         BLUETOOTH_DEVICE_MINOR_CLASS_CARD_READER = 0x18,        /**< Card Reader minor class */
761         BLUETOOTH_DEVICE_MINOR_CLASS_DIGITAL_PEN = 0x1C,        /**< Digital pen minor class */
762         BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_SCANNER = 0x20,   /**< Handheld scanner for bar-codes, RFID minor class */
763         BLUETOOTH_DEVICE_MINOR_CLASS_HANDHELD_GESTURAL_INPUT_DEVICE = 0x24,     /**< Handheld gestural input device minor class */
764
765         /* About Imaging Major class */
766         BLUETOOTH_DEVICE_MINOR_CLASS_DISPLAY = 0x10,            /**< Display minor class */
767         BLUETOOTH_DEVICE_MINOR_CLASS_CAMERA = 0x20,             /**< Camera minor class */
768         BLUETOOTH_DEVICE_MINOR_CLASS_SCANNER = 0x40,            /**< Scanner minor class */
769         BLUETOOTH_DEVICE_MINOR_CLASS_PRINTER = 0x80,            /**< Printer minor class */
770
771         /* About Wearable Major class */
772         BLUETOOTH_DEVICE_MINOR_CLASS_WRIST_WATCH = 0x04,        /**< Wrist watch minor class */
773         BLUETOOTH_DEVICE_MINOR_CLASS_PAGER = 0x08,              /**< Pager minor class */
774         BLUETOOTH_DEVICE_MINOR_CLASS_JACKET = 0x0C,             /**< Jacket minor class */
775         BLUETOOTH_DEVICE_MINOR_CLASS_HELMET = 0x10,             /**< Helmet minor class */
776         BLUETOOTH_DEVICE_MINOR_CLASS_GLASSES = 0x14,            /**< Glasses minor class */
777
778         /* About Toy Major class */
779         BLUETOOTH_DEVICE_MINOR_CLASS_ROBOT = 0x04,              /**< Robot minor class */
780         BLUETOOTH_DEVICE_MINOR_CLASS_VEHICLE = 0x08,            /**< Vehicle minor class */
781         BLUETOOTH_DEVICE_MINOR_CLASS_DOLL_OR_ACTION = 0x0C,     /**< Doll or Action minor class */
782         BLUETOOTH_DEVICE_MINOR_CLASS_CONTROLLER = 0x10,         /**< Controller minor class */
783         BLUETOOTH_DEVICE_MINOR_CLASS_GAME = 0x14,               /**< Game minor class */
784
785         /* About Health Major class */
786         BLUETOOTH_DEVICE_MINOR_CLASS_BLOOD_PRESSURE_MONITOR = 0x04,     /**< Blood Pressure minor class */
787         BLUETOOTH_DEVICE_MINOR_CLASS_THERMOMETER = 0x08,                /**< Thermometer minor class */
788         BLUETOOTH_DEVICE_MINOR_CLASS_WEIGHING_SCALE = 0x0C,             /**< Weighing Scale minor class */
789         BLUETOOTH_DEVICE_MINOR_CLASS_GLUCOSE_METER = 0x10,              /**< Glucose minor class */
790         BLUETOOTH_DEVICE_MINOR_CLASS_PULSE_OXIMETER = 0x14,             /**< Pulse Oximeter minor class */
791         BLUETOOTH_DEVICE_MINOR_CLASS_HEART_OR_PULSE_RATE_MONITOR = 0x18,/**< Heart or pulse rate monitor minor class */
792         BLUETOOTH_DEVICE_MINOR_CLASS_MEDICAL_DATA_DISPLAY = 0x1C,       /**< Medical minor class */
793         BLUETOOTH_DEVICE_MINOR_CLASS_STEP_COUNTER = 0x20,               /**< Step Counter minor class */
794         BLUETOOTH_DEVICE_MINOR_CLASS_BODY_COMPOSITION_ANALYZER = 0x24,  /**< Body composition analyzer minor class */
795         BLUETOOTH_DEVICE_MINOR_CLASS_PEAK_FLOW_MONITOR = 0x28,  /**< Peak flow monitor minor class */
796         BLUETOOTH_DEVICE_MINOR_CLASS_MEDICATION_MONITOR = 0x2C, /**< Medication monitor minor class */
797         BLUETOOTH_DEVICE_MINOR_CLASS_KNEE_PROSTHESIS = 0x30,    /**< Knee prosthesis minor class */
798         BLUETOOTH_DEVICE_MINOR_CLASS_ANKLE_PROSTHESIS = 0x34,   /**< Ankle prosthesis minor class */
799 } bluetooth_device_minor_class_t;
800
801 /**
802  * structure to hold the device information
803  */
804 typedef struct {
805         bluetooth_device_major_class_t major_class; /**< major device class */
806         bluetooth_device_minor_class_t minor_class; /**< minor device class */
807         bluetooth_device_service_class_t service_class;
808                                                     /**< service device class */
809 } bluetooth_device_class_t;
810
811 /**
812  * Discovery Role types
813  */
814 typedef enum {
815         DISCOVERY_ROLE_BREDR = 0x1,
816         DISCOVERY_ROLE_LE,
817         DISCOVERY_ROLE_LE_BREDR
818 } bt_discovery_role_type_t;
819
820 /**
821  * Connected state types
822  */
823 typedef enum {
824         BLUETOOTH_CONNECTED_LINK_NONE = 0x00,
825         BLUETOOTH_CONNECTED_LINK_BREDR = 0x01,
826         BLUETOOTH_CONNECTED_LINK_LE = 0x02,
827         BLUETOOTH_CONNECTED_LINK_BREDR_LE = 0x03,
828 } bluetooth_connected_link_t;
829
830 /**
831 * Scan filter entry
832 */
833 typedef enum {
834         BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_ADDRESS = 0x01,                 /**< device address */
835         BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_UUID = 0x04,                   /**< service uuid */
836         BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_SOLICITATION_UUID = 0x08,      /**< service solicitation uuid */
837         BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10,                    /**< device name */
838         BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20,              /**< manufacturer data */
839         BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40,                   /**< service data */
840 } bluetooth_le_scan_filter_feature_t;
841
842 /**
843 * structure to hold the device information
844 */
845 typedef struct {
846         bluetooth_device_address_t device_address;      /**< device address */
847         bluetooth_device_name_t device_name;    /**< device name */
848         bluetooth_device_class_t device_class;  /**< device class */
849         char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
850         unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
851         int service_index;
852         int rssi;                               /**< received strength signal*/
853         gboolean paired;                        /**< paired flag */
854         bluetooth_connected_link_t connected;   /**< connected link type */
855         gboolean trust;                         /**< trust flag */
856         bluetooth_manufacturer_data_t manufacturer_data;        /**< manafacturer specific class */
857 } bluetooth_device_info_t;
858
859 /**
860 * structure to hold the LE device information
861 */
862 typedef struct {
863         int data_len;           /**< manafacturer specific data length */
864         bluetooth_advertising_data_t data;              /**< manafacturer specific data */
865 } bluetooth_le_advertising_data_t;
866
867 typedef struct {
868         bluetooth_device_address_t device_address;      /**< device address */
869         int addr_type;                  /**< address type*/
870         int rssi;                       /**< received strength signal*/
871         bluetooth_le_advertising_data_t adv_ind_data;
872         bluetooth_le_advertising_data_t scan_resp_data;
873 } bluetooth_le_device_info_t;
874
875 typedef struct {
876         int slot_id;
877         bluetooth_le_scan_filter_feature_t added_features;              /**< added features */
878         bluetooth_device_address_t device_address;                      /**< device address */
879         char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];        /**< device name */
880         bluetooth_le_advertising_data_t service_uuid;                   /**< service uuid */
881         bluetooth_le_advertising_data_t service_uuid_mask;              /**< service uuid mask */
882         bluetooth_le_advertising_data_t service_solicitation_uuid;      /**< service solicitation uuid */
883         bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
884         bluetooth_le_advertising_data_t service_data;                   /**< service data */
885         bluetooth_le_advertising_data_t service_data_mask;              /**< service data mask */
886         int manufacturer_id;                                            /**< manufacturer ID */
887         bluetooth_le_advertising_data_t manufacturer_data;              /**< manufacturer data */
888         bluetooth_le_advertising_data_t manufacturer_data_mask;         /**< manufacturer data mask */
889 } bluetooth_le_scan_filter_t;
890
891 /**
892  * structure to hold the paired device information
893  */
894 typedef struct {
895         bluetooth_device_address_t device_address;  /**< paired device address */
896         bluetooth_device_name_t device_name;        /**< device name */
897         bluetooth_device_class_t device_class;      /**< device class */
898 } bluetooth_paired_device_info_t;
899
900 /**
901 * structure to hold the paired device information
902 */
903 typedef struct {
904         bluetooth_device_address_t device_address;
905                                                /**< device address */
906         char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
907                                                           /**< network interface name */
908 } bluetooth_network_device_info_t;
909
910 /**
911 * Stucture to hold discovery option
912 */
913 typedef struct {
914         unsigned short max_response;    /**< the number of maximum response */
915         unsigned short discovery_duration;
916                                         /**< duration of discovery (seconds) */
917         unsigned int classOfDeviceMask; /**<  mask for values of class of device. to be used with
918                                         classOfDevice variable */
919 } bluetooth_discovery_option_t;
920
921 /**
922  * Stucture to hold event information
923  */
924 typedef struct {
925         int event;      /**< event type */
926         int result;     /**< Success or error value */
927         void *param_data;
928                         /**<parameter data pointer */
929         void *user_data;
930 } bluetooth_event_param_t;
931
932 typedef struct {
933         bluetooth_device_address_t device_addr;
934         char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
935         unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
936         unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
937         int service_index;
938 } bt_sdp_info_t;
939
940 typedef struct {
941         bluetooth_device_address_t device_addr;
942         unsigned char addr_type;
943         int disc_reason;
944 } bt_connection_info_t;
945
946 /**
947  * Stucture to rfcomm receive data
948  */
949
950 typedef struct {
951         int socket_fd;
952                 /**< the socket fd */
953         int buffer_size;/**< the length of the receive buffer */
954         char *buffer;
955                 /**< the receive data buffer */
956 } bluetooth_rfcomm_received_data_t;
957
958 /**
959 * Stucture to rfcomm connection
960 */
961
962 typedef struct {
963         int socket_fd; /**< the socket fd */
964         int server_id; /* Server id */
965         int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
966         bluetooth_device_address_t device_addr;
967                                               /**< device address */
968         char uuid[BLUETOOTH_UUID_STRING_MAX];
969 } bluetooth_rfcomm_connection_t;
970
971 /**
972  * Stucture to rfcomm disconnection
973  */
974 typedef struct {
975         int socket_fd;
976                 /**< the socket fd */
977         int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
978         bluetooth_device_address_t device_addr;
979                                               /**< device address */
980         char uuid[BLUETOOTH_UUID_STRING_MAX];
981 } bluetooth_rfcomm_disconnection_t;
982
983 typedef struct {
984         int socket_fd;
985                 /**< the socket fd */
986         bluetooth_device_address_t device_addr;
987                                               /**< device address */
988 } bluetooth_rfcomm_connection_request_t;
989
990 /**
991  * HDP QOS types
992  */
993 typedef enum {
994         HDP_QOS_RELIABLE,
995         HDP_QOS_STREAMING,
996         HDP_QOS_ANY
997 }bt_hdp_qos_type_t;
998
999 /**
1000  * HDP Role types
1001  */
1002 typedef enum {
1003         HDP_ROLE_SOURCE = 0x0,
1004         HDP_ROLE_SINK
1005 }bt_hdp_role_type_t;
1006
1007
1008 /**
1009  * Stucture to HDP connected
1010  */
1011 typedef struct {
1012         const char *app_handle; /**< the application handle */
1013         unsigned int channel_id;        /**< the channel id */
1014         bt_hdp_qos_type_t type; /**< the QOS type */
1015         bluetooth_device_address_t device_address; /**< the remote address */
1016 } bt_hdp_connected_t;
1017
1018 /**
1019  * Stucture to HDP disconnected
1020  */
1021 typedef struct {
1022         unsigned int channel_id; /**< the channel id */
1023         bluetooth_device_address_t device_address; /**< the remote address */
1024 } bt_hdp_disconnected_t;
1025
1026 /**
1027  * Stucture to HDP data indication
1028  */
1029 typedef struct {
1030         unsigned int channel_id;         /**< the channel id */
1031         const char *buffer;      /**< the RX data buffer */
1032         unsigned int size;       /**< the RX data size */
1033 } bt_hdp_data_ind_t;
1034
1035 /**
1036  * Stucture to OPP client transfer information
1037  */
1038 typedef struct {
1039         char *filename;
1040         unsigned long size;
1041         int percentage;
1042 }bt_opc_transfer_info_t;
1043
1044 /* Obex Server transfer type */
1045 #define TRANSFER_PUT "PUT"
1046 #define TRANSFER_GET "GET"
1047 /**
1048  * Stucture to OPP/FTP Server authorize information
1049  */
1050 typedef struct {
1051         char *filename;
1052         int length;
1053 } bt_obex_server_authorize_into_t;
1054
1055 /**
1056  * Server type
1057  */
1058 typedef enum {
1059         OPP_SERVER = 0x0,
1060         FTP_SERVER
1061 } bt_obex_server_type_t;
1062
1063 /**
1064  * Stucture to OPP/FTP server transfer information
1065  */
1066 typedef struct {
1067         char *filename;
1068         char *device_name;
1069         char *file_path;
1070         char *type;
1071         int transfer_id;
1072         unsigned long file_size;
1073         int percentage;
1074         bt_obex_server_type_t server_type;
1075 } bt_obex_server_transfer_info_t;
1076
1077 /**
1078  * Stucture to OOB data
1079  */
1080
1081 typedef struct {
1082         unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1083         unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1084         unsigned int hash_len;
1085         unsigned int randomizer_len;
1086 } bt_oob_data_t;
1087
1088 /**
1089  * Structure to GATT attribute handle data
1090  */
1091
1092 typedef struct {
1093         int count;
1094         char **handle;
1095 } bt_gatt_handle_info_t;
1096
1097 /**
1098  * Structure to GATT Remote service data
1099  */
1100
1101 typedef struct {
1102         char *uuid;
1103         char *handle;
1104         gboolean primary;
1105         bt_gatt_handle_info_t include_handles;
1106         bt_gatt_handle_info_t char_handle;
1107 } bt_gatt_service_property_t;
1108
1109 /**
1110  * Structure to GATT Remote characteristic data
1111  */
1112
1113 typedef struct {
1114         char *service_handle;
1115         bt_gatt_handle_info_t handle_info;
1116 } bt_gatt_discovered_char_t;
1117
1118 /**
1119  * Structure to format of GATT Characteristic Value
1120  */
1121
1122 typedef struct {
1123         unsigned char format;
1124         unsigned char exponent;
1125         unsigned short unit;
1126         unsigned char name_space;
1127         unsigned short description;
1128 } bt_gatt_char_format_t;
1129
1130 /**
1131  * Structure to GATT Characteristic property
1132  */
1133
1134 typedef struct {
1135         char *handle;
1136         char *uuid;
1137         char *name;
1138         char *description;
1139         bt_gatt_char_format_t format;
1140         unsigned char *val;
1141         unsigned int val_len;
1142         unsigned int permission;
1143         char *representation;
1144         bt_gatt_handle_info_t char_desc_handle;
1145 } bt_gatt_char_property_t;
1146
1147 /**
1148  * Structure to GATT Characteristic descriptor property
1149  */
1150
1151 typedef struct {
1152         char *handle;
1153         char *uuid;
1154         unsigned char *val;
1155         unsigned int val_len;
1156 } bt_gatt_char_descriptor_property_t;
1157
1158 /**
1159  * Structure to GATT Characteristic value
1160  */
1161
1162 typedef struct {
1163         char *char_handle;
1164         guint8 *char_value;
1165         guint32 val_len;
1166 } bt_gatt_char_value_t;
1167
1168 /**
1169  * Structure to GATT Read Request
1170  */
1171 typedef struct {
1172         char *char_handle;
1173         char *service_handle;
1174         char *address;
1175         guint16 offset;
1176         guint8 req_id;
1177 } bt_gatt_read_req_t;
1178
1179 /**
1180  * Structure to RSSI Signal Strength Alert
1181  */
1182
1183 typedef struct {
1184         char *address;
1185         int link_type;
1186         int alert_type;
1187         int rssi_dbm;
1188 } bt_rssi_alert_t;
1189
1190 /**
1191  * Structure to RSSI Signal Strength
1192  */
1193
1194 typedef struct {
1195         char *address;
1196         int link_type;
1197         int rssi_dbm;
1198 } bt_raw_rssi_t;
1199
1200 /**
1201  * Structure for RSSI Enabled or Disabled
1202  */
1203
1204 typedef struct {
1205         char *address;
1206         int link_type;
1207         gboolean rssi_enabled;
1208 } bt_rssi_enabled_t;
1209
1210 /**
1211  * Structure for RSSI Threshold
1212  */
1213
1214 typedef struct {
1215         int low_threshold;
1216         int in_range_threshold;
1217         int high_threshold;
1218 } bt_rssi_threshold_t;
1219
1220 /**
1221  * Structure for PBAP Folder Parameters
1222  */
1223 typedef struct {
1224         unsigned char addressbook;
1225         unsigned char folder_type;
1226 } bt_pbap_folder_t;
1227
1228 /**
1229  * Structure for PBAP Pull application Parameters
1230  */
1231 typedef struct {
1232         unsigned char format;
1233         unsigned char order;
1234         unsigned short offset;
1235         unsigned short maxlist;
1236         long long unsigned fields;
1237 } bt_pbap_pull_parameters_t;
1238
1239 /**
1240  * Structure for PBAP List application Parameters
1241  */
1242 typedef struct {
1243         unsigned char order;
1244         unsigned short offset;
1245         unsigned short maxlist;
1246 } bt_pbap_list_parameters_t;
1247
1248 /**
1249  * Structure for PBAP Pull vCard application Parameters
1250  */
1251 typedef struct {
1252         unsigned char format;
1253         long long unsigned fields;
1254         int index;
1255 } bt_pbap_pull_vcard_parameters_t;
1256
1257 /**
1258  * Structure for PBAP Search application Parameters
1259  */
1260 typedef struct {
1261         unsigned char order;
1262         unsigned short offset;
1263         unsigned short maxlist;
1264         unsigned char search_attribute;
1265         char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1266 } bt_pbap_search_parameters_t;
1267
1268 /**
1269  * Structure for PBAP Connection Status
1270  */
1271 typedef struct {
1272         bluetooth_device_address_t btaddr;
1273         int connected;
1274 } bt_pbap_connected_t;
1275
1276 /**
1277  * Structure for PBAP Phonebook Size
1278  */
1279 typedef struct {
1280         bluetooth_device_address_t btaddr;
1281         int size;
1282 } bt_pbap_phonebook_size_t;
1283
1284 /**
1285  * Structure for PBAP Phonebook Pull
1286  */
1287 typedef struct {
1288         bluetooth_device_address_t btaddr;
1289         char *vcf_file;
1290         int success;
1291 } bt_pbap_phonebook_pull_t;
1292
1293 /**
1294  * Structure for PBAP vCard List
1295  */
1296 typedef struct {
1297         bluetooth_device_address_t btaddr;
1298         char **vcards;
1299         int length;
1300         int success;
1301 } bt_pbap_vcard_list_t;
1302
1303 /**
1304  * Structure for PBAP vCard Pull
1305  */
1306 typedef struct {
1307         bluetooth_device_address_t btaddr;
1308         char *vcf_file;
1309         int success;
1310 } bt_pbap_vcard_pull_t;
1311
1312 /**
1313  * Structure for PBAP Phonebook search List
1314  */
1315 typedef struct {
1316         bluetooth_device_address_t btaddr;
1317         char **vcards;
1318         int length;
1319         int success;
1320 } bt_pbap_phonebook_search_list_t;
1321
1322 /**
1323  * Stucture to HF Call status information
1324  */
1325
1326 typedef struct {
1327         char *number; /*Phone Number */
1328         int direction; /*Direction :Incoming(1), Outgoing(0)*/
1329         int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1330         int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1331         int idx; /*Call index/ID */
1332 } bt_hf_call_status_info_t;
1333
1334 typedef struct {
1335         GList *list;
1336         int count;
1337 } bt_hf_call_list_s;
1338
1339 /**
1340  * Callback pointer type
1341  */
1342 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1343
1344 /**
1345  * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1346  * @brief Set the callback function pointer for bluetooth event
1347  *
1348  *
1349  * This API will register the callback function, when any response and event are received from
1350  * bluetooth framework. @n
1351  * this registered callback function will be get called with appropriate event and data structures.
1352  * This function is a synchronous call. An application developer can call
1353  * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1354  * type. This registered function will receive events of bluetooth_event_type_t type along with
1355  * data any.
1356  *
1357  *
1358  * @param[in]   callback_ptr    A pointer to the callback function
1359  * @param[in]   user_data    A pointer to user data
1360  * @return      BLUETOOTH_ERROR_NONE - Success
1361  * @remark      None
1362  * @see         None
1363 @code
1364 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1365 {
1366         GMainLoop *main_loop = (GMainLoop*) user_data;
1367
1368         switch(event)
1369         {
1370                 // Code for each event
1371                 default:
1372                         g_main_loop_quit(main_loop);
1373                         break;
1374         }
1375 }
1376
1377 int main()
1378 {
1379         GMainLoop *main_loop = NULL;
1380         int ret = 0;
1381         g_type_init();
1382         main_loop = g_main_loop_new(NULL, FALSE);
1383         ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1384         if (ret >= BLUETOOTH_ERROR_NONE)
1385         {
1386                 // bluetooth_register_callback returned Success
1387         }
1388         else
1389         {
1390                 // bluetooth_register_callback returned failiure
1391         }
1392         g_main_loop_run(main_loop);
1393 }
1394 @endcode
1395  */
1396 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1397
1398 /**
1399  * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1400  * @brief Set the callback function pointer for bluetooth le event
1401  *
1402  *
1403  * This API will register the callback function, when any response and event are received from
1404  * bluetooth framework. @n
1405  * this registered callback function will be get called with appropriate event and data structures.
1406  * This function is a synchronous call. An application developer can call
1407  * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1408  * type. This registered function will receive events of bluetooth_event_type_t type along with
1409  * data any.
1410  *
1411  *
1412  * @param[in]   callback_ptr    A pointer to the callback function
1413  * @param[in]   user_data    A pointer to user data
1414  * @return      BLUETOOTH_ERROR_NONE - Success
1415  * @remark      None
1416  * @see         None
1417  * */
1418 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1419
1420 /**
1421  * @fn int bluetooth_le_unregister_callback(void)
1422  * @brief Set the callback function pointer for bluetooth le event
1423  *
1424  *
1425  * This API will register the callback function, when any response and event are received from
1426  * bluetooth framework. @n
1427  * this registered callback function will be get called with appropriate event and data structures.
1428  * This function is a synchronous call. An application developer can call
1429  * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1430  * type. This registered function will receive events of bluetooth_event_type_t type along with
1431  * data any.
1432  *
1433  *
1434  * @param[in]   none
1435  * @return      BLUETOOTH_ERROR_NONE - Success
1436  * @remark      None
1437  * @see         None
1438  * */
1439 int bluetooth_le_unregister_callback(void);
1440
1441 /**
1442  * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1443  * @brief Set the callback function pointer for bluetooth event
1444  *
1445  *
1446  * This API will register the callback function, when any response and event are received from
1447  * bluetooth framework. @n
1448  * this registered callback function will be get called with appropriate event and data structures.
1449  * This function is a synchronous call. An application developer can call
1450  * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1451  * type. This registered function will receive events of bluetooth_event_type_t type along with
1452  * data any.
1453  *
1454  *
1455  * @param[in]   none
1456  * @return      BLUETOOTH_ERROR_NONE - Success
1457  * @remark      None
1458  * @see         None
1459 @code
1460 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1461 {
1462         GMainLoop *main_loop = (GMainLoop*) user_data;
1463
1464         switch(event)
1465         {
1466                 // Code for each event
1467                 default:
1468                         g_main_loop_quit(main_loop);
1469                         break;
1470         }
1471 }
1472
1473 int main()
1474 {
1475         GMainLoop *main_loop = NULL;
1476         int ret = 0;
1477         g_type_init();
1478         main_loop = g_main_loop_new(NULL, FALSE);
1479         ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1480         if (ret >= BLUETOOTH_ERROR_NONE)
1481         {
1482                 // bluetooth_register_callback returned Success
1483         }
1484         else
1485         {
1486                 // bluetooth_register_callback returned failiure
1487         }
1488         ret = bluetooth_deregister_callback(void);
1489         g_main_loop_run(main_loop);
1490 }
1491 @endcode
1492  */
1493 int bluetooth_unregister_callback(void);
1494
1495 /**
1496  * @fn int bluetooth_enable_adapter(void)
1497  * @brief Enable the Bluetooth H/W
1498  *
1499  *
1500  * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
1501  * send request to bluetooth chip for activation.
1502  * This function is typically called at startup or when Bluetooth services are required.  This
1503  * function must be called before calling any other API of Bluetooth operations.
1504  *
1505  * Before performing any operations like Device discover, service search etc.., the adapter must be
1506  * enabled.
1507  *
1508  * This function is a asynchronous call.
1509  * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
1510  * through registered callback function with appropriate result code
1511  *                      BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
1512  *                      BLUETOOTH_ERROR_NONE - Success \n
1513  *
1514  * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
1515  * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
1516  *
1517  * @return      BLUETOOTH_ERROR_NONE - Success\n
1518  *              BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
1519  *              BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
1520  *              BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1521  * @exception   BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1522  * @remark      None
1523  * @see         bluetooth_check_adapter, bluetooth_disable_adapter
1524 @code
1525 void bt_event_callback(int event, bluetooth_event_param_t *param)
1526 {
1527         switch(event)
1528         {
1529                 case BLUETOOTH_EVENT_ENABLED:
1530                         if (param->result == BLUETOOTH_ERROR_NONE)
1531                         {
1532                                 // Successfully Enabled
1533                         }
1534                         else
1535                         {
1536                                 // Failed
1537                         }
1538                         break;
1539         }
1540 }
1541
1542 ...
1543
1544 int ret = 0;
1545 ret = bluetooth_enable_adapter();
1546
1547 @endcode
1548  */
1549 int bluetooth_enable_adapter(void);
1550
1551 /**
1552  * @fn int bluetooth_disable_adapter(void)
1553  * @brief Disable the Bluetooth H/W
1554  *
1555  *
1556  * This function disables Bluetooth protocol stack and hardware. This function is called when
1557  * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
1558  *
1559  * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
1560  * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
1561  * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
1562  * error code.
1563  * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1564  * internal error.
1565  *
1566  * This function is a asynchronous call.
1567  * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
1568  * through registered callback function.
1569  *
1570  *
1571  * @return      BLUETOOTH_ERROR_NONE - Success\n
1572  *              BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
1573  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
1574  * @exception   BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1575  * @remark      None
1576  * @see         bluetooth_check_adapter, bluetooth_enable_adapter
1577 @code
1578 void bt_event_callback(int event, bluetooth_event_param_t *param)
1579 {
1580         switch(event)
1581         {
1582                 case BLUETOOTH_EVENT_DISABLED:
1583                         if (param->result == BLUETOOTH_ERROR_NONE)
1584                         {
1585                                 // Successfully disabled
1586                         }
1587                         else
1588                         {
1589                                 // Failed
1590                         }
1591                         break;
1592         }
1593 }
1594
1595 ...
1596
1597 int ret = 0;
1598 ret = bluetooth_disable_adapter();
1599 @endcode
1600  */
1601 int bluetooth_disable_adapter(void);
1602 int bluetooth_recover_adapter(void);
1603 int bluetooth_check_adapter_le(void);
1604 int bluetooth_enable_adapter_le(void);
1605
1606 int bluetooth_disable_adapter_le(void);
1607
1608 /**
1609  * @fn int bluetooth_reset_adapter(void)
1610  * @brief Reset the Bluetooth H/W and values
1611  *
1612  *
1613  * This function resets Bluetooth protocol stack and hardware. This function is called when
1614  * an user want to initialize Bluetooth environment.
1615  *
1616  * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
1617  * internal error.
1618  *
1619  * This function is a synchronous call.
1620  *
1621  * @return      BLUETOOTH_ERROR_NONE - Success\n
1622  * @exception   BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
1623  * @remark      None
1624  * @see         bluetooth_check_adapter, bluetooth_enable_adapter
1625 @code
1626 ...
1627
1628 int ret = 0;
1629 ret = bluetooth_reset_adapter();
1630 @endcode
1631  */
1632 int bluetooth_reset_adapter(void);
1633
1634 /**
1635  * @fn int bluetooth_is_supported(void)
1636  * @brief Check if the bluetooth is supported or not by the current target
1637  *
1638  * This API checks whether the bluetooth is supported or not.
1639  * This API only run by root permission.
1640  *
1641  * This function is a synchronous call.
1642  *
1643  * @return      0 - if bluetooth is not supported\n
1644  *              1 - if bluetooth is supported\n
1645  *              BLUETOOTH_ERROR_INTERNAL - Error in API internal
1646  * @remark      None
1647 @code
1648
1649 int ret = 0;
1650 ret = bluetooth_is_supported();
1651 @endcode
1652  */
1653 int bluetooth_is_supported(void);
1654
1655
1656 /**
1657  * @fn int bluetooth_check_adapter(void)
1658  * @brief Check the current status of the Bluetooth adapter
1659  *
1660  *
1661  * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
1662  * the bluetooth adapter should be enabled. This API helps to find out the current state of the
1663  * bluetooth adapter.
1664  * This API get the adapter internal data structure and check current adapter status.
1665  *
1666  * This function is a synchronous call.
1667  *
1668  *
1669  * @return      BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
1670  *              BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
1671  * @remark      None
1672  * @see         bluetooth_enable_adapter, bluetooth_disable_adapter
1673 @code
1674
1675 int ret = 0;
1676 ret = bluetooth_check_adapter();
1677 @endcode
1678  */
1679 int bluetooth_check_adapter(void);
1680
1681 /**
1682  * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
1683  * @brief Get the local adapter bluetooth address
1684  *
1685  *
1686  * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
1687  * the adapter should be enabled.
1688  * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
1689  * contain Bluetooth address.
1690  * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
1691  * friendly name for each device.
1692  * There is no event callback for this API.
1693  *
1694  * This function is a synchronous call.
1695  *
1696  *
1697  * @return      BLUETOOTH_ERROR_NONE - Succeess \n
1698  *              BLUETOOTH_ERROR_INVALID_PARAM -  Invalid parameter (NULL buffer) \n
1699  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED -  Adapter is disabled \n
1700  * @param[out]  local_address   a device address of local bluetooth adapter
1701  * @remark      None
1702  * @see         None
1703 @code
1704
1705 bluetooth_device_address_t local_address={0,};
1706 int ret = 0;
1707
1708 ret = bluetooth_get_local_address(&local_address);
1709 @endcode
1710  */
1711 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
1712
1713 /**
1714  * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
1715  * @brief Get the hci version
1716  *
1717  *
1718  * This function is used to get the bluetooth hci version
1719  * Before calling this API make sure that the adapter is enabled.
1720  *
1721  * This function is a synchronous call.
1722  *
1723  *
1724  * @return      BLUETOOTH_ERROR_NONE - Success \n
1725  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
1726  * @param[out]  timeout   remain visibility timeout value
1727  * @remark      None
1728  @code
1729 bluetooth_version_t *version;
1730  int ret = 0;
1731  ret = bluetooth_get_local_version (&version);
1732  @endcode
1733  */
1734 int bluetooth_get_local_version(bluetooth_version_t *version);
1735
1736 /**
1737  * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
1738  * @brief Get the local device name
1739  *
1740  *
1741  * This function is used, get the local device name. Since its difficult to remember the Adapter
1742  * address, the friendly name can be assigned to the adapter and we can get it using this API. This
1743  * friendly name is retrived by the remote device and displaying.
1744  * Before calling this API, the adapter should be enabled. There is no event callback for this API.
1745  *
1746  * This function is a synchronous call.
1747  *
1748  *
1749  * @return      BLUETOOTH_ERROR_NONE - Success \n
1750  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
1751  * @param[out]  local_name      a local device name
1752  * @remark      None
1753  * @see         None
1754 @code
1755 bluetooth_device_name_t local_name={0,}
1756 int ret = 0;
1757 ret = bluetooth_get_local_name (&local_name);
1758 @endcode
1759  */
1760 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
1761
1762 /**
1763  * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
1764  * @brief Set the local device name
1765  *
1766  *
1767  * This function is used to set the local device name. This is a human friendly name whose
1768  * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
1769  *
1770  * This function is a synchronous call.
1771  *
1772  * @param[in]   local_name   bluetooth device name to set local device
1773  *
1774  * @return      BLUETOOTH_ERROR_NONE - Success \n
1775  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1776  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1777  *              BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
1778  *              BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
1779  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1780  *
1781  * @remark      None
1782
1783 @code
1784 bluetooth_device_name_t local_name={0,}
1785 int ret = 0;
1786 ret = bluetooth_set_local_name (&local_name);
1787 @endcode
1788  */
1789 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
1790
1791
1792 /**
1793  * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
1794  * @brief Check if the uuid is used or not
1795  *
1796  * This function is used to check if the uuid is used or not.
1797  *
1798  * This function is a synchronous call.
1799  *
1800  * @param[in]   service_uuid   service uuid (UUID 128 bit as string)
1801  * @param[out] used  if the uuid is used or not
1802  *
1803  * @return      BLUETOOTH_ERROR_NONE - Success \n
1804  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1805  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1806  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1807  *
1808  * @remark      None
1809  *
1810 @code
1811 gboolean used = FALSE;
1812 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
1813 ret = bluetooth_is_service_used(uuid, &used);
1814 @endcode
1815  */
1816 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
1817
1818 /**
1819  * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
1820  * @brief Check if the device is connected to the specific service
1821  *
1822  * This function is used to check if if the device is connected to the specific service.
1823  *
1824  * This function is a synchronous call.
1825  *
1826  * @param[in]   local_address   a device address of remote bluetooth device
1827  * @param[in]   type the service type
1828  * @param[out] is_connected  if the device is connected or not
1829  *
1830  * @return      BLUETOOTH_ERROR_NONE - Success \n
1831  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1832  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1833  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1834  *
1835  * @remark      None
1836  *
1837 @code
1838 gboolean is_connected = FALSE;
1839 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
1840 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
1841 @endcode
1842  */
1843 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
1844                                 bluetooth_service_type_t type,
1845                                 gboolean *is_connected);
1846
1847 /**
1848  * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
1849  * @brief Gets device's connected link type
1850  *
1851  * This function is used to get device's connected link type
1852  *
1853  * This function is a synchronous call.
1854  *
1855  * @param[in]   device_address  a device address of remote bluetooth device
1856  * @param[out]  connected_link  a device's connected link type
1857  *
1858  * @return      BLUETOOTH_ERROR_NONE - Success \n
1859  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1860  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
1861  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
1862  *
1863  * @remark      None
1864  *
1865 @code
1866 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
1867 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
1868 ret = bluetooth_get_connected_link(&device_address, &connected_link);
1869 @endcode
1870  */
1871 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
1872                                 bluetooth_connected_link_t *connected_link);
1873
1874 /**
1875  * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
1876  * @brief Get the visibility mode
1877  *
1878  *
1879  * This function is used to get the discoverable mode (Visibility option). Depending upon the
1880  * visibity mode, the property of the device is determined whether it can be discoverable, non
1881  * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
1882  *
1883  * This function is a synchronous call.
1884  *
1885  *
1886  * @return      BLUETOOTH_ERROR_NONE - Success \n
1887  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1888  *              BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
1889  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1890  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
1891  * @param[out]  discoverable_mode   current bluetooth discoverable mode
1892  * @remark      None
1893  * @see         bluetooth_set_discoverable_mode
1894  @code
1895  bluetooth_discoverable_mode_t discoverable_mode_ptr;
1896  int ret = 0;
1897  ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
1898  @endcode
1899  */
1900 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
1901
1902 /**
1903  * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
1904  *                                              int timeout)
1905  * @brief Set the visibility mode
1906  *
1907  *
1908  * This function is used to set the discoverable mode (Visibility option).
1909  *
1910  * Many times user may want to keep his device discoverable so that when peer device is performing
1911  * device search, he/she can find user's device. Application programmer can keep the mode as
1912  * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
1913  * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
1914  * modes cause bluetooth adapter to consume more battery. Hence developer should generally
1915  * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
1916  *
1917  * This function is a synchronous call.
1918  *
1919  * @return      BLUETOOTH_ERROR_NONE - Success \n
1920  *              BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
1921  *
1922  * @param[in]  discoverable_mode   the bluetooth discoverable mode to set
1923  * @param[in]  timeout   discoverable time in only limited discoverable mode (second), default: 0
1924  * @remark      None
1925  * @see         bluetooth_get_discoverable_mode
1926
1927 @code
1928
1929 bluetooth_discoverable_mode_t mode;
1930 int ret = 0;
1931 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
1932 ret = bluetooth_set_discoverable_mode (mode, 180);
1933
1934 @endcode
1935  */
1936 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
1937                                             int timeout);
1938
1939
1940 /**
1941  * @fn int bluetooth_get_timeout_value(int *timeout)
1942  * @brief Get the visibility timeout value
1943  *
1944  *
1945  * This function is used to get the visibility timeout
1946  * Before calling this API make sure that the adapter is enabled.
1947  *
1948  * This function is a synchronous call.
1949  *
1950  *
1951  * @return      BLUETOOTH_ERROR_NONE - Success \n
1952  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1953  *              BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
1954  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
1955  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
1956  * @param[out]  timeout   remain visibility timeout value
1957  * @remark      None
1958  * @see         bluetooth_set_discoverable_mode
1959  @code
1960  int timeout;
1961  int ret = 0;
1962  ret = bluetooth_get_timeout_value (&timeout);
1963  @endcode
1964  */
1965 int bluetooth_get_timeout_value(int *timeout);
1966
1967
1968 /**
1969  * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
1970  *                                      unsigned int  classOfDeviceMask)
1971  * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
1972  *
1973  * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
1974  * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
1975  * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
1976  * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
1977  * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
1978  * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
1979  * You will receive device address, device name, device class, rssi (received signal strength indicator).
1980  * please see bluetooth_device_info_t for more details.
1981  *
1982  *
1983  * This API provides searching options like max responses, discovery duration in seconds and class
1984  * of device mask to filter device search. some times there may be too many bluetooth devices in
1985  * vicinity of your device.in such scenario, application can request to reduce number of responces
1986  * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
1987  * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
1988  * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
1989  * application defined time. please note that discovery_duration should be mentioned in seconds.
1990  * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
1991  * duration.
1992  *
1993  * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
1994  * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
1995  * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
1996  *
1997  * This function is a asynchronous call.
1998  * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
1999  * through registered callback function.
2000  *
2001  * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2002  * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2003  *
2004  * The completion or cancellation of the discovery is indicated by an
2005  * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2006  *
2007  * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2008  *
2009  *
2010  * @return      BLUETOOTH_ERROR_NONE - Success \n
2011  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2012  *              BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2013  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2014                                                 agent is not running \n
2015  *
2016  * @param[in] max_response              define the maximum response of the number of founded devices
2017                                         (0 means unlimited)
2018  * @param[in] discovery_duration        define bluetooth discovery duration (0 means 180s )
2019  * @param[in] classOfDeviceMask         define classes of the device mask which user wants
2020                                         (refer to class of device)
2021  * @remark      None
2022  * @see         bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2023
2024 @code
2025 void bt_event_callback(int event, bluetooth_event_param_t *param)
2026 {
2027         switch(event)
2028         {
2029                 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2030                 {
2031                         bluetooth_device_info_t *device_info = NULL;
2032                         printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2033                                         param->result);
2034                         device_info  = (bluetooth_device_info_t *)param->param_data;
2035                         memcpy(&searched_device, &device_info->device_address,
2036                                                 sizeof(bluetooth_device_address_t));
2037                         printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2038                                 device_info->device_address.addr[0],
2039                                 device_info->device_address.addr[1],
2040                                 device_info->device_address.addr[2],
2041                                 device_info->device_address.addr[3],
2042                                 device_info->device_address.addr[4],
2043                                 device_info->device_address.addr[5]);
2044                         break;
2045                 }
2046                 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2047                 {
2048                         bluetooth_device_info_t *device_info = NULL;
2049                         printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2050                                                                                 param->result);
2051                         device_info  = (bluetooth_device_info_t *)param->param_data;
2052                         memcpy(&searched_device, &device_info->device_address,
2053                                                                 sizeof(bluetooth_device_address_t));
2054                         printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2055                                                         device_info->device_name.name,
2056                                                         device_info->device_address.addr[0],
2057                                                         device_info->device_address.addr[1],
2058                                                         device_info->device_address.addr[2],
2059                                                         device_info->device_address.addr[3],
2060                                                         device_info->device_address.addr[4],
2061                                                         device_info->device_address.addr[5]);
2062                         break;
2063                 }
2064
2065                 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2066                         printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2067                         break;
2068         }
2069 }
2070
2071 unsigned short max_response;
2072 unsigned short discovery_duration;
2073 unsigned classOfDeviceMask;
2074 int ret = 0;
2075
2076 max_response =0;
2077 discovery_duration =0;
2078 classOfDeviceMask =0;
2079
2080 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2081
2082 @endcode
2083  *
2084  */
2085 int bluetooth_start_discovery(unsigned short max_response,
2086                                       unsigned short discovery_duration,
2087                                       unsigned int classOfDeviceMask);
2088
2089 /**
2090  * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2091  *                                      unsigned short max_response,
2092  *                                      unsigned short discovery_duration,
2093  *                                      unsigned int  classOfDeviceMask)
2094  * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2095  *
2096  * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2097  * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2098  * Please see bluetooth_start_discovery() for other parameters description.
2099  *
2100  * This function is a asynchronous call.
2101  * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2102  * through registered callback function.
2103  *
2104  * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2105  * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2106  *
2107  * The completion or cancellation of the discovery is indicated by an
2108  * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2109  *
2110  * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2111  *
2112  *
2113  * @return      BLUETOOTH_ERROR_NONE - Success \n
2114  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2115  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2116  *              BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2117  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2118                                                 agent is not running \n
2119  *
2120  * @param[in] role              define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2121                                         (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2122                                         DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2123  * @param[in] max_response              define the maximum response of the number of founded devices
2124                                         (0 means unlimited)
2125  * @param[in] discovery_duration        define bluetooth discovery duration (0 means 180s )
2126  * @param[in] classOfDeviceMask         define classes of the device mask which user wants
2127                                         (refer to class of device)
2128  * @remark      None
2129  * @see         bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2130
2131 @code
2132 unsigned short type;
2133 unsigned short max_response;
2134 unsigned short discovery_duration;
2135 unsigned classOfDeviceMask;
2136 int ret = 0;
2137
2138 type = 1;
2139 max_response =0;
2140 discovery_duration =0;
2141 classOfDeviceMask =0;
2142
2143 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2144
2145 @endcode
2146  *
2147  */
2148 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2149                                                 unsigned short max_response,
2150                                                 unsigned short discovery_duration,
2151                                                 unsigned int classOfDeviceMask);
2152
2153 /**
2154  * @fn int bluetooth_cancel_discovery (void)
2155  * @brief Cancel the on-going device discovery operation
2156  *
2157  *
2158  * This function stops the on-going device discovery operation. This API has to be called after the
2159  * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2160  * the bluetooth_start_discovery API
2161  *
2162  * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2163  * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2164  * cancel the discover request once the user received the device to which he wish to connect.
2165  *
2166  * This function is a asynchronous call.
2167  * If the call is success to cancel discovey then the application will receive
2168  * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2169  * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2170  * BLUETOOTH_ERROR_NONE
2171  *
2172  *
2173  * @return      BLUETOOTH_ERROR_NONE - Success \n
2174  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2175  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2176  *              BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2177                                                 other application \n
2178  *              BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2179  * @remark      None
2180  * @see         bluetooth_start_discovery
2181 @code
2182 void bt_event_callback(int event, bluetooth_event_param_t *param)
2183 {
2184         switch(event)
2185         {
2186                 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2187                         TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2188                         break;
2189         }
2190 }
2191
2192 ..
2193
2194 int ret = 0;
2195
2196 ret = bluetooth_cancel_discovery();
2197 @endcode
2198  */
2199 int bluetooth_cancel_discovery(void);
2200
2201 /**
2202  * @fn int bluetooth_start_le_discovery(void)
2203  * @brief Start the generic device discovery which finds the LE devices.
2204  *
2205  * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2206  * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2207  * It try to find LE devices. Bluetooth device address and name are
2208  * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2209  * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2210  * You will receive device address, device name, device class, rssi (received signal strength indicator).
2211  * please see bluetooth_device_info_t for more details.
2212  *
2213  * This function is a asynchronous call.
2214  * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2215  * through registered callback function.
2216  *
2217  * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2218  * found.
2219  *
2220  * The completion or cancellation of the discovery is indicated by an
2221  * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2222  *
2223  * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2224  *
2225  *
2226  * @return      BLUETOOTH_ERROR_NONE - Success \n
2227  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2228  *              BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2229  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2230                                                 agent is not running \n
2231  *
2232  * @remark      None
2233  * @see         bluetooth_stop_le_discovery, bluetooth_device_info_t
2234
2235 @code
2236 void bt_event_callback(int event, bluetooth_event_param_t *param)
2237 {
2238         switch(event)
2239         {
2240                 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2241                 {
2242                         bluetooth_device_info_t *device_info = NULL;
2243                         printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2244                                         param->result);
2245                         device_info  = (bluetooth_device_info_t *)param->param_data;
2246                         memcpy(&searched_device, &device_info->device_address,
2247                                                 sizeof(bluetooth_device_address_t));
2248                         printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2249                                 device_info->device_address.addr[0],
2250                                 device_info->device_address.addr[1],
2251                                 device_info->device_address.addr[2],
2252                                 device_info->device_address.addr[3],
2253                                 device_info->device_address.addr[4],
2254                                 device_info->device_address.addr[5]);
2255                         break;
2256                 }
2257
2258                 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2259                         printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2260                         break;
2261         }
2262 }
2263
2264 int ret = 0;
2265 ret = bluetooth_start_discovery();
2266
2267 @endcode
2268  *
2269  */
2270 int bluetooth_start_le_discovery(void);
2271
2272 /**
2273  * @fn int bluetooth_stop_le_discovery (void)
2274  * @brief Cancel the on-going device LE discovery operation
2275  *
2276  *
2277  * This function stops the on-going device discovery operation. This API has to be called after the
2278  * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2279  * the bluetooth_start_le_discovery API
2280  *
2281  *
2282  * This function is a asynchronous call.
2283  * If the call is success to cancel discovey then the application will receive
2284  * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2285  * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2286  * BLUETOOTH_ERROR_NONE
2287  *
2288  *
2289  * @return      BLUETOOTH_ERROR_NONE - Success \n
2290  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2291  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2292  *              BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2293                                                 other application \n
2294  *              BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2295  * @remark      None
2296  * @see         bluetooth_start_discovery
2297 @code
2298 void bt_event_callback(int event, bluetooth_event_param_t *param)
2299 {
2300         switch(event)
2301         {
2302                 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2303                         TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2304                         break;
2305         }
2306 }
2307
2308 ..
2309
2310 int ret = 0;
2311
2312 ret = bluetooth_stop_le_discovery();
2313 @endcode
2314  */
2315 int bluetooth_stop_le_discovery(void);
2316
2317 /**
2318  * @fn int bluetooth_is_discovering(void)
2319  * @brief Check for the device discovery is in-progress or not.
2320  *
2321  * This API is used to check the current status of the Discovery operation.If discovery is in\
2322  * progress normally other operations are not allowed.
2323  * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2324  * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2325  * event before performing other operations. This API is used to get for the current discovery
2326  * operation status and using bluetooth_cancel_discovery()
2327  * we can cancell the ongoing discovery process.
2328  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2329  * this API.
2330  *
2331  * This function checks whether the device discovery is started or not.
2332  *
2333  * This function is a synchronous call.
2334  *
2335  *
2336  * @return      BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2337  *              BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2338  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2339  *
2340  * @remark      None
2341  * @see         bluetooth_start_discovery, bluetooth_cancel_discovery
2342
2343 @code
2344 int ret = 0;
2345 ret = bluetooth_is_discovering ();
2346 @endcode
2347  */
2348 int bluetooth_is_discovering(void);
2349
2350 /**
2351  * @fn int bluetooth_is_le_discovering(void)
2352  * @brief Check for the device LE discovery is in-progress or not.
2353  *
2354  * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2355  * progress normally other operations are not allowed.
2356  * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2357  * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2358  * event before performing other operations. This API is used to get for the current discovery
2359  * operation status and using bluetooth_stop_le_discovery()
2360  * we can cancell the ongoing LE discovery process.
2361  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2362  * this API.
2363  *
2364  * This function checks whether the device  LE discovery is started or not.
2365  *
2366  * This function is a synchronous call.
2367  *
2368  *
2369  * @return      BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2370  *              BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2371  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2372  *
2373  * @remark      None
2374  * @see         bluetooth_start_le_discovery, bluetooth_stop_le_discovery
2375
2376 @code
2377 int ret = 0;
2378 ret = bluetooth_is_le_discovering ();
2379 @endcode
2380  */
2381 int bluetooth_is_le_discovering(void);
2382
2383 /**
2384  * @fn int bluetooth_is_le_scanning(void)
2385  * @brief Check for the device LE scan is in-progress or not.
2386  *
2387  * This API is used to check the current status of the LE Scan operation.If discovery is in\
2388  * progress normally other operations are not allowed.
2389  *
2390  * This function checks whether the device  LE Scan is started or not.
2391  *
2392  * This function is a synchronous call.
2393  *
2394  * @return   TRUE  - LE Scan in progress \n
2395  *              FALSE - LE Scan is not in progress \n
2396  *
2397  * @remark      None
2398
2399 @code
2400 gboolean is_le_scanning = 0;
2401 is_le_scanning = bluetooth_is_le_scanning ();
2402 @endcode
2403  */
2404 gboolean bluetooth_is_le_scanning(void);
2405
2406 /**
2407  * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
2408  * @brief Register scan filter.
2409  *
2410  * This function registers the scan filter.
2411  *
2412  * This function is a synchronous call.
2413  *
2414  * @return      BLUETOOTH_ERROR_NONE - Success \n
2415  *
2416  * @param[in]   filter   scan filter to register
2417  * @param[out]  slot_id  the slot ID of scan filter
2418  *
2419  * @remark      None
2420  */
2421 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
2422
2423 /**
2424  * @fn int bluetooth_unregister_scan_filter(int slot_id)
2425  * @brief Register scan filter.
2426  *
2427  * This function unregisters the scan filter.
2428  *
2429  * This function is a synchronous call.
2430  *
2431  * @return      BLUETOOTH_ERROR_NONE - Success \n
2432  *
2433  * @param[in]   slot_id  the slot ID of scan filter
2434  *
2435  * @remark      None
2436  */
2437 int bluetooth_unregister_scan_filter(int slot_id);
2438
2439 /**
2440  * @fn int bluetooth_unregister_all_scan_filters(void)
2441  * @brief Register scan filter.
2442  *
2443  * This function usregisters all scan filters.
2444  *
2445  * This function is a synchronous call.
2446  *
2447  * @return      BLUETOOTH_ERROR_NONE - Success \n
2448  *
2449  * @remark      None
2450  */
2451 int bluetooth_unregister_all_scan_filters(void);
2452
2453 /**
2454  * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2455                 int link_type, bt_rssi_threshold_t rssi_threshold)
2456  * @brief Enable RSSI monitoring
2457  *
2458  * This function enables RSSI monitoring and sets threshold for a connection
2459  *
2460  * @return      BLUETOOTH_ERROR_NONE - Success \n
2461  *
2462  * @remark      None
2463  * @see bluetooth_get_rssi_strength
2464  */
2465 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
2466                 int link_type, bt_rssi_threshold_t *rssi_threshold);
2467
2468 /**
2469  * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
2470  * @brief Gets Raw RSSI signal Strength
2471  *
2472  * This function gives the Raw RSSI signal strength for a connection.
2473  *
2474  * @return      BLUETOOTH_ERROR_NONE - Success \n
2475  *
2476  * @remark      None
2477  * @see bluetooth_enable_rssi
2478  */
2479 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
2480
2481 int bluetooth_set_connectable(gboolean is_connectable);
2482
2483 int bluetooth_is_connectable(gboolean *is_connectable);
2484
2485 /**
2486  * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
2487  * @brief Initiate a bonding process
2488  *
2489  *
2490  * This function initiates a bonding procedure with a peer device.  The bonding procedure
2491  * enables authentication and optionally encryption on the Bluetooth link.
2492  *
2493  * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2494  * inititate the bonding request to the devices already in the paired list.
2495  *
2496  * Usually we call this API after the device discovery.
2497  * This function is a asynchronous call.
2498  *
2499  * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2500  * mentioed result code
2501  * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2502  * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2503  * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2504  * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2505  * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2506  *
2507  * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2508  * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2509  * result code
2510  *
2511  * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2512  *
2513  *
2514  * @return      BLUETOOTH_ERROR_NONE - Success \n
2515  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2516  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2517  *              BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2518  *              BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2519  * @exception   None
2520  * @param[in]   device_address   This indicates an address of the device with which the pairing
2521  *                                      should be initiated
2522  * @remark      None
2523  * @see         bluetooth_cancel_bonding
2524  @code
2525 void bt_event_callback(int event, bluetooth_event_param_t *param)
2526 {
2527         switch(event)
2528         {
2529                 case BLUETOOTH_EVENT_BONDING_FINISHED:
2530                 {
2531                         TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
2532                         if (param->result >= BLUETOOTH_ERROR_NONE)
2533                         {
2534                                 bluetooth_device_info_t *device_info = NULL;
2535                                 device_info  = (bluetooth_device_info_t *)param->param_data;
2536                                 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
2537                                                         mjr[%#x] min[%#x] srv[%#x]",
2538                                                         device_info->device_name.name,
2539                                                         device_info->device_address.addr[0],
2540                                                         device_info->device_address.addr[1],
2541                                                         device_info->device_address.addr[2],
2542                                                         device_info->device_address.addr[3],
2543                                                         device_info->device_address.addr[4],
2544                                                         device_info->device_address.addr[5],
2545                                                         device_info->device_class.major_class,
2546                                                         device_info->device_class.minor_class,
2547                                                         device_info->device_class.service_class);
2548                         }
2549                         else
2550                         {
2551                                 //bonding failed
2552                         }
2553                         break;
2554                 }
2555         }
2556 }
2557
2558 ...
2559
2560 int ret = 0;
2561 bluetooth_device_address_t device_address={{0}};
2562
2563 ret = bluetooth_bond_device(&device_address);
2564
2565 @endcode
2566  */
2567 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
2568
2569 /**
2570  * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2571  *                              bluetooth_conn_type_t conn_type)
2572  * @brief Initiate a bonding process
2573  *
2574  *
2575  * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
2576  * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
2577  *
2578  * Bonding is applied to the discovered device to which we need a secure connection. We cannot
2579  * inititate the bonding request to the devices already in the paired list.
2580  *
2581  * Usually we call this API after the device discovery.
2582  * This function is a asynchronous call.
2583  *
2584  * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
2585  * mentioed result code
2586  * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
2587  * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
2588  * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
2589  * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
2590  * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
2591  *
2592  * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
2593  * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
2594  * result code
2595  *
2596  * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
2597  *
2598  *
2599  * @return BLUETOOTH_ERROR_NONE - Success \n
2600  *             BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2601  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2602  *             BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
2603  *             BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
2604  * @exception None
2605  * @param[in] device_address This indicates an address of the device with which pairing
2606  *                                        should be initiated
2607  * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
2608  *                                 dual mode devices
2609  * @remark None
2610  * @see bluetooth_cancel_bonding
2611  */
2612 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
2613                                 bluetooth_conn_type_t conn_type);
2614
2615 /**
2616  * @fn int bluetooth_cancel_bonding(void)
2617  * @brief Cancel the on-going bonding process
2618  *
2619  * This API is called to cancel the on-going bonding procedure. It should be called before the
2620  * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
2621  * This API is useful when the remote device is not responding to the bond request or we wish to
2622  * cancel the bonding request. In this case we need not wait for the timeout to happen.
2623  *
2624  * This function is a synchronous call.
2625  *
2626  * @return      BLUETOOTH_ERROR_NONE - Success \n
2627  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
2628  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2629  * @exception   None
2630  * @remark      None
2631  * @see         bluetooth_bond_device
2632 @code
2633 ...
2634
2635 int ret = 0;
2636
2637 ret = bluetooth_cancel_bonding();
2638 @endcode
2639  */
2640 int bluetooth_cancel_bonding(void);
2641
2642 /**
2643  * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
2644  * @brief Remove bonding
2645  *
2646  *
2647  * To communicate with remote device over bluetooth link, user should bond with peer device.
2648  * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
2649  * API is used to remove peer device from the list. Please note that after removing the device
2650  * from bonded device list, you cannot communication with peer device until bonding happens again.
2651  *
2652  * User can call this function by passing bluetooth device address of any bonded device. Please note
2653  * that after successful return of this function, any bluetooth application running on your device
2654  * will not be able to communicate with unbonded device until bond operation happens again using
2655  * bluetooth_bond_device()
2656  *
2657  *
2658  * This function is a asynchronous call. The request to remove the specified device from the bonded
2659  * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
2660  * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
2661  * in case if there is a problem in locating given bluetooth device address in bonded devices list
2662  *
2663  *
2664  *
2665  * @return      BLUETOOTH_ERROR_NONE - Success \n
2666  *              BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
2667  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2668  *              BLUETOOTH_ERROR_DEVICE_BUSY     - Bluetooth adapter is busy doing some operation \n
2669  *              BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2670  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2671  *                                              agent is not running \n
2672  *              BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
2673  *                                              bonded device \n
2674  *
2675  * @param[in]   device_address   This indicates an address of the device to remove bonding
2676  *
2677  * @remark      None
2678  *
2679  * @see         bluetooth_bond_device, bluetooth_cancel_bonding
2680  *
2681 @code
2682 void bt_event_callback(int event, bluetooth_event_param_t *param)
2683 {
2684         switch(event) {
2685                 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
2686                         bluetooth_device_address_t *dev_addr = NULL;
2687
2688                         if (param->result == BLUETOOTH_ERROR_NONE) {
2689                                 dev_addr = (bluetooth_device_address_t *)param->param_data;
2690                                 //Unbound scuccess
2691                                 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
2692                                         dev_addr->addr[0], dev_addr->addr[1]
2693                                         dev_addr->addr[2], dev_addr->addr[3]
2694                                         dev_addr->addr[4], dev_addr->addr[5]
2695                         } else {
2696                                 //unbound failure
2697                         }
2698                 }
2699         }
2700 }
2701
2702 ...
2703
2704 int ret = 0;
2705 bluetooth_device_address_t *device_address;
2706
2707 // copy valid device address in device_address
2708
2709 ret = bluetooth_unbond_device(device_address);
2710 @endcode
2711  */
2712 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
2713
2714 /**
2715  * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
2716  * @brief Get bonded(paired) device list
2717  *
2718  *
2719  * This API gets all bonded device list.
2720  * The devices in the bonded device list further can be used to perform the authorization by calling
2721  * bluetooth_authorize_device API.
2722  *
2723  * This function is a synchronous call.
2724  * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
2725  * there is no valid information in the dev_list.
2726  * The len field in the dev_list represents the number of bonded devices. The data structure for
2727  * bonded device information is bluetooth_device_info_t.
2728  *
2729  *
2730  * @return      BLUETOOTH_ERROR_NONE - Success \n
2731  *              BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
2732  * @remark      None
2733  * @see         bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
2734  @code
2735 void bt_get_bonded_devices(void)
2736 {
2737 ...
2738         int i;
2739         GPtrArray *devinfo = NULL;
2740         bluetooth_device_info_t *ptr;
2741
2742         // allocate the g_pointer_array
2743         devinfo = g_ptr_array_new();
2744
2745         ret = bluetooth_get_bonded_device_list(&devinfo);
2746         if (ret != BLUETOOTH_ERROR_NONE)
2747         {
2748                 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
2749         }
2750         else
2751         {
2752                 printf("g pointer arrary count : [%d]", devinfo->len);
2753                 for (i=0; i<devinfo->len; i++)
2754                 {
2755                         ptr = g_ptr_array_index(devinfo, i);
2756                         if (ptr != NULL)
2757                         {
2758                                 printf("Name [%s]\n", ptr->device_name.name);
2759                                 printf("Major Class [%d]\n", ptr->device_class.major_class);
2760                                 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
2761                                 printf("Service Class [%d]\n", ptr->device_class.service_class);
2762                                 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
2763                                                                 ptr->device_address.addr[0],
2764                                 ptr->device_address.addr[1], ptr->device_address.addr[2],
2765                                                                 ptr->device_address.addr[3],
2766                                 ptr->device_address.addr[4], ptr->device_address.addr[5]);
2767
2768                                 // handle
2769                                 ...
2770                         }
2771                 }
2772         }
2773         // free g_pointer_array
2774         g_ptr_array_free(devinfo, TRUE);
2775 }
2776
2777 @endcode
2778  */
2779 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
2780
2781 /**
2782  * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
2783  *                                      bluetooth_device_info_t *dev_info)
2784  * @brief Get a bonded(paired) device
2785  *
2786  *
2787  * This API gets a bonded device.
2788  *
2789  * This function is a synchronous call.
2790  * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
2791  * there is no valid information in the dev_info.
2792  * The data structure for bonded device information is bluetooth_device_info_t.
2793  *
2794  *
2795  * @return      BLUETOOTH_ERROR_NONE - Success \n
2796  *              BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
2797  * @remark      None
2798  * @see         bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
2799  @code
2800 void bt_get_bonded_device(void)
2801 {
2802 ...
2803         int i;
2804         bluetooth_device_info_t devinfo = {0};
2805         bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
2806
2807         ret = bluetooth_get_bonded_device(&device_address, &devinfo);
2808         if (ret != BLUETOOTH_ERROR_NONE)
2809         {
2810                 printf("bluetooth_get_bonded_device failed with [%d]",ret);
2811         }
2812         else
2813         {
2814                 printf("Name [%s]\n", devinfo.device_name.name);
2815                 printf("Major Class [%d]\n", devinfo.device_class.major_class);
2816                 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
2817                 printf("Service Class [%d]\n", devinfo.device_class.service_class);
2818                 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
2819                 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
2820                 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
2821                 devinfo.device_address.addr[5]);
2822
2823                 // handle
2824                 ...
2825         }
2826 }
2827
2828 @endcode
2829  */
2830 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
2831                                         bluetooth_device_info_t *dev_info);
2832
2833 /**
2834  * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
2835  * @brief set alias for bonded device
2836  *
2837  *
2838  * This function set alias for bonded device.
2839  *
2840  * This function is a synchronous call.
2841  *
2842  *
2843  * @return      BLUETOOTH_ERROR_NONE - Success \n
2844  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2845  * @param[in]   device_address   This indicates an address of the remote device
2846  * @param[in]   alias                   This indicates an alias to set
2847  * @remark      None
2848  * @see         None
2849 @code
2850 int ret = 0;
2851 ret = bluetooth_set_alias(&remote_address);
2852 @endcode
2853  */
2854 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
2855                                 const char *alias);
2856
2857 /**
2858  * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
2859  * @brief Get remote deivice
2860  *
2861  *
2862  * This function gets specific remote device.
2863  *
2864  * This function is a asynchronous call.
2865  * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
2866  *
2867  *
2868  * @return      BLUETOOTH_ERROR_NONE - Success \n
2869  *              BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
2870  * @param[in]   device_address   This indicates an address of the remote device
2871  * @remark      None
2872  * @see         None
2873 @code
2874 int ret = 0;
2875 ret = bluetooth_get_remote_device(&remote_address);
2876 @endcode
2877  */
2878 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
2879
2880 /**
2881  * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
2882  *                                      gboolean authorized)
2883  * @brief Authorize/Unauthorize a bonded device
2884  *
2885  *
2886  * This function authorizes/unauthorize a bonded device. It decides the device to connect
2887  * with/without user confirmation.
2888  *
2889  * If we select a paired device and make it authorized by calling this API with the authorized
2890  * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
2891  * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
2892  * then it will ask for the user conformation before the connection.
2893  *
2894  * This API supposed to be called on the paired devices. Which means we have to use this API only
2895  * after successful pairing.
2896  *
2897  * This function is a asynchronous call.
2898  * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
2899  *
2900  * @return      BLUETOOTH_ERROR_NONE - Success \n
2901  * @exception   BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
2902  * @param[in]   device_address   This indicates an address of the device to authorize \n
2903  * @param[in]   authorized      TRUE : authorize FALSE: unauthorize
2904  * @remark      None
2905  * @see         bluetooth_get_bonded_device_list
2906 @code
2907 void bt_event_callback(int event, bluetooth_event_param_t *param)
2908 {
2909         switch(event)
2910         {
2911                 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
2912                 {
2913                         if (param->result == BLUETOOTH_ERROR_NONE)
2914                         {
2915                                 //Device authorized
2916                         }
2917                         //device authorization failed failure
2918                 }
2919         }
2920 }
2921
2922 ...
2923
2924 int ret = 0;
2925 bluetooth_device_address_t device_address={{0}};
2926 gboolean authorized;
2927
2928 authorized =TRUE;
2929
2930 ret = bluetooth_authorize_device(&device_address,authorized);
2931 @endcode
2932  */
2933 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
2934                                        gboolean authorized);
2935
2936 /**
2937  * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
2938  * @brief Get all services supported by remote device
2939  *
2940  *
2941  * This API call initiates the search for the services supported by the specified device. Normally
2942  * the service search will take a couple of seconds to get it completed. Before calling this API
2943  * make sure that the Adapter is enabled. We have to give the device address of the remote device to
2944  * perform the service search. We can get the device address by doing a device discovery operation.
2945  *
2946  *
2947  * This function is a asynchronous call.
2948  * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
2949  *
2950  * There is a timeout associated with the service search. The default time out is 40 seconds. If the
2951  * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
2952  * event is generated with appropriate result code.
2953  *
2954  * @return      BLUETOOTH_ERROR_NONE - Success \n
2955  *              BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
2956  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2957  * @param[in]   device_address   This indicates an address of the device
2958  *                               whose services need to be found
2959  * @remark      None
2960  * @see         bluetooth_cancel_service_search
2961  */
2962 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
2963
2964 /**
2965  * @fn int bluetooth_cancel_service_search(void)
2966  * @brief Cancel the ongoing service search operation
2967  *
2968  *
2969  * This function cancel the ongoing service search operation. This API is usually calling after the
2970  * bluetooth_search_service API.
2971  * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
2972  * if the user wish to cancel the Ongoing service search operation.
2973  *
2974  * This API should be called just after the bluetooth_search_service API and before the
2975  * BLUETOOTH_EVENT_SERVICE_SEARCHED event
2976  *
2977  * This function is a synchronous call.
2978  *
2979  * @return      BLUETOOTH_ERROR_NONE - Success \n
2980  *              BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
2981  *              BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
2982  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
2983  *
2984  * @remark      None
2985  * @see         bluetooth_search_service
2986 @code
2987 ...
2988
2989 int ret = 0;
2990 ret = bluetooth_cancel_service_search();
2991 @endcode
2992 */
2993 int bluetooth_cancel_service_search(void);
2994
2995 /**
2996  * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
2997  * @brief Register rfcomm socket with a specific uuid
2998  *
2999  *
3000  * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3001  * descriptor of the server.
3002  * This is the first API which is called to create the server. Once we created the server socket,
3003  * we will listen on that return socket.
3004  * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3005  *
3006  *
3007  * @return  socket FD on Success \n
3008  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3009  *              BLUETOOTH_ERROR_INTERNAL - Internal error\n
3010  *              BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3011  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3012  * @param[in]   UUID (128 bits)
3013  *
3014  * @remark      None
3015  * @see       bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3016  *
3017  @code
3018
3019   const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3020   fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3021
3022  @endcode
3023  */
3024 int bluetooth_rfcomm_create_socket(const char *uuid);
3025
3026 /**
3027  * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3028  * @brief Register rfcomm socket with a specific uuid
3029  *
3030  *
3031  * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3032  * descriptor of the server.
3033  * This is the first API which is called to create the server. Once we created the server socket,
3034  * we will listen on that return socket.
3035  * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3036  *
3037  *
3038  * @return  socket FD on Success \n
3039  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3040  *              BLUETOOTH_ERROR_INTERNAL - Internal error\n
3041  *              BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3042  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3043  * @param[in]   UUID (128 bits)
3044  * @param[in]   bus_name (const char)
3045  * @param[in]   path (const char)
3046  *
3047  * @remark      None
3048  * @see       bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3049  *
3050  @code
3051
3052   const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3053   fd  = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3054
3055  @endcode
3056  */
3057 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3058
3059 /**
3060  * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3061  * @brief De-register the rfcomm socket
3062  *
3063  *
3064  * This API deregister rfcomm socket with the given socket fd and  UUID. If the remote device is
3065  * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3066  * descriptor else no event will come. We will call this API only after the
3067  * bluetooth_rfcomm_listen_and_accept.
3068  * This is a synchronous call.
3069  *
3070  * @return   BLUETOOTH_ERROR_NONE - Success \n
3071  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3072  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3073  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3074  * @param[in]  int socket_fd
3075  *
3076  * @remark      None
3077  * @see       bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3078  *
3079  @code
3080  void bt_event_callback(int event, bluetooth_event_param_t *param)
3081  {
3082         switch(event)
3083         {
3084                 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3085                 {
3086                         bluetooth_rfcomm_connection_t *discon_ind =
3087                                         (bluetooth_rfcomm_connection_t *)param->param_data;
3088
3089                         printf("\nDisconnected from FD %d",  discon_ind->socket_fd);
3090                 }
3091         }
3092  }
3093
3094  ...
3095
3096  int ret = 0;
3097  fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3098  ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3099  ....
3100  ret = bluetooth_rfcomm_remove_socket(fd);
3101  @endcode
3102  */
3103 int bluetooth_rfcomm_remove_socket(int socket_fd);
3104
3105 /**
3106  * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3107  * @brief De-register the rfcomm socket
3108  *
3109  *
3110  * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3111  * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3112  * descriptor else no event will come. We will call this API only after the
3113  * bluetooth_rfcomm_listen_and_accept_ex.
3114  * This is a synchronous call.
3115  *
3116  * @return   BLUETOOTH_ERROR_NONE - Success \n
3117  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3118  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3119  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3120  * @param[in]   UUID (128 bits)
3121  *
3122  * @remark      None
3123  * @see       bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3124  *
3125  @code
3126  void bt_event_callback(int event, bluetooth_event_param_t *param)
3127  {
3128         switch(event)
3129         {
3130                 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3131                 {
3132                         bluetooth_rfcomm_connection_t *discon_ind =
3133                                         (bluetooth_rfcomm_connection_t *)param->param_data;
3134
3135                         printf("\nDisconnected from FD %d",  discon_ind->socket_fd);
3136                 }
3137         }
3138  }
3139
3140  ...
3141
3142  int ret = 0;
3143  fd  = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3144  ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3145  ....
3146  ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3147  @endcode
3148  */
3149 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3150
3151 /**
3152  * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3153  * @brief Disconnect rfcomm connection
3154  *
3155  *
3156  * Disconnect a specific(device node fd)  RFCOMM connection. This is a Synchronous call and there
3157  * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3158  * remote server.
3159  *
3160  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3161  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3162  *              BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3163  * @param[in]  int socket_fd the sending socket fd
3164  *
3165  * @remark      None
3166  *
3167  @code
3168
3169   ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3170   if (ret < 0)
3171         printf("Disconnection failed");
3172   else
3173   printf("Disconnection Success");
3174
3175  @endcode
3176  */
3177 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3178
3179 /**
3180  * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3181  * @brief Rfcomm socket listen
3182  *
3183  *
3184  * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3185  * after the bluetooth_rfcomm_create_socket API.
3186  * This API listen for the incomming connection and once it receives a connection, it will give
3187  * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3188  * event to the application. This is an Asynchronous API call.
3189  *
3190  *
3191  * @return  BLUETOOTH_ERROR_NONE - Success \n
3192  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3193  *              BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3194
3195  * @param[in]  int socket_fd
3196  * @param[in]  max pending connection.
3197  *
3198  * @remark      None
3199  * @see       bluetooth_rfcomm_create_socket
3200  *
3201   @code
3202   void bt_event_callback(int event, bluetooth_event_param_t* param)
3203  {
3204         switch(event)
3205         {
3206                 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3207                 {
3208                         bluetooth_rfcomm_connection_t *conn_ind =
3209                                                 (bluetooth_rfcomm_connection_t *)param->param_data;
3210
3211                         printf("\nConnected from FD %d",  conn_ind->socket_fd);
3212                 }
3213         }
3214  }
3215
3216  ...
3217
3218  int ret = 0;
3219  fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3220  ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3221
3222  @endcode
3223  */
3224 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3225
3226 /**
3227  * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3228  * @brief Rfcomm socket listen
3229  *
3230  *
3231  * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3232  * after the bluetooth_rfcomm_create_socket API.
3233  * This API listen for the incomming connection and once it receives a connection, it will give
3234  * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3235  * event to the application. This is an Asynchronous API call.
3236  *
3237  *
3238  * @return  BLUETOOTH_ERROR_NONE - Success \n
3239  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3240  *              BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3241
3242  * @param[in]  int socket_fd
3243  * @param[in]  max pending connection.
3244  * @param[in]  name
3245  * @param[in]  path
3246  *
3247  * @remark      None
3248  * @see       bluetooth_rfcomm_create_socket_ex
3249  *
3250   @code
3251   void bt_event_callback(int event, bluetooth_event_param_t* param)
3252  {
3253         switch(event)
3254         {
3255                 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3256                 {
3257                         bluetooth_rfcomm_connection_t *conn_ind =
3258                                                 (bluetooth_rfcomm_connection_t *)param->param_data;
3259
3260                         printf("\nConnected from FD %d",  conn_ind->socket_fd);
3261                 }
3262         }
3263  }
3264
3265  ...
3266
3267  int ret = 0;
3268  fd  = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3269  ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3270
3271  @endcode
3272  */
3273
3274 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3275
3276 /**
3277  * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3278  * @brief Rfcomm socket listen
3279  *
3280  *
3281  * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3282  * after the bluetooth_rfcomm_create_socket API.
3283  * This API listen for the incomming connection and once it receives a connection, it will give
3284  * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3285  * event to the application. This is an Asynchronous API call.
3286  *
3287  *
3288  * @return  BLUETOOTH_ERROR_NONE - Success \n
3289  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3290  *              BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3291
3292  * @param[in]  int socket_fd
3293  * @param[in]  max pending connection.
3294  *
3295  * @remark      None
3296  * @see       bluetooth_rfcomm_create_socket
3297  *
3298   @code
3299   void bt_event_callback(int event, bluetooth_event_param_t* param)
3300  {
3301         switch(event)
3302         {
3303                 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
3304                 {
3305                         char *name = (char *)param->param_data;
3306
3307                         printf("\nConnected from %s",  name);
3308
3309                         bluetooth_rfcomm_accept_connection();
3310                 }
3311         }
3312  }
3313
3314  ...
3315
3316  int ret = 0;
3317  fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3318  ret = bluetooth_rfcomm_listen(fd, 1);
3319
3320  @endcode
3321  */
3322 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
3323
3324 /**
3325  * @fn int bluetooth_rfcomm_accept_connection()
3326  * @brief Accepts the authorization request indicated by the event
3327   * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3328  *
3329  * This function is a synchronous call.
3330  *
3331  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3332  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
3333  *
3334  * @param[in]  the socket fd of the server
3335  * @param[out]  the socket fd of the client
3336  *
3337  * @exception   None
3338  * @remark       None
3339  * @see           bluetooth_rfcomm_reject_connection
3340  */
3341 int bluetooth_rfcomm_accept_connection(int server_fd);
3342
3343 /**
3344  * @fn int bluetooth_rfcomm_reject_connection()
3345  * @brief Rejects the authorization request indicated by the event
3346   * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
3347  *
3348  * This function is a synchronous call.
3349  *
3350  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3351  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
3352  *
3353  * @param[in]  the socket fd of the server
3354  *
3355  * @exception   None
3356  * @remark       None
3357  * @see           bluetooth_rfcomm_accept_connection
3358  */
3359 int bluetooth_rfcomm_reject_connection(int server_fd);
3360
3361 /**
3362  * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
3363  * @brief Informs whether rfcomm server uuid is available or not.
3364  *
3365  * This function is a synchronous call.
3366  *
3367  * @return   TRUE  - RFCOMM uuid is available \n
3368  *              FALSE - RFCOMM uuid is not available \n
3369  *
3370  * @param[in]  uuid UUID string
3371  *
3372  * @exception   None
3373  *
3374  * @remark       None
3375  */
3376 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
3377
3378 /**
3379  * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t  *remote_bt_address,
3380  *                                                                      const char *remote_uuid)
3381  * @brief Connect to the remote device rfcomm *
3382  *
3383  * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
3384  * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
3385  * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
3386  * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
3387  * initiating a connection.
3388  *
3389  * @return  BLUETOOTH_ERROR_NONE  - Success \n
3390  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3391  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3392  *              BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
3393  *              BLUETOOTH_ERROR_INTERNAL - Internal Error\n
3394  * @param[in]  bluetooth_device_address_t remote bt_address
3395  * @param[in]  char remote uuid
3396  * @remark      None
3397  * @see         bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
3398  *
3399  @code
3400
3401  void bt_event_callback(int event, bluetooth_event_param_t *param)
3402  {
3403         switch(event)
3404         {
3405                 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
3406                 {
3407                         if (param->result >= BLUETOOTH_ERROR_NONE)
3408                         {
3409                                 bt_sdp_info_t *bt_sdp_info=param->param_data;
3410
3411                                 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3412                                         bt_sdp_info->device_addr.addr[0],
3413                                         bt_sdp_info->device_addr.addr[1],
3414                                         bt_sdp_info->device_addr.addr[2],
3415                                         bt_sdp_info->device_addr.addr[3],
3416                                         bt_sdp_info->device_addr.addr[4],
3417                                         bt_sdp_info->device_addr.addr[5]);
3418
3419                                         printf("Supported service list:\n");
3420                                         for(i=0; i<bt_sdp_info->service_index; i++)
3421                                                 printf("[%#x]\n",
3422                                                         bt_sdp_info->service_list_array[i]);
3423
3424                                 //Alternate method
3425                                 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
3426                                                                                 //rfcomm_test_uuid);
3427                         }
3428                         break;
3429                 }
3430                 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3431                 {
3432                         bluetooth_rfcomm_connection_t *conn_ind =
3433                                                 (bluetooth_rfcomm_connection_t *)param->param_data;
3434
3435                         printf("\nConnected from FD %d, Role = %s",  conn_ind->socket_fd,
3436                                                 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
3437                                                                         "SERVER" : "CLIENT");
3438                 }
3439         }
3440  }
3441
3442   bluetooth_device_address_t remote_address = {{0},};
3443   remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
3444   remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19;  remote_address.addr[5]= 0x36;
3445   ret = bluetooth_search_service(&remote_address);
3446  if (ret < 0)
3447         printf("Seach failed, Reason = %d", ret);
3448   else
3449          printf("Search Success, Ret = %d", ret);
3450
3451   ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
3452   if (ret < 0)
3453         printf("Connection failed, Reason = %d", ret);
3454   else
3455          printf("Connection Success, Ret = %d", ret);
3456
3457   @endcode
3458   */
3459 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
3460                                      const char *remote_uuid);
3461
3462 /**
3463  * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
3464  * @brief Disconnect rfcomm connection
3465  *
3466  *
3467  * Disconnect a specific(device node fd)  RFCOMM connection. This is a Synchronous call and there
3468  * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3469  * remote server.
3470  *
3471  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3472  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3473  *              BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3474  * @param[in]  char remote bt_address
3475  *
3476  * @remark      None
3477  * @see         bluetooth_rfcomm_connect
3478  *
3479  @code
3480
3481   ret = bluetooth_rfcomm_disconnect(g_ret_fd);
3482   if (ret < 0)
3483         printf("Disconnection failed");
3484   else
3485   printf("Disconnection Success");
3486
3487  @endcode
3488  */
3489
3490 int bluetooth_rfcomm_disconnect(int socket_fd);
3491
3492 /**
3493  * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
3494  * @brief Write to rfcomm connection
3495  *
3496  *
3497  * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
3498  * API is used to send the data for server and the client.
3499  *
3500  * @return  BLUETOOTH_ERROR_NONE  - Success \n
3501  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3502  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
3503  * @param[in]  int fd
3504  * @param[in]  const char *buff  Data buffer to send
3505  * @param[in]  int length Length of the data
3506  *
3507  * @remark      None
3508  * @see         bluetooth_rfcomm_connect
3509  *
3510   @code
3511   char *buff = "Test data 123456789"
3512   ret =  bluetooth_rfcomm_write(g_ret_fd, buff, 15);
3513   if (ret < 0)
3514         printf("Send failed");
3515   else
3516    printf("Send success");
3517
3518  @endcode
3519  */
3520 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
3521
3522 /**
3523  * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
3524  * @brief Informs whether rfcomm client is connected.
3525  *
3526  * This function is a synchronous call.
3527  *
3528  * @return   TRUE  - RFCOMM client is connected \n
3529  *              FALSE - RFCOMM client is not connected \n
3530  *
3531  * @exception   None
3532  *
3533  * @remark       None
3534  */
3535 gboolean bluetooth_rfcomm_is_client_connected(void);
3536 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3537 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
3538
3539 /**
3540  * @fn int bluetooth_network_activate_server(void)
3541  * @brief Activate the NAP (Network Access Point) service
3542  *
3543  * This function is a asynchronous call.
3544  * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
3545  *
3546  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3547  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3548  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3549  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3550  *
3551  * @remark      None
3552   * @see        bluetooth_network_deactivate_server
3553  *
3554  */
3555 int bluetooth_network_activate_server(void);
3556
3557 /**
3558  * @fn int bluetooth_network_deactivate_server(void)
3559  * @brief Deactivate the NAP (Network Access Point) service
3560  *
3561  * This function is a asynchronous call.
3562  * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
3563  *
3564  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3565  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3566  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3567  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3568  *
3569  * @remark      None
3570  * @see         bluetooth_network_activate_server
3571  *
3572  */
3573 int bluetooth_network_deactivate_server(void);
3574
3575 /**
3576  * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3577  *                                      bluetooth_network_role_t role,
3578  *                                      char  custom_uuid)
3579  * @brief Connect the network server in the peer
3580  *
3581  * This function is a asynchronous call.
3582  * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3583  *
3584  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3585  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3586  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3587  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3588  *
3589  * @exception   None
3590  * @param[in]  device_address   This indicates an address of the device with which the pairing
3591  *                              should be initiated
3592  * @param[in]  role   The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
3593  *                      need to use the third parameter.
3594  * @param[in]  custom_uuid   If use the CUSTOM value in second parameter, use this parameter to
3595  *                              connect. UUID string
3596  * @remark      None
3597  * @see         bluetooth_network_disconnect
3598  */
3599 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
3600                                       bluetooth_network_role_t role, char *custom_uuid);
3601
3602 /**
3603  * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
3604  *                                                      bluetooth_network_role_t role,
3605  *                                                        char *custom_uuid)
3606  * @brief Connect the network server in the peer
3607  *
3608  * This function is a asynchronous call.
3609  * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
3610  *
3611  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3612  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3613  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3614  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3615  *
3616  * @exception   None
3617  * @param[in]   device_address   This indicates an address of the device with which the pairing
3618  *                                      should be initiated
3619  * @remark       None
3620  * @see         bluetooth_network_connect
3621  */
3622 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
3623
3624 /**
3625  * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
3626  * @brief Disconnect the device from the network
3627  *
3628  * This function is an asynchronous call.
3629  * The network server disconnect request is responded by
3630  * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
3631  *
3632  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3633  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3634  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3635  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3636  *
3637  * @exception   None
3638  * @param[in]   device_address   This indicates an address of the connected client device
3639  * @remark       None
3640  * @see         bluetooth_network_activate_server
3641  */
3642 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
3643
3644 /*HDP - API's*/
3645
3646 /**
3647  * @fn int bluetooth_hdp_activate(unsigned short  data_type,
3648  *                                      bt_hdp_role_type_t role,
3649  *                                      bt_hdp_qos_type_t channel_type,
3650  *                                      char **app_handle)
3651  * @brief Activate the HDP service for a particular data type
3652  *
3653  * This function is a synchronous call.
3654  *
3655  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3656  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3657  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3658  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3659  *
3660  * @exception   None
3661  * @param[in]  data_type   The data type against corresponding service
3662  * @param[in]  role   The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
3663  * @param[in]  channel_type   The QOS type for the channel.
3664  *                              HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
3665  *                              For role = HDP_ROLE_SINK, the channel_type
3666  *                              should be HDP_QOS_ANY.
3667  * @param[out]  app_handle    The application handler against corresponding service
3668  * @remark       None
3669  * @see            bluetooth_hdp_deactivate
3670  */
3671 int bluetooth_hdp_activate(unsigned short  data_type,
3672                                 bt_hdp_role_type_t role,
3673                                 bt_hdp_qos_type_t channel_type,
3674                                 char **app_handle);
3675 /**
3676  * @fn int bluetooth_hdp_deactivate(const char *app_handle)
3677  * @brief Deactivate the HDP service for a particular service using the handler
3678  *
3679  * This function is a synchronous call.
3680  *
3681  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3682  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3683  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3684  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3685  *
3686  * @exception   None
3687  * @param[in]  app_handle   The application handler against corresponding service
3688  * @remark       None
3689  * @see            bluetooth_hdp_deactivate
3690  */
3691 int bluetooth_hdp_deactivate(const char *app_handle);
3692
3693 /**
3694  * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
3695  *                                      const char *buffer, unsigned int size)
3696  * @brief Send data to the remote HDP device
3697  *
3698  * This function is a synchronous call.
3699  *
3700  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3701  *             BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3702  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3703  *             BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3704  *             BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid  \n
3705  *
3706  * @exception   None
3707  * @param[in]  channel_id   The channel id for the connection.
3708  * @param[in]  buffer   The pdu buffer.
3709  * @param[in]  size   Size of the buffer.
3710  * @remark       None
3711  * @see            bluetooth_hdp_connect
3712  */
3713 int bluetooth_hdp_send_data(unsigned int channel_id,
3714                                 const char *buffer, unsigned int size);
3715 /**
3716  * @fn int bluetooth_hdp_connect(const char *app_handle,
3717  *                              bt_hdp_qos_type_t channel_type,
3718  *                              const bluetooth_device_address_t *device_address)
3719  * @brief Connect to the remote device(Mainly used by source)
3720  *
3721  * This function is a asynchronous call.
3722  * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
3723  *
3724  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3725  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3726  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3727  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3728  *              BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
3729  *
3730  * @exception   None
3731  * @param[in]  app_handle   The application handler against corresponding service
3732  * @param[in]  channel_type   The QOS type for the channel.
3733  *                              HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
3734  * @param[in]  device_address   The remote device Bd address.
3735  *
3736  * @remark       None
3737  * @see            bluetooth_hdp_disconnect
3738  */
3739 int bluetooth_hdp_connect(const char *app_handle,
3740                         bt_hdp_qos_type_t channel_type,
3741                         const bluetooth_device_address_t *device_address);
3742 /**
3743  * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
3744  *                      const bluetooth_device_address_t *device_address)
3745  * @brief Disconnect from the remote device(Mainly used by source)
3746  *
3747  * This function is a asynchronous call.
3748  * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
3749  *
3750  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3751  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3752  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3753  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3754   *              BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
3755  *
3756  * @exception   None
3757  * @param[in]  channel_id    The channel id for the connection.
3758  * @param[in]  device_address   The remote device Bd address.
3759  *
3760  * @remark       None
3761  * @see            bluetooth_hdp_connect
3762  */
3763 int bluetooth_hdp_disconnect(unsigned int channel_id,
3764                         const bluetooth_device_address_t  *device_address);
3765
3766
3767 /**
3768  * @fn int bluetooth_opc_init(void)
3769  * @brief Initialize OPP client.
3770  *
3771  * This function is a synchronous call.
3772  * No event corresponding to this api
3773  *
3774  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3775  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3776  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3777  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3778   *             BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
3779  *
3780  * @exception   None
3781  *
3782  * @remark       None
3783  * @see           bluetooth_opc_deinit
3784  */
3785 int bluetooth_opc_init(void);
3786
3787 /**
3788  * @fn int bluetooth_opc_deinit(void)
3789  * @brief Deinitialize OPP client.
3790  *
3791  * This function is a synchronous call.
3792  * No event corresponding to this api
3793  *
3794  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3795  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3796  *              BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
3797  *
3798  * @exception   None
3799  *
3800  * @remark       None
3801  * @see           bluetooth_opc_init
3802  */
3803
3804  int bluetooth_opc_deinit(void);
3805
3806 /**
3807  * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
3808                                         char **file_name_array)
3809  * @brief Send multiple files to a remote device.
3810  *
3811  * This function is a asynchronous call.
3812  * This api  is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
3813  *
3814  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3815  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3816  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3817  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
3818  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3819  *              BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
3820  *              BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
3821  *
3822  * @exception   None
3823  * @param[in]  device_address   The remote device Bd address.
3824  * @param[in]  file_name_array  Array of filepaths to be sent.
3825  *
3826  * @remark       None
3827  * @see          bluetooth_opc_cancel_push
3828  */
3829
3830 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
3831                                 char **file_name_array);
3832
3833 /**
3834  * @fn int bluetooth_opc_cancel_push(void)
3835  * @brief Cancels the ongoing file push.
3836  *
3837  * This function is a asynchronous call.
3838  * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
3839  * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
3840  *
3841  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3842  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3843  *              BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
3844  *
3845  * @exception   None
3846  *
3847  * @remark       None
3848  * @see           bluetooth_opc_push_files
3849  */
3850
3851 int bluetooth_opc_cancel_push(void);
3852
3853 /**
3854  * @fn gboolean bluetooth_opc_session_is_exist(void)
3855  * @brief Informs whether opc session exists or not.
3856  *
3857  * This function is a synchronous call.
3858  *
3859  * @return   TRUE  - OPC session exists \n
3860  *              FALSE - OPC session does not exist \n
3861  *
3862  * @exception   None
3863  *
3864  * @remark       None
3865  * @see          None
3866  */
3867
3868 gboolean bluetooth_opc_session_is_exist(void);
3869
3870 /**
3871  * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
3872  * @brief Informs whether opc session exists or not.
3873  *
3874  * This function is a synchronous call.
3875  *
3876  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3877  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
3878  *               BLUETOOTH_ERROR_INTERNAL \n
3879  *
3880  * @exception   None
3881  * @param[out] is_sending The sending status: (@c TRUE = in sending , @c  false = not in sending)
3882  *
3883  * @remark       None
3884  * @see            None
3885  */
3886 int bluetooth_opc_is_sending(gboolean *is_sending);
3887
3888 /**
3889  * @fn int bluetooth_obex_server_init(const char *dst_path)
3890  * @brief Initialize OPP and FTP server.
3891  *
3892  * This function is a synchronous call.
3893  * No event corresponding to this api
3894  *
3895  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3896  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3897  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3898  *              BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
3899  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3900  *
3901  * @exception   None
3902  * @param[in]  dst_path   OPS destination file path.
3903  * @remark       None
3904  * @see           bluetooth_obex_server_deinit
3905  */
3906 int bluetooth_obex_server_init(const char *dst_path);
3907
3908
3909 /**
3910  * @fn int bluetooth_obex_server_deinit(void)
3911  * @brief Deinitialize OPP and FTP server.
3912  *
3913  * This function is a synchronous call.
3914  * No event corresponding to this api
3915  *
3916  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3917  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3918  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
3919  *
3920  * @exception   None
3921  *
3922  * @remark       None
3923  * @see           bluetooth_obex_server_init
3924  */
3925 int bluetooth_obex_server_deinit(void);
3926
3927
3928 /**
3929  * @fn gboolean bluetooth_obex_server_is_activated(void)
3930  * @brief Informs whether obex server is activated or not.
3931  *
3932  * This function is a synchronous call.
3933  *
3934  * @return   TRUE  - OBEX server is activated \n
3935  *              FALSE - OBEX server is not activated \n
3936  *
3937  * @exception   None
3938  *
3939  * @remark       None
3940  */
3941
3942 gboolean bluetooth_obex_server_is_activated(void);
3943
3944
3945 /**
3946  * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
3947  * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
3948  *
3949  * This function is a synchronous call.
3950  * No event corresponding to this api
3951  *
3952  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3953  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3954  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3955  *              BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
3956  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3957  *
3958  *
3959  * @exception   None
3960  * @param[in]  dst_path   OPS destination file path.
3961  * @remark       None
3962  * @see           bluetooth_obex_server_deinit_without_agent
3963  */
3964 int bluetooth_obex_server_init_without_agent(const char *dst_path);
3965
3966
3967 /**
3968  * @fn int bluetooth_obex_server_deinit_without_agent(void)
3969  * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
3970  *
3971  * This function is a synchronous call.
3972  * No event corresponding to this api
3973  *
3974  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3975  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3976  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
3977  *
3978  * @exception   None
3979  *
3980  * @remark       None
3981  * @see           bluetooth_obex_server_init_without_agent
3982  */
3983 int bluetooth_obex_server_deinit_without_agent(void);
3984
3985
3986 /**
3987  * @fn int bluetooth_obex_server_accept_connection(void)
3988  * @brief Accepts the authorization request indicated by the event
3989   * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
3990  *
3991  * This function is a synchronous call.
3992  *
3993  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3994  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
3995  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
3996  *
3997  * @exception   None
3998  * @remark       None
3999  * @see           bluetooth_obex_server_reject_authorize
4000  */
4001 int bluetooth_obex_server_accept_connection(void);
4002
4003
4004 /**
4005  * @fn int bluetooth_obex_server_reject_connection(void)
4006  * @brief Rejects the authorization request indicated by the event
4007   * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4008  *
4009  * This function is a synchronous call.
4010  *
4011  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4012  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4013  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
4014  *
4015  * @exception   None
4016  * @remark       None
4017  * @see           bluetooth_obex_server_reject_authorize
4018  */
4019 int bluetooth_obex_server_reject_connection(void);
4020
4021
4022 /**
4023  * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4024  * @brief Accepts the authorization request indicated by the event
4025   * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4026  *
4027  * This function is a asynchronous call.
4028  * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4029  *
4030  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4031  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4032  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4033  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4034  *
4035  * @exception   None
4036  * @param[in]  filename   Authorized filename.
4037
4038  * @remark       None
4039  * @see           bluetooth_obex_server_reject_authorize
4040  */
4041
4042 int bluetooth_obex_server_accept_authorize(const char *filename);
4043
4044 /**
4045  * @fn int bluetooth_obex_server_reject_authorize(void)
4046  * @brief Reject the authorization request indicated by the event
4047   * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4048  *
4049  * This function is a asynchronous call.
4050  * No event for this api..
4051  *
4052  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4053  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4054  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4055  *
4056  * @exception   None
4057
4058  * @remark       None
4059  * @see           bluetooth_obex_server_accept_authorize
4060  */
4061
4062 int bluetooth_obex_server_reject_authorize(void);
4063
4064 /**
4065  * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4066  * @brief Set the OPS destination file path..
4067  *
4068  * This function is a asynchronous call.
4069  * No event for this api..
4070  *
4071  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4072  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4073  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4074  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4075  *
4076  * @exception   None
4077  * @param[in]  dst_path   OPS destination file path.
4078
4079  * @remark       None
4080  * @see          None
4081  */
4082
4083 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4084
4085 /**
4086  * @fn int bluetooth_obex_server_set_root(const char *root)
4087  * @brief Set the FTS root folder..
4088  *
4089  * This function is a asynchronous call.
4090  * No event for this api..
4091  *
4092  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4093  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4094  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4095  *              BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4096  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4097  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4098  *
4099  * @exception  None
4100  * @param[in]   root   FTS root folder.
4101
4102  * @remark       None
4103  * @see          None
4104  */
4105
4106 int bluetooth_obex_server_set_root(const char *root);
4107
4108 /**
4109  * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4110  * @brief Cancel the transfer on server
4111  *
4112  * This function is an asynchronous call.
4113  * If the function call that cancels transfer is successful, the application would receive
4114  * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4115  * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4116  * the error code will be BLUETOOTH_ERROR_NONE
4117  *
4118  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4119  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4120  *               BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4121  *               BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4122  *               BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4123  *
4124  * @exception None
4125  * @param[in] transfer_id transfer ID
4126
4127  * @remark       None
4128  * @see          None
4129  */
4130 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4131
4132
4133 /**
4134  * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4135  * @brief Cancel the transfer on server
4136  *
4137  * This function is an asynchronous call.
4138  * If the function call that cancels transfer is successful, the application would receive
4139  * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4140  * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4141  * the error code will be BLUETOOTH_ERROR_NONE
4142  *
4143  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4144  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4145  *               BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4146  *               BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4147  *               BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4148  *
4149  * @exception None
4150  *
4151  * @remark       None
4152  * @see          None
4153  */
4154 int bluetooth_obex_server_cancel_all_transfers(void);
4155
4156
4157 /**
4158  * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4159  * @brief Informs whether obex server is receiving or not.
4160  *
4161  * This function is a synchronous call.
4162  *
4163  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4164  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4165  *               BLUETOOTH_ERROR_INTERNAL \n
4166  *
4167  * @exception   None
4168  * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c  false = not in receiving)
4169  *
4170  * @remark       None
4171  * @see            None
4172  */
4173 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4174
4175
4176 /**
4177  * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4178  * @brief Read the local Hash and Randmizer.
4179  *
4180  * This function is a synchronous call.
4181  *
4182  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4183  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4184  *
4185  * @exception  None
4186  * @param[in]  None.
4187  * @param[out] local_oob_data - Pointer to the local OOB data
4188  *
4189  * @remark       None
4190  * @see          None
4191  */
4192
4193 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
4194
4195
4196 /**
4197  * @fn int bluetooth_oob_add_remote_data(
4198  *                      const bluetooth_device_address_t *remote_device_address,
4199  *                      bt_oob_data_t *oob_data)
4200  * @brief Add/updated the remote device  Hash and Randmizer.
4201  *
4202  * This function is a synchronous call.
4203  * No event for this api..
4204  *
4205  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4206  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4207  *
4208  * @exception   None
4209  * @param[in] remote_device_address - Remote device address
4210  *            remote_oob_data - Ponter to Hash and Randomizer oob data structure
4211  *
4212  * @remark      None
4213  * @see         None
4214  */
4215
4216 int bluetooth_oob_add_remote_data(
4217                    const bluetooth_device_address_t *remote_device_address,
4218                    bt_oob_data_t *remote_oob_data);
4219
4220
4221 /**
4222  * @fn int bluetooth_oob_remove_remote_data(
4223  *                      const bluetooth_device_address_t *remote_device_address)
4224  * @brief Delete the Hash and Randomizer w.r.t the remote device address.
4225  *
4226  * This function is a synchronous call.
4227  * No event for this api..
4228  *
4229  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4230  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4231  *
4232  * @exception  None
4233  * @param[in] remote_device_address - Remote device address
4234  *
4235  * @remark       None
4236  * @see          None
4237  */
4238
4239 int bluetooth_oob_remove_remote_data(
4240                         const bluetooth_device_address_t *remote_device_address);
4241
4242 /**
4243  * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4244  *                                              bt_gatt_handle_info_t *prim_svc);
4245  *
4246  * @brief Gets the GATT based primary services handle supported by remote device
4247  *
4248  * This function is a synchronous call.
4249  * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4250  *
4251  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4252  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4253  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4254  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4255  *
4256  * @exception    None
4257  * @param[in]    address - Remote device address
4258  * @param[out] prim_svc - Structure containing remote service count and handle list.
4259  *
4260  * @remark      None
4261  * @see         bluetooth_gatt_free_primary_services()
4262  */
4263 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
4264                                                 bt_gatt_handle_info_t *prim_svc);
4265
4266 /**
4267  * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
4268  *
4269  * @brief Discovers the characteristics of GATT based service of remote device
4270  *
4271  * This function is an asynchronous call.
4272  * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
4273  *
4274  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4275  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4276  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4277  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4278  *
4279  * @exception   None
4280  * @param[in]   service_handle - Handle for remote service.
4281  *
4282  * @remark      None
4283  * @see         None
4284  */
4285 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
4286
4287 /**
4288  * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
4289  *                                              bt_gatt_service_property_t *service);
4290  *
4291  * @brief Gets the properties of GATT based service of remote device
4292  *
4293  * This function is a synchronous call.
4294  * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
4295  *
4296  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4297  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4298  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4299  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4300  *
4301  * @exception   None
4302  * @param[in]   service_handle - Handle for remote service.
4303  * @param[out]  service - Structure containing remote service property.
4304  *
4305  * @remark      None
4306  * @see         bluetooth_gatt_free_service_property()
4307  */
4308 int bluetooth_gatt_get_service_property(const char *service_handle,
4309                                                 bt_gatt_service_property_t *service);
4310
4311 /**
4312  * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
4313  *
4314  * @brief Register to GATT based service to receive value change notification/indication.
4315  *
4316  * This function is a synchronous call.
4317  * No event for this api.
4318  *
4319  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4320  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4321  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4322  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4323  *
4324  * @exception   None
4325  * @param[in]   service_handle - Handle for remote service.
4326  *
4327  * @remark      None
4328  * @see         None
4329  */
4330 int bluetooth_gatt_watch_characteristics(const char *service_handle);
4331
4332 /**
4333  * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
4334  *
4335  * @brief Unregister GATT based service to receive value change notification/indication.
4336  *
4337  * This function is a synchronous call.
4338  * No event for this api.
4339  *
4340  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4341  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4342  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4343  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4344  *
4345  * @exception   None
4346  * @param[in]   service_handle - Handle for remote service.
4347  *
4348  * @remark      None
4349  * @see         None
4350  */
4351 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
4352
4353 /**
4354  * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4355  *                                              bt_gatt_char_property_t *characteristic);
4356  *
4357  * @brief Provides characteristic value along with properties.
4358  *
4359  * This function is a synchronous call.
4360  * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
4361  *
4362  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4363  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4364  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4365  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4366  *
4367  * @exception   None
4368  * @param[in]   char_handle - Handle for Characteristic property.
4369  * @param[out] characteristic - Structure containing remote characteristic property.
4370  *
4371  * @remark      None
4372  * @see         bluetooth_gatt_free_char_property()
4373  */
4374 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
4375                                                 bt_gatt_char_property_t *characteristic);
4376
4377 /**
4378  * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
4379  *                                              bt_gatt_char_property_t *characteristic);
4380  *
4381  * @brief Provides characteristic descriptor value along with its UUID.
4382  *
4383  * This function is a synchronous call.
4384  * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
4385  *
4386  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4387  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4388  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4389  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4390  *
4391  * @exception   None
4392  * @param[in]   desc_handle - Handle for Characteristic descriptor.
4393  * @param[out] descriptor - Structure containing remote characteristic descriptor property.
4394  *
4395  * @remark      None
4396  * @see         bluetooth_gatt_free_desc_property()
4397  */
4398 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
4399                                                 bt_gatt_char_descriptor_property_t *descriptor);
4400
4401
4402 /**
4403  * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4404  *                                              const guint8 *value, int length)
4405  *
4406  * @brief Set characteristic value.
4407  *
4408  * This function is a synchronous call.
4409  *
4410  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4411  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4412  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4413  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4414  *
4415  * @exception   None
4416  * @param[in]   char_handle - Handle for Characteristic property.
4417  * @param[in]   value - New value to set for characteristic property.
4418  * @param[in]   length - Length of the value to be set.
4419  *
4420  * @remark      None
4421  * @see         None
4422  */
4423 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
4424                                                 const guint8 *value, int length);
4425
4426 /**
4427  * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4428  *                              const guint8 *value, int length, guint8 write_type)
4429  *
4430  * @brief Set characteristic value by write type.
4431  *
4432  * This function is a synchronous call if write type is "write without resonse"
4433  * and it is an asynchronous call if write type is "write with response"
4434  *
4435  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4436  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4437  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4438  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4439  *
4440  * @exception   None
4441  * @param[in]   char_handle - Handle for Characteristic property.
4442  * @param[in]   value - New value to set for characteristic property.
4443  * @param[in]   length - Length of the value to be set.
4444  * @param[in]   write_type - Type of write.
4445  *
4446  * @remark      None
4447  * @see         None
4448  */
4449 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
4450                                 const guint8 *value, int length, guint8 write_type);
4451
4452
4453 /**
4454  * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4455  *                                              const guint8 *value, int length)
4456  *
4457  * @brief Set characteristic value request.
4458  *
4459  * This function is an asynchronous call.
4460  *
4461  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4462  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4463  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4464  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4465  *
4466  * @exception   None
4467  * @param[in]   char_handle - Handle for Characteristic property.
4468  * @param[in]   value - New value to set for characteristic property.
4469  * @param[in]   length - Length of the value to be set.
4470   *
4471  * @remark      None
4472  * @see         None
4473  */
4474 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
4475                                                 const guint8 *value, int length);
4476
4477 /**
4478  * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
4479  *
4480  * @brief Read characteristic value.
4481  *
4482  * This function is a asynchronous call.
4483  *
4484  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4485  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4486  *             BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4487  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4488  *
4489  * @exception  None
4490  * @param[in]  char_handle - Handle for Characteristic property.
4491  *
4492  * @remark     None
4493  * @see        None
4494  */
4495 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
4496
4497 /**
4498  * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4499  *                                      const char *service_uuid,
4500  *                                      bt_gatt_service_property_t *service)
4501  *
4502  * @brief Gets the service property from a device based on a particular uuid
4503  *
4504  * This function is a synchronous call.
4505  *
4506  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4507  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4508  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4509  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4510  *
4511  * @exception   None
4512  * @param[in]   address - BD address of the remote device
4513  * @param[in]   service_uuid - uuid of the service.
4514  * @param[out] service - Structure containing the service property.
4515  *
4516  * @remark      None
4517  * @see         None
4518  */
4519  int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
4520                                         const char *service_uuid,
4521                                         bt_gatt_service_property_t *service);
4522
4523 /**
4524  * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4525  *                                                      const char *char_uuid)
4526  *
4527  * @brief Gets the characteristic property from a service based on a particular char uuid
4528  *
4529  * This function is an asynchronous call.
4530  * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
4531  *
4532  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4533  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4534  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4535  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4536  *
4537  * @exception   None
4538  * @param[in]   service_handle - Service handle.
4539  * @param[in]   uuid - Characteristic uuid.
4540  *
4541  * @remark      None
4542  * @see         None
4543  */
4544 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
4545                                                 const char *char_uuid);
4546
4547 /**
4548  * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4549  *
4550  * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
4551  *
4552  * This function is a synchronous call.
4553  * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
4554  *
4555  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4556  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4557  *
4558  * @exception   None
4559  * @param[in]   prim_svc - GATT handle info structure
4560  *
4561  * @remark      None
4562  * @see         bluetooth_gatt_get_primary_services()
4563  */
4564 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
4565
4566 /**
4567  * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4568  *
4569  * @brief  Releases the memory allocated by bluetooth_gatt_get_service_property()
4570  *
4571  * This function is a synchronous call.
4572  * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
4573  *
4574  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4575  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4576  *
4577  * @exception   None
4578  * @param[in]   svc_pty - GATT service property structure.
4579  *
4580  * @remark      None
4581  * @see         bluetooth_gatt_get_service_property()
4582  */
4583 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
4584
4585 /**
4586  * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4587  *
4588  * @brief Provides characteristic value along with properties.
4589  *
4590  * This function is a synchronous call.
4591  * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4592  *
4593  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4594  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4595  *
4596  * @exception   None
4597  * @param[in]   char_pty - GATT characteristics property structure.
4598  *
4599  * @remark      None
4600  * @see         bluetooth_gatt_get_characteristics_property()
4601  */
4602  int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
4603
4604 /**
4605  * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4606  *
4607  * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
4608  *
4609  * This function is a synchronous call.
4610  * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
4611  *
4612  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4613  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4614  *
4615  * @exception   None
4616  * @param[in]   desc_pty - GATT characteristics descriptor property structure.
4617  *
4618  * @remark      None
4619  * @see         bluetooth_gatt_get_char_descriptor_property()
4620  */
4621  int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
4622
4623
4624  int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
4625
4626  int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
4627
4628  /**
4629  * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4630  *
4631  * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
4632  *
4633  * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
4634  *
4635  * @return  BLUETOOTH_ERROR_NONE  - Success \n
4636  *                      BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4637  *
4638  * @exception   None
4639  * @param[in]   characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
4640  *
4641  * @remark      None
4642  */
4643 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
4644
4645 /**
4646  * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
4647  *
4648  * @brief Read characteristic descriptor value.
4649  *
4650  * This function is a asynchronous call.
4651  *
4652  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4653  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4654  *             BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4655  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4656  *
4657  * @exception  None
4658  * @param[in]  desc_handle - Handle for Characteristic descriptor
4659  *
4660  * @remark     None
4661  * @see        None
4662  */
4663  int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
4664
4665 /**
4666  * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4667  *                      const guint8 *value, int length);
4668  *
4669  * @brief Set characteristic descriptor value.
4670  *
4671  * This function is a asynchronous call.
4672  *
4673  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4674  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4675  *             BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4676  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4677  *
4678  * @exception  None
4679  * @param[in]  desc_handle - Handle for Characteristic descriptor
4680  * @param[in]  value - New value to set for characteristic descriptor
4681  * @param[in]  length - Length of the value to be set.
4682  *
4683  * @remark     None
4684  * @see        None
4685  */
4686  int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
4687                         const guint8 *value, int length);
4688
4689 /* @fn int bluetooth_gatt_init(void)
4690 *
4691 * @brief Initializes the gatt service.
4692 *
4693 * This function is a synchronous call.
4694 * @return   BLUETOOTH_ERROR_NONE        - Success \n
4695 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4696 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4697 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4698 *
4699 * @exception     None
4700 * @remark  Adapter should be enabled
4701 * @see  bluetooth_gatt_deinit()
4702 */
4703 int bluetooth_gatt_init(void);
4704
4705 /* @fn int bluetooth_gatt_init(void)
4706 *
4707 * @brief DeInitializes the gatt service.
4708 *
4709 * This function is a synchronous call.
4710 * @return   BLUETOOTH_ERROR_NONE        - Success \n
4711 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4712 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4713 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4714 *
4715 * @exception     None
4716 * @remark  Adapter should be enabled
4717 * @see  bluetooth_gatt_init()
4718 */
4719 int bluetooth_gatt_deinit(void);
4720
4721 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
4722                         unsigned char **svc_path)
4723 *
4724 * @brief Exports a new gatt service to the service interface.
4725 *
4726 * This function is a synchronous call.
4727 *
4728 * @return       BLUETOOTH_ERROR_NONE    - Success \n
4729 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4730 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4731 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4732 *
4733 * @exception     None
4734 * @param[in]   svc_uuid  Gatt service uuid.
4735 * @param[out] svc_path  service object path of the exported service.
4736 * @remark  Adapter should be enabled
4737 * @see  bluetooth_gatt_init()
4738 */
4739 int bluetooth_gatt_add_service(const char *svc_uuid,
4740                         char **svc_path);
4741
4742 /* @fn int bluetooth_gatt_add_new_characteristic(
4743                         const char *svc_path, const char *char_uuid,
4744                         bt_gatt_characteristic_property_t *properties,
4745                         int flags_length, char **char_path);;
4746 *
4747 * @brief Exports a new gatt characteristic to the characteristic interface.
4748 *
4749 * This function is a synchronous call.
4750 * @return       BLUETOOTH_ERROR_NONE    - Success \n
4751 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4752 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4753 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4754 * @exception     None
4755 * @param[in]   svc_path service object path of the exported service.
4756 * @param[in]   char_uuid  Gatt service uuid.
4757 * @param[in]   properties       GATT characteristic properties.
4758 * @param[out] char_path characteristic object path of the exported characteristic.
4759 *
4760 * @remark  Adapter should be enabled
4761 * @see  bluetooth_gatt_add_service()
4762 */
4763 int bluetooth_gatt_add_new_characteristic(
4764                         const char *svc_path, const char *char_uuid,
4765                         bt_gatt_characteristic_property_t properties,
4766                         char **char_path);
4767
4768 /* @fn bluetooth_gatt_set_characteristic_value(
4769                         const char *characteristic, const char *char_value,
4770                         int value_length);
4771 *
4772 * @brief adds gatt charactertisic value to the given charactertistic path.
4773 *
4774 * This function is a synchronous call.
4775 * @return       BLUETOOTH_ERROR_NONE    - Success \n
4776 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4777 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4778 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4779 * @exception     None
4780 * @param[in]   char_value Value of the GATT characteristic to be added.
4781 * @param[in]   value_length length of the chantacteristic value..
4782 * @param[out] characteristic characteristic object path..
4783 *
4784 * @remark  Adapter should be enabled
4785 * @see  bluetooth_gatt_add_service()
4786 */
4787 int bluetooth_gatt_set_characteristic_value(
4788                         const char *characteristic, const char *char_value,
4789                         int value_length);
4790
4791 /* @fn int bluetooth_gatt_add_descriptor(const char *desc_uuid,
4792                         const char *desc_value, int value_length,
4793                         const char *permissions, const char *char_path,
4794                         char **desc_path);
4795 *
4796 * @brief Exports a new gatt descriptor to the descriptor interface.
4797 *
4798 * This function is a synchronous call.
4799 *
4800 * @return       BLUETOOTH_ERROR_NONE    - Success \n
4801 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4802 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4803 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4804 *
4805 * @exception     None
4806 * @param[in]   desc_uuid  Gatt descriptor uuid.
4807 * @param[in]   desc_value       GATT descriptor value.
4808 * @param[in]   value_length     Length of GATT descriptor value.
4809 * @param[in]   permissions      descriptor permissions.
4810 * @param[in]  char_path characteristics object path of the exported character.
4811 *
4812 * @remark  Adapter should be enabled
4813 * @see  bluetooth_gatt_add_service()
4814 * @see  bluetooth_gatt_add_characteristics()
4815 */
4816 int bluetooth_gatt_add_descriptor(const char *char_path,
4817                         const char *desc_uuid,
4818                         char **desc_path);
4819
4820 /* @fn int bluetooth_gatt_set_descriptor_value(
4821                    const char *desc_path, const char *desc_value,
4822                    int value_length);
4823 *
4824 * @brief Adds value to the given descriptor handle.
4825 *
4826 * This function is a synchronous call.
4827 *
4828 * @return       BLUETOOTH_ERROR_NONE    - Success \n
4829 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4830 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4831 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4832 *
4833 * @exception     None
4834 * @param[in]   desc_value       GATT descriptor value.
4835 * @param[in]   value_length     Length of GATT descriptor value.
4836 * @param[in]  desc_path descriptor path to which the value needs to be added.
4837 *
4838 * @remark  Adapter should be enabled
4839 * @see  bluetooth_gatt_add_service()
4840 * @see  bluetooth_gatt_add_characteristics()
4841 */
4842 int bluetooth_gatt_set_descriptor_value(
4843                    const char *desc_path, const char *desc_value,
4844                    int value_length);
4845
4846 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
4847 *
4848 * @brief Reads the Service registered on manager interface.
4849 *
4850 * This function is a synchronous call.
4851 *
4852 * @return       BLUETOOTH_ERROR_NONE    - Success \n
4853 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4854 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4855 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4856 *
4857 * @exception     None
4858 * @param[in]   svc_uuid  Gatt Service uuid.
4859 *
4860 * @remark  Adapter should be enabled and service should be registered.
4861 * @see  bluetooth_gatt_register_service()
4862 */
4863 int bluetooth_gatt_get_service(const char *svc_uuid);
4864
4865 /* @fn int bluetooth_gatt_register_service(const  char *svc_path)
4866 *
4867 * @brief Registers the given service path with the bluez gatt server.
4868 *
4869 * This function is a synchronous call.
4870 *
4871 * @return       BLUETOOTH_ERROR_NONE    - Success \n
4872 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4873 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4874 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4875 *
4876 * @exception     None
4877 * @param[in] svc_path   service object path of the exported service.
4878 *
4879 * @remark  Adapter should be enabled
4880 * @see  bluetooth_gatt_add_service()
4881 * @see  bluetooth_gatt_add_characteristics()
4882 * @see  bluetooth_gatt_add_descriptor()
4883 */
4884 int bluetooth_gatt_register_service(const char *svc_path);
4885
4886 /* @fn int bluetooth_gatt_unregister_service(const  char *svc_path)
4887 *
4888 * @brief Removes(unregister) service from the bluez gatt server db.
4889 *
4890 * This function is a synchronous call.
4891 *
4892 * @return       BLUETOOTH_ERROR_NONE    - Success \n
4893 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4894 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4895 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4896 *
4897 * @exception     None
4898 * @param[in] svc_path   service object path of the exported service.
4899 *
4900 * @remark  Adapter should be enabled
4901 * @see  bluetooth_gatt_add_service()
4902 * @see  bluetooth_gatt_add_characteristics()
4903 * @see  bluetooth_gatt_add_descriptor()
4904 * @see bluetooth_gatt_register_service()
4905 */
4906 int bluetooth_gatt_unregister_service(const char *svc_path);
4907
4908 /* @fn int bluetooth_gatt_send_response(int request_id,
4909 *                               int offset, char *value, int value_length)
4910 *
4911 * @brief Updates the attribute value in local attribute list.
4912 *
4913 * This function is a synchronous call.
4914 *
4915 * @return       BLUETOOTH_ERROR_NONE    - Success \n
4916 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4917 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4918 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4919 *
4920 * @exception     None
4921 * @param[in] request_id The identification of a read request
4922 * @param[in] offset The offset from where a value is read
4923 * @param[in] value The value to be sent. It will be sent from @a offset.
4924 *               If it is NULL, a requested GATT handle's value will be sent from @a offset.
4925 * @param[in] value_length Value Length.
4926 *
4927 * @remark  Adapter should be enabled
4928 * @see  bluetooth_gatt_add_service()
4929 * @see  bluetooth_gatt_add_characteristics()
4930 * @see  bluetooth_gatt_add_descriptor()
4931 * @see bluetooth_gatt_register_service()
4932 */
4933 int bluetooth_gatt_send_response(int request_id,
4934                                 int offset, char *value, int value_length);
4935
4936
4937 /* @fn int bluetooth_gatt_delete_services(void)
4938 *
4939 * @brief deletes (unregisters) all services from the gatt server database..
4940 *
4941 * This function is a synchronous call.
4942 *
4943 * @return       BLUETOOTH_ERROR_NONE    - Success \n
4944 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4945 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4946 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4947 *
4948 * @exception     None
4949 *
4950 * @remark  Adapter should be enabled
4951 * @see  bluetooth_gatt_add_service()
4952 * @see  bluetooth_gatt_add_characteristics()
4953 * @see  bluetooth_gatt_add_descriptor()
4954 * @see bluetooth_gatt_register_service()
4955 * @see bluetooth_gatt_unregister_service()
4956 */
4957 int bluetooth_gatt_delete_services(void);
4958
4959 /* @fn int bluetooth_gatt_update_characteristic(void)
4960 *
4961 * @brief updates the given characteristic with a new value
4962 *
4963 * This function is a synchronous call.
4964 *
4965 * @return       BLUETOOTH_ERROR_NONE    - Success \n
4966 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4967 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
4968 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
4969 *
4970 * @exception     None
4971 *
4972 * @remark  Adapter should be enabled
4973 * @see  bluetooth_gatt_add_service()
4974 * @see  bluetooth_gatt_add_characteristics()
4975 * @see  bluetooth_gatt_add_descriptor()
4976 * @see bluetooth_gatt_register_service()
4977 * @see bluetooth_gatt_unregister_service()
4978 */
4979 int bluetooth_gatt_update_characteristic(const char *char_path,
4980                 const char* char_value, int value_length);
4981
4982 /**
4983  * @fn int bluetooth_set_advertising(int handle, gboolean enable);
4984  *
4985  * @brief Set advertising status.
4986  *
4987  * This function is used to enable or disable LE advertising.
4988  * Once advertising is enabled, Advertising data is transmitted in the advertising packets
4989  *
4990  * This function is a synchronous call.
4991  *
4992  * @return      BLUETOOTH_ERROR_NONE - Success \n
4993  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
4994  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
4995  *
4996  * @exception   None
4997  * @param[in]   enable - The status of advertising
4998  *
4999  * @remark      None
5000  * @see         bluetooth_set_advertising_data
5001  */
5002 int bluetooth_set_advertising(int handle, gboolean enable);
5003
5004 /**
5005  * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5006  *
5007  * @brief Set advertising status along with interval value.
5008  *
5009  * This function is used to enable or disable LE advertising.
5010  * Interval_min and Interval_max is used to set the best advertising interval.
5011  * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5012  *
5013  * This function is a synchronous call.
5014  *
5015  * @return      BLUETOOTH_ERROR_NONE - Success \n
5016  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5017  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5018  *
5019  * @exception   None
5020  * @param[in]   enable - The status of advertising
5021  * @param[in]   interval_min - Minimum interval of advertising (msec)
5022  * @param[in]   interval_max - Maximum interval of advertising (msec)
5023  * @param[in]   filter_policy - Advertising filter policy
5024  *
5025  * @remark      None
5026  * @see         bluetooth_set_advertising_data
5027  */
5028 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5029                                         bluetooth_advertising_params_t *params);
5030
5031 /**
5032  * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5033  * @brief Get the advertising data
5034  *
5035  * This function is used to get advertising data.
5036  * Before calling this API, the adapter should be enabled.
5037  *
5038  * This function is a synchronous call.
5039  *
5040  * @return      BLUETOOTH_ERROR_NONE - Success \n
5041  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5042  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5043  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5044  *
5045  * @param[out]  value - Advertising data structure.
5046  * @param[out]  length - The length of Advertising data.
5047  *
5048  * @remark      None
5049 @code
5050 bluetooth_advertising_data_t *value = { {0} };
5051 int length;
5052 int ret = 0;
5053 ret = bluetooth_get_advertising_data(&value, &length);
5054 @endcode
5055  */
5056 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5057
5058 /**
5059  * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5060  *
5061  * @brief Set advertising data with value
5062  *
5063  * This function is used to set advertising data and Maximum size of advertising data
5064  *  is 28 byte (Except Flag)
5065  *
5066  * This function is a synchronous call.
5067  *
5068  * @return      BLUETOOTH_ERROR_NONE - Success \n
5069  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5070  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5071  *
5072  * @exception   None
5073  * @param[in]   value - Advertising data structure.
5074  *
5075  * @remark      None
5076  */
5077 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5078
5079 /**
5080  * @fn int bluetooth_check_privilege_advertising_parameter(void);
5081  *
5082  * @brief Check the privilege for advertising parameter setting
5083  *
5084  * This function is a synchronous call.
5085  *
5086  * @return      BLUETOOTH_ERROR_NONE - Success \n
5087  *              BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5088  *
5089  * @exception   None
5090  *
5091  * @remark      None
5092  */
5093 int bluetooth_check_privilege_advertising_parameter(void);
5094
5095 /**
5096  * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5097  * @brief Get the LE scan response data
5098  *
5099  * This function is used to get scan response data.
5100  * Before calling this API, the adapter should be enabled.
5101  *
5102  * This function is a synchronous call.
5103  *
5104  * @return      BLUETOOTH_ERROR_NONE - Success \n
5105  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5106  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5107  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5108  *
5109  * @param[out]  value - Scan response data structure.
5110  * @param[out]  length - The length of Scan response data.
5111  *
5112  * @remark      None
5113 @code
5114 bluetooth_scan_resp_data_t *value = { {0} };
5115 int length;
5116 int ret = 0;
5117 ret = bluetooth_get_scan_response_data(&value, &length);
5118 @endcode
5119  */
5120 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5121
5122 /**
5123  * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5124  *
5125  * @brief Set scan response data with value
5126  *
5127  * This function is used to set scan response data and Maximum size of scan response data is 31 byte
5128  *
5129  * This function is a synchronous call.
5130  *
5131  * @return      BLUETOOTH_ERROR_NONE - Success \n
5132  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5133  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5134  *
5135  * @exception   None
5136  * @param[in]   value - LE Scan response data structure.
5137  *
5138  * @remark      None
5139  */
5140 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
5141
5142 /**
5143  * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5144  *
5145  * @brief Set scan interval and window
5146  *
5147  * This function is used to set LE scan interval and window size
5148  *
5149  * This function is a synchronous call.
5150  *
5151  * @return      BLUETOOTH_ERROR_NONE - Success \n
5152  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5153  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5154  *
5155  * @exception   None
5156  * @param[in]   interval - Interval of LE scan (msec)
5157  * @param[in]   window - Window size of LE scan (msec)
5158  *
5159  * @remark      None
5160  */
5161 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
5162
5163 /**
5164  * @fn int bluetooth_is_advertising(void)
5165  * @brief Check for the advertising is in-progress or not.
5166  *
5167  * This API is used to check the current status of the advertising procedure.
5168  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5169  * this API.
5170  *
5171  * This function checks whether the advertising is started or not.
5172  *
5173  * This function is a synchronous call.
5174  *
5175  * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c  false = not in progress)
5176  *
5177  * @return      BLUETOOTH_ERROR_NONE - Success \n
5178  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5179  *
5180  * @remark      None
5181  * @see         bluetooth_set_advertising, bluetooth_set_custom_advertising
5182
5183 @code
5184 int ret;
5185 gboolean is_advertising = 0;
5186
5187 ret = bluetooth_is_advertising(&is_advertising);
5188 @endcode
5189  */
5190 int bluetooth_is_advertising(gboolean *is_advertising);
5191
5192 /**
5193  * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5194  * @brief Add LE device to white list
5195  *
5196  * This API is used to add LE device to white list
5197  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5198  * this API.
5199  *
5200  *
5201  * This function is a synchronous call.
5202  *
5203  * @param[in] address The address of remote device
5204  *
5205  * @return      BLUETOOTH_ERROR_NONE - Success \n
5206  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5207  *
5208  * @remark      None
5209  * @see         bluetooth_set_custom_advertising
5210  */
5211 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5212
5213 /**
5214  * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
5215  * @brief Remove LE device from white list
5216  *
5217  * This API is used to remove LE device from white list
5218  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5219  * this API.
5220  *
5221  *
5222  * This function is a synchronous call.
5223  *
5224  * @param[in] address The address of remote device
5225  *
5226  * @return      BLUETOOTH_ERROR_NONE - Success \n
5227  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5228  *
5229  * @remark      None
5230  * @see         bluetooth_set_custom_advertising
5231  */
5232 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
5233
5234 /**
5235  * @fn int bluetooth_clear_white_list(void)
5236  * @brief Clear white list
5237  *
5238  * This API is used to clear white list
5239  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
5240  * this API.
5241  *
5242  *
5243  * This function is a synchronous call.
5244  *
5245  * @param[in] address The address of remote device
5246  *
5247  * @return      BLUETOOTH_ERROR_NONE - Success \n
5248  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5249  *
5250  * @remark      None
5251  * @see         bluetooth_set_custom_advertising
5252  */
5253 int bluetooth_clear_white_list(void);
5254
5255 /**
5256  * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
5257  *          const bluetooth_le_conn_update_t *parameters)
5258  * @brief update connection paramter of LE connection.
5259  *
5260  * This function is a synchronous call.
5261  *
5262  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5263  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5264  *
5265  * @exception  None
5266  * @param[in]  address - remote device address value.
5267  * @param[in]  parameters - new connection parameters.
5268  *
5269  * @remark       None
5270  * @see     bluetooth_bond_device
5271  */
5272 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
5273             const bluetooth_le_conn_update_t *parameters);
5274
5275
5276 /**
5277  * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
5278  *
5279  * @brief Enable/Disable LE Privacy feature.
5280  *
5281  * This function is used to enable or disable LE Privacy feature.
5282  * Once Privacy feature is enabled, Adapter can use Random Address for more security.
5283  *
5284  * This function is a synchronous call.
5285  *
5286  * @return      BLUETOOTH_ERROR_NONE - Success \n
5287  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5288  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5289  *
5290  * @exception   None
5291  * @param[in]   enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
5292  *
5293  * @remark      None
5294  */
5295 int bluetooth_enable_le_privacy(gboolean enable_privacy);
5296
5297 int bluetooth_pbap_init(void);
5298 int bluetooth_pbap_deinit(void);
5299 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
5300 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
5301 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
5302                 bt_pbap_folder_t *folder);
5303 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
5304                 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
5305 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
5306                 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
5307 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
5308                 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
5309 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
5310                 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
5311
5312 /**
5313  * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5314  *
5315  * @brief Set manufacturer data with value
5316  *
5317  * This function is used to set manufacturer data.
5318  *
5319  * This function is a synchronous call.
5320  *
5321  * @return      BLUETOOTH_ERROR_NONE - Success \n
5322  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5323  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5324  *
5325  * @exception   None
5326  * @param[in]   value - Manufacturer data structure.
5327  *
5328  * @remark      None
5329  */
5330 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
5331 /**
5332  * @}
5333  */
5334
5335 #ifdef __cplusplus
5336 }
5337 #endif                          /* __cplusplus */
5338 #endif                          /* _BLUETOOTH_API_H_*/