Fix : Simultaneous GATT client requests are failed
[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 } bt_hid_header_type_t;
1237
1238 /**
1239  * HID Param type
1240  */
1241 typedef enum {
1242         PTYPE_DATA_RTYPE_INPUT,
1243         PTYPE_DATA_RTYPE_OUTPUT
1244 } bt_hid_param_type_t;
1245
1246 /**
1247  * Stucture to hid receive data
1248  */
1249 typedef struct {
1250         const char *address;
1251         bt_hid_header_type_t type;
1252                 /**< Header type containing */
1253         bt_hid_param_type_t param;
1254                 /**< Param type in header like INPUT Report or OutPut Report */
1255         int buffer_size;/**< the length of the receive buffer */
1256         char *buffer;
1257                 /**< the receive data buffer */
1258 } bluetooth_hid_received_data_t;
1259
1260 /**
1261 * Stucture to rfcomm connection
1262 */
1263
1264 typedef struct {
1265         int socket_fd; /**< the socket fd */
1266         int server_id; /* Server id */
1267         int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1268         bluetooth_device_address_t device_addr;
1269                                               /**< device address */
1270         char uuid[BLUETOOTH_UUID_STRING_MAX];
1271 } bluetooth_rfcomm_connection_t;
1272
1273 /**
1274  * Stucture to rfcomm disconnection
1275  */
1276 typedef struct {
1277         int socket_fd;
1278                 /**< the socket fd */
1279         int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1280         bluetooth_device_address_t device_addr;
1281                                               /**< device address */
1282         char uuid[BLUETOOTH_UUID_STRING_MAX];
1283 } bluetooth_rfcomm_disconnection_t;
1284
1285 typedef struct {
1286         int socket_fd;
1287                 /**< the socket fd */
1288         bluetooth_device_address_t device_addr;
1289                                               /**< device address */
1290 } bluetooth_rfcomm_connection_request_t;
1291
1292 typedef struct {
1293         int socket_fd;
1294                 /**< the socket fd */
1295         bluetooth_device_address_t device_addr;
1296                                               /**< device address */
1297 } bluetooth_hid_request_t;
1298
1299 /**
1300  * HDP QOS types
1301  */
1302 typedef enum {
1303         HDP_QOS_RELIABLE,
1304         HDP_QOS_STREAMING,
1305         HDP_QOS_ANY
1306 } bt_hdp_qos_type_t;
1307
1308 /**
1309  * HDP Role types
1310  */
1311 typedef enum {
1312         HDP_ROLE_SOURCE = 0x0,
1313         HDP_ROLE_SINK
1314 } bt_hdp_role_type_t;
1315
1316
1317 /**
1318  * Stucture to HDP connected
1319  */
1320 typedef struct {
1321         const char *app_handle; /**< the application handle */
1322         unsigned int channel_id;        /**< the channel id */
1323         bt_hdp_qos_type_t type; /**< the QOS type */
1324         bluetooth_device_address_t device_address; /**< the remote address */
1325 } bt_hdp_connected_t;
1326
1327 /**
1328  * Stucture to HDP disconnected
1329  */
1330 typedef struct {
1331         unsigned int channel_id; /**< the channel id */
1332         bluetooth_device_address_t device_address; /**< the remote address */
1333 } bt_hdp_disconnected_t;
1334
1335 /**
1336  * Stucture to HDP data indication
1337  */
1338 typedef struct {
1339         unsigned int channel_id;         /**< the channel id */
1340         const char *buffer;      /**< the RX data buffer */
1341         unsigned int size;       /**< the RX data size */
1342 } bt_hdp_data_ind_t;
1343
1344 /**
1345  * Stucture to OPP client transfer information
1346  */
1347 typedef struct {
1348         char *device_addr;
1349         char *filename;
1350         unsigned long size;
1351         int percentage;
1352 } bt_opc_transfer_info_t;
1353
1354 /* TODO: MAP client structures, see above */
1355 /**
1356  * Stucture to Map filter fields
1357  */
1358 typedef struct {
1359         char **fields;
1360         int size;
1361 } bt_map_list_filter_fields_info_t;
1362
1363 /* Obex Server transfer type */
1364 #define TRANSFER_PUT "PUT"
1365 #define TRANSFER_GET "GET"
1366 /**
1367  * Stucture to OPP/FTP Server authorize information
1368  */
1369 typedef struct {
1370         char *filename;
1371         int length;
1372         char *address;
1373         char *name;
1374 } bt_obex_server_authorize_into_t;
1375
1376 /**
1377  * Server type
1378  */
1379 typedef enum {
1380         OPP_SERVER = 0x0,
1381         FTP_SERVER
1382 } bt_obex_server_type_t;
1383
1384 /**
1385  * Stucture to OPP/FTP server transfer information
1386  */
1387 typedef struct {
1388         char *filename;
1389         char *device_name;
1390         char *file_path;
1391         char *type;
1392         int transfer_id;
1393         unsigned long file_size;
1394         int percentage;
1395         bt_obex_server_type_t server_type;
1396         char *address;
1397         unsigned char *contact_auth_info;
1398 } bt_obex_server_transfer_info_t;
1399
1400 /**
1401  * Stucture to OPP/FTP server connection/disconnection information
1402  */
1403 typedef struct {
1404         char *address;
1405         char *device_name;
1406         int transfer_id;
1407 } bt_obex_server_connection_info_t;
1408
1409
1410 /**
1411  * Stucture to OOB data
1412  */
1413
1414 typedef struct {
1415         unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1416         unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1417         unsigned int hash_len;
1418         unsigned int randomizer_len;
1419
1420         unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1421         unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1422         unsigned int hash256_len;
1423         unsigned int randomizer256_len;
1424 } bt_oob_data_t;
1425
1426 /**
1427  * Structure to GATT attribute handle data
1428  */
1429
1430 typedef struct {
1431         int count;
1432         char **handle;
1433 } bt_gatt_handle_info_t;
1434
1435 /**
1436  * Structure to GATT Remote service data
1437  */
1438
1439 typedef struct {
1440         char *uuid;
1441         char *handle;
1442         gboolean primary;
1443         bt_gatt_handle_info_t include_handles;
1444         bt_gatt_handle_info_t char_handle;
1445 } bt_gatt_service_property_t;
1446
1447 /**
1448  * Structure to GATT Remote characteristic data
1449  */
1450
1451 typedef struct {
1452         char *service_handle;
1453         bt_gatt_handle_info_t handle_info;
1454 } bt_gatt_discovered_char_t;
1455
1456 /**
1457  * Structure to format of GATT Characteristic Value
1458  */
1459
1460 typedef struct {
1461         unsigned char format;
1462         unsigned char exponent;
1463         unsigned short unit;
1464         unsigned char name_space;
1465         unsigned short description;
1466 } bt_gatt_char_format_t;
1467
1468 /**
1469  * Structure to GATT Characteristic property
1470  */
1471
1472 typedef struct {
1473         char *handle;
1474         char *uuid;
1475         char *name;
1476         char *description;
1477         bt_gatt_char_format_t format;
1478         unsigned char *val;
1479         unsigned int val_len;
1480         unsigned int permission;
1481         char *representation;
1482         bt_gatt_handle_info_t char_desc_handle;
1483 } bt_gatt_char_property_t;
1484
1485 /**
1486  * Structure to GATT Characteristic descriptor property
1487  */
1488
1489 typedef struct {
1490         char *handle;
1491         char *uuid;
1492         unsigned char *val;
1493         unsigned int val_len;
1494 } bt_gatt_char_descriptor_property_t;
1495
1496 /**
1497  * Structure to GATT Characteristic value
1498  */
1499
1500 typedef struct {
1501         char *char_handle;
1502         guint8 *char_value;
1503         guint32 val_len;
1504 } bt_gatt_char_value_t;
1505
1506 /**
1507  * Structure to GATT Read Request
1508  */
1509 typedef struct {
1510         char *att_handle;
1511         char *service_handle;
1512         char *address;
1513         guint16 offset;
1514         guint req_id;
1515 } bt_gatt_read_req_t;
1516
1517 /**
1518  * Structure to GATT Value change
1519  */
1520 typedef struct {
1521         char *att_handle;
1522         char *service_handle;
1523         char *address;
1524         guint req_id;
1525         gboolean response_needed;
1526         guint16 offset;
1527         guint8 *att_value;
1528         guint32 val_len;
1529 } bt_gatt_value_change_t;
1530
1531 typedef struct {
1532         bluetooth_device_address_t device_addr;
1533         char *svc_path;
1534         bluetooth_gatt_service_change_type_t change_type;
1535 } bt_gatt_service_change_t;
1536
1537 /**
1538  * Structure to GATT characteristc Notification change
1539  */
1540 typedef struct {
1541         char *att_handle;
1542         char *service_handle;
1543         gboolean att_notify;
1544 } bt_gatt_char_notify_change_t;
1545
1546 /**
1547  * Structure to Indication confirmation
1548  */
1549 typedef struct {
1550         char *att_handle;
1551         char *service_handle;
1552         char *address;
1553         gboolean complete;
1554 } bt_gatt_indicate_confirm_t;
1555
1556 /**
1557  * Structure for GATT response data
1558  */
1559 typedef struct {
1560         guint8 *value;
1561         guint32 len;
1562         gpointer user_data;
1563 } bt_gatt_resp_data_t;
1564
1565 /**
1566  * Structure to RSSI Signal Strength Alert
1567  */
1568
1569 typedef struct {
1570         char *address;
1571         int link_type;
1572         int alert_type;
1573         int rssi_dbm;
1574 } bt_rssi_alert_t;
1575
1576 /**
1577  * Structure to RSSI Signal Strength
1578  */
1579
1580 typedef struct {
1581         char *address;
1582         int link_type;
1583         int rssi_dbm;
1584 } bt_raw_rssi_t;
1585
1586 /**
1587  * Structure for RSSI Enabled or Disabled
1588  */
1589
1590 typedef struct {
1591         char *address;
1592         int link_type;
1593         gboolean rssi_enabled;
1594 } bt_rssi_enabled_t;
1595
1596 /**
1597  * Structure for RSSI Threshold
1598  */
1599
1600 typedef struct {
1601         int low_threshold;
1602         int in_range_threshold;
1603         int high_threshold;
1604 } bt_rssi_threshold_t;
1605
1606
1607 /**
1608  * Structure for Suppoted Profiles and Trusted Profiles
1609  */
1610 typedef struct {
1611         char *address;
1612         int profile;
1613         gboolean supported;
1614         gboolean trusted;
1615 } bt_supported_profile_trusted_t;
1616
1617 /**
1618  * Structure for PBAP Folder Parameters
1619  */
1620 typedef struct {
1621         unsigned char addressbook;
1622         unsigned char folder_type;
1623 } bt_pbap_folder_t;
1624
1625 /**
1626  * Structure for PBAP Pull application Parameters
1627  */
1628 typedef struct {
1629         unsigned char format;
1630         unsigned char order;
1631         unsigned short offset;
1632         unsigned short maxlist;
1633         long long unsigned fields;
1634 } bt_pbap_pull_parameters_t;
1635
1636 /**
1637  * Structure for PBAP List application Parameters
1638  */
1639 typedef struct {
1640         unsigned char order;
1641         unsigned short offset;
1642         unsigned short maxlist;
1643 } bt_pbap_list_parameters_t;
1644
1645 /**
1646  * Structure for PBAP Pull vCard application Parameters
1647  */
1648 typedef struct {
1649         unsigned char format;
1650         long long unsigned fields;
1651         int index;
1652 } bt_pbap_pull_vcard_parameters_t;
1653
1654 /**
1655  * Structure for PBAP Search application Parameters
1656  */
1657 typedef struct {
1658         unsigned char order;
1659         unsigned short offset;
1660         unsigned short maxlist;
1661         unsigned char search_attribute;
1662         char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1663 } bt_pbap_search_parameters_t;
1664
1665 /**
1666  * Structure for PBAP Connection Status
1667  */
1668 typedef struct {
1669         bluetooth_device_address_t btaddr;
1670         int connected;
1671 } bt_pbap_connected_t;
1672
1673 /**
1674  * Structure for PBAP Phonebook Size
1675  */
1676 typedef struct {
1677         bluetooth_device_address_t btaddr;
1678         int size;
1679 } bt_pbap_phonebook_size_t;
1680
1681 /**
1682  * Structure for PBAP Phonebook Pull
1683  */
1684 typedef struct {
1685         bluetooth_device_address_t btaddr;
1686         char *vcf_file;
1687         int success;
1688 } bt_pbap_phonebook_pull_t;
1689
1690 /**
1691  * Structure for PBAP vCard List
1692  */
1693 typedef struct {
1694         bluetooth_device_address_t btaddr;
1695         char **vcards;
1696         int length;
1697         int success;
1698 } bt_pbap_vcard_list_t;
1699
1700 /**
1701  * Structure for PBAP vCard Pull
1702  */
1703 typedef struct {
1704         bluetooth_device_address_t btaddr;
1705         char *vcf_file;
1706         int success;
1707 } bt_pbap_vcard_pull_t;
1708
1709 /**
1710  * Structure for PBAP Phonebook search List
1711  */
1712 typedef struct {
1713         bluetooth_device_address_t btaddr;
1714         char **vcards;
1715         int length;
1716         int success;
1717 } bt_pbap_phonebook_search_list_t;
1718
1719 /**
1720  * Stucture to HF Call status information
1721  */
1722
1723 typedef struct {
1724         char *number; /*Phone Number */
1725         int direction; /*Direction :Incoming(1), Outgoing(0)*/
1726         int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1727         int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1728         int idx; /*Call index/ID */
1729 } bt_hf_call_status_info_t;
1730
1731 typedef struct {
1732         GList *list;
1733         int count;
1734 } bt_hf_call_list_s;
1735
1736 /**
1737  * Profile types
1738  */
1739 typedef enum {
1740         TRUSTED_PROFILE_PBAP = 1,
1741         TRUSTED_PROFILE_MAP,
1742         TRUSTED_PROFILE_SAP,
1743         TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1744 } bluetooth_trusted_profile_t;
1745
1746 /**
1747  * Restricted Profile types
1748  */
1749 typedef enum {
1750         RESTRICTED_PROFILE_HFP_HS = 1,
1751         RESTRICTED_PROFILE_A2DP,
1752 } bluetooth_restricted_profile_t;
1753
1754 /**
1755  * Structure for LE data length change params
1756  */
1757 typedef struct {
1758         bluetooth_device_address_t device_address;
1759         guint16 max_tx_octets;
1760         guint16 max_tx_time;
1761         guint16 max_rx_octets;
1762         guint16 max_rx_time;
1763 } bt_le_data_length_params_t;
1764
1765 /**
1766  * Structure for proximity property change params
1767  */
1768 typedef struct {
1769         bluetooth_device_address_t device_address;
1770         int role;
1771         int service_type;
1772         int alert_lvl;
1773 } bt_pxp_property_changed_params_t;
1774
1775  /**
1776  * @brief DPM BT allowance state
1777  * @see
1778  */
1779 typedef enum {
1780         BLUETOOTH_DPM_ERROR      = -1,   /**< bluetooth allowance error */
1781         BLUETOOTH_DPM_BT_ALLOWED,                /**< bluetooth allowance allowed */
1782         BLUETOOTH_DPM_HANDSFREE_ONLY,  /**< bluetooth allowance handsfree only */
1783         BLUETOOTH_DPM_BT_RESTRICTED,  /**< bluetooth allowance restricted */
1784 } bt_dpm_allow_t;
1785
1786  /**
1787  * @brief DPM API result
1788  * @see
1789  */
1790 typedef enum {
1791         BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5,  /**< DPM API result service not enabled. */
1792         BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4,                        /**< DPM API result access denied. */
1793         BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3,                        /**< DPM API result invalid parameter. */
1794         BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2,                        /**< DPM API result not supported. */
1795         BLUETOOTH_DPM_RESULT_FAIL        = -1,                          /**< DPM API result fail. */
1796         BLUETOOTH_DPM_RESULT_SUCCESS     = 0,                           /**< DPM API result success. */
1797 } bt_dpm_result_t;
1798
1799 /**
1800  * @brief DPM Policy status
1801  * @see
1802  */
1803 typedef enum {
1804         BLUETOOTH_DPM_STATUS_ERROR      = -1,
1805
1806         BLUETOOTH_DPM_ALLOWED           = 0,    /**< DPM Policy status allowed. */
1807         BLUETOOTH_DPM_RESTRICTED                = 1,    /**< DPM Policy status restricted. */
1808
1809         BLUETOOTH_DPM_ENABLE                    = 1,    /**< DPM Policy status enabled. */
1810         BLUETOOTH_DPM_DISABLE   = 0,    /**< DPM Policy status disabled. */
1811
1812         BLUETOOTH_DPM_FALSE                     = 0,    /**< DPM Policy status false. */
1813         BLUETOOTH_DPM_TRUE                      = 1,    /**< DPM Policy status true. */
1814 } bt_dpm_status_t;
1815
1816 typedef enum {
1817         /* policy-group : BLUETOOTH */
1818         BLUETOOTH_DPM_POLICY_ALLOW,
1819         BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
1820         BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
1821         BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
1822         BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
1823         BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
1824         BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
1825         BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
1826         BLUETOOTH_DPM_POLICY_PAIRING_STATE,
1827         BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
1828         BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
1829         BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
1830         BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
1831         BLUETOOTH_DPM_POLICY_END,
1832 } bt_dpm_policy_cmd_t;
1833
1834
1835 struct bt_dpm_policy {
1836         union {
1837                 int value;
1838                 GSList *list;
1839         };
1840 };
1841 typedef struct bt_dpm_policy bt_dpm_policy_t;
1842
1843 typedef enum {
1844         BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
1845         BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
1846         BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
1847         BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
1848         BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
1849         BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
1850         BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
1851         BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
1852         BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
1853         BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
1854         BLUETOOTH_DPM_PROFILE_NONE,
1855 } bt_dpm_profile_t;
1856
1857 struct bt_dpm_profile_val {
1858                 int value; /* tells whether the profile is enabled or disabled */
1859 };
1860 typedef struct dpm_profile_val dpm_profile_state_t;
1861
1862 /**
1863  * Structure to DPM device list
1864  */
1865 typedef struct {
1866         int count;
1867         bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
1868 } bt_dpm_device_list_t;
1869
1870 /**
1871  * Structure to DPM uuid list
1872  */
1873 typedef struct {
1874         int count;
1875         char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
1876 } bt_dpm_uuids_list_t;
1877
1878 /**
1879  * Structure for IPSP Interface Info
1880  */
1881 typedef struct {
1882         bluetooth_device_address_t btaddr;
1883         char if_name[16];
1884 } bt_ipsp_connection_info_t;
1885
1886 typedef struct {
1887         char* session_path;
1888         char* remote_address;
1889 } bt_map_client_session_info_s;
1890
1891 typedef char* bt_map_client_message_object_t;
1892
1893 typedef struct {
1894         int16_t offset;
1895         int16_t max_count;
1896 } bt_map_client_list_folders_filter_t;
1897
1898 typedef struct {
1899         int16_t offset;
1900         int16_t max_count;
1901         int8_t subject_length;
1902         char *fields;
1903         char *types;
1904         char *period_begin;
1905         char *period_end;
1906         int is_read;
1907         char *recipient;
1908         char *sender;
1909         int is_priority;
1910 } bt_map_client_list_messages_filter_t;
1911
1912 typedef struct {
1913         bt_map_client_message_object_t message_object;
1914         char *folder;
1915         char *subject;
1916         char *timestamp;
1917         char *sender;
1918         char *sender_address;
1919         char *reply_to;
1920         char *recipient;
1921         char *recipient_address;
1922         char *type;
1923         int64_t size;
1924         int is_text;
1925         char *status;
1926         int64_t attachment_size;
1927         int is_priority;
1928         int is_read;
1929         int is_sent;
1930         int is_protected;
1931 } bt_map_client_message_item_t;
1932
1933 typedef struct {
1934         int is_transparent;
1935         int is_retry;
1936         char *charset;
1937 } bt_map_client_push_message_args_t;
1938
1939 typedef struct {
1940         char *folder;
1941         char *subject;
1942         char *timestamp;
1943         char *sender;
1944         char *sender_address;
1945         char *reply_to;
1946         char *recipient;
1947         char *recipient_address;
1948         char *type;
1949         int64_t size;
1950         char *status;
1951         int is_priority;
1952         int is_read;
1953         int is_deleted;
1954         int is_sent;
1955         int is_protected;
1956 } bt_map_client_message_t;
1957
1958 typedef struct {
1959         char **names; // holding %size null-terminated folder names
1960         int64_t size;
1961 } bt_map_client_folders_s;
1962
1963 typedef struct {
1964         bt_map_client_message_item_t *message_items;
1965         int64_t size;
1966 } bt_map_client_message_items_s;
1967
1968 typedef struct {
1969         const char* target_file;
1970         void* user_data;
1971 } bt_get_message_callback_data;
1972
1973 /**
1974  * Callback pointer type
1975  */
1976 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1977
1978 /**
1979  * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1980  * @brief Set the callback function pointer for bluetooth event
1981  *
1982  *
1983  * This API will register the callback function, when any response and event are received from
1984  * bluetooth framework. @n
1985  * this registered callback function will be get called with appropriate event and data structures.
1986  * This function is a synchronous call. An application developer can call
1987  * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1988  * type. This registered function will receive events of bluetooth_event_type_t type along with
1989  * data any.
1990  *
1991  *
1992  * @param[in]   callback_ptr    A pointer to the callback function
1993  * @param[in]   user_data    A pointer to user data
1994  * @return      BLUETOOTH_ERROR_NONE - Success
1995  * @remark      None
1996  * @see         None
1997 @code
1998 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1999 {
2000         GMainLoop *main_loop = (GMainLoop*) user_data;
2001
2002         switch(event)
2003         {
2004                 // Code for each event
2005                 default:
2006                         g_main_loop_quit(main_loop);
2007                         break;
2008         }
2009 }
2010
2011 int main()
2012 {
2013         GMainLoop *main_loop = NULL;
2014         int ret = 0;
2015         g_type_init();
2016         main_loop = g_main_loop_new(NULL, FALSE);
2017         ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2018         if (ret >= BLUETOOTH_ERROR_NONE)
2019         {
2020                 // bluetooth_register_callback returned Success
2021         }
2022         else
2023         {
2024                 // bluetooth_register_callback returned failiure
2025         }
2026         g_main_loop_run(main_loop);
2027 }
2028 @endcode
2029  */
2030 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2031
2032 /**
2033  * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2034  * @brief Set the callback function pointer for bluetooth le event
2035  *
2036  *
2037  * This API will register the callback function, when any response and event are received from
2038  * bluetooth framework. @n
2039  * this registered callback function will be get called with appropriate event and data structures.
2040  * This function is a synchronous call. An application developer can call
2041  * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2042  * type. This registered function will receive events of bluetooth_event_type_t type along with
2043  * data any.
2044  *
2045  *
2046  * @param[in]   callback_ptr    A pointer to the callback function
2047  * @param[in]   user_data    A pointer to user data
2048  * @return      BLUETOOTH_ERROR_NONE - Success
2049  * @remark      None
2050  * @see         None
2051  * */
2052 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2053
2054 /**
2055  * @fn int bluetooth_le_unregister_callback(void)
2056  * @brief Set the callback function pointer for bluetooth le event
2057  *
2058  *
2059  * This API will register the callback function, when any response and event are received from
2060  * bluetooth framework. @n
2061  * this registered callback function will be get called with appropriate event and data structures.
2062  * This function is a synchronous call. An application developer can call
2063  * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2064  * type. This registered function will receive events of bluetooth_event_type_t type along with
2065  * data any.
2066  *
2067  *
2068  * @param[in]   none
2069  * @return      BLUETOOTH_ERROR_NONE - Success
2070  * @remark      None
2071  * @see         None
2072  * */
2073 int bluetooth_le_unregister_callback(void);
2074
2075 /**
2076  * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2077  * @brief Set the callback function pointer for bluetooth event
2078  *
2079  *
2080  * This API will register the callback function, when any response and event are received from
2081  * bluetooth framework. @n
2082  * this registered callback function will be get called with appropriate event and data structures.
2083  * This function is a synchronous call. An application developer can call
2084  * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2085  * type. This registered function will receive events of bluetooth_event_type_t type along with
2086  * data any.
2087  *
2088  *
2089  * @param[in]   none
2090  * @return      BLUETOOTH_ERROR_NONE - Success
2091  * @remark      None
2092  * @see         None
2093 @code
2094 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2095 {
2096         GMainLoop *main_loop = (GMainLoop*) user_data;
2097
2098         switch(event)
2099         {
2100                 // Code for each event
2101                 default:
2102                         g_main_loop_quit(main_loop);
2103                         break;
2104         }
2105 }
2106
2107 int main()
2108 {
2109         GMainLoop *main_loop = NULL;
2110         int ret = 0;
2111         g_type_init();
2112         main_loop = g_main_loop_new(NULL, FALSE);
2113         ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2114         if (ret >= BLUETOOTH_ERROR_NONE)
2115         {
2116                 // bluetooth_register_callback returned Success
2117         }
2118         else
2119         {
2120                 // bluetooth_register_callback returned failiure
2121         }
2122         ret = bluetooth_deregister_callback(void);
2123         g_main_loop_run(main_loop);
2124 }
2125 @endcode
2126  */
2127 int bluetooth_unregister_callback(void);
2128
2129 /**
2130  * @fn int bluetooth_enable_adapter(void)
2131  * @brief Enable the Bluetooth H/W
2132  *
2133  *
2134  * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2135  * send request to bluetooth chip for activation.
2136  * This function is typically called at startup or when Bluetooth services are required.  This
2137  * function must be called before calling any other API of Bluetooth operations.
2138  *
2139  * Before performing any operations like Device discover, service search etc.., the adapter must be
2140  * enabled.
2141  *
2142  * This function is a asynchronous call.
2143  * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2144  * through registered callback function with appropriate result code
2145  *                      BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2146  *                      BLUETOOTH_ERROR_NONE - Success \n
2147  *
2148  * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2149  * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2150  *
2151  * @return      BLUETOOTH_ERROR_NONE - Success\n
2152  *              BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2153  *              BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2154  *              BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2155  * @exception   BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2156  * @remark      None
2157  * @see         bluetooth_check_adapter, bluetooth_disable_adapter
2158 @code
2159 void bt_event_callback(int event, bluetooth_event_param_t *param)
2160 {
2161         switch(event)
2162         {
2163                 case BLUETOOTH_EVENT_ENABLED:
2164                         if (param->result == BLUETOOTH_ERROR_NONE)
2165                         {
2166                                 // Successfully Enabled
2167                         }
2168                         else
2169                         {
2170                                 // Failed
2171                         }
2172                         break;
2173         }
2174 }
2175
2176 ...
2177
2178 int ret = 0;
2179 ret = bluetooth_enable_adapter();
2180
2181 @endcode
2182  */
2183 int bluetooth_enable_adapter(void);
2184
2185 /**
2186  * @fn int bluetooth_disable_adapter(void)
2187  * @brief Disable the Bluetooth H/W
2188  *
2189  *
2190  * This function disables Bluetooth protocol stack and hardware. This function is called when
2191  * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2192  *
2193  * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2194  * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2195  * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2196  * error code.
2197  * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2198  * internal error.
2199  *
2200  * This function is a asynchronous call.
2201  * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2202  * through registered callback function.
2203  *
2204  *
2205  * @return      BLUETOOTH_ERROR_NONE - Success\n
2206  *              BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2207  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2208  * @exception   BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2209  * @remark      None
2210  * @see         bluetooth_check_adapter, bluetooth_enable_adapter
2211 @code
2212 void bt_event_callback(int event, bluetooth_event_param_t *param)
2213 {
2214         switch(event)
2215         {
2216                 case BLUETOOTH_EVENT_DISABLED:
2217                         if (param->result == BLUETOOTH_ERROR_NONE)
2218                         {
2219                                 // Successfully disabled
2220                         }
2221                         else
2222                         {
2223                                 // Failed
2224                         }
2225                         break;
2226         }
2227 }
2228
2229 ...
2230
2231 int ret = 0;
2232 ret = bluetooth_disable_adapter();
2233 @endcode
2234  */
2235 int bluetooth_disable_adapter(void);
2236 int bluetooth_recover_adapter(void);
2237 int bluetooth_check_adapter_le(void);
2238 int bluetooth_enable_adapter_le(void);
2239
2240 int bluetooth_disable_adapter_le(void);
2241
2242 /**
2243  * @fn int bluetooth_reset_adapter(void)
2244  * @brief Reset the Bluetooth H/W and values
2245  *
2246  *
2247  * This function resets Bluetooth protocol stack and hardware. This function is called when
2248  * an user want to initialize Bluetooth environment.
2249  *
2250  * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2251  * internal error.
2252  *
2253  * This function is a synchronous call.
2254  *
2255  * @return      BLUETOOTH_ERROR_NONE - Success\n
2256  * @exception   BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2257  * @remark      None
2258  * @see         bluetooth_check_adapter, bluetooth_enable_adapter
2259 @code
2260 ...
2261
2262 int ret = 0;
2263 ret = bluetooth_reset_adapter();
2264 @endcode
2265  */
2266 int bluetooth_reset_adapter(void);
2267
2268 /**
2269  * @fn int bluetooth_is_supported(void)
2270  * @brief Check if the bluetooth is supported or not by the current target
2271  *
2272  * This API checks whether the bluetooth is supported or not.
2273  * This API only run by root permission.
2274  *
2275  * This function is a synchronous call.
2276  *
2277  * @return      0 - if bluetooth is not supported\n
2278  *              1 - if bluetooth is supported\n
2279  *              BLUETOOTH_ERROR_INTERNAL - Error in API internal
2280  * @remark      None
2281 @code
2282
2283 int ret = 0;
2284 ret = bluetooth_is_supported();
2285 @endcode
2286  */
2287 int bluetooth_is_supported(void);
2288
2289
2290 /**
2291  * @fn int bluetooth_check_adapter(void)
2292  * @brief Check the current status of the Bluetooth adapter
2293  *
2294  *
2295  * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2296  * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2297  * bluetooth adapter.
2298  * This API get the adapter internal data structure and check current adapter status.
2299  *
2300  * This function is a synchronous call.
2301  *
2302  *
2303  * @return      BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2304  *              BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2305  * @remark      None
2306  * @see         bluetooth_enable_adapter, bluetooth_disable_adapter
2307 @code
2308
2309 int ret = 0;
2310 ret = bluetooth_check_adapter();
2311 @endcode
2312  */
2313 int bluetooth_check_adapter(void);
2314
2315 /**
2316  * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2317  * @brief Get the local adapter bluetooth address
2318  *
2319  *
2320  * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2321  * the adapter should be enabled.
2322  * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2323  * contain Bluetooth address.
2324  * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2325  * friendly name for each device.
2326  * There is no event callback for this API.
2327  *
2328  * This function is a synchronous call.
2329  *
2330  *
2331  * @return      BLUETOOTH_ERROR_NONE - Succeess \n
2332  *              BLUETOOTH_ERROR_INVALID_PARAM -  Invalid parameter (NULL buffer) \n
2333  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED -  Adapter is disabled \n
2334  * @param[out]  local_address   a device address of local bluetooth adapter
2335  * @remark      None
2336  * @see         None
2337 @code
2338
2339 bluetooth_device_address_t local_address={0,};
2340 int ret = 0;
2341
2342 ret = bluetooth_get_local_address(&local_address);
2343 @endcode
2344  */
2345 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2346
2347 /**
2348  * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2349  * @brief Get the hci version
2350  *
2351  *
2352  * This function is used to get the bluetooth hci version
2353  * Before calling this API make sure that the adapter is enabled.
2354  *
2355  * This function is a synchronous call.
2356  *
2357  *
2358  * @return      BLUETOOTH_ERROR_NONE - Success \n
2359  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2360  * @param[out]  timeout   remain visibility timeout value
2361  * @remark      None
2362  @code
2363 bluetooth_version_t *version;
2364  int ret = 0;
2365  ret = bluetooth_get_local_version (&version);
2366  @endcode
2367  */
2368 int bluetooth_get_local_version(bluetooth_version_t *version);
2369
2370 /**
2371  * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2372  * @brief Get the local device name
2373  *
2374  *
2375  * This function is used, get the local device name. Since its difficult to remember the Adapter
2376  * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2377  * friendly name is retrived by the remote device and displaying.
2378  * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2379  *
2380  * This function is a synchronous call.
2381  *
2382  *
2383  * @return      BLUETOOTH_ERROR_NONE - Success \n
2384  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2385  * @param[out]  local_name      a local device name
2386  * @remark      None
2387  * @see         None
2388 @code
2389 bluetooth_device_name_t local_name={0,}
2390 int ret = 0;
2391 ret = bluetooth_get_local_name (&local_name);
2392 @endcode
2393  */
2394 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2395
2396 /**
2397  * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2398  * @brief Set the local device name
2399  *
2400  *
2401  * This function is used to set the local device name. This is a human friendly name whose
2402  * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2403  *
2404  * This function is a synchronous call.
2405  *
2406  * @param[in]   local_name   bluetooth device name to set local device
2407  *
2408  * @return      BLUETOOTH_ERROR_NONE - Success \n
2409  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2410  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2411  *              BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2412  *              BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2413  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2414  *
2415  * @remark      None
2416
2417 @code
2418 bluetooth_device_name_t local_name={0,}
2419 int ret = 0;
2420 ret = bluetooth_set_local_name (&local_name);
2421 @endcode
2422  */
2423 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2424
2425
2426 /**
2427  * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2428  * @brief Check if the uuid is used or not
2429  *
2430  * This function is used to check if the uuid is used or not.
2431  *
2432  * This function is a synchronous call.
2433  *
2434  * @param[in]   service_uuid   service uuid (UUID 128 bit as string)
2435  * @param[out] used  if the uuid is used or not
2436  *
2437  * @return      BLUETOOTH_ERROR_NONE - Success \n
2438  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2439  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2440  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2441  *
2442  * @remark      None
2443  *
2444 @code
2445 gboolean used = FALSE;
2446 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2447 ret = bluetooth_is_service_used(uuid, &used);
2448 @endcode
2449  */
2450 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2451
2452 /**
2453  * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2454  * @brief Check if the device is connected to the specific service
2455  *
2456  * This function is used to check if if the device is connected to the specific service.
2457  *
2458  * This function is a synchronous call.
2459  *
2460  * @param[in]   local_address   a device address of remote bluetooth device
2461  * @param[in]   type the service type
2462  * @param[out] is_connected  if the device is connected or not
2463  *
2464  * @return      BLUETOOTH_ERROR_NONE - Success \n
2465  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2466  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2467  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2468  *
2469  * @remark      None
2470  *
2471 @code
2472 gboolean is_connected = FALSE;
2473 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2474 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2475 @endcode
2476  */
2477 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2478                                 bluetooth_service_type_t type,
2479                                 gboolean *is_connected);
2480
2481 /**
2482  * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2483  * @brief Gets device's connected link type
2484  *
2485  * This function is used to get device's connected link type
2486  *
2487  * This function is a synchronous call.
2488  *
2489  * @param[in]   device_address  a device address of remote bluetooth device
2490  * @param[out]  connected_link  a device's connected link type
2491  *
2492  * @return      BLUETOOTH_ERROR_NONE - Success \n
2493  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2494  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2495  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2496  *
2497  * @remark      None
2498  *
2499 @code
2500 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2501 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2502 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2503 @endcode
2504  */
2505 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2506                                 bluetooth_connected_link_t *connected_link);
2507
2508 /**
2509  * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2510  * @brief Sets a profile trusted for a device
2511  *
2512  * This function is used to Set a profile as trusted for a device
2513  *
2514  * This function is a synchronous call.
2515  *
2516  * @param[in]   device_address  a device address of remote bluetooth device
2517  * @param[in]   profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2518  * @param[in]   trust   to set as trusted or untrusted[1-trusted 0-untrusted]
2519  *
2520  * @return      BLUETOOTH_ERROR_NONE - Success \n
2521  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2522  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2523  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2524  *
2525  * @remark      None
2526  */
2527 int bluetooth_set_profile_trusted(
2528                 const bluetooth_device_address_t *device_address,
2529                 int profile, int trust);
2530
2531 /**
2532  * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2533  * @brief Gets a profile is trusted for a device
2534  *
2535  * This function is used to Get a profile is trusted or not for a device
2536  *
2537  * This function is a synchronous call.
2538  *
2539  * @param[in]   device_address  a device address of remote bluetooth device
2540  * @param[in]   profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2541  * @param[out]  trust   profile is set as trusted or untrusted[1-trusted 0-untrusted]
2542  *
2543  * @return      BLUETOOTH_ERROR_NONE - Success \n
2544  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2545  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2546  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2547  *
2548  * @remark      None
2549  */
2550 int bluetooth_get_profile_trusted(
2551                 const bluetooth_device_address_t *device_address,
2552                 int profile, int *trust);
2553
2554 /**
2555  * @fn int bluetooth_set_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int restricted)
2556  * @brief Sets a profile restricted connection for a device
2557  *
2558  * This function is used to Set a profile as restricted for a device
2559  *
2560  * This function is a synchronous call.
2561  *
2562  * @param[in]   device_address  a device address of remote bluetooth device
2563  * @param[in]   profile profile which is to be set as restricted[1-HFP_HS, 2-A2DP]
2564  * @param[in]   restricted      to set as restricted or not[1-restricted 0-permitted]
2565  *
2566  * @return      BLUETOOTH_ERROR_NONE - Success \n
2567  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2568  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2569  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2570  *
2571  * @remark      None
2572  */
2573 int bluetooth_set_profile_restricted(
2574                 const bluetooth_device_address_t *device_address,
2575                 int profile, int restricted);
2576
2577 /**
2578  * @fn int bluetooth_get_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int *restricted)
2579  * @brief Gets a restricted connection state
2580  *
2581  * This function is used to Get a profile is restricted or not for a device
2582  *
2583  * This function is a synchronous call.
2584  *
2585  * @param[in]   device_address  a device address of remote bluetooth device
2586  * @param[in]   profile profile whose restricted status is needed[1-HFP_HS, 2-A2DP]
2587  * @param[out]  restricted      profile is set as restricted or not[1-restricted 0-permitted]
2588  *
2589  * @return      BLUETOOTH_ERROR_NONE - Success \n
2590  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2591  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2592  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2593  *
2594  * @remark      None
2595  */
2596 int bluetooth_get_profile_restricted(
2597                 const bluetooth_device_address_t *device_address,
2598                 int profile, int *restricted);
2599
2600 /**
2601  * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2602  * @brief Get the visibility mode
2603  *
2604  *
2605  * This function is used to get the discoverable mode (Visibility option). Depending upon the
2606  * visibity mode, the property of the device is determined whether it can be discoverable, non
2607  * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2608  *
2609  * This function is a synchronous call.
2610  *
2611  *
2612  * @return      BLUETOOTH_ERROR_NONE - Success \n
2613  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2614  *              BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2615  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2616  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2617  * @param[out]  discoverable_mode   current bluetooth discoverable mode
2618  * @remark      None
2619  * @see         bluetooth_set_discoverable_mode
2620  @code
2621  bluetooth_discoverable_mode_t discoverable_mode_ptr;
2622  int ret = 0;
2623  ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2624  @endcode
2625  */
2626 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2627
2628 /**
2629  * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2630  *                                              int timeout)
2631  * @brief Set the visibility mode
2632  *
2633  *
2634  * This function is used to set the discoverable mode (Visibility option).
2635  *
2636  * Many times user may want to keep his device discoverable so that when peer device is performing
2637  * device search, he/she can find user's device. Application programmer can keep the mode as
2638  * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2639  * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2640  * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2641  * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2642  *
2643  * This function is a synchronous call.
2644  *
2645  * @return      BLUETOOTH_ERROR_NONE - Success \n
2646  *              BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2647  *
2648  * @param[in]  discoverable_mode   the bluetooth discoverable mode to set
2649  * @param[in]  timeout   discoverable time in only limited discoverable mode (second), default: 0
2650  * @remark      None
2651  * @see         bluetooth_get_discoverable_mode
2652
2653 @code
2654
2655 bluetooth_discoverable_mode_t mode;
2656 int ret = 0;
2657 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2658 ret = bluetooth_set_discoverable_mode (mode, 180);
2659
2660 @endcode
2661  */
2662 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2663                                             int timeout);
2664
2665
2666 /**
2667  * @fn int bluetooth_get_timeout_value(int *timeout)
2668  * @brief Get the visibility timeout value
2669  *
2670  *
2671  * This function is used to get the visibility timeout
2672  * Before calling this API make sure that the adapter is enabled.
2673  *
2674  * This function is a synchronous call.
2675  *
2676  *
2677  * @return      BLUETOOTH_ERROR_NONE - Success \n
2678  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2679  *              BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2680  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2681  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2682  * @param[out]  timeout   remain visibility timeout value
2683  * @remark      None
2684  * @see         bluetooth_set_discoverable_mode
2685  @code
2686  int timeout;
2687  int ret = 0;
2688  ret = bluetooth_get_timeout_value (&timeout);
2689  @endcode
2690  */
2691 int bluetooth_get_timeout_value(int *timeout);
2692
2693
2694 /**
2695  * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2696  *                                      unsigned int  classOfDeviceMask)
2697  * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2698  *
2699  * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2700  * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2701  * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2702  * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2703  * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2704  * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2705  * You will receive device address, device name, device class, rssi (received signal strength indicator).
2706  * please see bluetooth_device_info_t for more details.
2707  *
2708  *
2709  * This API provides searching options like max responses, discovery duration in seconds and class
2710  * of device mask to filter device search. some times there may be too many bluetooth devices in
2711  * vicinity of your device.in such scenario, application can request to reduce number of responces
2712  * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2713  * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2714  * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2715  * application defined time. please note that discovery_duration should be mentioned in seconds.
2716  * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2717  * duration.
2718  *
2719  * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2720  * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2721  * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2722  *
2723  * This function is a asynchronous call.
2724  * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2725  * through registered callback function.
2726  *
2727  * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2728  * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2729  *
2730  * The completion or cancellation of the discovery is indicated by an
2731  * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2732  *
2733  * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2734  *
2735  *
2736  * @return      BLUETOOTH_ERROR_NONE - Success \n
2737  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2738  *              BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2739  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2740                                                 agent is not running \n
2741  *
2742  * @param[in] max_response              define the maximum response of the number of founded devices
2743                                         (0 means unlimited)
2744  * @param[in] discovery_duration        define bluetooth discovery duration (0 means 180s )
2745  * @param[in] classOfDeviceMask         define classes of the device mask which user wants
2746                                         (refer to class of device)
2747  * @remark      None
2748  * @see         bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2749
2750 @code
2751 void bt_event_callback(int event, bluetooth_event_param_t *param)
2752 {
2753         switch(event)
2754         {
2755                 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2756                 {
2757                         bluetooth_device_info_t *device_info = NULL;
2758                         printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2759                                         param->result);
2760                         device_info  = (bluetooth_device_info_t *)param->param_data;
2761                         memcpy(&searched_device, &device_info->device_address,
2762                                                 sizeof(bluetooth_device_address_t));
2763                         printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2764                                 device_info->device_address.addr[0],
2765                                 device_info->device_address.addr[1],
2766                                 device_info->device_address.addr[2],
2767                                 device_info->device_address.addr[3],
2768                                 device_info->device_address.addr[4],
2769                                 device_info->device_address.addr[5]);
2770                         break;
2771                 }
2772                 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2773                 {
2774                         bluetooth_device_info_t *device_info = NULL;
2775                         printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2776                                                                                 param->result);
2777                         device_info  = (bluetooth_device_info_t *)param->param_data;
2778                         memcpy(&searched_device, &device_info->device_address,
2779                                                                 sizeof(bluetooth_device_address_t));
2780                         printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2781                                                         device_info->device_name.name,
2782                                                         device_info->device_address.addr[0],
2783                                                         device_info->device_address.addr[1],
2784                                                         device_info->device_address.addr[2],
2785                                                         device_info->device_address.addr[3],
2786                                                         device_info->device_address.addr[4],
2787                                                         device_info->device_address.addr[5]);
2788                         break;
2789                 }
2790
2791                 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2792                         printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2793                         break;
2794         }
2795 }
2796
2797 unsigned short max_response;
2798 unsigned short discovery_duration;
2799 unsigned classOfDeviceMask;
2800 int ret = 0;
2801
2802 max_response =0;
2803 discovery_duration =0;
2804 classOfDeviceMask =0;
2805
2806 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2807
2808 @endcode
2809  *
2810  */
2811 int bluetooth_start_discovery(unsigned short max_response,
2812                                       unsigned short discovery_duration,
2813                                       unsigned int classOfDeviceMask);
2814
2815 /**
2816  * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2817  *                                      unsigned short max_response,
2818  *                                      unsigned short discovery_duration,
2819  *                                      unsigned int  classOfDeviceMask)
2820  * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2821  *
2822  * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2823  * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2824  * Please see bluetooth_start_discovery() for other parameters description.
2825  *
2826  * This function is a asynchronous call.
2827  * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2828  * through registered callback function.
2829  *
2830  * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2831  * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2832  *
2833  * The completion or cancellation of the discovery is indicated by an
2834  * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2835  *
2836  * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2837  *
2838  *
2839  * @return      BLUETOOTH_ERROR_NONE - Success \n
2840  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2841  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2842  *              BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2843  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2844                                                 agent is not running \n
2845  *
2846  * @param[in] role              define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2847                                         (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2848                                         DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2849  * @param[in] max_response              define the maximum response of the number of founded devices
2850                                         (0 means unlimited)
2851  * @param[in] discovery_duration        define bluetooth discovery duration (0 means 180s )
2852  * @param[in] classOfDeviceMask         define classes of the device mask which user wants
2853                                         (refer to class of device)
2854  * @remark      None
2855  * @see         bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2856
2857 @code
2858 unsigned short type;
2859 unsigned short max_response;
2860 unsigned short discovery_duration;
2861 unsigned classOfDeviceMask;
2862 int ret = 0;
2863
2864 type = 1;
2865 max_response =0;
2866 discovery_duration =0;
2867 classOfDeviceMask =0;
2868
2869 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2870
2871 @endcode
2872  *
2873  */
2874 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2875                                                 unsigned short max_response,
2876                                                 unsigned short discovery_duration,
2877                                                 unsigned int classOfDeviceMask);
2878
2879 /**
2880  * @fn int bluetooth_cancel_discovery (void)
2881  * @brief Cancel the on-going device discovery operation
2882  *
2883  *
2884  * This function stops the on-going device discovery operation. This API has to be called after the
2885  * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2886  * the bluetooth_start_discovery API
2887  *
2888  * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2889  * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2890  * cancel the discover request once the user received the device to which he wish to connect.
2891  *
2892  * This function is a asynchronous call.
2893  * If the call is success to cancel discovey then the application will receive
2894  * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2895  * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2896  * BLUETOOTH_ERROR_NONE
2897  *
2898  *
2899  * @return      BLUETOOTH_ERROR_NONE - Success \n
2900  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2901  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2902  *              BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2903                                                 other application \n
2904  *              BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2905  * @remark      None
2906  * @see         bluetooth_start_discovery
2907 @code
2908 void bt_event_callback(int event, bluetooth_event_param_t *param)
2909 {
2910         switch(event)
2911         {
2912                 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2913                         TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2914                         break;
2915         }
2916 }
2917
2918 ..
2919
2920 int ret = 0;
2921
2922 ret = bluetooth_cancel_discovery();
2923 @endcode
2924  */
2925 int bluetooth_cancel_discovery(void);
2926
2927 /**
2928  * @fn int bluetooth_start_le_discovery(void)
2929  * @brief Start the generic device discovery which finds the LE devices.
2930  *
2931  * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2932  * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2933  * It try to find LE devices. Bluetooth device address and name are
2934  * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2935  * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2936  * You will receive device address, device name, device class, rssi (received signal strength indicator).
2937  * please see bluetooth_device_info_t for more details.
2938  *
2939  * This function is a asynchronous call.
2940  * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2941  * through registered callback function.
2942  *
2943  * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2944  * found.
2945  *
2946  * The completion or cancellation of the discovery is indicated by an
2947  * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2948  *
2949  * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2950  *
2951  *
2952  * @return      BLUETOOTH_ERROR_NONE - Success \n
2953  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2954  *              BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2955  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2956                                                 agent is not running \n
2957  *
2958  * @remark      None
2959  * @see         bluetooth_stop_le_discovery, bluetooth_device_info_t
2960
2961 @code
2962 void bt_event_callback(int event, bluetooth_event_param_t *param)
2963 {
2964         switch(event)
2965         {
2966                 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2967                 {
2968                         bluetooth_device_info_t *device_info = NULL;
2969                         printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2970                                         param->result);
2971                         device_info  = (bluetooth_device_info_t *)param->param_data;
2972                         memcpy(&searched_device, &device_info->device_address,
2973                                                 sizeof(bluetooth_device_address_t));
2974                         printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2975                                 device_info->device_address.addr[0],
2976                                 device_info->device_address.addr[1],
2977                                 device_info->device_address.addr[2],
2978                                 device_info->device_address.addr[3],
2979                                 device_info->device_address.addr[4],
2980                                 device_info->device_address.addr[5]);
2981                         break;
2982                 }
2983
2984                 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2985                         printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2986                         break;
2987         }
2988 }
2989
2990 int ret = 0;
2991 ret = bluetooth_start_discovery();
2992
2993 @endcode
2994  *
2995  */
2996 int bluetooth_start_le_discovery(void);
2997
2998 /**
2999  * @fn int bluetooth_stop_le_discovery (void)
3000  * @brief Cancel the on-going device LE discovery operation
3001  *
3002  *
3003  * This function stops the on-going device discovery operation. This API has to be called after the
3004  * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3005  * the bluetooth_start_le_discovery API
3006  *
3007  *
3008  * This function is a asynchronous call.
3009  * If the call is success to cancel discovey then the application will receive
3010  * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3011  * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3012  * BLUETOOTH_ERROR_NONE
3013  *
3014  *
3015  * @return      BLUETOOTH_ERROR_NONE - Success \n
3016  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3017  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3018  *              BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3019                                                 other application \n
3020  *              BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3021  * @remark      None
3022  * @see         bluetooth_start_discovery
3023 @code
3024 void bt_event_callback(int event, bluetooth_event_param_t *param)
3025 {
3026         switch(event)
3027         {
3028                 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3029                         TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3030                         break;
3031         }
3032 }
3033
3034 ..
3035
3036 int ret = 0;
3037
3038 ret = bluetooth_stop_le_discovery();
3039 @endcode
3040  */
3041 int bluetooth_stop_le_discovery(void);
3042
3043 /**
3044  * @fn int bluetooth_is_discovering(void)
3045  * @brief Check for the device discovery is in-progress or not.
3046  *
3047  * This API is used to check the current status of the Discovery operation.If discovery is in\
3048  * progress normally other operations are not allowed.
3049  * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3050  * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3051  * event before performing other operations. This API is used to get for the current discovery
3052  * operation status and using bluetooth_cancel_discovery()
3053  * we can cancell the ongoing discovery process.
3054  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3055  * this API.
3056  *
3057  * This function checks whether the device discovery is started or not.
3058  *
3059  * This function is a synchronous call.
3060  *
3061  *
3062  * @return      BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3063  *              BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3064  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3065  *
3066  * @remark      None
3067  * @see         bluetooth_start_discovery, bluetooth_cancel_discovery
3068
3069 @code
3070 int ret = 0;
3071 ret = bluetooth_is_discovering ();
3072 @endcode
3073  */
3074 int bluetooth_is_discovering(void);
3075
3076 /**
3077  * @fn int bluetooth_is_le_discovering(void)
3078  * @brief Check for the device LE discovery is in-progress or not.
3079  *
3080  * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3081  * progress normally other operations are not allowed.
3082  * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3083  * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3084  * event before performing other operations. This API is used to get for the current discovery
3085  * operation status and using bluetooth_stop_le_discovery()
3086  * we can cancell the ongoing LE discovery process.
3087  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3088  * this API.
3089  *
3090  * This function checks whether the device  LE discovery is started or not.
3091  *
3092  * This function is a synchronous call.
3093  *
3094  *
3095  * @return      BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3096  *              BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3097  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3098  *
3099  * @remark      None
3100  * @see         bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3101
3102 @code
3103 int ret = 0;
3104 ret = bluetooth_is_le_discovering ();
3105 @endcode
3106  */
3107 int bluetooth_is_le_discovering(void);
3108
3109 /**
3110  * @fn int bluetooth_is_le_scanning(void)
3111  * @brief Check for the device LE scan is in-progress or not.
3112  *
3113  * This API is used to check the current status of the LE Scan operation.If discovery is in\
3114  * progress normally other operations are not allowed.
3115  *
3116  * This function checks whether the device  LE Scan is started or not.
3117  *
3118  * This function is a synchronous call.
3119  *
3120  * @return   TRUE  - LE Scan in progress \n
3121  *              FALSE - LE Scan is not in progress \n
3122  *
3123  * @remark      None
3124
3125 @code
3126 gboolean is_le_scanning = 0;
3127 is_le_scanning = bluetooth_is_le_scanning ();
3128 @endcode
3129  */
3130 gboolean bluetooth_is_le_scanning(void);
3131
3132 gboolean bluetooth_is_scan_filter_supported(void);
3133
3134 /**
3135  * @fn int bluetooth_force_hcidump(int timeout)
3136  * @brief Enable /disable force-hcidump
3137  *
3138  * This function control force-hcidump.
3139  *
3140  * This function is a synchronous call.
3141  *
3142  * @return      BLUETOOTH_ERROR_NONE - Success \n
3143  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3144  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3145  *
3146  * @param[in]   start  To enable or disable force-hcidump[TRUE / FALSE]
3147  *
3148  *
3149  * @remark      None
3150  */
3151 int bluetooth_force_hcidump(int timeout);
3152
3153 /**
3154  * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
3155  * @brief Register scan filter.
3156  *
3157  * This function registers the scan filter.
3158  *
3159  * This function is a synchronous call.
3160  *
3161  * @return      BLUETOOTH_ERROR_NONE - Success \n
3162  *
3163  * @param[in]   filter   scan filter to register
3164  * @param[out]  slot_id  the slot ID of scan filter
3165  *
3166  * @remark      None
3167  */
3168 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
3169
3170 /**
3171  * @fn int bluetooth_unregister_scan_filter(int slot_id)
3172  * @brief Register scan filter.
3173  *
3174  * This function unregisters the scan filter.
3175  *
3176  * This function is a synchronous call.
3177  *
3178  * @return      BLUETOOTH_ERROR_NONE - Success \n
3179  *
3180  * @param[in]   slot_id  the slot ID of scan filter
3181  *
3182  * @remark      None
3183  */
3184 int bluetooth_unregister_scan_filter(int slot_id);
3185
3186 /**
3187  * @fn int bluetooth_unregister_all_scan_filters(void)
3188  * @brief Register scan filter.
3189  *
3190  * This function usregisters all scan filters.
3191  *
3192  * This function is a synchronous call.
3193  *
3194  * @return      BLUETOOTH_ERROR_NONE - Success \n
3195  *
3196  * @remark      None
3197  */
3198 int bluetooth_unregister_all_scan_filters(void);
3199
3200 /**
3201  * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3202                 int link_type, bt_rssi_threshold_t rssi_threshold)
3203  * @brief Enable RSSI monitoring
3204  *
3205  * This function enables RSSI monitoring and sets threshold for a connection
3206  *
3207  * @return      BLUETOOTH_ERROR_NONE - Success \n
3208  *
3209  * @remark      None
3210  * @see bluetooth_get_rssi_strength
3211  */
3212 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3213                 int link_type, bt_rssi_threshold_t *rssi_threshold);
3214
3215 /**
3216  * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3217  * @brief Gets Raw RSSI signal Strength
3218  *
3219  * This function gives the Raw RSSI signal strength for a connection.
3220  *
3221  * @return      BLUETOOTH_ERROR_NONE - Success \n
3222  *
3223  * @remark      None
3224  * @see bluetooth_enable_rssi
3225  */
3226 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3227
3228 int bluetooth_set_connectable(gboolean is_connectable);
3229
3230 int bluetooth_is_connectable(gboolean *is_connectable);
3231
3232 /**
3233  * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3234  * @brief Initiate a bonding process
3235  *
3236  *
3237  * This function initiates a bonding procedure with a peer device.  The bonding procedure
3238  * enables authentication and optionally encryption on the Bluetooth link.
3239  *
3240  * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3241  * inititate the bonding request to the devices already in the paired list.
3242  *
3243  * Usually we call this API after the device discovery.
3244  * This function is a asynchronous call.
3245  *
3246  * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3247  * mentioed result code
3248  * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3249  * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3250  * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3251  * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3252  * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3253  *
3254  * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3255  * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3256  * result code
3257  *
3258  * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3259  *
3260  *
3261  * @return      BLUETOOTH_ERROR_NONE - Success \n
3262  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3263  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3264  *              BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3265  *              BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3266  * @exception   None
3267  * @param[in]   device_address   This indicates an address of the device with which the pairing
3268  *                                      should be initiated
3269  * @remark      None
3270  * @see         bluetooth_cancel_bonding
3271  @code
3272 void bt_event_callback(int event, bluetooth_event_param_t *param)
3273 {
3274         switch(event)
3275         {
3276                 case BLUETOOTH_EVENT_BONDING_FINISHED:
3277                 {
3278                         TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3279                         if (param->result >= BLUETOOTH_ERROR_NONE)
3280                         {
3281                                 bluetooth_device_info_t *device_info = NULL;
3282                                 device_info  = (bluetooth_device_info_t *)param->param_data;
3283                                 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3284                                                         mjr[%#x] min[%#x] srv[%#x]",
3285                                                         device_info->device_name.name,
3286                                                         device_info->device_address.addr[0],
3287                                                         device_info->device_address.addr[1],
3288                                                         device_info->device_address.addr[2],
3289                                                         device_info->device_address.addr[3],
3290                                                         device_info->device_address.addr[4],
3291                                                         device_info->device_address.addr[5],
3292                                                         device_info->device_class.major_class,
3293                                                         device_info->device_class.minor_class,
3294                                                         device_info->device_class.service_class);
3295                         }
3296                         else
3297                         {
3298                                 //bonding failed
3299                         }
3300                         break;
3301                 }
3302         }
3303 }
3304
3305 ...
3306
3307 int ret = 0;
3308 bluetooth_device_address_t device_address={{0}};
3309
3310 ret = bluetooth_bond_device(&device_address);
3311
3312 @endcode
3313  */
3314 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3315
3316 /**
3317  * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3318  *                              bluetooth_conn_type_t conn_type)
3319  * @brief Initiate a bonding process
3320  *
3321  *
3322  * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3323  * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3324  *
3325  * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3326  * inititate the bonding request to the devices already in the paired list.
3327  *
3328  * Usually we call this API after the device discovery.
3329  * This function is a asynchronous call.
3330  *
3331  * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3332  * mentioed result code
3333  * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3334  * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3335  * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3336  * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3337  * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3338  *
3339  * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3340  * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3341  * result code
3342  *
3343  * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3344  *
3345  *
3346  * @return BLUETOOTH_ERROR_NONE - Success \n
3347  *             BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3348  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3349  *             BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3350  *             BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3351  * @exception None
3352  * @param[in] device_address This indicates an address of the device with which pairing
3353  *                                        should be initiated
3354  * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3355  *                                 dual mode devices
3356  * @remark None
3357  * @see bluetooth_cancel_bonding
3358  */
3359 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3360                                 bluetooth_conn_type_t conn_type);
3361
3362 /**
3363  * @fn int bluetooth_cancel_bonding(void)
3364  * @brief Cancel the on-going bonding process
3365  *
3366  * This API is called to cancel the on-going bonding procedure. It should be called before the
3367  * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3368  * This API is useful when the remote device is not responding to the bond request or we wish to
3369  * cancel the bonding request. In this case we need not wait for the timeout to happen.
3370  *
3371  * This function is a synchronous call.
3372  *
3373  * @return      BLUETOOTH_ERROR_NONE - Success \n
3374  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3375  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3376  * @exception   None
3377  * @remark      None
3378  * @see         bluetooth_bond_device
3379 @code
3380 ...
3381
3382 int ret = 0;
3383
3384 ret = bluetooth_cancel_bonding();
3385 @endcode
3386  */
3387 int bluetooth_cancel_bonding(void);
3388
3389 /**
3390  * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3391  * @brief Remove bonding
3392  *
3393  *
3394  * To communicate with remote device over bluetooth link, user should bond with peer device.
3395  * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3396  * API is used to remove peer device from the list. Please note that after removing the device
3397  * from bonded device list, you cannot communication with peer device until bonding happens again.
3398  *
3399  * User can call this function by passing bluetooth device address of any bonded device. Please note
3400  * that after successful return of this function, any bluetooth application running on your device
3401  * will not be able to communicate with unbonded device until bond operation happens again using
3402  * bluetooth_bond_device()
3403  *
3404  *
3405  * This function is a asynchronous call. The request to remove the specified device from the bonded
3406  * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3407  * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3408  * in case if there is a problem in locating given bluetooth device address in bonded devices list
3409  *
3410  *
3411  *
3412  * @return      BLUETOOTH_ERROR_NONE - Success \n
3413  *              BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3414  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3415  *              BLUETOOTH_ERROR_DEVICE_BUSY     - Bluetooth adapter is busy doing some operation \n
3416  *              BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3417  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3418  *                                              agent is not running \n
3419  *              BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3420  *                                              bonded device \n
3421  *
3422  * @param[in]   device_address   This indicates an address of the device to remove bonding
3423  *
3424  * @remark      None
3425  *
3426  * @see         bluetooth_bond_device, bluetooth_cancel_bonding
3427  *
3428 @code
3429 void bt_event_callback(int event, bluetooth_event_param_t *param)
3430 {
3431         switch(event) {
3432                 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3433                         bluetooth_device_address_t *dev_addr = NULL;
3434
3435                         if (param->result == BLUETOOTH_ERROR_NONE) {
3436                                 dev_addr = (bluetooth_device_address_t *)param->param_data;
3437                                 //Unbound scuccess
3438                                 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3439                                         dev_addr->addr[0], dev_addr->addr[1]
3440                                         dev_addr->addr[2], dev_addr->addr[3]
3441                                         dev_addr->addr[4], dev_addr->addr[5]
3442                         } else {
3443                                 //unbound failure
3444                         }
3445                 }
3446         }
3447 }
3448
3449 ...
3450
3451 int ret = 0;
3452 bluetooth_device_address_t *device_address;
3453
3454 // copy valid device address in device_address
3455
3456 ret = bluetooth_unbond_device(device_address);
3457 @endcode
3458  */
3459 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3460
3461 /**
3462  * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3463  * @brief Get bonded(paired) device list
3464  *
3465  *
3466  * This API gets all bonded device list.
3467  * The devices in the bonded device list further can be used to perform the authorization by calling
3468  * bluetooth_authorize_device API.
3469  *
3470  * This function is a synchronous call.
3471  * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3472  * there is no valid information in the dev_list.
3473  * The len field in the dev_list represents the number of bonded devices. The data structure for
3474  * bonded device information is bluetooth_device_info_t.
3475  *
3476  *
3477  * @return      BLUETOOTH_ERROR_NONE - Success \n
3478  *              BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3479  * @remark      None
3480  * @see         bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3481  @code
3482 void bt_get_bonded_devices(void)
3483 {
3484 ...
3485         int i;
3486         GPtrArray *devinfo = NULL;
3487         bluetooth_device_info_t *ptr;
3488
3489         // allocate the g_pointer_array
3490         devinfo = g_ptr_array_new();
3491
3492         ret = bluetooth_get_bonded_device_list(&devinfo);
3493         if (ret != BLUETOOTH_ERROR_NONE)
3494         {
3495                 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3496         }
3497         else
3498         {
3499                 printf("g pointer arrary count : [%d]", devinfo->len);
3500                 for (i=0; i<devinfo->len; i++)
3501                 {
3502                         ptr = g_ptr_array_index(devinfo, i);
3503                         if (ptr != NULL)
3504                         {
3505                                 printf("Name [%s]\n", ptr->device_name.name);
3506                                 printf("Major Class [%d]\n", ptr->device_class.major_class);
3507                                 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3508                                 printf("Service Class [%d]\n", ptr->device_class.service_class);
3509                                 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3510                                                                 ptr->device_address.addr[0],
3511                                 ptr->device_address.addr[1], ptr->device_address.addr[2],
3512                                                                 ptr->device_address.addr[3],
3513                                 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3514
3515                                 // handle
3516                                 ...
3517                         }
3518                 }
3519         }
3520         // free g_pointer_array
3521         g_ptr_array_free(devinfo, TRUE);
3522 }
3523
3524 @endcode
3525  */
3526 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3527
3528 int bluetooth_get_profile_connected_device_list(
3529                 const char *profile_uuid, GPtrArray **addr_list);
3530
3531 /**
3532  * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3533  *                                      bluetooth_device_info_t *dev_info)
3534  * @brief Get a bonded(paired) device
3535  *
3536  *
3537  * This API gets a bonded device.
3538  *
3539  * This function is a synchronous call.
3540  * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3541  * there is no valid information in the dev_info.
3542  * The data structure for bonded device information is bluetooth_device_info_t.
3543  *
3544  *
3545  * @return      BLUETOOTH_ERROR_NONE - Success \n
3546  *              BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3547  * @remark      None
3548  * @see         bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3549  @code
3550 void bt_get_bonded_device(void)
3551 {
3552 ...
3553         int i;
3554         bluetooth_device_info_t devinfo = {0};
3555         bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3556
3557         ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3558         if (ret != BLUETOOTH_ERROR_NONE)
3559         {
3560                 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3561         }
3562         else
3563         {
3564                 printf("Name [%s]\n", devinfo.device_name.name);
3565                 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3566                 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3567                 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3568                 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3569                 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3570                 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3571                 devinfo.device_address.addr[5]);
3572
3573                 // handle
3574                 ...
3575         }
3576 }
3577
3578 @endcode
3579  */
3580 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3581                                         bluetooth_device_info_t *dev_info);
3582
3583
3584 /**
3585  * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3586  *                                      gboolean *is_alias_set)
3587  * @brief Get is_alias_set property of device
3588  *
3589  * This API gets is_alias_set property of a bonded device.
3590  *
3591  * This function is a synchronous call.
3592  * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3593  * If not,there is no valid information in the is_alias_set.
3594  *
3595  * @return      BLUETOOTH_ERROR_NONE - Success \n
3596  *                      BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3597  * @remark None
3598  @code
3599         int ret = 0;
3600         gboolean alias_set;
3601         bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3602
3603         ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3604  @endcode
3605  */
3606 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3607                                 gboolean *is_alias_set);
3608
3609 /**
3610  * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3611  * @brief set alias for bonded device
3612  *
3613  *
3614  * This function set alias for bonded device.
3615  *
3616  * This function is a synchronous call.
3617  *
3618  *
3619  * @return      BLUETOOTH_ERROR_NONE - Success \n
3620  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3621  * @param[in]   device_address   This indicates an address of the remote device
3622  * @param[in]   alias                   This indicates an alias to set
3623  * @remark      None
3624  * @see         None
3625 @code
3626 int ret = 0;
3627 ret = bluetooth_set_alias(&remote_address);
3628 @endcode
3629  */
3630 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3631                                 const char *alias);
3632
3633 /**
3634  * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3635  * @brief Get remote deivice
3636  *
3637  *
3638  * This function gets specific remote device.
3639  *
3640  * This function is a asynchronous call.
3641  * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3642  *
3643  *
3644  * @return      BLUETOOTH_ERROR_NONE - Success \n
3645  *              BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3646  * @param[in]   device_address   This indicates an address of the remote device
3647  * @remark      None
3648  * @see         None
3649 @code
3650 int ret = 0;
3651 ret = bluetooth_get_remote_device(&remote_address);
3652 @endcode
3653  */
3654 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3655
3656 /**
3657  * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3658  *                                      gboolean authorized)
3659  * @brief Authorize/Unauthorize a bonded device
3660  *
3661  *
3662  * This function authorizes/unauthorize a bonded device. It decides the device to connect
3663  * with/without user confirmation.
3664  *
3665  * If we select a paired device and make it authorized by calling this API with the authorized
3666  * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3667  * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3668  * then it will ask for the user conformation before the connection.
3669  *
3670  * This API supposed to be called on the paired devices. Which means we have to use this API only
3671  * after successful pairing.
3672  *
3673  * This function is a asynchronous call.
3674  * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3675  *
3676  * @return      BLUETOOTH_ERROR_NONE - Success \n
3677  * @exception   BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3678  * @param[in]   device_address   This indicates an address of the device to authorize \n
3679  * @param[in]   authorized      TRUE : authorize FALSE: unauthorize
3680  * @remark      None
3681  * @see         bluetooth_get_bonded_device_list
3682 @code
3683 void bt_event_callback(int event, bluetooth_event_param_t *param)
3684 {
3685         switch(event)
3686         {
3687                 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3688                 {
3689                         if (param->result == BLUETOOTH_ERROR_NONE)
3690                         {
3691                                 //Device authorized
3692                         }
3693                         //device authorization failed failure
3694                 }
3695         }
3696 }
3697
3698 ...
3699
3700 int ret = 0;
3701 bluetooth_device_address_t device_address={{0}};
3702 gboolean authorized;
3703
3704 authorized =TRUE;
3705
3706 ret = bluetooth_authorize_device(&device_address,authorized);
3707 @endcode
3708  */
3709 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3710                                        gboolean authorized);
3711
3712 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3713                                 const bluetooth_device_pin_code_t *pin_code);
3714
3715 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3716
3717 /**
3718  * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3719  *
3720  * @brief Receives Legacy Passkey\pin with following authentication response types
3721  *
3722  * @param[in]   passkey : This is the PIN or PASSKEY string required for remote device authentication
3723  * @param[in]   reply    TRUE : Accept AUthentication FALSE: Cancels authentication
3724  *
3725  */
3726 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3727
3728 /**
3729  * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3730  *
3731  * @brief This API sends user confirmation reply to the local adapter.
3732  *
3733  * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3734  *
3735  */
3736 int bluetooth_passkey_confirmation_reply(gboolean reply);
3737
3738 /**
3739  * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3740  * @brief Get all services supported by remote device
3741  *
3742  *
3743  * This API call initiates the search for the services supported by the specified device. Normally
3744  * the service search will take a couple of seconds to get it completed. Before calling this API
3745  * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3746  * perform the service search. We can get the device address by doing a device discovery operation.
3747  *
3748  *
3749  * This function is a asynchronous call.
3750  * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3751  *
3752  * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3753  * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3754  * event is generated with appropriate result code.
3755  *
3756  * @return      BLUETOOTH_ERROR_NONE - Success \n
3757  *              BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3758  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3759  * @param[in]   device_address   This indicates an address of the device
3760  *                               whose services need to be found
3761  * @remark      None
3762  * @see         bluetooth_cancel_service_search
3763  */
3764 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3765
3766 /**
3767  * @fn int bluetooth_cancel_service_search(void)
3768  * @brief Cancel the ongoing service search operation
3769  *
3770  *
3771  * This function cancel the ongoing service search operation. This API is usually calling after the
3772  * bluetooth_search_service API.
3773  * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3774  * if the user wish to cancel the Ongoing service search operation.
3775  *
3776  * This API should be called just after the bluetooth_search_service API and before the
3777  * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3778  *
3779  * This function is a synchronous call.
3780  *
3781  * @return      BLUETOOTH_ERROR_NONE - Success \n
3782  *              BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3783  *              BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3784  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3785  *
3786  * @remark      None
3787  * @see         bluetooth_search_service
3788 @code
3789 ...
3790
3791 int ret = 0;
3792 ret = bluetooth_cancel_service_search();
3793 @endcode
3794 */
3795 int bluetooth_cancel_service_search(void);
3796
3797 /**
3798  * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3799  * @brief Register rfcomm socket with a specific uuid
3800  *
3801  *
3802  * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3803  * descriptor of the server.
3804  * This is the first API which is called to create the server. Once we created the server socket,
3805  * we will listen on that return socket.
3806  * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3807  *
3808  *
3809  * @return  socket FD on Success \n
3810  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3811  *              BLUETOOTH_ERROR_INTERNAL - Internal error\n
3812  *              BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3813  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3814  * @param[in]   UUID (128 bits)
3815  *
3816  * @remark      None
3817  * @see       bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3818  *
3819  @code
3820
3821   const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3822   fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3823
3824  @endcode
3825  */
3826 int bluetooth_rfcomm_create_socket(const char *uuid);
3827
3828 /**
3829  * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3830  * @brief Register rfcomm socket with a specific uuid
3831  *
3832  *
3833  * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3834  * descriptor of the server.
3835  * This is the first API which is called to create the server. Once we created the server socket,
3836  * we will listen on that return socket.
3837  * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3838  *
3839  *
3840  * @return  socket FD on Success \n
3841  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3842  *              BLUETOOTH_ERROR_INTERNAL - Internal error\n
3843  *              BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3844  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3845  * @param[in]   UUID (128 bits)
3846  * @param[in]   bus_name (const char)
3847  * @param[in]   path (const char)
3848  *
3849  * @remark      None
3850  * @see       bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3851  *
3852  @code
3853
3854   const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3855   fd  = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3856
3857  @endcode
3858  */
3859 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3860
3861 /**
3862  * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3863  * @brief De-register the rfcomm socket
3864  *
3865  *
3866  * This API deregister rfcomm socket with the given socket fd and  UUID. If the remote device is
3867  * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3868  * descriptor else no event will come. We will call this API only after the
3869  * bluetooth_rfcomm_listen_and_accept.
3870  * This is a synchronous call.
3871  *
3872  * @return   BLUETOOTH_ERROR_NONE - Success \n
3873  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3874  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3875  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3876  * @param[in]  int socket_fd
3877  *
3878  * @remark      None
3879  * @see       bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3880  *
3881  @code
3882  void bt_event_callback(int event, bluetooth_event_param_t *param)
3883  {
3884         switch(event)
3885         {
3886                 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3887                 {
3888                         bluetooth_rfcomm_connection_t *discon_ind =
3889                                         (bluetooth_rfcomm_connection_t *)param->param_data;
3890
3891                         printf("\nDisconnected from FD %d",  discon_ind->socket_fd);
3892                 }
3893         }
3894  }
3895
3896  ...
3897
3898  int ret = 0;
3899  fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3900  ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3901  ....
3902  ret = bluetooth_rfcomm_remove_socket(fd);
3903  @endcode
3904  */
3905 int bluetooth_rfcomm_remove_socket(int socket_fd);
3906
3907 /**
3908  * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3909  * @brief De-register the rfcomm socket
3910  *
3911  *
3912  * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3913  * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3914  * descriptor else no event will come. We will call this API only after the
3915  * bluetooth_rfcomm_listen_and_accept_ex.
3916  * This is a synchronous call.
3917  *
3918  * @return   BLUETOOTH_ERROR_NONE - Success \n
3919  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3920  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3921  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3922  * @param[in]   UUID (128 bits)
3923  *
3924  * @remark      None
3925  * @see       bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3926  *
3927  @code
3928  void bt_event_callback(int event, bluetooth_event_param_t *param)
3929  {
3930         switch(event)
3931         {
3932                 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3933                 {
3934                         bluetooth_rfcomm_connection_t *discon_ind =
3935                                         (bluetooth_rfcomm_connection_t *)param->param_data;
3936
3937                         printf("\nDisconnected from FD %d",  discon_ind->socket_fd);
3938                 }
3939         }
3940  }
3941
3942  ...
3943
3944  int ret = 0;
3945  fd  = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3946  ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3947  ....
3948  ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3949  @endcode
3950  */
3951 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3952
3953 /**
3954  * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3955  * @brief Disconnect rfcomm connection
3956  *
3957  *
3958  * Disconnect a specific(device node fd)  RFCOMM connection. This is a Synchronous call and there
3959  * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3960  * remote server.
3961  *
3962  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3963  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3964  *              BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3965  * @param[in]  int socket_fd the sending socket fd
3966  *
3967  * @remark      None
3968  *
3969  @code
3970
3971   ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3972   if (ret < 0)
3973         printf("Disconnection failed");
3974   else
3975   printf("Disconnection Success");
3976
3977  @endcode
3978  */
3979 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3980
3981 /**
3982  * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3983  * @brief Rfcomm socket listen
3984  *
3985  *
3986  * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3987  * after the bluetooth_rfcomm_create_socket API.
3988  * This API listen for the incomming connection and once it receives a connection, it will give
3989  * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3990  * event to the application. This is an Asynchronous API call.
3991  *
3992  *
3993  * @return  BLUETOOTH_ERROR_NONE - Success \n
3994  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3995  *              BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3996
3997  * @param[in]  int socket_fd
3998  * @param[in]  max pending connection.
3999  *
4000  * @remark      None
4001  * @see       bluetooth_rfcomm_create_socket
4002  *
4003   @code
4004   void bt_event_callback(int event, bluetooth_event_param_t* param)
4005  {
4006         switch(event)
4007         {
4008                 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4009                 {
4010                         bluetooth_rfcomm_connection_t *conn_ind =
4011                                                 (bluetooth_rfcomm_connection_t *)param->param_data;
4012
4013                         printf("\nConnected from FD %d",  conn_ind->socket_fd);
4014                 }
4015         }
4016  }
4017
4018  ...
4019
4020  int ret = 0;
4021  fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4022  ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4023
4024  @endcode
4025  */
4026 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4027
4028 /**
4029  * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
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_CONNECTED
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  * @param[in]  name
4047  * @param[in]  path
4048  *
4049  * @remark      None
4050  * @see       bluetooth_rfcomm_create_socket_ex
4051  *
4052   @code
4053   void bt_event_callback(int event, bluetooth_event_param_t* param)
4054  {
4055         switch(event)
4056         {
4057                 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4058                 {
4059                         bluetooth_rfcomm_connection_t *conn_ind =
4060                                                 (bluetooth_rfcomm_connection_t *)param->param_data;
4061
4062                         printf("\nConnected from FD %d",  conn_ind->socket_fd);
4063                 }
4064         }
4065  }
4066
4067  ...
4068
4069  int ret = 0;
4070  fd  = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4071  ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4072
4073  @endcode
4074  */
4075
4076 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4077
4078 /**
4079  * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4080  * @brief Rfcomm socket listen
4081  *
4082  *
4083  * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4084  * after the bluetooth_rfcomm_create_socket API.
4085  * This API listen for the incomming connection and once it receives a connection, it will give
4086  * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4087  * event to the application. This is an Asynchronous API call.
4088  *
4089  *
4090  * @return  BLUETOOTH_ERROR_NONE - Success \n
4091  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4092  *              BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4093
4094  * @param[in]  int socket_fd
4095  * @param[in]  max pending connection.
4096  *
4097  * @remark      None
4098  * @see       bluetooth_rfcomm_create_socket
4099  *
4100   @code
4101   void bt_event_callback(int event, bluetooth_event_param_t* param)
4102  {
4103         switch(event)
4104         {
4105                 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4106                 {
4107                         char *name = (char *)param->param_data;
4108
4109                         printf("\nConnected from %s",  name);
4110
4111                         bluetooth_rfcomm_accept_connection();
4112                 }
4113         }
4114  }
4115
4116  ...
4117
4118  int ret = 0;
4119  fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4120  ret = bluetooth_rfcomm_listen(fd, 1);
4121
4122  @endcode
4123  */
4124 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4125
4126 /**
4127  * @fn int bluetooth_rfcomm_accept_connection()
4128  * @brief Accepts the authorization request indicated by the event
4129   * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4130  *
4131  * This function is a synchronous call.
4132  *
4133  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4134  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
4135  *
4136  * @param[in]  the socket fd of the server
4137  * @param[out]  the socket fd of the client
4138  *
4139  * @exception   None
4140  * @remark       None
4141  * @see bluetooth_rfcomm_reject_connection
4142  */
4143 int bluetooth_rfcomm_accept_connection(int server_fd);
4144
4145 /**
4146  * @fn int bluetooth_rfcomm_reject_connection()
4147  * @brief Rejects the authorization request indicated by the event
4148   * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4149  *
4150  * This function is a synchronous call.
4151  *
4152  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4153  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
4154  *
4155  * @param[in]  the socket fd of the server
4156  *
4157  * @exception   None
4158  * @remark       None
4159  * @see bluetooth_rfcomm_accept_connection
4160  */
4161 int bluetooth_rfcomm_reject_connection(int server_fd);
4162
4163 /**
4164  * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4165  * @brief Informs whether rfcomm server uuid is available or not.
4166  *
4167  * This function is a synchronous call.
4168  *
4169  * @return   TRUE  - RFCOMM uuid is available \n
4170  *              FALSE - RFCOMM uuid is not available \n
4171  *
4172  * @param[in]  uuid UUID string
4173  *
4174  * @exception   None
4175  *
4176  * @remark       None
4177  */
4178 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4179
4180 /**
4181  * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t  *remote_bt_address,
4182  *                                                                      const char *remote_uuid)
4183  * @brief Connect to the remote device rfcomm *
4184  *
4185  * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4186  * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4187  * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4188  * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4189  * initiating a connection.
4190  *
4191  * @return  BLUETOOTH_ERROR_NONE  - Success \n
4192  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4193  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4194  *              BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4195  *              BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4196  * @param[in]  bluetooth_device_address_t remote bt_address
4197  * @param[in]  char remote uuid
4198  * @remark      None
4199  * @see         bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4200  *
4201  @code
4202
4203  void bt_event_callback(int event, bluetooth_event_param_t *param)
4204  {
4205         switch(event)
4206         {
4207                 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4208                 {
4209                         if (param->result >= BLUETOOTH_ERROR_NONE)
4210                         {
4211                                 bt_sdp_info_t *bt_sdp_info=param->param_data;
4212
4213                                 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4214                                         bt_sdp_info->device_addr.addr[0],
4215                                         bt_sdp_info->device_addr.addr[1],
4216                                         bt_sdp_info->device_addr.addr[2],
4217                                         bt_sdp_info->device_addr.addr[3],
4218                                         bt_sdp_info->device_addr.addr[4],
4219                                         bt_sdp_info->device_addr.addr[5]);
4220
4221                                         printf("Supported service list:\n");
4222                                         for(i=0; i<bt_sdp_info->service_index; i++)
4223                                                 printf("[%#x]\n",
4224                                                         bt_sdp_info->service_list_array[i]);
4225
4226                                 //Alternate method
4227                                 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4228                                                                                 //rfcomm_test_uuid);
4229                         }
4230                         break;
4231                 }
4232                 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4233                 {
4234                         bluetooth_rfcomm_connection_t *conn_ind =
4235                                                 (bluetooth_rfcomm_connection_t *)param->param_data;
4236
4237                         printf("\nConnected from FD %d, Role = %s",  conn_ind->socket_fd,
4238                                                 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4239                                                                         "SERVER" : "CLIENT");
4240                 }
4241         }
4242  }
4243
4244   bluetooth_device_address_t remote_address = {{0},};
4245   remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4246   remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19;  remote_address.addr[5]= 0x36;
4247   ret = bluetooth_search_service(&remote_address);
4248  if (ret < 0)
4249         printf("Seach failed, Reason = %d", ret);
4250   else
4251          printf("Search Success, Ret = %d", ret);
4252
4253   ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4254   if (ret < 0)
4255         printf("Connection failed, Reason = %d", ret);
4256   else
4257          printf("Connection Success, Ret = %d", ret);
4258
4259   @endcode
4260   */
4261 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4262                                      const char *remote_uuid);
4263
4264 /**
4265  * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4266  * @brief Disconnect rfcomm connection
4267  *
4268  *
4269  * Disconnect a specific(device node fd)  RFCOMM connection. This is a Synchronous call and there
4270  * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4271  * remote server.
4272  *
4273  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4274  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4275  *              BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4276  * @param[in]  char remote bt_address
4277  *
4278  * @remark      None
4279  * @see         bluetooth_rfcomm_connect
4280  *
4281  @code
4282
4283   ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4284   if (ret < 0)
4285         printf("Disconnection failed");
4286   else
4287   printf("Disconnection Success");
4288
4289  @endcode
4290  */
4291
4292 int bluetooth_rfcomm_disconnect(int socket_fd);
4293
4294 /**
4295  * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4296  * @brief Write to rfcomm connection
4297  *
4298  *
4299  * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4300  * API is used to send the data for server and the client.
4301  *
4302  * @return  BLUETOOTH_ERROR_NONE  - Success \n
4303  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4304  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4305  * @param[in]  int fd
4306  * @param[in]  const char *buff  Data buffer to send
4307  * @param[in]  int length Length of the data
4308  *
4309  * @remark      None
4310  * @see         bluetooth_rfcomm_connect
4311  *
4312   @code
4313   char *buff = "Test data 123456789"
4314   ret =  bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4315   if (ret < 0)
4316         printf("Send failed");
4317   else
4318    printf("Send success");
4319
4320  @endcode
4321  */
4322 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4323
4324 /**
4325  * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4326  * @brief Informs whether rfcomm client is connected.
4327  *
4328  * This function is a synchronous call.
4329  *
4330  * @return   TRUE  - RFCOMM client is connected \n
4331  *              FALSE - RFCOMM client is not connected \n
4332  *
4333  * @exception   None
4334  *
4335  * @remark       None
4336  */
4337 gboolean bluetooth_rfcomm_is_client_connected(void);
4338 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4339 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4340
4341 /**
4342  * @fn int bluetooth_network_activate_server(void)
4343  * @brief Activate the NAP (Network Access Point) service
4344  *
4345  * This function is a asynchronous call.
4346  * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4347  *
4348  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4349  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4350  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4351  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4352  *
4353  * @remark      None
4354   * @see        bluetooth_network_deactivate_server
4355  *
4356  */
4357 int bluetooth_network_activate_server(void);
4358
4359 /**
4360  * @fn int bluetooth_network_deactivate_server(void)
4361  * @brief Deactivate the NAP (Network Access Point) service
4362  *
4363  * This function is a asynchronous call.
4364  * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4365  *
4366  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4367  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4368  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4369  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4370  *
4371  * @remark      None
4372  * @see         bluetooth_network_activate_server
4373  *
4374  */
4375 int bluetooth_network_deactivate_server(void);
4376
4377 /**
4378  * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4379  *                                      bluetooth_network_role_t role,
4380  *                                      char  custom_uuid)
4381  * @brief Connect the network server in the peer
4382  *
4383  * This function is a asynchronous call.
4384  * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4385  *
4386  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4387  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4388  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4389  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4390  *
4391  * @exception   None
4392  * @param[in]  device_address   This indicates an address of the device with which the pairing
4393  *                              should be initiated
4394  * @param[in]  role   The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4395  *                      need to use the third parameter.
4396  * @param[in]  custom_uuid   If use the CUSTOM value in second parameter, use this parameter to
4397  *                              connect. UUID string
4398  * @remark      None
4399  * @see         bluetooth_network_disconnect
4400  */
4401 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4402                                       bluetooth_network_role_t role, char *custom_uuid);
4403
4404 /**
4405  * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4406  *                                                      bluetooth_network_role_t role,
4407  *                                                        char *custom_uuid)
4408  * @brief Connect the network server in the peer
4409  *
4410  * This function is a asynchronous call.
4411  * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4412  *
4413  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4414  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4415  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4416  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4417  *
4418  * @exception   None
4419  * @param[in]   device_address   This indicates an address of the device with which the pairing
4420  *                                      should be initiated
4421  * @remark       None
4422  * @see         bluetooth_network_connect
4423  */
4424 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4425
4426 /**
4427  * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4428  * @brief Disconnect the device from the network
4429  *
4430  * This function is an asynchronous call.
4431  * The network server disconnect request is responded by
4432  * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4433  *
4434  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4435  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4436  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4437  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4438  *
4439  * @exception   None
4440  * @param[in]   device_address   This indicates an address of the connected client device
4441  * @remark       None
4442  * @see         bluetooth_network_activate_server
4443  */
4444 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4445
4446 /*HDP - API's*/
4447
4448 /**
4449  * @fn int bluetooth_hdp_activate(unsigned short  data_type,
4450  *                                      bt_hdp_role_type_t role,
4451  *                                      bt_hdp_qos_type_t channel_type,
4452  *                                      char **app_handle)
4453  * @brief Activate the HDP service for a particular data type
4454  *
4455  * This function is a synchronous call.
4456  *
4457  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4458  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4459  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4460  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4461  *
4462  * @exception   None
4463  * @param[in]  data_type   The data type against corresponding service
4464  * @param[in]  role   The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4465  * @param[in]  channel_type   The QOS type for the channel.
4466  *                              HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4467  *                              For role = HDP_ROLE_SINK, the channel_type
4468  *                              should be HDP_QOS_ANY.
4469  * @param[out]  app_handle    The application handler against corresponding service
4470  * @remark       None
4471  * @see bluetooth_hdp_deactivate
4472  */
4473 int bluetooth_hdp_activate(unsigned short  data_type,
4474                                 bt_hdp_role_type_t role,
4475                                 bt_hdp_qos_type_t channel_type,
4476                                 char **app_handle);
4477 /**
4478  * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4479  * @brief Deactivate the HDP service for a particular service using the handler
4480  *
4481  * This function is a synchronous call.
4482  *
4483  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4484  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4485  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4486  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4487  *
4488  * @exception   None
4489  * @param[in]  app_handle   The application handler against corresponding service
4490  * @remark       None
4491  * @see bluetooth_hdp_deactivate
4492  */
4493 int bluetooth_hdp_deactivate(const char *app_handle);
4494
4495 /**
4496  * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4497  *                                      const char *buffer, unsigned int size)
4498  * @brief Send data to the remote HDP device
4499  *
4500  * This function is a synchronous call.
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_NOT_IN_OPERATION - FD is invalid  \n
4507  *
4508  * @exception   None
4509  * @param[in]  channel_id   The channel id for the connection.
4510  * @param[in]  buffer   The pdu buffer.
4511  * @param[in]  size   Size of the buffer.
4512  * @remark       None
4513  * @see bluetooth_hdp_connect
4514  */
4515 int bluetooth_hdp_send_data(unsigned int channel_id,
4516                                 const char *buffer, unsigned int size);
4517 /**
4518  * @fn int bluetooth_hdp_connect(const char *app_handle,
4519  *                              bt_hdp_qos_type_t channel_type,
4520  *                              const bluetooth_device_address_t *device_address)
4521  * @brief Connect to the remote device(Mainly used by source)
4522  *
4523  * This function is a asynchronous call.
4524  * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4525  *
4526  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4527  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4528  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4529  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4530  *              BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4531  *
4532  * @exception   None
4533  * @param[in]  app_handle   The application handler against corresponding service
4534  * @param[in]  channel_type   The QOS type for the channel.
4535  *                              HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4536  * @param[in]  device_address   The remote device Bd address.
4537  *
4538  * @remark       None
4539  * @see bluetooth_hdp_disconnect
4540  */
4541 int bluetooth_hdp_connect(const char *app_handle,
4542                         bt_hdp_qos_type_t channel_type,
4543                         const bluetooth_device_address_t *device_address);
4544 /**
4545  * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4546  *                      const bluetooth_device_address_t *device_address)
4547  * @brief Disconnect from the remote device(Mainly used by source)
4548  *
4549  * This function is a asynchronous call.
4550  * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4551  *
4552  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4553  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4554  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4555  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4556   *              BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4557  *
4558  * @exception   None
4559  * @param[in]  channel_id    The channel id for the connection.
4560  * @param[in]  device_address   The remote device Bd address.
4561  *
4562  * @remark       None
4563  * @see bluetooth_hdp_connect
4564  */
4565 int bluetooth_hdp_disconnect(unsigned int channel_id,
4566                         const bluetooth_device_address_t  *device_address);
4567
4568
4569 /**
4570  * @fn int bluetooth_opc_init(void)
4571  * @brief Initialize OPP client.
4572  *
4573  * This function is a synchronous call.
4574  * No event corresponding to this api
4575  *
4576  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4577  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4578  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4579  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4580   *             BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4581  *
4582  * @exception   None
4583  *
4584  * @remark       None
4585  * @see bluetooth_opc_deinit
4586  */
4587 int bluetooth_opc_init(void);
4588
4589 /**
4590  * @fn int bluetooth_opc_deinit(void)
4591  * @brief Deinitialize OPP client.
4592  *
4593  * This function is a synchronous call.
4594  * No event corresponding to this api
4595  *
4596  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4597  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4598  *              BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4599  *
4600  * @exception   None
4601  *
4602  * @remark       None
4603  * @see bluetooth_opc_init
4604  */
4605
4606 int bluetooth_opc_deinit(void);
4607
4608 /**
4609  * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4610                                         char **file_name_array)
4611  * @brief Send multiple files to a remote device.
4612  *
4613  * This function is a asynchronous call.
4614  * This api  is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4615  *
4616  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4617  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4618  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4619  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4620  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4621  *              BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4622  *              BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4623  *
4624  * @exception   None
4625  * @param[in]  device_address   The remote device Bd address.
4626  * @param[in]  file_name_array  Array of filepaths to be sent.
4627  *
4628  * @remark       None
4629  * @see bluetooth_opc_cancel_push
4630  */
4631
4632 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4633                                 char **file_name_array);
4634
4635 /**
4636  * @fn int bluetooth_opc_cancel_push(void)
4637  * @brief Cancels the ongoing file push.
4638  *
4639  * This function is a asynchronous call.
4640  * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4641  * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4642  *
4643  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4644  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4645  *              BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4646  *
4647  * @exception   None
4648  *
4649  * @remark       None
4650  * @see bluetooth_opc_push_files
4651  */
4652
4653 int bluetooth_opc_cancel_push(void);
4654
4655 /**
4656  * @fn gboolean bluetooth_opc_session_is_exist(void)
4657  * @brief Informs whether opc session exists or not.
4658  *
4659  * This function is a synchronous call.
4660  *
4661  * @return   TRUE  - OPC session exists \n
4662  *              FALSE - OPC session does not exist \n
4663  *
4664  * @exception   None
4665  *
4666  * @remark       None
4667  * @see None
4668  */
4669
4670 gboolean bluetooth_opc_session_is_exist(void);
4671
4672 /**
4673  * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4674  * @brief Informs whether opc session exists or not.
4675  *
4676  * This function is a synchronous call.
4677  *
4678  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4679  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4680  *               BLUETOOTH_ERROR_INTERNAL \n
4681  *
4682  * @exception   None
4683  * @param[out] is_sending The sending status: (@c TRUE = in sending , @c  false = not in sending)
4684  *
4685  * @remark       None
4686  * @see            None
4687  */
4688 int bluetooth_opc_is_sending(gboolean *is_sending);
4689
4690 /**
4691  * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4692                 int transfer_id, unsigned char *progress)
4693  * @brief Gets the percentage progress for ongoing transfers.
4694  *
4695  * This function is a synchronous call.
4696  *
4697  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4698  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4699  *               BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4700  *
4701  * @exception   None
4702  * @param[in] transfer_type     Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c  BLUETOOTH_TRANSFER_OUTBOUND = sending)
4703  * @param[in] transfer_id       Transfer ID
4704  * @param[out] progress         Percentage Progress
4705  * @remark       None
4706  * @see            None
4707  */
4708 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4709                 int transfer_id, unsigned char *progress);
4710
4711 /**
4712  * @fn int bluetooth_obex_server_init(const char *dst_path)
4713  * @brief Initialize OPP and FTP server.
4714  *
4715  * This function is a synchronous call.
4716  * No event corresponding to this api
4717  *
4718  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4719  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4720  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4721  *              BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4722  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4723  *
4724  * @exception   None
4725  * @param[in]  dst_path   OPS destination file path.
4726  * @remark       None
4727  * @see bluetooth_obex_server_deinit
4728  */
4729 int bluetooth_obex_server_init(const char *dst_path);
4730
4731
4732 /**
4733  * @fn int bluetooth_obex_server_deinit(void)
4734  * @brief Deinitialize OPP and FTP server.
4735  *
4736  * This function is a synchronous call.
4737  * No event corresponding to this api
4738  *
4739  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4740  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4741  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4742  *
4743  * @exception   None
4744  *
4745  * @remark       None
4746  * @see bluetooth_obex_server_init
4747  */
4748 int bluetooth_obex_server_deinit(void);
4749
4750
4751 /**
4752  * @fn gboolean bluetooth_obex_server_is_activated(void)
4753  * @brief Informs whether obex server is activated or not.
4754  *
4755  * This function is a synchronous call.
4756  *
4757  * @return   TRUE  - OBEX server is activated \n
4758  *              FALSE - OBEX server is not activated \n
4759  *
4760  * @exception   None
4761  *
4762  * @remark       None
4763  */
4764
4765 gboolean bluetooth_obex_server_is_activated(void);
4766
4767
4768 /**
4769  * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4770  * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4771  *
4772  * This function is a synchronous call.
4773  * No event corresponding to this api
4774  *
4775  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4776  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4777  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4778  *              BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4779  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4780  *
4781  *
4782  * @exception   None
4783  * @param[in]  dst_path   OPS destination file path.
4784  * @remark       None
4785  * @see bluetooth_obex_server_deinit_without_agent
4786  */
4787 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4788
4789
4790 /**
4791  * @fn int bluetooth_obex_server_deinit_without_agent(void)
4792  * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4793  *
4794  * This function is a synchronous call.
4795  * No event corresponding to this api
4796  *
4797  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4798  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4799  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4800  *
4801  * @exception   None
4802  *
4803  * @remark       None
4804  * @see bluetooth_obex_server_init_without_agent
4805  */
4806 int bluetooth_obex_server_deinit_without_agent(void);
4807
4808
4809 /**
4810  * @fn int bluetooth_obex_server_accept_connection(void)
4811  * @brief Accepts the authorization request indicated by the event
4812   * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4813  *
4814  * This function is a synchronous call.
4815  *
4816  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4817  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4818  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
4819  *
4820  * @exception   None
4821  * @remark       None
4822  * @see bluetooth_obex_server_reject_authorize
4823  */
4824 int bluetooth_obex_server_accept_connection(void);
4825
4826
4827 /**
4828  * @fn int bluetooth_obex_server_reject_connection(void)
4829  * @brief Rejects the authorization request indicated by the event
4830   * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4831  *
4832  * This function is a synchronous call.
4833  *
4834  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4835  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4836  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
4837  *
4838  * @exception   None
4839  * @remark       None
4840  * @see bluetooth_obex_server_reject_authorize
4841  */
4842 int bluetooth_obex_server_reject_connection(void);
4843
4844
4845 /**
4846  * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4847  * @brief Accepts the authorization request indicated by the event
4848   * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4849  *
4850  * This function is a asynchronous call.
4851  * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4852  *
4853  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4854  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4855  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4856  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4857  *
4858  * @exception   None
4859  * @param[in]  filename   Authorized filename.
4860
4861  * @remark       None
4862  * @see bluetooth_obex_server_reject_authorize
4863  */
4864
4865 int bluetooth_obex_server_accept_authorize(const char *filename);
4866
4867 /**
4868  * @fn int bluetooth_obex_server_reject_authorize(void)
4869  * @brief Reject the authorization request indicated by the event
4870   * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4871  *
4872  * This function is a asynchronous call.
4873  * No event for this api..
4874  *
4875  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4876  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4877  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4878  *
4879  * @exception   None
4880
4881  * @remark       None
4882  * @see bluetooth_obex_server_accept_authorize
4883  */
4884
4885 int bluetooth_obex_server_reject_authorize(void);
4886
4887 /**
4888  * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4889  * @brief Set the OPS destination file path..
4890  *
4891  * This function is a asynchronous call.
4892  * No event for this api..
4893  *
4894  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4895  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4896  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4897  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4898  *
4899  * @exception   None
4900  * @param[in]  dst_path   OPS destination file path.
4901
4902  * @remark       None
4903  * @see None
4904  */
4905
4906 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4907
4908 /**
4909  * @fn int bluetooth_obex_server_set_root(const char *root)
4910  * @brief Set the FTS root folder..
4911  *
4912  * This function is a asynchronous call.
4913  * No event for this api..
4914  *
4915  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4916  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4917  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4918  *              BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4919  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4920  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4921  *
4922  * @exception  None
4923  * @param[in]   root   FTS root folder.
4924
4925  * @remark       None
4926  * @see None
4927  */
4928
4929 int bluetooth_obex_server_set_root(const char *root);
4930
4931 /**
4932  * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4933  * @brief Cancel the transfer on server
4934  *
4935  * This function is an asynchronous call.
4936  * If the function call that cancels transfer is successful, the application would receive
4937  * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4938  * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4939  * the error code will be BLUETOOTH_ERROR_NONE
4940  *
4941  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4942  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4943  *               BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4944  *               BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4945  *               BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4946  *
4947  * @exception None
4948  * @param[in] transfer_id transfer ID
4949
4950  * @remark       None
4951  * @see None
4952  */
4953 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4954
4955
4956 /**
4957  * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4958  * @brief Cancel the transfer on server
4959  *
4960  * This function is an asynchronous call.
4961  * If the function call that cancels transfer is successful, the application would receive
4962  * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4963  * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4964  * the error code will be BLUETOOTH_ERROR_NONE
4965  *
4966  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4967  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4968  *               BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4969  *               BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4970  *               BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4971  *
4972  * @exception None
4973  *
4974  * @remark       None
4975  * @see None
4976  */
4977 int bluetooth_obex_server_cancel_all_transfers(void);
4978
4979
4980 /**
4981  * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4982  * @brief Informs whether obex server is receiving or not.
4983  *
4984  * This function is a synchronous call.
4985  *
4986  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4987  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4988  *               BLUETOOTH_ERROR_INTERNAL \n
4989  *
4990  * @exception   None
4991  * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c  false = not in receiving)
4992  *
4993  * @remark       None
4994  * @see None
4995  */
4996 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4997
4998
4999 /**
5000  * @fn int bluetooth_map_client_init(void)
5001  * @brief Initialize MAP client.
5002  *
5003  * This function is a synchronous call.
5004  * No event corresponding to this api
5005  *
5006  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5007  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5008  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5009  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5010  *              BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5011  *
5012  * @exception None
5013  *
5014  * @remark None
5015  * @see bluetooth_map_client_deinit
5016  */
5017 int bluetooth_map_client_init(void);
5018
5019 int bluetooth_map_client_deinit(void);
5020
5021 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5022
5023 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5024
5025 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5026
5027 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5028                         bt_map_client_list_folders_filter_t *filter);
5029
5030 /**
5031  * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5032  * @brief Return all available fields that can be used in Fields filter.
5033  *
5034  * This function is a asynchronous call.
5035  *
5036  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5037  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5038  *              BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5039  *
5040  * @exception   None
5041  * @param[in]  session   Information about session.
5042  * @remark       None
5043  */
5044 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5045
5046 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5047                         const char *folder,
5048                         bt_map_client_list_messages_filter_t *filter);
5049
5050 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5051
5052 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5053                         const char *source_file,
5054                         const char *folder,
5055                         bt_map_client_push_message_args_t *args);
5056
5057 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5058                         const bt_map_client_message_object_t message_object,
5059                         const char *target_file,
5060                         bool attachment);
5061
5062
5063 /**
5064  * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5065  * @brief Read the local Hash and Randmizer.
5066  *
5067  * This function is a synchronous call.
5068  *
5069  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5070  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5071  *
5072  * @exception  None
5073  * @param[in]  None.
5074  * @param[out] local_oob_data - Pointer to the local OOB data
5075  *
5076  * @remark       None
5077  * @see None
5078  */
5079
5080 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5081
5082
5083 /**
5084  * @fn int bluetooth_oob_add_remote_data(
5085  *                      const bluetooth_device_address_t *remote_device_address,
5086  *                      bt_oob_data_t *oob_data)
5087  * @brief Add/updated the remote device  Hash and Randmizer.
5088  *
5089  * This function is a synchronous call.
5090  * No event for this api..
5091  *
5092  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5093  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5094  *
5095  * @exception   None
5096  * @param[in] remote_device_address - Remote device address
5097  *            remote_oob_data - Ponter to Hash and Randomizer oob data structure
5098  *
5099  * @remark      None
5100  * @see         None
5101  */
5102
5103 int bluetooth_oob_add_remote_data(
5104                    const bluetooth_device_address_t *remote_device_address,
5105                    bt_oob_data_t *remote_oob_data);
5106
5107
5108 /**
5109  * @fn int bluetooth_oob_remove_remote_data(
5110  *                      const bluetooth_device_address_t *remote_device_address)
5111  * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5112  *
5113  * This function is a synchronous call.
5114  * No event for this api..
5115  *
5116  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5117  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5118  *
5119  * @exception  None
5120  * @param[in] remote_device_address - Remote device address
5121  *
5122  * @remark       None
5123  * @see None
5124  */
5125
5126 int bluetooth_oob_remove_remote_data(
5127                         const bluetooth_device_address_t *remote_device_address);
5128
5129 /**
5130  * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5131  *                                              bt_gatt_handle_info_t *prim_svc);
5132  *
5133  * @brief Gets the GATT based primary services handle supported by remote device
5134  *
5135  * This function is a synchronous call.
5136  * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5137  *
5138  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5139  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5140  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5141  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5142  *
5143  * @exception    None
5144  * @param[in]    address - Remote device address
5145  * @param[out] prim_svc - Structure containing remote service count and handle list.
5146  *
5147  * @remark      None
5148  * @see         bluetooth_gatt_free_primary_services()
5149  */
5150 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5151                                                 bt_gatt_handle_info_t *prim_svc);
5152
5153 /**
5154  * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5155  *
5156  * @brief Discovers the characteristics of GATT based service of remote device
5157  *
5158  * This function is an asynchronous call.
5159  * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5160  *
5161  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5162  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5163  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5164  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5165  *
5166  * @exception   None
5167  * @param[in]   service_handle - Handle for remote service.
5168  *
5169  * @remark      None
5170  * @see         None
5171  */
5172 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5173
5174 int bluetooth_gatt_set_service_change_watcher(
5175                 const bluetooth_device_address_t *address, gboolean enable);
5176
5177 /**
5178  * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5179  *                                              bt_gatt_service_property_t *service);
5180  *
5181  * @brief Gets the properties of GATT based service of remote device
5182  *
5183  * This function is a synchronous call.
5184  * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5185  *
5186  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5187  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5188  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5189  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5190  *
5191  * @exception   None
5192  * @param[in]   service_handle - Handle for remote service.
5193  * @param[out]  service - Structure containing remote service property.
5194  *
5195  * @remark      None
5196  * @see         bluetooth_gatt_free_service_property()
5197  */
5198 int bluetooth_gatt_get_service_property(const char *service_handle,
5199                                                 bt_gatt_service_property_t *service);
5200
5201 /**
5202  * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
5203  *
5204  * @brief Register to GATT based service to receive value change notification/indication.
5205  *
5206  * This function is a synchronous call.
5207  * No event for this api.
5208  *
5209  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5210  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5211  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5212  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5213  *
5214  * @exception   None
5215  * @param[in]   service_handle - Handle for remote service.
5216  *
5217  * @remark      None
5218  * @see None
5219  */
5220 int bluetooth_gatt_watch_characteristics(const char *service_handle);
5221
5222 /**
5223  * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5224  *
5225  * @brief Unregister GATT based service to receive value change notification/indication.
5226  *
5227  * This function is a synchronous call.
5228  * No event for this api.
5229  *
5230  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5231  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5232  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5233  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5234  *
5235  * @exception   None
5236  * @param[in]   service_handle - Handle for remote service.
5237  *
5238  * @remark      None
5239  * @see         None
5240  */
5241 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5242
5243 /**
5244  * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5245  *                                              bt_gatt_char_property_t *characteristic);
5246  *
5247  * @brief Provides characteristic value along with properties.
5248  *
5249  * This function is a synchronous call.
5250  * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5251  *
5252  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5253  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5254  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5255  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5256  *
5257  * @exception   None
5258  * @param[in]   char_handle - Handle for Characteristic property.
5259  * @param[out] characteristic - Structure containing remote characteristic property.
5260  *
5261  * @remark      None
5262  * @see         bluetooth_gatt_free_char_property()
5263  */
5264 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5265                                                 bt_gatt_char_property_t *characteristic);
5266
5267 /**
5268  * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5269  *                                              bt_gatt_char_property_t *characteristic);
5270  *
5271  * @brief Provides characteristic descriptor value along with its UUID.
5272  *
5273  * This function is a synchronous call.
5274  * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5275  *
5276  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5277  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5278  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5279  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5280  *
5281  * @exception   None
5282  * @param[in]   desc_handle - Handle for Characteristic descriptor.
5283  * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5284  *
5285  * @remark      None
5286  * @see         bluetooth_gatt_free_desc_property()
5287  */
5288 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5289                                                 bt_gatt_char_descriptor_property_t *descriptor);
5290
5291
5292 /**
5293  * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5294  *                                              const guint8 *value, int length)
5295  *
5296  * @brief Set characteristic value.
5297  *
5298  * This function is a synchronous call.
5299  *
5300  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5301  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5302  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5303  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5304  *
5305  * @exception   None
5306  * @param[in]   char_handle - Handle for Characteristic property.
5307  * @param[in]   value - New value to set for characteristic property.
5308  * @param[in]   length - Length of the value to be set.
5309  *
5310  * @remark      None
5311  * @see         None
5312  */
5313 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5314                                                 const guint8 *value, int length);
5315
5316 /**
5317  * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5318  *                              const guint8 *value, int length, guint8 write_type)
5319  *
5320  * @brief Set characteristic value by write type.
5321  *
5322  * This function is a synchronous call if write type is "write without resonse"
5323  * and it is an asynchronous call if write type is "write with response"
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  * @param[in]   value - New value to set for characteristic property.
5333  * @param[in]   length - Length of the value to be set.
5334  * @param[in]   write_type - Type of write.
5335  *
5336  * @remark      None
5337  * @see         None
5338  */
5339 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5340                                         const guint8 *value, int length,
5341                                         guint8 write_type, gpointer app_data);
5342
5343
5344 /**
5345  * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5346  *                                              const guint8 *value, int length)
5347  *
5348  * @brief Set characteristic value request.
5349  *
5350  * This function is an asynchronous call.
5351  *
5352  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5353  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5354  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5355  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5356  *
5357  * @exception   None
5358  * @param[in]   char_handle - Handle for Characteristic property.
5359  * @param[in]   value - New value to set for characteristic property.
5360  * @param[in]   length - Length of the value to be set.
5361   *
5362  * @remark      None
5363  * @see         None
5364  */
5365 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5366                                                 const guint8 *value, int length);
5367
5368 /**
5369  * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5370  *
5371  * @brief Read characteristic value.
5372  *
5373  * This function is a asynchronous call.
5374  *
5375  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5376  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5377  *             BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5378  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5379  *
5380  * @exception  None
5381  * @param[in]  char_handle - Handle for Characteristic property.
5382  *
5383  * @remark     None
5384  * @see        None
5385  */
5386 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5387
5388 /**
5389  * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5390  *                                      const char *service_uuid,
5391  *                                      bt_gatt_service_property_t *service)
5392  *
5393  * @brief Gets the service property from a device based on a particular uuid
5394  *
5395  * This function is a synchronous call.
5396  *
5397  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5398  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5399  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5400  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5401  *
5402  * @exception   None
5403  * @param[in]   address - BD address of the remote device
5404  * @param[in]   service_uuid - uuid of the service.
5405  * @param[out] service - Structure containing the service property.
5406  *
5407  * @remark      None
5408  * @see         None
5409  */
5410 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5411                                         const char *service_uuid,
5412                                         bt_gatt_service_property_t *service);
5413
5414 /**
5415  * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5416  *                                                      const char *char_uuid)
5417  *
5418  * @brief Gets the characteristic property from a service based on a particular char uuid
5419  *
5420  * This function is an asynchronous call.
5421  * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5422  *
5423  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5424  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5425  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5426  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5427  *
5428  * @exception   None
5429  * @param[in]   service_handle - Service handle.
5430  * @param[in]   uuid - Characteristic uuid.
5431  *
5432  * @remark      None
5433  * @see         None
5434  */
5435 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5436                                                 const char *char_uuid);
5437
5438 /**
5439  * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5440  *
5441  * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5442  *
5443  * This function is a synchronous call.
5444  * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5445  *
5446  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5447  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5448  *
5449  * @exception   None
5450  * @param[in]   prim_svc - GATT handle info structure
5451  *
5452  * @remark      None
5453  * @see         bluetooth_gatt_get_primary_services()
5454  */
5455 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5456
5457 /**
5458  * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5459  *
5460  * @brief  Releases the memory allocated by bluetooth_gatt_get_service_property()
5461  *
5462  * This function is a synchronous call.
5463  * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5464  *
5465  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5466  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5467  *
5468  * @exception   None
5469  * @param[in]   svc_pty - GATT service property structure.
5470  *
5471  * @remark      None
5472  * @see         bluetooth_gatt_get_service_property()
5473  */
5474 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5475
5476 /**
5477  * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5478  *
5479  * @brief Provides characteristic value along with properties.
5480  *
5481  * This function is a synchronous call.
5482  * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5483  *
5484  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5485  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5486  *
5487  * @exception   None
5488  * @param[in]   char_pty - GATT characteristics property structure.
5489  *
5490  * @remark      None
5491  * @see         bluetooth_gatt_get_characteristics_property()
5492  */
5493 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5494
5495 /**
5496  * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5497  *
5498  * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5499  *
5500  * This function is a synchronous call.
5501  * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5502  *
5503  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5504  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5505  *
5506  * @exception   None
5507  * @param[in]   desc_pty - GATT characteristics descriptor property structure.
5508  *
5509  * @remark      None
5510  * @see         bluetooth_gatt_get_char_descriptor_property()
5511  */
5512 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5513
5514 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5515
5516 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5517
5518  /**
5519  * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5520  *
5521  * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5522  *
5523  * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5524  *
5525  * @return  BLUETOOTH_ERROR_NONE  - Success \n
5526  *                      BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5527  *
5528  * @exception   None
5529  * @param[in]   characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5530  *
5531  * @remark      None
5532  */
5533 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5534
5535 /**
5536  * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5537  *
5538  * @brief Read characteristic descriptor value.
5539  *
5540  * This function is a asynchronous call.
5541  *
5542  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5543  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5544  *             BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5545  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5546  *
5547  * @exception  None
5548  * @param[in]  desc_handle - Handle for Characteristic descriptor
5549  *
5550  * @remark     None
5551  * @see        None
5552  */
5553 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5554
5555 /**
5556  * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5557  *                      const guint8 *value, int length);
5558  *
5559  * @brief Set characteristic descriptor value.
5560  *
5561  * This function is a asynchronous call.
5562  *
5563  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5564  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5565  *             BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5566  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5567  *
5568  * @exception  None
5569  * @param[in]  desc_handle - Handle for Characteristic descriptor
5570  * @param[in]  value - New value to set for characteristic descriptor
5571  * @param[in]  length - Length of the value to be set.
5572  *
5573  * @remark     None
5574  * @see        None
5575  */
5576 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5577                         const guint8 *value, int length, gpointer app_data);
5578
5579 /* @fn int bluetooth_gatt_init(void)
5580 *
5581 * @brief Initializes the gatt service.
5582 *
5583 * This function is a synchronous call.
5584 * @return   BLUETOOTH_ERROR_NONE        - Success \n
5585 *       BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5586 *       BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5587 *       BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5588 *
5589 * @exception     None
5590 * @remark  Adapter should be enabled
5591 * @see  bluetooth_gatt_deinit()
5592 */
5593 int bluetooth_gatt_init(void);
5594
5595 /* @fn int bluetooth_gatt_init(void)
5596 *
5597 * @brief DeInitializes the gatt service.
5598 *
5599 * This function is a synchronous call.
5600 * @return   BLUETOOTH_ERROR_NONE        - Success \n
5601 *       BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5602 *       BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5603 *       BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5604 *
5605 * @exception     None
5606 * @remark  Adapter should be enabled
5607 * @see  bluetooth_gatt_init()
5608 */
5609 int bluetooth_gatt_deinit(void);
5610
5611 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5612                         unsigned char **svc_path)
5613 *
5614 * @brief Exports a new gatt service to the service interface.
5615 *
5616 * This function is a synchronous call.
5617 *
5618 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5619 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5620 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5621 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5622 *
5623 * @exception     None
5624 * @param[in]   svc_uuid  Gatt service uuid.
5625 * @param[out] svc_path  service object path of the exported service.
5626 * @remark  Adapter should be enabled
5627 * @see  bluetooth_gatt_init()
5628 */
5629 int bluetooth_gatt_add_service(const char *svc_uuid,
5630                         char **svc_path);
5631
5632 /* @fn int bluetooth_gatt_add_new_characteristic(
5633                         const char *svc_path, const char *char_uuid,
5634                         bt_gatt_permission_t permissions,
5635                         bt_gatt_characteristic_property_t properties,
5636                         int flags_length, char **char_path);;
5637 *
5638 * @brief Exports a new gatt characteristic to the characteristic interface.
5639 *
5640 * This function is a synchronous call.
5641 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5642 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5643 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5644 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5645 * @exception     None
5646 * @param[in]   svc_path service object path of the exported service.
5647 * @param[in]   char_uuid  Gatt service uuid.
5648 * @param[in]   properties       GATT characteristic properties.
5649 * @param[out] char_path characteristic object path of the exported characteristic.
5650 *
5651 * @remark  Adapter should be enabled
5652 * @see  bluetooth_gatt_add_service()
5653 */
5654 int bluetooth_gatt_add_new_characteristic(
5655                         const char *svc_path, const char *char_uuid,
5656                         bt_gatt_permission_t permissions,
5657                         bt_gatt_characteristic_property_t properties,
5658                         char **char_path);
5659
5660 /* @fn bluetooth_gatt_set_characteristic_value(
5661                         const char *characteristic, const char *char_value,
5662                         int value_length);
5663 *
5664 * @brief adds gatt charactertisic value to the given charactertistic path.
5665 *
5666 * This function is a synchronous call.
5667 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5668 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5669 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5670 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5671 * @exception     None
5672 * @param[in]   char_value Value of the GATT characteristic to be added.
5673 * @param[in]   value_length length of the chantacteristic value..
5674 * @param[out] characteristic characteristic object path..
5675 *
5676 * @remark  Adapter should be enabled
5677 * @see  bluetooth_gatt_add_service()
5678 */
5679 int bluetooth_gatt_set_characteristic_value(
5680                         const char *characteristic, const char *char_value,
5681                         int value_length);
5682
5683 /* @fn  int bluetooth_gatt_add_descriptor(
5684                         const char *char_path, const char *desc_uuid,
5685                         bt_gatt_permission_t permissions,
5686                         char **desc_path);
5687 *
5688 * @brief Exports a new gatt descriptor to the descriptor interface.
5689 *
5690 * This function is a synchronous call.
5691 *
5692 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5693 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5694 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5695 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5696 *
5697 * @exception    None
5698 * @param[in]    desc_uuid  Gatt descriptor uuid.
5699 * @param[in]    desc_value      GATT descriptor value.
5700 * @param[in]    value_length    Length of GATT descriptor value.
5701 * @param[in]    permissions     descriptor permissions.
5702 * @param[in]    properties      GATT descriptor properties.
5703 * @param[in]    char_path       characteristics object path of the exported character.
5704 *
5705 * @remark  Adapter should be enabled
5706 * @see  bluetooth_gatt_add_service()
5707 * @see  bluetooth_gatt_add_characteristics()
5708 */
5709 int bluetooth_gatt_add_descriptor(
5710                         const char *char_path, const char *desc_uuid,
5711                         bt_gatt_permission_t permissions,
5712                         char **desc_path);
5713
5714 /* @fn int bluetooth_gatt_set_descriptor_value(
5715                    const char *desc_path, const char *desc_value,
5716                    int value_length);
5717 *
5718 * @brief Adds value to the given descriptor handle.
5719 *
5720 * This function is a synchronous call.
5721 *
5722 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5723 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5724 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5725 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5726 *
5727 * @exception     None
5728 * @param[in]   desc_value       GATT descriptor value.
5729 * @param[in]   value_length     Length of GATT descriptor value.
5730 * @param[in]   desc_path descriptor path to which the value needs to be added.
5731 *
5732 * @remark  Adapter should be enabled
5733 * @see  bluetooth_gatt_add_service()
5734 * @see  bluetooth_gatt_add_characteristics()
5735 */
5736 int bluetooth_gatt_set_descriptor_value(
5737                    const char *desc_path, const char *desc_value,
5738                    int value_length);
5739
5740 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5741 *
5742 * @brief Reads the Service registered on manager interface.
5743 *
5744 * This function is a synchronous call.
5745 *
5746 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5747 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5748 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5749 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5750 *
5751 * @exception     None
5752 * @param[in]   svc_uuid  Gatt Service uuid.
5753 *
5754 * @remark  Adapter should be enabled and service should be registered.
5755 * @see  bluetooth_gatt_register_service()
5756 */
5757 int bluetooth_gatt_get_service(const char *svc_uuid);
5758
5759 /* @fn int bluetooth_gatt_register_service(const  char *svc_path)
5760 *
5761 * @brief Registers the given service path with the library.
5762 *
5763 * This function is a synchronous call.
5764 *
5765 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5766 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5767 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5768 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5769 *
5770 * @exception     None
5771 * @param[in] svc_path   service object path of the exported service.
5772 *
5773 * @remark  Adapter should be enabled
5774 * @see  bluetooth_gatt_add_service()
5775 * @see  bluetooth_gatt_add_characteristics()
5776 * @see  bluetooth_gatt_add_descriptor()
5777 * @see  bluetooth_gatt_register_application()
5778 */
5779 int bluetooth_gatt_register_service(const char *svc_path);
5780
5781 /* @fn int bluetooth_gatt_register_application(void)
5782 *
5783 * @brief Registers the application with the bluez gatt server.
5784 *
5785 * This function is a synchronous call.
5786 *
5787 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5788 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5789 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5790 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5791 *
5792 * @exception     None
5793 *
5794 * @remark  Adapter should be enabled
5795 * @see  bluetooth_gatt_init()
5796 * @see  bluetooth_gatt_add_service()
5797 * @see  bluetooth_gatt_add_characteristics()
5798 * @see  bluetooth_gatt_add_descriptor()
5799 * @see  bluetooth_gatt_register_service()
5800 */
5801 int bluetooth_gatt_register_application(void);
5802
5803 /* @fn int bluetooth_gatt_unregister_service(const  char *svc_path)
5804 *
5805 * @brief Removes(unregister) service from the bluez gatt server db.
5806 *
5807 * This function is a synchronous call.
5808 *
5809 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5810 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5811 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5812 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5813 *
5814 * @exception     None
5815 * @param[in] svc_path   service object path of the exported service.
5816 *
5817 * @remark  Adapter should be enabled
5818 * @see  bluetooth_gatt_add_service()
5819 * @see  bluetooth_gatt_add_characteristics()
5820 * @see  bluetooth_gatt_add_descriptor()
5821 * @see bluetooth_gatt_register_service()
5822 */
5823 int bluetooth_gatt_unregister_service(const char *svc_path);
5824
5825 /* @fn int bluetooth_gatt_unregister_application(void)
5826 *
5827 * @brief Removes(unregister) the application with the bluez gatt server,
5828 *        and deletes all the service registered.
5829 *
5830 * This function is a synchronous call.
5831 *
5832 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5833 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5834 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5835 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5836 *
5837 * @exception     None
5838 *
5839 * @remark  Adapter should be enabled
5840 * @see  bluetooth_gatt_init()
5841 * @see  bluetooth_gatt_add_service()
5842 * @see  bluetooth_gatt_add_characteristics()
5843 * @see  bluetooth_gatt_add_descriptor()
5844 * @see  bluetooth_gatt_register_service()
5845 * @see  bluetooth_gatt_unregister_service()
5846 */
5847 int bluetooth_gatt_unregister_application(void);
5848
5849 /* @fn int bluetooth_gatt_send_response(int request_id,
5850 *                               int offset, char *value, int value_length)
5851 *
5852 * @brief Updates the attribute value in local attribute list.
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 * @param[in] request_id The identification of a read request
5863 * @param[in] req_type The identification of  request type (TRUE for Read request and FALSE for write request)
5864 * @param[in] resp_state The identification of response state
5865 * @param[in] offset The offset from where a value is read
5866 * @param[in] value The value to be sent. It will be sent from @a offset.
5867 *               If it is NULL, a requested GATT handle's value will be sent from @a offset.
5868 * @param[in] value_length Value Length.
5869 *
5870 * @remark  Adapter should be enabled
5871 * @see  bluetooth_gatt_add_service()
5872 * @see  bluetooth_gatt_add_characteristics()
5873 * @see  bluetooth_gatt_add_descriptor()
5874 * @see bluetooth_gatt_register_service()
5875 */
5876 int bluetooth_gatt_send_response(int request_id, guint req_type,
5877                                 int resp_state, int offset, char *value, int value_length);
5878
5879 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5880 *
5881 * @brief Sets the notification property for a characteristic.
5882 *
5883 * This function is a synchronous call.
5884 *
5885 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5886 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5887 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5888 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5889 *
5890 * @exception     None
5891 * @param[in] char_path characteristic object path.
5892 * @param[in]   unicast_address remote device address. if set notification is sent to only one device.
5893 *
5894 * @remark  Adapter should be enabled
5895 * @see  bluetooth_gatt_update_characteristic()
5896 */
5897 int bluetooth_gatt_server_set_notification(const char *char_path,
5898                                 bluetooth_device_address_t *unicast_address);
5899
5900 /* @fn int bluetooth_gatt_delete_services(void)
5901 *
5902 * @brief deletes (unregisters) all services from the gatt server database..
5903 *
5904 * This function is a synchronous call.
5905 *
5906 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5907 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5908 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5909 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5910 *
5911 * @exception     None
5912 *
5913 * @remark  Adapter should be enabled
5914 * @see  bluetooth_gatt_add_service()
5915 * @see  bluetooth_gatt_add_characteristics()
5916 * @see  bluetooth_gatt_add_descriptor()
5917 * @see bluetooth_gatt_register_service()
5918 * @see bluetooth_gatt_unregister_service()
5919 */
5920 int bluetooth_gatt_delete_services(void);
5921
5922 /* @fn int bluetooth_gatt_update_characteristic(void)
5923 *
5924 * @brief updates the given characteristic with a new value
5925 *
5926 * This function is a synchronous call.
5927 *
5928 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5929 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5930 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5931 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5932 *
5933 * @exception     None
5934 *
5935 * @remark  Adapter should be enabled
5936 * @see  bluetooth_gatt_add_service()
5937 * @see  bluetooth_gatt_add_characteristics()
5938 * @see  bluetooth_gatt_add_descriptor()
5939 * @see bluetooth_gatt_register_service()
5940 * @see bluetooth_gatt_unregister_service()
5941 */
5942 int bluetooth_gatt_update_characteristic(const char *char_path,
5943                 const char* char_value, int value_length);
5944
5945 /**
5946  * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5947  *
5948  * @brief Set advertising status.
5949  *
5950  * This function is used to enable or disable LE advertising.
5951  * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5952  *
5953  * This function is a synchronous call.
5954  *
5955  * @return      BLUETOOTH_ERROR_NONE - Success \n
5956  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5957  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5958  *
5959  * @exception   None
5960  * @param[in]   enable - The status of advertising
5961  *
5962  * @remark      None
5963  * @see         bluetooth_set_advertising_data
5964  */
5965 int bluetooth_set_advertising(int handle, gboolean enable);
5966
5967 /**
5968  * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5969  *
5970  * @brief Set advertising status along with interval value.
5971  *
5972  * This function is used to enable or disable LE advertising.
5973  * Interval_min and Interval_max is used to set the best advertising interval.
5974  * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5975  *
5976  * This function is a synchronous call.
5977  *
5978  * @return      BLUETOOTH_ERROR_NONE - Success \n
5979  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5980  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5981  *
5982  * @exception   None
5983  * @param[in]   enable - The status of advertising
5984  * @param[in]   interval_min - Minimum interval of advertising (msec)
5985  * @param[in]   interval_max - Maximum interval of advertising (msec)
5986  * @param[in]   filter_policy - Advertising filter policy
5987  *
5988  * @remark      None
5989  * @see         bluetooth_set_advertising_data
5990  */
5991 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5992                                         bluetooth_advertising_params_t *params);
5993
5994 /**
5995  * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5996  * @brief Get the advertising data
5997  *
5998  * This function is used to get advertising data.
5999  * Before calling this API, the adapter should be enabled.
6000  *
6001  * This function is a synchronous call.
6002  *
6003  * @return      BLUETOOTH_ERROR_NONE - Success \n
6004  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6005  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6006  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6007  *
6008  * @param[out]  value - Advertising data structure.
6009  * @param[out]  length - The length of Advertising data.
6010  *
6011  * @remark      None
6012 @code
6013 bluetooth_advertising_data_t *value = { {0} };
6014 int length;
6015 int ret = 0;
6016 ret = bluetooth_get_advertising_data(&value, &length);
6017 @endcode
6018  */
6019 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6020
6021 /**
6022  * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6023  *
6024  * @brief Set advertising data with value
6025  *
6026  * This function is used to set advertising data and Maximum size of advertising data
6027  *  is 28 byte (Except Flag)
6028  *
6029  * This function is a synchronous call.
6030  *
6031  * @return      BLUETOOTH_ERROR_NONE - Success \n
6032  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6033  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6034  *
6035  * @exception   None
6036  * @param[in]   value - Advertising data structure.
6037  *
6038  * @remark      None
6039  */
6040 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6041
6042 /**
6043  * @fn int bluetooth_check_privilege_advertising_parameter(void);
6044  *
6045  * @brief Check the privilege for advertising parameter setting
6046  *
6047  * This function is a synchronous call.
6048  *
6049  * @return      BLUETOOTH_ERROR_NONE - Success \n
6050  *              BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6051  *
6052  * @exception   None
6053  *
6054  * @remark      None
6055  */
6056 int bluetooth_check_privilege_advertising_parameter(void);
6057
6058 /**
6059  * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6060  * @brief Get the LE scan response data
6061  *
6062  * This function is used to get scan response data.
6063  * Before calling this API, the adapter should be enabled.
6064  *
6065  * This function is a synchronous call.
6066  *
6067  * @return      BLUETOOTH_ERROR_NONE - Success \n
6068  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6069  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6070  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6071  *
6072  * @param[out]  value - Scan response data structure.
6073  * @param[out]  length - The length of Scan response data.
6074  *
6075  * @remark      None
6076 @code
6077 bluetooth_scan_resp_data_t *value = { {0} };
6078 int length;
6079 int ret = 0;
6080 ret = bluetooth_get_scan_response_data(&value, &length);
6081 @endcode
6082  */
6083 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6084
6085 /**
6086  * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6087  *
6088  * @brief Set scan response data with value
6089  *
6090  * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6091  *
6092  * This function is a synchronous call.
6093  *
6094  * @return      BLUETOOTH_ERROR_NONE - Success \n
6095  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6096  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6097  *
6098  * @exception   None
6099  * @param[in]   value - LE Scan response data structure.
6100  *
6101  * @remark      None
6102  */
6103 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6104
6105 /**
6106  * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6107  *
6108  * @brief Set scan interval and window
6109  *
6110  * This function is used to set LE scan interval and window size
6111  *
6112  * This function is a synchronous call.
6113  *
6114  * @return      BLUETOOTH_ERROR_NONE - Success \n
6115  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6116  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6117  *
6118  * @exception   None
6119  * @param[in]   interval - Interval of LE scan (msec)
6120  * @param[in]   window - Window size of LE scan (msec)
6121  *
6122  * @remark      None
6123  */
6124 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6125
6126 /**
6127  * @fn int bluetooth_is_advertising(void)
6128  * @brief Check for the advertising is in-progress or not.
6129  *
6130  * This API is used to check the current status of the advertising procedure.
6131  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6132  * this API.
6133  *
6134  * This function checks whether the advertising is started or not.
6135  *
6136  * This function is a synchronous call.
6137  *
6138  * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c  false = not in progress)
6139  *
6140  * @return      BLUETOOTH_ERROR_NONE - Success \n
6141  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6142  *
6143  * @remark      None
6144  * @see         bluetooth_set_advertising, bluetooth_set_custom_advertising
6145
6146 @code
6147 int ret;
6148 gboolean is_advertising = 0;
6149
6150 ret = bluetooth_is_advertising(&is_advertising);
6151 @endcode
6152  */
6153 int bluetooth_is_advertising(gboolean *is_advertising);
6154
6155 /**
6156  * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6157  * @brief Add LE device to white list
6158  *
6159  * This API is used to add LE device to white list
6160  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6161  * this API.
6162  *
6163  *
6164  * This function is a synchronous call.
6165  *
6166  * @param[in] address The address of remote device
6167  *
6168  * @return      BLUETOOTH_ERROR_NONE - Success \n
6169  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6170  *
6171  * @remark      None
6172  * @see         bluetooth_set_custom_advertising
6173  */
6174 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6175
6176 /**
6177  * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6178  * @brief Remove LE device from white list
6179  *
6180  * This API is used to remove LE device from white list
6181  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6182  * this API.
6183  *
6184  *
6185  * This function is a synchronous call.
6186  *
6187  * @param[in] address The address of remote device
6188  *
6189  * @return      BLUETOOTH_ERROR_NONE - Success \n
6190  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6191  *
6192  * @remark      None
6193  * @see         bluetooth_set_custom_advertising
6194  */
6195 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6196
6197 /**
6198  * @fn int bluetooth_clear_white_list(void)
6199  * @brief Clear white list
6200  *
6201  * This API is used to clear white list
6202  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6203  * this API.
6204  *
6205  *
6206  * This function is a synchronous call.
6207  *
6208  * @param[in] address The address of remote device
6209  *
6210  * @return      BLUETOOTH_ERROR_NONE - Success \n
6211  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6212  *
6213  * @remark      None
6214  * @see         bluetooth_set_custom_advertising
6215  */
6216 int bluetooth_clear_white_list(void);
6217
6218 /**
6219  * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6220  *          const bluetooth_le_connection_param_t *parameters)
6221  * @brief update connection paramter of LE connection.
6222  *
6223  * This function is a synchronous call.
6224  *
6225  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6226  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6227  *
6228  * @exception  None
6229  * @param[in]  address - remote device address value.
6230  * @param[in]  parameters - new connection parameters.
6231  *
6232  * @remark       None
6233  * @see     bluetooth_bond_device
6234  */
6235 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6236                 const bluetooth_le_connection_param_t *parameters);
6237
6238 /**
6239  * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6240  *
6241  * @brief Enable/Disable LE Privacy feature.
6242  *
6243  * This function is used to enable or disable LE Privacy feature.
6244  * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6245  *
6246  * This function is a synchronous call.
6247  *
6248  * @return      BLUETOOTH_ERROR_NONE - Success \n
6249  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6250  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6251  *
6252  * @exception   None
6253  * @param[in]   enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6254  *
6255  * @remark      None
6256  */
6257 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6258
6259 /**
6260  * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6261  *
6262  * @brief Enable/Disable LE static random address.
6263  *
6264  * This function is used to enable or disable LE static random address.
6265  *
6266  * This function is a synchronous call.
6267  *
6268  * @return      BLUETOOTH_ERROR_NONE - Success \n
6269  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6270  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6271  *
6272  * @exception   None
6273  * @param[in]   enable - The status of LE static random address to be activated/deactivated[True/False].
6274  *
6275  * @remark      None
6276  */
6277 int bluetooth_set_le_static_random_address(gboolean enable);
6278
6279 /**
6280  * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6281  *                                             bluetooth_le_connection_mode_t mode)
6282  * @brief update connection paramter of LE connection.
6283  *
6284  * This function is a synchronous call.
6285  *
6286  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6287  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6288  *           BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6289  *
6290  * @exception  None
6291  * @param[in]  address - remote device address value.
6292  * @param[in]  mode - new connection mode.
6293  *
6294  * @remark       None
6295  */
6296 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6297                 bluetooth_le_connection_mode_t mode);
6298
6299 /**
6300  * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6301  * @brief Request for new ATT MTU value.
6302  *
6303  * This function is a asynchronous call.
6304  *
6305  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6306  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6307  *           BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6308  *
6309  * @exception  None
6310  * @param[in]  address - remote device address value.
6311  * @param[in]  mtu - MTU value to be set.
6312  *
6313  * @remark       None
6314  */
6315 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6316
6317 /**
6318  * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6319  *                              unsigned int *mtu)
6320  * @brief Gets the xisting MTU value set for a connection.
6321  *
6322  * This function is a synchronous call.
6323  *
6324  * @return       BLUETOOTH_ERROR_NONE  - Success \n
6325  *                       BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6326  *                       BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6327  *
6328  * @exception  None
6329  * @param[in]  address - remote device address value.
6330  * @param[out]  mtu - MTU value set for the connection.
6331  *
6332  * @remark               None
6333  */
6334 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6335                                 unsigned int *mtu);
6336
6337 /**
6338  * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6339  *                                      bluetooth_device_address_t *id_address)
6340  * @brief Gets the Identity address of remote device.
6341  *
6342  * This function is a synchronous call.
6343  *
6344  * @return              BLUETOOTH_ERROR_NONE  - Success \n
6345  *                      BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6346  *                      BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6347  *
6348  * @exception  None
6349  * @param[in]  device_rpa - remote Resolvable private address.
6350  * @param[out] id_address - remote Identity device address value.
6351  *
6352  * @remark               None
6353  */
6354 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6355         bluetooth_device_address_t *id_address);
6356
6357 /**
6358  * @fn int bluetooth_le_read_maximum_data_length()
6359  * @brief reads the maximum LE data length supported in the controller.
6360  *
6361  * This function is a synchronous call.
6362  *
6363  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6364  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6365  *
6366  * @exception  None
6367  *
6368  * @remark       None
6369  */
6370 int bluetooth_le_read_maximum_data_length(
6371                         bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6372 /**
6373  * @fn int bluetooth_le_write_host_suggested_default_data_length()
6374  * @brief writes the host suggested values for the controllers max transmitted no of payload
6375  * octects to be used for new connections.
6376  *
6377  * This function is a synchronous call.
6378  *
6379  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6380  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6381  *
6382  * @exception  None
6383  *
6384  * @remark       None
6385  */
6386 int bluetooth_le_write_host_suggested_default_data_length(
6387                 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6388
6389 int bluetooth_le_read_suggested_default_data_length(
6390         bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6391
6392 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6393         const unsigned int max_tx_octets, const unsigned int max_tx_time);
6394
6395 int bluetooth_pbap_init(void);
6396 int bluetooth_pbap_deinit(void);
6397 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6398 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6399 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6400                 bt_pbap_folder_t *folder);
6401 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6402                 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6403 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6404                 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6405 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6406                 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6407 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6408                 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6409
6410 /**
6411  * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6412  *
6413  * @brief Set manufacturer data with value
6414  *
6415  * This function is used to set manufacturer data.
6416  *
6417  * This function is a synchronous call.
6418  *
6419  * @return      BLUETOOTH_ERROR_NONE - Success \n
6420  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6421  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6422  *
6423  * @exception   None
6424  * @param[in]   value - Manufacturer data structure.
6425  *
6426  * @remark      None
6427  */
6428 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6429
6430 int bluetooth_set_passkey_notification(gboolean enable);
6431
6432 /**
6433  * @fn int bluetooth_dpm_is_mode_allowed(void);
6434  *
6435  * @brief Checks Restriction for BT mode(BT allowed or not)
6436  *
6437  * This function is a synchronous call.
6438  *
6439  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6440  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6441  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6442  *
6443  * @exception   None
6444  *  @param[in] None
6445  *
6446  * @remark      None
6447  */
6448 int bluetooth_dpm_is_mode_allowed(void);
6449
6450 /**
6451  * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6452  *
6453  * @brief Sets Restriction for BT mode(BT allowed or not)
6454  *
6455  * This function is a synchronous call.
6456  *
6457  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6458  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6459  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6460  *
6461  * @exception   None
6462  * @param[in]   value - BT Allow value.
6463  *              BLUETOOTH_DPM_ERROR  = -1,       < bluetooth allowance error
6464  *              BLUETOOTH_DPM_BT_ALLOWED,                < bluetooth allowance allowed
6465  *              BLUETOOTH_DPM_HANDSFREE_ONLY,  < bluetooth allowance handsfree only
6466  *              BLUETOOTH_DPM_BT_RESTRICTED,  < bluetooth allowance restricted
6467  *
6468  * @remark      None
6469  */
6470 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6471
6472 /**
6473  * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6474  *
6475  * @brief Reads the Restriction for BT mode(BT allowed or not)
6476  *
6477  * This function is a synchronous call.
6478  *
6479  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6480  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6481  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6482  *
6483  * @exception   None
6484  *  @param[in] None
6485  * @param[out]  value - BT Allow value.
6486  *              BLUETOOTH_DPM_ERROR      = -1,   < bluetooth allowance error
6487  *              BLUETOOTH_DPM_BT_ALLOWED,                < bluetooth allowance allowed
6488  *              BLUETOOTH_DPM_HANDSFREE_ONLY,  < bluetooth allowance handsfree only
6489  *              BLUETOOTH_DPM_BT_RESTRICTED,  < bluetooth allowance restricted
6490  *
6491  * @remark      None
6492  */
6493 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6494
6495 /**
6496  * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6497  *
6498  * @brief Sets the Restriction for device.
6499  *
6500  * This function is a synchronous call.
6501  *
6502  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6503  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6504  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6505  *
6506  * @exception   None
6507  * @param[in]   value - State value.
6508  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6509  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6510  *
6511  * @remark      None
6512  */
6513 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6514
6515 /**
6516  * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6517  *
6518  * @brief Reads the Restriction for device.
6519  *
6520  * This function is a synchronous call.
6521  *
6522  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6523  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6524  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6525  *
6526  * @exception   None
6527  * @param[in] None
6528  * @param[out]  value - State value.
6529  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6530  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6531  *
6532  * @remark      None
6533  */
6534 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6535
6536 /**
6537  * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6538  *
6539  * @brief Sets the Restriction for uuid.
6540  *
6541  * This function is a synchronous call.
6542  *
6543  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6544  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6545  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6546  *
6547  * @exception   None
6548  * @param[in]   value - State value.
6549  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6550  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6551  *
6552  * @remark      None
6553  */
6554 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6555
6556 /**
6557  * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6558  *
6559  * @brief Reads the Restriction for uuid.
6560  *
6561  * This function is a synchronous call.
6562  *
6563  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6564  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6565  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6566  *
6567  * @exception   None
6568  * @param[in] None
6569  * @param[out]  value - State value.
6570  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6571  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6572  *
6573  * @remark      None
6574  */
6575 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6576
6577 /**
6578  * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6579  *
6580  * @brief Adds the device to blacklist.
6581  *
6582  * This function is a synchronous call.
6583  *
6584  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6585  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6586  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6587  *
6588  * @exception   None
6589  * @param[in]   device_address - Device address
6590  *
6591  * @remark      None
6592  */
6593 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6594
6595 /**
6596  * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6597  *
6598  * @brief Adds the device to whitelist.
6599  *
6600  * This function is a synchronous call.
6601  *
6602  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6603  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6604  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6605  *
6606  * @exception   None
6607  * @param[in]   device_address - Device address
6608  *
6609  * @remark      None
6610  */
6611 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6612
6613 /**
6614  * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6615  *
6616  * @brief Adds the Service UUIDS to blacklist.
6617  *
6618  * This function is a synchronous call.
6619  *
6620  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6621  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6622  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6623  *
6624  * @exception   None
6625  * @param[in]   service_uuids - profile or custom service uuids
6626  *
6627  * @remark      None
6628  */
6629 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6630
6631 /**
6632  * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6633  *
6634  * @brief Adds the Service UUIDS to whitelist.
6635  *
6636  * This function is a synchronous call.
6637  *
6638  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6639  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6640  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6641  *
6642  * @exception   None
6643  * @param[in]   service_uuids - profile or custom service uuids
6644  *
6645  * @remark      None
6646  */
6647 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6648
6649 /**
6650  * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6651  *
6652  * @brief Clears the devices from blacklist.
6653  *
6654  * This function is a synchronous call.
6655  *
6656  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6657  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6658  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6659  *
6660  * @exception   None
6661  * @param[in]   None
6662  *
6663  * @remark      None
6664  */
6665 int bluetooth_dpm_clear_devices_from_blacklist(void);
6666
6667 /**
6668  * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6669  *
6670  * @brief Clears the devices from whitelist.
6671  *
6672  * This function is a synchronous call.
6673  *
6674  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6675  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6676  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6677  *
6678  * @exception   None
6679  * @param[in]   None
6680  *
6681  * @remark      None
6682  */
6683 int bluetooth_dpm_clear_devices_from_whitelist(void);
6684
6685 /**
6686  * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6687  *
6688  * @brief Clears the uuids from blacklist.
6689  *
6690  * This function is a synchronous call.
6691  *
6692  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6693  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6694  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6695  *
6696  * @exception   None
6697  * @param[in]   None
6698  *
6699  * @remark      None
6700  */
6701 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6702
6703 /**
6704  * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6705  *
6706  * @brief Clears the uuids from whitelist.
6707  *
6708  * This function is a synchronous call.
6709  *
6710  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6711  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6712  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6713  *
6714  * @exception   None
6715  * @param[in]   None
6716  *
6717  * @remark      None
6718  */
6719 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6720
6721 /**
6722  * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6723  *
6724  * @brief reads the devices from blacklist.
6725  *
6726  * This function is a synchronous call.
6727  *
6728  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6729  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6730  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6731  *
6732  * @exception   None
6733  * @param[out]  device_list - list of devices
6734  *
6735  * @remark      None
6736  */
6737 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6738
6739 /**
6740  * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6741  *
6742  * @brief reads the devices from whitelist.
6743  *
6744  * This function is a synchronous call.
6745  *
6746  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6747  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6748  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6749  *
6750  * @exception   None
6751  * @param[out]  device_list - list of devices
6752  *
6753  * @remark      None
6754  */
6755 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6756
6757 /**
6758  * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6759  *
6760  * @brief reads the uuids from blacklist.
6761  *
6762  * This function is a synchronous call.
6763  *
6764  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6765  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6766  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6767  *
6768  * @exception   None
6769  * @param[in]   uuid_list - list of uuids
6770  *
6771  * @remark      None
6772  */
6773 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6774
6775 /**
6776  * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6777  *
6778  * @brief reads the uuids from whitelist.
6779  *
6780  * This function is a synchronous call.
6781  *
6782  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6783  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6784  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6785  *
6786  * @exception   None
6787  * @param[in]   uuid_list - list of uuids
6788  *
6789  * @remark      None
6790  */
6791 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6792
6793 /**
6794  * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6795  *
6796  * @brief Removes the device from whitelist.
6797  *
6798  * This function is a synchronous call.
6799  *
6800  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6801  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6802  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6803  *
6804  * @exception   None
6805  * @param[in]   device_address - Device address
6806  *
6807  * @remark      None
6808  */
6809 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6810
6811 /**
6812  * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6813  *
6814  * @brief Removes the device from blacklist.
6815  *
6816  * This function is a synchronous call.
6817  *
6818  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6819  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6820  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6821  *
6822  * @exception   None
6823  * @param[in]   device_address - Device address
6824  *
6825  * @remark      None
6826  */
6827 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6828
6829 /**
6830  * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6831  *
6832  * @brief Removes the Service UUIDS from whitelist.
6833  *
6834  * This function is a synchronous call.
6835  *
6836  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6837  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6838  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6839  *
6840  * @exception   None
6841  * @param[in]   service_uuids - profile or custom service uuids
6842  *
6843  * @remark      None
6844  */
6845 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6846
6847 /**
6848  * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6849  *
6850  * @brief Removes the Service UUIDS from blacklist.
6851  *
6852  * This function is a synchronous call.
6853  *
6854  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6855  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6856  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6857  *
6858  * @exception   None
6859  * @param[in]   service_uuids - profile or custom service uuids
6860  *
6861  * @remark      None
6862  */
6863 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6864
6865 /**
6866  * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6867  *
6868  * @brief Sets the Restriction for outgoing call.
6869  *
6870  * This function is a synchronous call.
6871  *
6872  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6873  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6874  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6875  *
6876  * @exception   None
6877  * @param[in]   value - State value.
6878  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6879  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6880  *
6881  * @remark      None
6882  */
6883 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6884
6885 /**
6886  * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6887  *
6888  * @brief Reads the Restriction for  outgoing call.
6889  *
6890  * This function is a synchronous call.
6891  *
6892  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6893  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6894  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6895  *
6896  * @exception   None
6897  * @param[in] None
6898  * @param[out]  value - State value.
6899  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6900  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6901  *
6902  * @remark      None
6903  */
6904 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6905
6906 /**
6907  * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6908  *
6909  * @brief Sets the Restriction for Pairing.
6910  *
6911  * This function is a synchronous call.
6912  *
6913  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6914  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6915  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6916  *
6917  * @exception   None
6918  * @param[in]   value - State value.
6919  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6920  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6921  *
6922  * @remark      None
6923  */
6924 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6925
6926 /**
6927  * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6928  *
6929  * @brief Reads the Restriction for Pairing
6930  *
6931  * This function is a synchronous call.
6932  *
6933  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6934  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6935  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6936  *
6937  * @exception   None
6938  * @param[in] None
6939  * @param[out]  value - State value.
6940  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6941  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6942  *
6943  * @remark      None
6944  */
6945 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6946
6947 /**
6948  * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6949  *
6950  * @brief Sets the Restriction for using Profiles.
6951  *
6952  * This function is a synchronous call.
6953  *
6954  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6955  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6956  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6957  *
6958  * @exception   None
6959  * @param[in]profile - Profile.
6960  *              BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6961  *              BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6962  *              BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6963  *              BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6964  *              BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6965  *              BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6966  *              BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6967  *              BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6968  *              BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6969  *              BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6970  *              BLUETOOTH_DPM_PROFILE_NONE
6971  * @param[in]   value - State value.
6972  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6973  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6974  *
6975  * @remark      None
6976  */
6977 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6978
6979 /**
6980  * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6981  *
6982  * @brief Reads the Restriction for using Profiles.
6983  *
6984  * This function is a synchronous call.
6985  *
6986  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6987  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6988  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6989  *
6990  * @exception   None
6991  * @param[in]profile - Profile.
6992  *              BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6993  *              BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6994  *              BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6995  *              BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6996  *              BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6997  *              BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6998  *              BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6999  *              BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7000  *              BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7001  *              BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7002  *              BLUETOOTH_DPM_PROFILE_NONE
7003  * @param[out]  value - State value.
7004  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7005  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7006  *
7007  * @remark      None
7008  */
7009 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7010
7011 /**
7012  * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7013  *
7014  * @brief Sets the Restriction for Desktop Connectivity.
7015  *
7016  * This function is a synchronous call.
7017  *
7018  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7019  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7020  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7021  *
7022  * @exception   None
7023  * @param[in]   value - State value.
7024  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7025  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7026  *
7027  * @remark      None
7028  */
7029 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7030
7031 /**
7032  * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7033  *
7034  * @brief Reads the Restriction for Desktop Connectivity.
7035  *
7036  * This function is a synchronous call.
7037  *
7038  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7039  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7040  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7041  *
7042  * @exception   None
7043  * @param[in] None
7044  * @param[out]  value - State value.
7045  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7046  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7047  *
7048  * @remark      None
7049  */
7050 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7051
7052 /**
7053  * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7054  *
7055  * @brief Sets the Restriction for Discoverable state.
7056  *
7057  * This function is a synchronous call.
7058  *
7059  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7060  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7061  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7062  *
7063  * @exception   None
7064  * @param[in]   value - State value.
7065  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7066  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7067  *
7068  * @remark      None
7069  */
7070 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7071
7072 /**
7073  * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7074  *
7075  * @brief Reads the Restriction for Discoverable state.
7076  *
7077  * This function is a synchronous call.
7078  *
7079  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7080  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7081  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7082  *
7083  * @exception   None
7084  * @param[in] None
7085  * @param[out]  value - State value.
7086  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7087  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7088  *
7089  * @remark      None
7090  */
7091 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7092
7093 /**
7094  * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7095  *
7096  * @brief Sets the Restriction for linited discoverable state..
7097  *
7098  * This function is a synchronous call.
7099  *
7100  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7101  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7102  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7103  *
7104  * @exception   None
7105  * @param[in]   value - State value.
7106  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7107  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7108  *
7109  * @remark      None
7110  */
7111 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7112
7113 /**
7114  * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7115  *
7116  * @brief Reads the Restriction for limited discoverable state.
7117  *
7118  * This function is a synchronous call.
7119  *
7120  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7121  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7122  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7123  *
7124  * @exception   None
7125  * @param[in] None
7126  * @param[out]  value - State value.
7127  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7128  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7129  *
7130  * @remark      None
7131  */
7132 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7133 /**
7134  * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7135  *
7136  * @brief Sets the Restriction for Data trasnfer.
7137  *
7138  * This function is a synchronous call.
7139  *
7140  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7141  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7142  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7143  *
7144  * @exception   None
7145  * @param[in]   value - State value.
7146  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7147  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7148  *
7149  * @remark      None
7150  */
7151 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7152
7153
7154 /**
7155  * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7156  *
7157  * @brief Reads the Restriction for Data trasnfer.
7158  *
7159  * This function is a synchronous call.
7160  *
7161  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7162  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7163  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7164  *
7165  * @exception   None
7166  * @param[in] None
7167  * @param[out]  value - State value.
7168  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7169  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7170  *
7171  * @remark      None
7172  */
7173 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7174
7175 /**
7176  * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7177  *                                              bluetooth_pxp_poperty_t property, int value);
7178  *
7179  * @brief Sets the Proximity alert level/properties for monitor role.
7180  *
7181  * This function is a synchronous call.
7182  *
7183  * @return   BLUETOOTH_ERROR_NONE - Success \n
7184  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7185  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7186  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7187  *
7188  * @exception   None
7189  * @param[in] device_address remote device address
7190  * @param[in] property proximity profile property
7191  * @param[in] value alert level/property value to be set
7192  * @param[out] None
7193  *
7194  * @remark      None
7195  */
7196 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7197                                                         bluetooth_pxp_poperty_t property, int value);
7198
7199 /**
7200  * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7201  *                                              bluetooth_pxp_poperty_t property, int *value);
7202  *
7203  * @brief Reads the Proximity alert level/properties for monitor role.
7204  *
7205  * This function is a synchronous call.
7206  *
7207  * @return   BLUETOOTH_ERROR_NONE - Success \n
7208  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7209  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7210  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7211  *
7212  * @exception   None
7213  * @param[in] device_address remote device address
7214  * @param[in] property proximity profile property
7215  * @param[out] value alert level/property value
7216  *
7217  * @remark      None
7218  */
7219 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7220                                                         bluetooth_pxp_poperty_t property, int *value);
7221
7222 /**
7223  * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7224  *                                              int *services_supported);
7225  *
7226  * @brief Reads the Proximity Monitor profile supported properties/services.
7227  *
7228  * This function is a synchronous call.
7229  *
7230  * @return       BLUETOOTH_ERROR_NONE - Success \n
7231  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7232  *                               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7233  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7234  *
7235  * @exception   None
7236  * @param[in] device_address remote device address
7237  * @param[out] services_supported proximity profile property/service
7238  *
7239  * @remark      None
7240  */
7241 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7242                                                         int *services_supported);
7243
7244 /**
7245  * @fn int bluetooth_proximity_reporter_register();
7246  *
7247  * @brief Register all proximity related services in BlueZ.
7248  *
7249  * This function is a synchronous call.
7250  *
7251  * @return       BLUETOOTH_ERROR_NONE - Success \n
7252  *                       BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7253  *
7254  * @exception   None
7255  *
7256  * @remark      None
7257  */
7258 int bluetooth_proximity_reporter_register(void);
7259
7260 /**
7261  * @fn int bluetooth_proximity_reporter_unregister();
7262  *
7263  * @brief Unregister all proximity related services in BlueZ.
7264  *
7265  * This function is a synchronous call.
7266  *
7267  * @return       BLUETOOTH_ERROR_NONE - Success \n
7268  *                       BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7269  *
7270  * @exception   None
7271  *
7272  * @remark      None
7273  */
7274 int bluetooth_proximity_reporter_unregister(void);
7275
7276 /**
7277  * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7278  *                                              bluetooth_pxp_poperty_t property, int *value);
7279  *
7280  * @brief Reads the Proximity alert level/properties for reporter role.
7281  *
7282  * This function is a synchronous call.
7283  *
7284  * @return       BLUETOOTH_ERROR_NONE - Success \n
7285  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7286  *                               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7287  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7288  *
7289  * @exception   None
7290  * @param[in] device_address remote device address
7291  * @param[in] property proximity profile property
7292  * @param[out] value alert level/property value
7293  *
7294  * @remark      None
7295  */
7296 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7297                                                         bluetooth_pxp_poperty_t property, int *value);
7298
7299 /**
7300  * @fn int bluetooth_tds_provider_register(void);
7301  *
7302  * @brief Register Transport Discovery Provider role.
7303  *
7304  * This function is a synchronous call.
7305  *
7306  * @return       BLUETOOTH_ERROR_NONE - Success \n
7307  *                               BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7308  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7309  *                               BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7310  *
7311  * @exception   None
7312  * @param[in] None
7313  * @param[out] None
7314  *
7315  * @remark      None
7316  */
7317 int bluetooth_tds_provider_register(void);
7318
7319 /**
7320  * @fn int bluetooth_tds_provider_unregister(void);
7321  *
7322  * @brief Unregister Transport Discovery Provider role.
7323  *
7324  * This function is a synchronous call.
7325  *
7326  * @return       BLUETOOTH_ERROR_NONE - Success \n
7327  *                               BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7328  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7329  *                               BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7330  *
7331  * @exception   None
7332  * @param[in] None
7333  * @param[out] None
7334  *
7335  * @remark      None
7336  */
7337 int bluetooth_tds_provider_unregister(void);
7338
7339 /**
7340  * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7341  *
7342  * @brief Create Transport Discovery Provider for a transport.
7343  *
7344  * This function is a synchronous call.
7345  *
7346  * @return       BLUETOOTH_ERROR_NONE - Success \n
7347  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7348  *                               BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7349  *                               BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7350  *
7351  * @exception   None
7352  * @param[in] Transport (BT, CUSTOM etc.)
7353  * @param[in] Unique handle for TDS provider.
7354  * @param[out] None
7355  *
7356  * @remark      None
7357  */
7358 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7359
7360 /**
7361  * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7362  *
7363  * @brief Remove previously created Transport Discovery Provider.
7364  *
7365  * This function is a synchronous call.
7366  *
7367  * @return       BLUETOOTH_ERROR_NONE - Success \n
7368  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7369  *
7370  * @exception   None
7371  * @param[in] Unique handle for previously created provider.
7372  * @param[out] None
7373  *
7374  * @remark      None
7375  */
7376 int bluetooth_tds_provider_destroy(unsigned int handle);
7377
7378 /**
7379  * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7380  *
7381  * @brief Set transport block for in advertisement and gatt db.
7382  *
7383  * This function is a synchronous call.
7384  *
7385  * @return       BLUETOOTH_ERROR_NONE - Success \n
7386  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7387  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7388  *                               BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7389  *
7390  * @exception   None
7391  * @param[in] Provider specific manufacturer data.
7392  * @param[in] Provider specific manufacturer data length.
7393  * @param[out] None
7394  *
7395  * @remark      None
7396  */
7397 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7398
7399 /**
7400  * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7401  *              bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7402  *
7403  * @brief Set transport block for in advertisement and gatt db.
7404  *
7405  * This function is a synchronous call.
7406  *
7407  * @return       BLUETOOTH_ERROR_NONE - Success \n
7408  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7409  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7410  *                               BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7411  *
7412  * @exception   None
7413  * @param[in] Unique handle for TDS provider.
7414  * @param[in] Transport state (On/Off/Not Available).
7415  * @param[in] Transport specific data block.
7416  * @param[in] Transport specific data block length.
7417  * @param[out] None
7418  *
7419  * @remark      None
7420  */
7421 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7422                 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7423
7424 /**
7425  * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7426  *              unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7427  *
7428  * @brief Send response to TDS activation request from remoted device.
7429  *
7430  * This function is a synchronous call.
7431  *
7432  * @return       BLUETOOTH_ERROR_NONE - Success \n
7433  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7434  *                               BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7435  *                               BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7436  *
7437  * @exception   None
7438  * @param[in] Remote device BT address.
7439  * @param[in] Unique handle for TDS provider.
7440  * @param[in] Response for TDS activation request.
7441  * @param[in] Transport specific data block to be sent in activation response.
7442  * @param[in] Data block length.
7443  * @param[out] None
7444  *
7445  * @remark      None
7446  */
7447 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7448         unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7449
7450 /**
7451  * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7452  *
7453  * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7454  *
7455  * This function is an asynchronous call.
7456  *
7457  * @return       BLUETOOTH_ERROR_NONE - Success \n
7458  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7459  *                               BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7460  *                               BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7461  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7462  *
7463  * @exception   None
7464  * @param[in] device_address remote device address
7465  * @param[in] handle attribute handle
7466  *
7467  * @remark      BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7468  * when TDS data is received from Remote provider
7469  */
7470 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7471                                                 const char *handle);
7472
7473 /**
7474  * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7475  *
7476  * @brief Enables CCCD on Remote Provider.
7477  *
7478  * This function is an asynchronous call.
7479  *
7480  * @return       BLUETOOTH_ERROR_NONE - Success \n
7481  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7482  *                               BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7483  *                               BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7484  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7485  *
7486  * @exception   None
7487  * @param[in] device_address remote device address
7488  * @param[in] handle attribute handle
7489  *
7490  * @remark      BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7491  * when Indication is enabled on Remote provider
7492  */
7493 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7494                                                 const char *handle);
7495
7496 /**
7497  * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7498  *                                                      unsigned char *buf, int length);
7499  * @brief Sends activation request for Alternate Transport enable on Remote Provider
7500  *
7501  * This function is an asynchronous call.
7502  *
7503  * @return       BLUETOOTH_ERROR_NONE - Success \n
7504  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7505  *                               BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7506  *                               BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7507  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7508  *
7509  * @exception   None
7510  * @param[in] device_address remote device address
7511  * @param[in] handle attribute handle
7512  * @param[in] buf Control point activation param
7513  * @param[in] param length
7514  *
7515  * @remark      BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7516  * is received from remote Provider
7517  */
7518 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7519                                                 unsigned char *buf, int length);
7520
7521 /**
7522  * @}
7523  */
7524
7525 #ifdef __cplusplus
7526 }
7527 #endif                          /* __cplusplus */
7528 #endif                          /* _BLUETOOTH_API_H_*/