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