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