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