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