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