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