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