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