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