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