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