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