Take BLE Advertising Interval min & max parameters in 0.625ms unit
[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         int interval_min;
610         int 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_RSSI_HIGH_THRESHOLD = 0x80,                    /**< rssi high threshold */
1233 } bluetooth_le_scan_filter_feature_t;
1234
1235 /**
1236  * LE connection mode
1237  */
1238 typedef enum {
1239         BLUETOOTH_LE_CONNECTION_MODE_BALANCED,
1240         BLUETOOTH_LE_CONNECTION_MODE_LOW_LATENCY,
1241         BLUETOOTH_LE_CONNECTION_MODE_LOW_POWER
1242 } bluetooth_le_connection_mode_t;
1243
1244 /**
1245 * structure to hold the device information
1246 */
1247 typedef struct {
1248         bluetooth_device_address_t device_address;      /**< device address */
1249         bluetooth_device_name_t device_name;    /**< device name */
1250         bluetooth_device_class_t device_class;  /**< device class */
1251         char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1252         unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1253         int service_index;
1254         int rssi;                               /**< received strength signal*/
1255         gboolean paired;                        /**< paired flag */
1256         bluetooth_connected_link_t connected;   /**< connected link type */
1257         gboolean trust;                         /**< trust flag */
1258         gboolean is_alias_set;          /** is device alias set flag**/
1259         bluetooth_manufacturer_data_t manufacturer_data;        /**< manafacturer specific class */
1260 } bluetooth_device_info_t;
1261
1262 /**
1263 * structure to hold the LE device information
1264 */
1265 typedef struct {
1266         int data_len;           /**< manafacturer specific data length */
1267         bluetooth_advertising_data_t data;              /**< manafacturer specific data */
1268 } bluetooth_le_advertising_data_t;
1269
1270 typedef struct {
1271         bluetooth_device_address_t device_address;      /**< device address */
1272         int addr_type;                  /**< address type*/
1273         int rssi;                       /**< received strength signal*/
1274         bluetooth_le_advertising_data_t adv_ind_data;
1275         bluetooth_le_advertising_data_t scan_resp_data;
1276 } bluetooth_le_device_info_t;
1277
1278 typedef struct {
1279         int slot_id;
1280         bluetooth_le_scan_filter_feature_t added_features;              /**< added features */
1281         bluetooth_device_address_t device_address;                      /**< device address */
1282         char device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX];        /**< device name */
1283         bluetooth_le_advertising_data_t service_uuid;                   /**< service uuid */
1284         bluetooth_le_advertising_data_t service_uuid_mask;              /**< service uuid mask */
1285         bluetooth_le_advertising_data_t service_solicitation_uuid;      /**< service solicitation uuid */
1286         bluetooth_le_advertising_data_t service_solicitation_uuid_mask; /**< service solicitation uuid mask */
1287         bluetooth_le_advertising_data_t service_data;                   /**< service data */
1288         bluetooth_le_advertising_data_t service_data_mask;              /**< service data mask */
1289         int manufacturer_id;                                            /**< manufacturer ID */
1290         bluetooth_le_advertising_data_t manufacturer_data;              /**< manufacturer data */
1291         bluetooth_le_advertising_data_t manufacturer_data_mask;         /**< manufacturer data mask */
1292         int rssi_high_threshold;                                                        /**< rssi high threshold */
1293 } bluetooth_le_scan_filter_t;
1294
1295 typedef struct {
1296         bluetooth_device_address_t device_address;      /**< device address */
1297         unsigned int mtu;       /** < MTU set for the ATT connection */
1298         unsigned int status; /** < status of the MTU exchange */
1299 } bluetooth_le_att_mtu_info_t;
1300
1301 /**
1302  * structure to hold the paired device information
1303  */
1304 typedef struct {
1305         bluetooth_device_address_t device_address;  /**< paired device address */
1306         bluetooth_device_name_t device_name;        /**< device name */
1307         bluetooth_device_class_t device_class;      /**< device class */
1308 } bluetooth_paired_device_info_t;
1309
1310 /**
1311 * structure to hold the paired device information
1312 */
1313 typedef struct {
1314         bluetooth_device_address_t device_address;
1315                                                /**< device address */
1316         char interface_name[BLUETOOTH_INTERFACE_NAME_LENGTH + 1];
1317                                                           /**< network interface name */
1318 } bluetooth_network_device_info_t;
1319
1320 /**
1321  * Authentication event types
1322  */
1323
1324 typedef enum {
1325         BLUETOOTH_AUTH_KEYBOARD_PASSKEY_REQUEST = 0,
1326         BLUETOOTH_AUTH_PIN_REQUEST,
1327         BLUETOOTH_AUTH_PASSKEY_REQUEST,
1328         BLUETOOTH_AUTH_PASSKEY_CONFIRM_REQUEST,
1329 } bluetooth_auth_type_t;
1330
1331 /**
1332 * structure to hold the pincode/pass-key req informations
1333 */
1334 typedef struct {
1335         bluetooth_device_address_t device_address;  /**< remote device address */
1336         bluetooth_device_name_t device_name;        /**< device name */
1337         char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
1338         bool incoming; /**< stores if bonding request is incoming */
1339 } bluetooth_authentication_request_info_t;
1340
1341 /**
1342 * Stucture to hold discovery option
1343 */
1344 typedef struct {
1345         unsigned short max_response;    /**< the number of maximum response */
1346         unsigned short discovery_duration;
1347                                         /**< duration of discovery (seconds) */
1348         unsigned int classOfDeviceMask; /**<  mask for values of class of device. to be used with
1349                                         classOfDevice variable */
1350 } bluetooth_discovery_option_t;
1351
1352 /**
1353  * Stucture to hold event information
1354  */
1355 typedef struct {
1356         int event;      /**< event type */
1357         int result;     /**< Success or error value */
1358         void *param_data;
1359                         /**<parameter data pointer */
1360         void *user_data;
1361 } bluetooth_event_param_t;
1362
1363 typedef struct {
1364         bluetooth_device_address_t device_addr;
1365         char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1366         unsigned int service_list_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE]; /**< Use enum values in bt_service_uuid_list_t */
1367         unsigned int service_name_array[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1368         int service_index;
1369 } bt_sdp_info_t;
1370
1371 typedef struct {
1372         bluetooth_device_address_t device_addr;
1373         unsigned char addr_type;
1374         int disc_reason;
1375         int rssi;
1376 } bt_connection_info_t;
1377
1378 /**
1379  * Stucture to rfcomm receive data
1380  */
1381
1382 typedef struct {
1383         int socket_fd;
1384                 /**< the socket fd */
1385         int buffer_size;/**< the length of the receive buffer */
1386         char *buffer;
1387                 /**< the receive data buffer */
1388 } bluetooth_rfcomm_received_data_t;
1389
1390 /**
1391  * HID Header type
1392  */
1393 typedef enum {
1394         HTYPE_TRANS_HANDSHAKE,
1395         HTYPE_TRANS_HID_CONTROL,
1396         HTYPE_TRANS_GET_REPORT,
1397         HTYPE_TRANS_SET_REPORT,
1398         HTYPE_TRANS_GET_PROTOCOL,
1399         HTYPE_TRANS_SET_PROTOCOL,
1400         HTYPE_TRANS_DATA,
1401         HTYPE_TRANS_UNKNOWN,
1402         HTYPE_TRANS_GET_IDLE = 0xF0,
1403         HTYPE_TRANS_SET_IDLE = 0xF1,
1404 } bt_hid_header_type_t;
1405
1406 /**
1407  * HID Param type
1408  */
1409 typedef enum {
1410         PTYPE_DATA_RTYPE_INPUT,
1411         PTYPE_DATA_RTYPE_OUTPUT
1412 } bt_hid_param_type_t;
1413
1414 /**
1415  * Stucture to hid receive data
1416  */
1417 typedef struct {
1418         const char *address;
1419         bt_hid_header_type_t type;
1420                 /**< Header type containing */
1421         bt_hid_param_type_t param;
1422                 /**< Param type in header like INPUT Report or OutPut Report */
1423         int buffer_size;/**< the length of the receive buffer */
1424         char *buffer;
1425                 /**< the receive data buffer */
1426 } bluetooth_hid_received_data_t;
1427
1428 /**
1429 * Stucture to rfcomm connection
1430 */
1431
1432 typedef struct {
1433         int socket_fd; /**< the socket fd */
1434         int server_id; /* Server id */
1435         int device_role; /** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1436         bluetooth_device_address_t device_addr;
1437                                               /**< device address */
1438         char uuid[BLUETOOTH_UUID_STRING_MAX];
1439 } bluetooth_rfcomm_connection_t;
1440
1441 /**
1442  * Stucture to rfcomm disconnection
1443  */
1444 typedef struct {
1445         int socket_fd;
1446                 /**< the socket fd */
1447         int device_role;/** < Device role - RFCOMM_ROLE_SERVER or RFCOMM_ROLE_CLIENT */
1448         bluetooth_device_address_t device_addr;
1449                                               /**< device address */
1450         char uuid[BLUETOOTH_UUID_STRING_MAX];
1451 } bluetooth_rfcomm_disconnection_t;
1452
1453 typedef struct {
1454         int socket_fd;
1455                 /**< the socket fd */
1456         bluetooth_device_address_t device_addr;
1457                                               /**< device address */
1458 } bluetooth_rfcomm_connection_request_t;
1459
1460 /**
1461  * HDP QOS types
1462  */
1463 typedef enum {
1464         HDP_QOS_RELIABLE,
1465         HDP_QOS_STREAMING,
1466         HDP_QOS_ANY
1467 } bt_hdp_qos_type_t;
1468
1469 /**
1470  * HDP Role types
1471  */
1472 typedef enum {
1473         HDP_ROLE_SOURCE = 0x0,
1474         HDP_ROLE_SINK
1475 } bt_hdp_role_type_t;
1476
1477
1478 /**
1479  * Stucture to HDP connected
1480  */
1481 typedef struct {
1482         const char *app_handle; /**< the application handle */
1483         unsigned int channel_id;        /**< the channel id */
1484         bt_hdp_qos_type_t type; /**< the QOS type */
1485         bluetooth_device_address_t device_address; /**< the remote address */
1486 } bt_hdp_connected_t;
1487
1488 /**
1489  * Stucture to HDP disconnected
1490  */
1491 typedef struct {
1492         unsigned int channel_id; /**< the channel id */
1493         bluetooth_device_address_t device_address; /**< the remote address */
1494 } bt_hdp_disconnected_t;
1495
1496 /**
1497  * Stucture to HDP data indication
1498  */
1499 typedef struct {
1500         unsigned int channel_id;         /**< the channel id */
1501         const char *buffer;      /**< the RX data buffer */
1502         unsigned int size;       /**< the RX data size */
1503 } bt_hdp_data_ind_t;
1504
1505 /**
1506  * Stucture to OPP client transfer information
1507  */
1508 typedef struct {
1509         char *device_addr;
1510         char *filename;
1511         unsigned long size;
1512         int percentage;
1513 } bt_opc_transfer_info_t;
1514
1515 /* TODO: MAP client structures, see above */
1516 /**
1517  * Stucture to Map filter fields
1518  */
1519 typedef struct {
1520         char **fields;
1521         int size;
1522 } bt_map_list_filter_fields_info_t;
1523
1524 /* Obex Server transfer type */
1525 #define TRANSFER_PUT "PUT"
1526 #define TRANSFER_GET "GET"
1527 /**
1528  * Stucture to OPP/FTP Server authorize information
1529  */
1530 typedef struct {
1531         char *filename;
1532         int length;
1533         char *address;
1534         char *name;
1535 } bt_obex_server_authorize_into_t;
1536
1537 /**
1538  * Server type
1539  */
1540 typedef enum {
1541         OPP_SERVER = 0x0,
1542         FTP_SERVER
1543 } bt_obex_server_type_t;
1544
1545 /**
1546  * Stucture to OPP/FTP server transfer information
1547  */
1548 typedef struct {
1549         char *filename;
1550         char *device_name;
1551         char *file_path;
1552         char *type;
1553         int transfer_id;
1554         unsigned long file_size;
1555         int percentage;
1556         bt_obex_server_type_t server_type;
1557         char *address;
1558         unsigned char *contact_auth_info;
1559 } bt_obex_server_transfer_info_t;
1560
1561 /**
1562  * Stucture to OPP/FTP server connection/disconnection information
1563  */
1564 typedef struct {
1565         char *address;
1566         char *device_name;
1567         int transfer_id;
1568 } bt_obex_server_connection_info_t;
1569
1570
1571 /**
1572  * Stucture to OOB data
1573  */
1574
1575 typedef struct {
1576         unsigned char hash[BLUETOOTH_OOB_DATA_LENGTH];
1577         unsigned char randomizer[BLUETOOTH_OOB_DATA_LENGTH];
1578         unsigned int hash_len;
1579         unsigned int randomizer_len;
1580
1581         unsigned char hash256[BLUETOOTH_OOB_DATA_LENGTH];
1582         unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
1583         unsigned int hash256_len;
1584         unsigned int randomizer256_len;
1585
1586         unsigned char eir[BLUETOOTH_LE_OOB_DATA_LENGTH];
1587         unsigned int eir_len;
1588 } bt_oob_data_t;
1589
1590 /**
1591  * Structure to GATT attribute handle data
1592  */
1593
1594 typedef struct {
1595         int count;
1596         char **handle;
1597         char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
1598         int inst_id[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
1599 } bt_gatt_handle_info_t;
1600
1601 /**
1602  * Structure to a most basic GATT attribute handle data
1603  */
1604 typedef struct {
1605         int instance_id;
1606         unsigned char uuid[16];
1607         char address[BLUETOOTH_ADDRESS_STRING_LENGTH];
1608 } bt_gatt_handle_property_t;
1609
1610 /**
1611  * Structure to GATT Remote service data
1612  */
1613
1614 typedef struct {
1615         char *uuid;
1616         char *handle;
1617         gboolean primary;
1618         bt_gatt_handle_info_t include_handles;
1619         bt_gatt_handle_info_t char_handle;
1620         bt_gatt_handle_property_t prop; /* Added Service UUID, instance_id & associated remote device  */
1621 } bt_gatt_service_property_t;
1622
1623 /**
1624  * Structure to GATT Remote characteristic data
1625  */
1626
1627 typedef struct {
1628         char *service_handle;
1629         bt_gatt_handle_info_t handle_info;
1630 } bt_gatt_discovered_char_t;
1631
1632 /**
1633  * Structure to format of GATT Characteristic Value
1634  */
1635
1636 typedef struct {
1637         unsigned char format;
1638         unsigned char exponent;
1639         unsigned short unit;
1640         unsigned char name_space;
1641         unsigned short description;
1642 } bt_gatt_char_format_t;
1643
1644 /**
1645  * Structure to GATT Characteristic property
1646  */
1647
1648 typedef struct {
1649         char *handle;
1650         char *uuid;
1651         char *name;
1652         char *description;
1653         bt_gatt_char_format_t format;
1654         unsigned char *val;
1655         unsigned int val_len;
1656         unsigned int permission;
1657         char *representation;
1658         bt_gatt_handle_info_t char_desc_handle;
1659         bt_gatt_handle_property_t prop;      /* Added Char UUID, instance_id */
1660         bt_gatt_handle_property_t svc_prop;  /* Added Service UUID, instance_id */
1661         char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX]; /* Added */
1662         char address[BLUETOOTH_ADDRESS_STRING_LENGTH];         /* Added */
1663 } bt_gatt_char_property_t;
1664
1665 /**
1666  * Structure to GATT Characteristic descriptor property
1667  */
1668
1669 typedef struct {
1670         char *handle;
1671         char *uuid;
1672         unsigned char *val;
1673         unsigned int val_len;
1674         bt_gatt_handle_property_t prop;      /* Added Descriptor UUID, instance_id */
1675         bt_gatt_handle_property_t char_prop; /* Added Char UUID, instance_id */
1676         bt_gatt_handle_property_t svc_prop;  /* Added Service UUID, instance_id */
1677         char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX];/* Added */
1678         char address[BLUETOOTH_ADDRESS_STRING_LENGTH];          /* Added */
1679 } bt_gatt_char_descriptor_property_t;
1680
1681 /**
1682  * Structure to GATT Characteristic value
1683  */
1684
1685 typedef struct {
1686         char *char_handle;
1687         guint8 *char_value;
1688         guint32 val_len;
1689 } bt_gatt_char_value_t;
1690
1691 typedef struct {
1692         unsigned char UUID[16];
1693         char address[18];
1694         char *val;
1695         int len;
1696 } bt_gatt_notify_req_t ;
1697
1698 /**
1699  * Structure to GATT Read Request
1700  */
1701 typedef struct {
1702         char *att_handle;
1703         char *service_handle;
1704         char *address;
1705         guint16 offset;
1706         guint req_id;
1707 } bt_gatt_read_req_t;
1708
1709 /**
1710  * Structure to GATT Value change
1711  */
1712 typedef struct {
1713         char *att_handle;
1714         char *service_handle;
1715         char *address;
1716         guint req_id;
1717         gboolean response_needed;
1718         guint16 offset;
1719         guint8 *att_value;
1720         guint32 val_len;
1721 } bt_gatt_value_change_t;
1722
1723 typedef struct {
1724         bluetooth_device_address_t device_addr;
1725         char *svc_path;
1726         bluetooth_gatt_service_change_type_t change_type;
1727         int inst_id;
1728         char *uuid;
1729 } bt_gatt_service_change_t;
1730
1731 /**
1732  * Structure to GATT characteristc Notification change
1733  */
1734 typedef struct {
1735         char *att_handle;
1736         char *service_handle;
1737         gboolean att_notify;
1738 } bt_gatt_char_notify_change_t;
1739
1740 /**
1741  * Structure to Indication confirmation
1742  */
1743 typedef struct {
1744         char *att_handle;
1745         char *service_handle;
1746         char *address;
1747         gboolean complete;
1748 } bt_gatt_indicate_confirm_t;
1749
1750 /**
1751  * Structure for GATT response data
1752  */
1753 typedef struct {
1754         char *handle;
1755         guint8 *value;
1756         guint32 len;
1757         gpointer user_data;
1758 } bt_gatt_resp_data_t;
1759
1760 /**
1761  * Structure to RSSI Signal Strength Alert
1762  */
1763
1764 typedef struct {
1765         char *address;
1766         int link_type;
1767         int alert_type;
1768         int rssi_dbm;
1769 } bt_rssi_alert_t;
1770
1771 /**
1772  * Structure to RSSI Signal Strength
1773  */
1774
1775 typedef struct {
1776         char *address;
1777         int link_type;
1778         int rssi_dbm;
1779 } bt_raw_rssi_t;
1780
1781 /**
1782  * Structure for RSSI Enabled or Disabled
1783  */
1784
1785 typedef struct {
1786         char *address;
1787         int link_type;
1788         gboolean rssi_enabled;
1789 } bt_rssi_enabled_t;
1790
1791 /**
1792  * Structure for RSSI Threshold
1793  */
1794
1795 typedef struct {
1796         int low_threshold;
1797         int in_range_threshold;
1798         int high_threshold;
1799 } bt_rssi_threshold_t;
1800
1801
1802 /**
1803  * Structure for Suppoted Profiles and Trusted Profiles
1804  */
1805 typedef struct {
1806         char *address;
1807         int profile;
1808         gboolean supported;
1809         gboolean trusted;
1810 } bt_supported_profile_trusted_t;
1811
1812 /**
1813  * Structure for PBAP Folder Parameters
1814  */
1815 typedef struct {
1816         unsigned char addressbook;
1817         unsigned char folder_type;
1818 } bt_pbap_folder_t;
1819
1820 /**
1821  * Structure for PBAP Pull application Parameters
1822  */
1823 typedef struct {
1824         unsigned char format;
1825         unsigned char order;
1826         unsigned short offset;
1827         unsigned short maxlist;
1828         long long unsigned fields;
1829 } bt_pbap_pull_parameters_t;
1830
1831 /**
1832  * Structure for PBAP List application Parameters
1833  */
1834 typedef struct {
1835         unsigned char order;
1836         unsigned short offset;
1837         unsigned short maxlist;
1838 } bt_pbap_list_parameters_t;
1839
1840 /**
1841  * Structure for PBAP Pull vCard application Parameters
1842  */
1843 typedef struct {
1844         unsigned char format;
1845         long long unsigned fields;
1846         int index;
1847 } bt_pbap_pull_vcard_parameters_t;
1848
1849 /**
1850  * Structure for PBAP Search application Parameters
1851  */
1852 typedef struct {
1853         unsigned char order;
1854         unsigned short offset;
1855         unsigned short maxlist;
1856         unsigned char search_attribute;
1857         char search_value[BLUETOOTH_PBAP_MAX_SEARCH_VALUE_LENGTH];
1858 } bt_pbap_search_parameters_t;
1859
1860 /**
1861  * Structure for PBAP Connection Status
1862  */
1863 typedef struct {
1864         bluetooth_device_address_t btaddr;
1865         int connected;
1866 } bt_pbap_connected_t;
1867
1868 /**
1869  * Structure for PBAP Phonebook Size
1870  */
1871 typedef struct {
1872         bluetooth_device_address_t btaddr;
1873         int size;
1874 } bt_pbap_phonebook_size_t;
1875
1876 /**
1877  * Structure for PBAP Phonebook Pull
1878  */
1879 typedef struct {
1880         bluetooth_device_address_t btaddr;
1881         char *vcf_file;
1882         int success;
1883 } bt_pbap_phonebook_pull_t;
1884
1885 /**
1886  * Structure for PBAP vCard List
1887  */
1888 typedef struct {
1889         bluetooth_device_address_t btaddr;
1890         char **vcards;
1891         int length;
1892         int success;
1893 } bt_pbap_vcard_list_t;
1894
1895 /**
1896  * Structure for PBAP vCard Pull
1897  */
1898 typedef struct {
1899         bluetooth_device_address_t btaddr;
1900         char *vcf_file;
1901         int success;
1902 } bt_pbap_vcard_pull_t;
1903
1904 /**
1905  * Structure for PBAP Phonebook search List
1906  */
1907 typedef struct {
1908         bluetooth_device_address_t btaddr;
1909         char **vcards;
1910         int length;
1911         int success;
1912 } bt_pbap_phonebook_search_list_t;
1913
1914 /**
1915  * Stucture to HF Call status information
1916  */
1917
1918 typedef struct {
1919         char *number; /*Phone Number */
1920         int direction; /*Direction :Incoming(1), Outgoing(0)*/
1921         int status; /* Call Status :Active(0), Held(1), Waiting(5), Dailing(2)*/
1922         int mpart; /*Multiparty/conf call: Yes(1), No(0) */
1923         int idx; /*Call index/ID */
1924 } bt_hf_call_status_info_t;
1925
1926 typedef struct {
1927         GList *list;
1928         int count;
1929 } bt_hf_call_list_s;
1930
1931 /**
1932  * Profile types
1933  */
1934 typedef enum {
1935         TRUSTED_PROFILE_PBAP = 1,
1936         TRUSTED_PROFILE_MAP,
1937         TRUSTED_PROFILE_SAP,
1938         TRUSTED_PROFILE_HFP_HF,
1939         TRUSTED_PROFILE_A2DP,
1940         TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
1941 } bluetooth_trusted_profile_t;
1942
1943 /**
1944  * Structure for LE data length change params
1945  */
1946 typedef struct {
1947         bluetooth_device_address_t device_address;
1948         guint16 max_tx_octets;
1949         guint16 max_tx_time;
1950         guint16 max_rx_octets;
1951         guint16 max_rx_time;
1952 } bt_le_data_length_params_t;
1953
1954 /**
1955  * Structure for proximity property change params
1956  */
1957 typedef struct {
1958         bluetooth_device_address_t device_address;
1959         int role;
1960         int service_type;
1961         int alert_lvl;
1962 } bt_pxp_property_changed_params_t;
1963
1964  /**
1965  * @brief DPM BT allowance state
1966  * @see
1967  */
1968 typedef enum {
1969         BLUETOOTH_DPM_ERROR      = -1,   /**< bluetooth allowance error */
1970         BLUETOOTH_DPM_BT_ALLOWED,                /**< bluetooth allowance allowed */
1971         BLUETOOTH_DPM_HANDSFREE_ONLY,  /**< bluetooth allowance handsfree only */
1972         BLUETOOTH_DPM_BT_RESTRICTED,  /**< bluetooth allowance restricted */
1973 } bt_dpm_allow_t;
1974
1975  /**
1976  * @brief DPM API result
1977  * @see
1978  */
1979 typedef enum {
1980         BLUETOOTH_DPM_RESULT_SERVICE_NOT_ENABLED = -5,  /**< DPM API result service not enabled. */
1981         BLUETOOTH_DPM_RESULT_ACCESS_DENIED = -4,                        /**< DPM API result access denied. */
1982         BLUETOOTH_DPM_RESULT_INVALID_PARAM = -3,                        /**< DPM API result invalid parameter. */
1983         BLUETOOTH_DPM_RESULT_NOT_SUPPORTED = -2,                        /**< DPM API result not supported. */
1984         BLUETOOTH_DPM_RESULT_FAIL        = -1,                          /**< DPM API result fail. */
1985         BLUETOOTH_DPM_RESULT_SUCCESS     = 0,                           /**< DPM API result success. */
1986 } bt_dpm_result_t;
1987
1988 /**
1989  * @brief DPM Policy status
1990  * @see
1991  */
1992 typedef enum {
1993         BLUETOOTH_DPM_STATUS_ERROR      = -1,
1994
1995         BLUETOOTH_DPM_ALLOWED           = 0,    /**< DPM Policy status allowed. */
1996         BLUETOOTH_DPM_RESTRICTED                = 1,    /**< DPM Policy status restricted. */
1997
1998         BLUETOOTH_DPM_ENABLE                    = 1,    /**< DPM Policy status enabled. */
1999         BLUETOOTH_DPM_DISABLE   = 0,    /**< DPM Policy status disabled. */
2000
2001         BLUETOOTH_DPM_FALSE                     = 0,    /**< DPM Policy status false. */
2002         BLUETOOTH_DPM_TRUE                      = 1,    /**< DPM Policy status true. */
2003 } bt_dpm_status_t;
2004
2005 typedef enum {
2006         /* policy-group : BLUETOOTH */
2007         BLUETOOTH_DPM_POLICY_ALLOW,
2008         BLUETOOTH_DPM_POLICY_DEVICE_RESTRICTION,
2009         BLUETOOTH_DPM_POLICY_UUID_RESTRICTION,
2010         BLUETOOTH_DPM_POLICY_DEVICES_WHITELIST,
2011         BLUETOOTH_DPM_POLICY_DEVICES_BLACKLIST,
2012         BLUETOOTH_DPM_POLICY_UUIDS_WHITELIST,
2013         BLUETOOTH_DPM_POLICY_UUIDS_BLACKLIST,
2014         BLUETOOTH_DPM_POLICY_ALLOW_OUTGOING_CALL,
2015         BLUETOOTH_DPM_POLICY_PAIRING_STATE,
2016         BLUETOOTH_DPM_POLICY_DESKTOP_CONNECTIVITY_STATE,
2017         BLUETOOTH_DPM_POLICY_DISCOVERABLE_STATE,
2018         BLUETOOTH_DPM_POLICY_LIMITED_DISCOVERABLE_STATE,
2019         BLUETOOTH_DPM_POLICY_DATA_TRANSFER_STATE,
2020         BLUETOOTH_DPM_POLICY_END,
2021 } bt_dpm_policy_cmd_t;
2022
2023
2024 struct bt_dpm_policy {
2025         union {
2026                 int value;
2027                 GSList *list;
2028         };
2029 };
2030 typedef struct bt_dpm_policy bt_dpm_policy_t;
2031
2032 typedef enum {
2033         BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
2034         BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
2035         BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
2036         BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
2037         BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
2038         BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
2039         BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
2040         BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
2041         BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
2042         BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
2043         BLUETOOTH_DPM_PROFILE_NONE,
2044 } bt_dpm_profile_t;
2045
2046 struct bt_dpm_profile_val {
2047                 int value; /* tells whether the profile is enabled or disabled */
2048 };
2049 typedef struct dpm_profile_val dpm_profile_state_t;
2050
2051 /**
2052  * Structure to DPM device list
2053  */
2054 typedef struct {
2055         int count;
2056         bluetooth_device_address_t addresses[BLUETOOTH_MAX_DPM_LIST];
2057 } bt_dpm_device_list_t;
2058
2059 /**
2060  * Structure to DPM uuid list
2061  */
2062 typedef struct {
2063         int count;
2064         char uuids[BLUETOOTH_MAX_DPM_LIST][BLUETOOTH_UUID_STRING_MAX];
2065 } bt_dpm_uuids_list_t;
2066
2067 /**
2068  * Structure for IPSP Interface Info
2069  */
2070 typedef struct {
2071         bluetooth_device_address_t btaddr;
2072         char if_name[16];
2073 } bt_ipsp_connection_info_t;
2074
2075 typedef struct {
2076         char* session_path;
2077         char* remote_address;
2078 } bt_map_client_session_info_s;
2079
2080 typedef char* bt_map_client_message_object_t;
2081
2082 typedef struct {
2083         int16_t offset;
2084         int16_t max_count;
2085 } bt_map_client_list_folders_filter_t;
2086
2087 typedef struct {
2088         int16_t offset;
2089         int16_t max_count;
2090         int8_t subject_length;
2091         char *fields;
2092         char *types;
2093         char *period_begin;
2094         char *period_end;
2095         int is_read;
2096         char *recipient;
2097         char *sender;
2098         int is_priority;
2099 } bt_map_client_list_messages_filter_t;
2100
2101 typedef struct {
2102         bt_map_client_message_object_t message_object;
2103         char *folder;
2104         char *subject;
2105         char *timestamp;
2106         char *sender;
2107         char *sender_address;
2108         char *reply_to;
2109         char *recipient;
2110         char *recipient_address;
2111         char *type;
2112         int64_t size;
2113         int is_text;
2114         char *status;
2115         int64_t attachment_size;
2116         int is_priority;
2117         int is_read;
2118         int is_sent;
2119         int is_protected;
2120 } bt_map_client_message_item_t;
2121
2122 typedef struct {
2123         int is_transparent;
2124         int is_retry;
2125         char *charset;
2126 } bt_map_client_push_message_args_t;
2127
2128 typedef struct {
2129         char *folder;
2130         char *subject;
2131         char *timestamp;
2132         char *sender;
2133         char *sender_address;
2134         char *reply_to;
2135         char *recipient;
2136         char *recipient_address;
2137         char *type;
2138         int64_t size;
2139         char *status;
2140         int is_priority;
2141         int is_read;
2142         int is_deleted;
2143         int is_sent;
2144         int is_protected;
2145 } bt_map_client_message_t;
2146
2147 typedef struct {
2148         char **names; // holding %size null-terminated folder names
2149         int64_t size;
2150 } bt_map_client_folders_s;
2151
2152 typedef struct {
2153         bt_map_client_message_item_t *message_items;
2154         int64_t size;
2155 } bt_map_client_message_items_s;
2156
2157 typedef struct {
2158         const char* target_file;
2159         void* user_data;
2160 } bt_get_message_callback_data;
2161
2162 /**
2163  * Callback pointer type
2164  */
2165 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
2166
2167 /**
2168  * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2169  * @brief Set the callback function pointer for bluetooth event
2170  *
2171  *
2172  * This API will register the callback function, when any response and event are received from
2173  * bluetooth framework. @n
2174  * this registered callback function will be get called with appropriate event and data structures.
2175  * This function is a synchronous call. An application developer can call
2176  * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2177  * type. This registered function will receive events of bluetooth_event_type_t type along with
2178  * data any.
2179  *
2180  *
2181  * @param[in]   callback_ptr    A pointer to the callback function
2182  * @param[in]   user_data    A pointer to user data
2183  * @return      BLUETOOTH_ERROR_NONE - Success
2184  * @remark      None
2185  * @see         None
2186 @code
2187 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2188 {
2189         GMainLoop *main_loop = (GMainLoop*) user_data;
2190
2191         switch(event)
2192         {
2193                 // Code for each event
2194                 default:
2195                         g_main_loop_quit(main_loop);
2196                         break;
2197         }
2198 }
2199
2200 int main()
2201 {
2202         GMainLoop *main_loop = NULL;
2203         int ret = 0;
2204         g_type_init();
2205         main_loop = g_main_loop_new(NULL, FALSE);
2206         ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2207         if (ret >= BLUETOOTH_ERROR_NONE)
2208         {
2209                 // bluetooth_register_callback returned Success
2210         }
2211         else
2212         {
2213                 // bluetooth_register_callback returned failiure
2214         }
2215         g_main_loop_run(main_loop);
2216 }
2217 @endcode
2218  */
2219 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2220
2221 /**
2222  * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
2223  * @brief Set the callback function pointer for bluetooth le event
2224  *
2225  *
2226  * This API will register the callback function, when any response and event are received from
2227  * bluetooth framework. @n
2228  * this registered callback function will be get called with appropriate event and data structures.
2229  * This function is a synchronous call. An application developer can call
2230  * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2231  * type. This registered function will receive events of bluetooth_event_type_t type along with
2232  * data any.
2233  *
2234  *
2235  * @param[in]   callback_ptr    A pointer to the callback function
2236  * @param[in]   user_data    A pointer to user data
2237  * @return      BLUETOOTH_ERROR_NONE - Success
2238  * @remark      None
2239  * @see         None
2240  * */
2241 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
2242
2243 /**
2244  * @fn int bluetooth_le_unregister_callback(void)
2245  * @brief Set the callback function pointer for bluetooth le event
2246  *
2247  *
2248  * This API will register the callback function, when any response and event are received from
2249  * bluetooth framework. @n
2250  * this registered callback function will be get called with appropriate event and data structures.
2251  * This function is a synchronous call. An application developer can call
2252  * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2253  * type. This registered function will receive events of bluetooth_event_type_t type along with
2254  * data any.
2255  *
2256  *
2257  * @param[in]   none
2258  * @return      BLUETOOTH_ERROR_NONE - Success
2259  * @remark      None
2260  * @see         None
2261  * */
2262 int bluetooth_le_unregister_callback(void);
2263
2264 /**
2265  * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
2266  * @brief Set the callback function pointer for bluetooth event
2267  *
2268  *
2269  * This API will register the callback function, when any response and event are received from
2270  * bluetooth framework. @n
2271  * this registered callback function will be get called with appropriate event and data structures.
2272  * This function is a synchronous call. An application developer can call
2273  * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
2274  * type. This registered function will receive events of bluetooth_event_type_t type along with
2275  * data any.
2276  *
2277  *
2278  * @param[in]   none
2279  * @return      BLUETOOTH_ERROR_NONE - Success
2280  * @remark      None
2281  * @see         None
2282 @code
2283 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2284 {
2285         GMainLoop *main_loop = (GMainLoop*) user_data;
2286
2287         switch(event)
2288         {
2289                 // Code for each event
2290                 default:
2291                         g_main_loop_quit(main_loop);
2292                         break;
2293         }
2294 }
2295
2296 int main()
2297 {
2298         GMainLoop *main_loop = NULL;
2299         int ret = 0;
2300         g_type_init();
2301         main_loop = g_main_loop_new(NULL, FALSE);
2302         ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2303         if (ret >= BLUETOOTH_ERROR_NONE)
2304         {
2305                 // bluetooth_register_callback returned Success
2306         }
2307         else
2308         {
2309                 // bluetooth_register_callback returned failiure
2310         }
2311         ret = bluetooth_deregister_callback(void);
2312         g_main_loop_run(main_loop);
2313 }
2314 @endcode
2315  */
2316 int bluetooth_unregister_callback(void);
2317
2318 /**
2319  * @fn int bluetooth_enable_adapter(void)
2320  * @brief Enable the Bluetooth H/W
2321  *
2322  *
2323  * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2324  * send request to bluetooth chip for activation.
2325  * This function is typically called at startup or when Bluetooth services are required.  This
2326  * function must be called before calling any other API of Bluetooth operations.
2327  *
2328  * Before performing any operations like Device discover, service search etc.., the adapter must be
2329  * enabled.
2330  *
2331  * This function is a asynchronous call.
2332  * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2333  * through registered callback function with appropriate result code
2334  *                      BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2335  *                      BLUETOOTH_ERROR_NONE - Success \n
2336  *
2337  * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2338  * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2339  *
2340  * @return      BLUETOOTH_ERROR_NONE - Success\n
2341  *              BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2342  *              BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2343  *              BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2344  * @exception   BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2345  * @remark      None
2346  * @see         bluetooth_check_adapter, bluetooth_disable_adapter
2347 @code
2348 void bt_event_callback(int event, bluetooth_event_param_t *param)
2349 {
2350         switch(event)
2351         {
2352                 case BLUETOOTH_EVENT_ENABLED:
2353                         if (param->result == BLUETOOTH_ERROR_NONE)
2354                         {
2355                                 // Successfully Enabled
2356                         }
2357                         else
2358                         {
2359                                 // Failed
2360                         }
2361                         break;
2362         }
2363 }
2364
2365 ...
2366
2367 int ret = 0;
2368 ret = bluetooth_enable_adapter();
2369
2370 @endcode
2371  */
2372 int bluetooth_enable_adapter(void);
2373
2374 /**
2375  * @fn int bluetooth_disable_adapter(void)
2376  * @brief Disable the Bluetooth H/W
2377  *
2378  *
2379  * This function disables Bluetooth protocol stack and hardware. This function is called when
2380  * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2381  *
2382  * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2383  * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2384  * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2385  * error code.
2386  * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2387  * internal error.
2388  *
2389  * This function is a asynchronous call.
2390  * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2391  * through registered callback function.
2392  *
2393  *
2394  * @return      BLUETOOTH_ERROR_NONE - Success\n
2395  *              BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2396  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2397  * @exception   BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2398  * @remark      None
2399  * @see         bluetooth_check_adapter, bluetooth_enable_adapter
2400 @code
2401 void bt_event_callback(int event, bluetooth_event_param_t *param)
2402 {
2403         switch(event)
2404         {
2405                 case BLUETOOTH_EVENT_DISABLED:
2406                         if (param->result == BLUETOOTH_ERROR_NONE)
2407                         {
2408                                 // Successfully disabled
2409                         }
2410                         else
2411                         {
2412                                 // Failed
2413                         }
2414                         break;
2415         }
2416 }
2417
2418 ...
2419
2420 int ret = 0;
2421 ret = bluetooth_disable_adapter();
2422 @endcode
2423  */
2424 int bluetooth_disable_adapter(void);
2425 int bluetooth_read_battery_data(bt_battery_data *latest);
2426 int bluetooth_set_battery_monitor_state(bool state);
2427 int bluetooth_get_battery_monitor_state(void);
2428 int bluetooth_recover_adapter(void);
2429 int bluetooth_check_adapter_le(void);
2430 int bluetooth_enable_adapter_le(void);
2431
2432 int bluetooth_disable_adapter_le(void);
2433 int bluetooth_get_uuid_name(const char *uuid, char **name);
2434
2435 /**
2436  * @fn int bluetooth_reset_adapter(void)
2437  * @brief Reset the Bluetooth H/W and values
2438  *
2439  *
2440  * This function resets Bluetooth protocol stack and hardware. This function is called when
2441  * an user want to initialize Bluetooth environment.
2442  *
2443  * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2444  * internal error.
2445  *
2446  * This function is a synchronous call.
2447  *
2448  * @return      BLUETOOTH_ERROR_NONE - Success\n
2449  * @exception   BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2450  * @remark      None
2451  * @see         bluetooth_check_adapter, bluetooth_enable_adapter
2452 @code
2453 ...
2454
2455 int ret = 0;
2456 ret = bluetooth_reset_adapter();
2457 @endcode
2458  */
2459 int bluetooth_reset_adapter(void);
2460
2461 /**
2462  * @fn int bluetooth_is_supported(void)
2463  * @brief Check if the bluetooth is supported or not by the current target
2464  *
2465  * This API checks whether the bluetooth is supported or not.
2466  * This API only run by root permission.
2467  *
2468  * This function is a synchronous call.
2469  *
2470  * @return      0 - if bluetooth is not supported\n
2471  *              1 - if bluetooth is supported\n
2472  *              BLUETOOTH_ERROR_INTERNAL - Error in API internal
2473  * @remark      None
2474 @code
2475
2476 int ret = 0;
2477 ret = bluetooth_is_supported();
2478 @endcode
2479  */
2480 int bluetooth_is_supported(void);
2481
2482
2483 /**
2484  * @fn int bluetooth_check_adapter(void)
2485  * @brief Check the current status of the Bluetooth adapter
2486  *
2487  *
2488  * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2489  * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2490  * bluetooth adapter.
2491  * This API get the adapter internal data structure and check current adapter status.
2492  *
2493  * This function is a synchronous call.
2494  *
2495  *
2496  * @return      BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2497  *              BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2498  * @remark      None
2499  * @see         bluetooth_enable_adapter, bluetooth_disable_adapter
2500 @code
2501
2502 int ret = 0;
2503 ret = bluetooth_check_adapter();
2504 @endcode
2505  */
2506 int bluetooth_check_adapter(void);
2507
2508 /**
2509  * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2510  * @brief Get the local adapter bluetooth address
2511  *
2512  *
2513  * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2514  * the adapter should be enabled.
2515  * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2516  * contain Bluetooth address.
2517  * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2518  * friendly name for each device.
2519  * There is no event callback for this API.
2520  *
2521  * This function is a synchronous call.
2522  *
2523  *
2524  * @return      BLUETOOTH_ERROR_NONE - Succeess \n
2525  *              BLUETOOTH_ERROR_INVALID_PARAM -  Invalid parameter (NULL buffer) \n
2526  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED -  Adapter is disabled \n
2527  * @param[out]  local_address   a device address of local bluetooth adapter
2528  * @remark      None
2529  * @see         None
2530 @code
2531
2532 bluetooth_device_address_t local_address={0,};
2533 int ret = 0;
2534
2535 ret = bluetooth_get_local_address(&local_address);
2536 @endcode
2537  */
2538 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2539
2540 /**
2541  * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2542  * @brief Get the hci version
2543  *
2544  *
2545  * This function is used to get the bluetooth hci version
2546  * Before calling this API make sure that the adapter is enabled.
2547  *
2548  * This function is a synchronous call.
2549  *
2550  *
2551  * @return      BLUETOOTH_ERROR_NONE - Success \n
2552  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2553  * @param[out]  timeout   remain visibility timeout value
2554  * @remark      None
2555  @code
2556 bluetooth_version_t *version;
2557  int ret = 0;
2558  ret = bluetooth_get_local_version (&version);
2559  @endcode
2560  */
2561 int bluetooth_get_local_version(bluetooth_version_t *version);
2562
2563 /**
2564  * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2565  * @brief Get the local device name
2566  *
2567  *
2568  * This function is used, get the local device name. Since its difficult to remember the Adapter
2569  * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2570  * friendly name is retrived by the remote device and displaying.
2571  * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2572  *
2573  * This function is a synchronous call.
2574  *
2575  *
2576  * @return      BLUETOOTH_ERROR_NONE - Success \n
2577  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2578  * @param[out]  local_name      a local device name
2579  * @remark      None
2580  * @see         None
2581 @code
2582 bluetooth_device_name_t local_name={0,}
2583 int ret = 0;
2584 ret = bluetooth_get_local_name (&local_name);
2585 @endcode
2586  */
2587 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2588
2589 /**
2590  * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2591  * @brief Set the local device name
2592  *
2593  *
2594  * This function is used to set the local device name. This is a human friendly name whose
2595  * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2596  *
2597  * This function is a synchronous call.
2598  *
2599  * @param[in]   local_name   bluetooth device name to set local device
2600  *
2601  * @return      BLUETOOTH_ERROR_NONE - Success \n
2602  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2603  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2604  *              BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2605  *              BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2606  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2607  *
2608  * @remark      None
2609
2610 @code
2611 bluetooth_device_name_t local_name={0,}
2612 int ret = 0;
2613 ret = bluetooth_set_local_name (&local_name);
2614 @endcode
2615  */
2616 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2617
2618
2619 /**
2620  * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2621  * @brief Check if the uuid is used or not
2622  *
2623  * This function is used to check if the uuid is used or not.
2624  *
2625  * This function is a synchronous call.
2626  *
2627  * @param[in]   service_uuid   service uuid (UUID 128 bit as string)
2628  * @param[out] used  if the uuid is used or not
2629  *
2630  * @return      BLUETOOTH_ERROR_NONE - Success \n
2631  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2632  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2633  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2634  *
2635  * @remark      None
2636  *
2637 @code
2638 gboolean used = FALSE;
2639 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2640 ret = bluetooth_is_service_used(uuid, &used);
2641 @endcode
2642  */
2643 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2644
2645 /**
2646  * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2647  * @brief Check if the device is connected to the specific service
2648  *
2649  * This function is used to check if if the device is connected to the specific service.
2650  *
2651  * This function is a synchronous call.
2652  *
2653  * @param[in]   local_address   a device address of remote bluetooth device
2654  * @param[in]   type the service type
2655  * @param[out] is_connected  if the device is connected or not
2656  *
2657  * @return      BLUETOOTH_ERROR_NONE - Success \n
2658  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2659  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2660  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2661  *
2662  * @remark      None
2663  *
2664 @code
2665 gboolean is_connected = FALSE;
2666 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2667 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2668 @endcode
2669  */
2670 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2671                                 bluetooth_service_type_t type,
2672                                 gboolean *is_connected);
2673
2674 /**
2675  * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2676  * @brief Gets device's connected link type
2677  *
2678  * This function is used to get device's connected link type
2679  *
2680  * This function is a synchronous call.
2681  *
2682  * @param[in]   device_address  a device address of remote bluetooth device
2683  * @param[out]  connected_link  a device's connected link type
2684  *
2685  * @return      BLUETOOTH_ERROR_NONE - Success \n
2686  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2687  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2688  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2689  *
2690  * @remark      None
2691  *
2692 @code
2693 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2694 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2695 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2696 @endcode
2697  */
2698 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2699                                 bluetooth_connected_link_t *connected_link);
2700
2701 /**
2702  * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2703  * @brief Sets a profile trusted for a device
2704  *
2705  * This function is used to Set a profile as trusted for a device
2706  *
2707  * This function is a synchronous call.
2708  *
2709  * @param[in]   device_address  a device address of remote bluetooth device
2710  * @param[in]   profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2711  * @param[in]   trust   to set as trusted or untrusted[1-trusted 0-untrusted]
2712  *
2713  * @return      BLUETOOTH_ERROR_NONE - Success \n
2714  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2715  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2716  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2717  *
2718  * @remark      None
2719  */
2720 int bluetooth_set_profile_trusted(
2721                 const bluetooth_device_address_t *device_address,
2722                 int profile, int trust);
2723
2724 /**
2725  * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2726  * @brief Gets a profile is trusted for a device
2727  *
2728  * This function is used to Get a profile is trusted or not for a device
2729  *
2730  * This function is a synchronous call.
2731  *
2732  * @param[in]   device_address  a device address of remote bluetooth device
2733  * @param[in]   profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2734  * @param[out]  trust   profile is set as trusted or untrusted[1-trusted 0-untrusted]
2735  *
2736  * @return      BLUETOOTH_ERROR_NONE - Success \n
2737  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2738  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2739  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2740  *
2741  * @remark      None
2742  */
2743 int bluetooth_get_profile_trusted(
2744                 const bluetooth_device_address_t *device_address,
2745                 int profile, int *trust);
2746
2747 /**
2748  * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2749  * @brief Get the visibility mode
2750  *
2751  *
2752  * This function is used to get the discoverable mode (Visibility option). Depending upon the
2753  * visibity mode, the property of the device is determined whether it can be discoverable, non
2754  * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2755  *
2756  * This function is a synchronous call.
2757  *
2758  *
2759  * @return      BLUETOOTH_ERROR_NONE - Success \n
2760  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2761  *              BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2762  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2763  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2764  * @param[out]  discoverable_mode   current bluetooth discoverable mode
2765  * @remark      None
2766  * @see         bluetooth_set_discoverable_mode
2767  @code
2768  bluetooth_discoverable_mode_t discoverable_mode_ptr;
2769  int ret = 0;
2770  ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2771  @endcode
2772  */
2773 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2774
2775 /**
2776  * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2777  *                                              int timeout)
2778  * @brief Set the visibility mode
2779  *
2780  *
2781  * This function is used to set the discoverable mode (Visibility option).
2782  *
2783  * Many times user may want to keep his device discoverable so that when peer device is performing
2784  * device search, he/she can find user's device. Application programmer can keep the mode as
2785  * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2786  * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2787  * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2788  * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2789  *
2790  * This function is a synchronous call.
2791  *
2792  * @return      BLUETOOTH_ERROR_NONE - Success \n
2793  *              BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2794  *
2795  * @param[in]  discoverable_mode   the bluetooth discoverable mode to set
2796  * @param[in]  timeout   discoverable time in only limited discoverable mode (second), default: 0
2797  * @remark      None
2798  * @see         bluetooth_get_discoverable_mode
2799
2800 @code
2801
2802 bluetooth_discoverable_mode_t mode;
2803 int ret = 0;
2804 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2805 ret = bluetooth_set_discoverable_mode (mode, 180);
2806
2807 @endcode
2808  */
2809 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2810                                             int timeout);
2811
2812
2813 /**
2814  * @fn int bluetooth_get_timeout_value(int *timeout)
2815  * @brief Get the visibility timeout value
2816  *
2817  *
2818  * This function is used to get the visibility timeout
2819  * Before calling this API make sure that the adapter is enabled.
2820  *
2821  * This function is a synchronous call.
2822  *
2823  *
2824  * @return      BLUETOOTH_ERROR_NONE - Success \n
2825  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2826  *              BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2827  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2828  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2829  * @param[out]  timeout   remain visibility timeout value
2830  * @remark      None
2831  * @see         bluetooth_set_discoverable_mode
2832  @code
2833  int timeout;
2834  int ret = 0;
2835  ret = bluetooth_get_timeout_value (&timeout);
2836  @endcode
2837  */
2838 int bluetooth_get_timeout_value(int *timeout);
2839
2840
2841 /**
2842  * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2843  *                                      unsigned int  classOfDeviceMask)
2844  * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2845  *
2846  * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2847  * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2848  * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2849  * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2850  * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2851  * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2852  * You will receive device address, device name, device class, rssi (received signal strength indicator).
2853  * please see bluetooth_device_info_t for more details.
2854  *
2855  *
2856  * This API provides searching options like max responses, discovery duration in seconds and class
2857  * of device mask to filter device search. some times there may be too many bluetooth devices in
2858  * vicinity of your device.in such scenario, application can request to reduce number of responces
2859  * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2860  * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2861  * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2862  * application defined time. please note that discovery_duration should be mentioned in seconds.
2863  * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2864  * duration.
2865  *
2866  * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2867  * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2868  * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2869  *
2870  * This function is a asynchronous call.
2871  * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2872  * through registered callback function.
2873  *
2874  * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2875  * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2876  *
2877  * The completion or cancellation of the discovery is indicated by an
2878  * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2879  *
2880  * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2881  *
2882  *
2883  * @return      BLUETOOTH_ERROR_NONE - Success \n
2884  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2885  *              BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2886  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2887                                                 agent is not running \n
2888  *
2889  * @param[in] max_response              define the maximum response of the number of founded devices
2890                                         (0 means unlimited)
2891  * @param[in] discovery_duration        define bluetooth discovery duration (0 means 180s )
2892  * @param[in] classOfDeviceMask         define classes of the device mask which user wants
2893                                         (refer to class of device)
2894  * @remark      None
2895  * @see         bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2896
2897 @code
2898 void bt_event_callback(int event, bluetooth_event_param_t *param)
2899 {
2900         switch(event)
2901         {
2902                 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2903                 {
2904                         bluetooth_device_info_t *device_info = NULL;
2905                         printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2906                                         param->result);
2907                         device_info  = (bluetooth_device_info_t *)param->param_data;
2908                         memcpy(&searched_device, &device_info->device_address,
2909                                                 sizeof(bluetooth_device_address_t));
2910                         printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2911                                 device_info->device_address.addr[0],
2912                                 device_info->device_address.addr[1],
2913                                 device_info->device_address.addr[2],
2914                                 device_info->device_address.addr[3],
2915                                 device_info->device_address.addr[4],
2916                                 device_info->device_address.addr[5]);
2917                         break;
2918                 }
2919                 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2920                 {
2921                         bluetooth_device_info_t *device_info = NULL;
2922                         printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2923                                                                                 param->result);
2924                         device_info  = (bluetooth_device_info_t *)param->param_data;
2925                         memcpy(&searched_device, &device_info->device_address,
2926                                                                 sizeof(bluetooth_device_address_t));
2927                         printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2928                                                         device_info->device_name.name,
2929                                                         device_info->device_address.addr[0],
2930                                                         device_info->device_address.addr[1],
2931                                                         device_info->device_address.addr[2],
2932                                                         device_info->device_address.addr[3],
2933                                                         device_info->device_address.addr[4],
2934                                                         device_info->device_address.addr[5]);
2935                         break;
2936                 }
2937
2938                 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2939                         printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2940                         break;
2941         }
2942 }
2943
2944 unsigned short max_response;
2945 unsigned short discovery_duration;
2946 unsigned classOfDeviceMask;
2947 int ret = 0;
2948
2949 max_response =0;
2950 discovery_duration =0;
2951 classOfDeviceMask =0;
2952
2953 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2954
2955 @endcode
2956  *
2957  */
2958 int bluetooth_start_discovery(unsigned short max_response,
2959                                       unsigned short discovery_duration,
2960                                       unsigned int classOfDeviceMask);
2961
2962 /**
2963  * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2964  *                                      unsigned short max_response,
2965  *                                      unsigned short discovery_duration,
2966  *                                      unsigned int  classOfDeviceMask)
2967  * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2968  *
2969  * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2970  * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2971  * Please see bluetooth_start_discovery() for other parameters description.
2972  *
2973  * This function is a asynchronous call.
2974  * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2975  * through registered callback function.
2976  *
2977  * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2978  * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2979  *
2980  * The completion or cancellation of the discovery is indicated by an
2981  * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2982  *
2983  * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2984  *
2985  *
2986  * @return      BLUETOOTH_ERROR_NONE - Success \n
2987  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2988  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2989  *              BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2990  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2991                                                 agent is not running \n
2992  *
2993  * @param[in] role              define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2994                                         (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2995                                         DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2996  * @param[in] max_response              define the maximum response of the number of founded devices
2997                                         (0 means unlimited)
2998  * @param[in] discovery_duration        define bluetooth discovery duration (0 means 180s )
2999  * @param[in] classOfDeviceMask         define classes of the device mask which user wants
3000                                         (refer to class of device)
3001  * @remark      None
3002  * @see         bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
3003
3004 @code
3005 unsigned short type;
3006 unsigned short max_response;
3007 unsigned short discovery_duration;
3008 unsigned classOfDeviceMask;
3009 int ret = 0;
3010
3011 type = 1;
3012 max_response =0;
3013 discovery_duration =0;
3014 classOfDeviceMask =0;
3015
3016 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
3017
3018 @endcode
3019  *
3020  */
3021 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
3022                                                 unsigned short max_response,
3023                                                 unsigned short discovery_duration,
3024                                                 unsigned int classOfDeviceMask);
3025
3026 /**
3027  * @fn int bluetooth_cancel_discovery (void)
3028  * @brief Cancel the on-going device discovery operation
3029  *
3030  *
3031  * This function stops the on-going device discovery operation. This API has to be called after the
3032  * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
3033  * the bluetooth_start_discovery API
3034  *
3035  * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
3036  * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
3037  * cancel the discover request once the user received the device to which he wish to connect.
3038  *
3039  * This function is a asynchronous call.
3040  * If the call is success to cancel discovey then the application will receive
3041  * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
3042  * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3043  * BLUETOOTH_ERROR_NONE
3044  *
3045  *
3046  * @return      BLUETOOTH_ERROR_NONE - Success \n
3047  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3048  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3049  *              BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3050                                                 other application \n
3051  *              BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3052  * @remark      None
3053  * @see         bluetooth_start_discovery
3054 @code
3055 void bt_event_callback(int event, bluetooth_event_param_t *param)
3056 {
3057         switch(event)
3058         {
3059                 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
3060                         TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3061                         break;
3062         }
3063 }
3064
3065 ..
3066
3067 int ret = 0;
3068
3069 ret = bluetooth_cancel_discovery();
3070 @endcode
3071  */
3072 int bluetooth_cancel_discovery(void);
3073
3074 /**
3075  * @fn int bluetooth_start_le_discovery(void)
3076  * @brief Start the generic device discovery which finds the LE devices.
3077  *
3078  * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
3079  * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
3080  * It try to find LE devices. Bluetooth device address and name are
3081  * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
3082  * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
3083  * You will receive device address, device name, device class, rssi (received signal strength indicator).
3084  * please see bluetooth_device_info_t for more details.
3085  *
3086  * This function is a asynchronous call.
3087  * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
3088  * through registered callback function.
3089  *
3090  * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
3091  * found.
3092  *
3093  * The completion or cancellation of the discovery is indicated by an
3094  * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
3095  *
3096  * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
3097  *
3098  *
3099  * @return      BLUETOOTH_ERROR_NONE - Success \n
3100  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3101  *              BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
3102  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3103                                                 agent is not running \n
3104  *
3105  * @remark      None
3106  * @see         bluetooth_stop_le_discovery, bluetooth_device_info_t
3107
3108 @code
3109 void bt_event_callback(int event, bluetooth_event_param_t *param)
3110 {
3111         switch(event)
3112         {
3113                 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
3114                 {
3115                         bluetooth_device_info_t *device_info = NULL;
3116                         printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
3117                                         param->result);
3118                         device_info  = (bluetooth_device_info_t *)param->param_data;
3119                         memcpy(&searched_device, &device_info->device_address,
3120                                                 sizeof(bluetooth_device_address_t));
3121                         printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
3122                                 device_info->device_address.addr[0],
3123                                 device_info->device_address.addr[1],
3124                                 device_info->device_address.addr[2],
3125                                 device_info->device_address.addr[3],
3126                                 device_info->device_address.addr[4],
3127                                 device_info->device_address.addr[5]);
3128                         break;
3129                 }
3130
3131                 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3132                         printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3133                         break;
3134         }
3135 }
3136
3137 int ret = 0;
3138 ret = bluetooth_start_discovery();
3139
3140 @endcode
3141  *
3142  */
3143 int bluetooth_start_le_discovery(void);
3144
3145 /**
3146  * @fn int bluetooth_stop_le_discovery (void)
3147  * @brief Cancel the on-going device LE discovery operation
3148  *
3149  *
3150  * This function stops the on-going device discovery operation. This API has to be called after the
3151  * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
3152  * the bluetooth_start_le_discovery API
3153  *
3154  *
3155  * This function is a asynchronous call.
3156  * If the call is success to cancel discovey then the application will receive
3157  * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
3158  * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
3159  * BLUETOOTH_ERROR_NONE
3160  *
3161  *
3162  * @return      BLUETOOTH_ERROR_NONE - Success \n
3163  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3164  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
3165  *              BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
3166                                                 other application \n
3167  *              BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
3168  * @remark      None
3169  * @see         bluetooth_start_discovery
3170 @code
3171 void bt_event_callback(int event, bluetooth_event_param_t *param)
3172 {
3173         switch(event)
3174         {
3175                 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
3176                         TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
3177                         break;
3178         }
3179 }
3180
3181 ..
3182
3183 int ret = 0;
3184
3185 ret = bluetooth_stop_le_discovery();
3186 @endcode
3187  */
3188 int bluetooth_stop_le_discovery(void);
3189
3190 /**
3191  * @fn int bluetooth_is_discovering(void)
3192  * @brief Check for the device discovery is in-progress or not.
3193  *
3194  * This API is used to check the current status of the Discovery operation.If discovery is in\
3195  * progress normally other operations are not allowed.
3196  * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3197  * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
3198  * event before performing other operations. This API is used to get for the current discovery
3199  * operation status and using bluetooth_cancel_discovery()
3200  * we can cancell the ongoing discovery process.
3201  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3202  * this API.
3203  *
3204  * This function checks whether the device discovery is started or not.
3205  *
3206  * This function is a synchronous call.
3207  *
3208  *
3209  * @return      BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3210  *              BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3211  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3212  *
3213  * @remark      None
3214  * @see         bluetooth_start_discovery, bluetooth_cancel_discovery
3215
3216 @code
3217 int ret = 0;
3218 ret = bluetooth_is_discovering ();
3219 @endcode
3220  */
3221 int bluetooth_is_discovering(void);
3222
3223 /**
3224  * @fn int bluetooth_is_le_discovering(void)
3225  * @brief Check for the device LE discovery is in-progress or not.
3226  *
3227  * This API is used to check the current status of the LE Discovery operation.If discovery is in\
3228  * progress normally other operations are not allowed.
3229  * If a device discovery is in progress, we have to either cancel the discovery operation or wait
3230  * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
3231  * event before performing other operations. This API is used to get for the current discovery
3232  * operation status and using bluetooth_stop_le_discovery()
3233  * we can cancell the ongoing LE discovery process.
3234  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
3235  * this API.
3236  *
3237  * This function checks whether the device  LE discovery is started or not.
3238  *
3239  * This function is a synchronous call.
3240  *
3241  *
3242  * @return      BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3243  *              BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3244  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3245  *
3246  * @remark      None
3247  * @see         bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3248
3249 @code
3250 int ret = 0;
3251 ret = bluetooth_is_le_discovering ();
3252 @endcode
3253  */
3254 int bluetooth_is_le_discovering(void);
3255
3256 /**
3257  * @fn int bluetooth_is_le_scanning(void)
3258  * @brief Check for the device LE scan is in-progress or not.
3259  *
3260  * This API is used to check the current status of the LE Scan operation.If discovery is in\
3261  * progress normally other operations are not allowed.
3262  *
3263  * This function checks whether the device  LE Scan is started or not.
3264  *
3265  * This function is a synchronous call.
3266  *
3267  * @return   TRUE  - LE Scan in progress \n
3268  *              FALSE - LE Scan is not in progress \n
3269  *
3270  * @remark      None
3271
3272 @code
3273 gboolean is_le_scanning = 0;
3274 is_le_scanning = bluetooth_is_le_scanning ();
3275 @endcode
3276  */
3277 gboolean bluetooth_is_le_scanning(void);
3278
3279 int  bluetooth_is_scan_filter_supported(gboolean *is_supported);
3280
3281 /**
3282  * @fn int bluetooth_force_hcidump(int timeout)
3283  * @brief Enable /disable force-hcidump
3284  *
3285  * This function control force-hcidump.
3286  *
3287  * This function is a synchronous call.
3288  *
3289  * @return      BLUETOOTH_ERROR_NONE - Success \n
3290  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3291  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3292  *
3293  * @param[in]   start  To enable or disable force-hcidump[TRUE / FALSE]
3294  *
3295  *
3296  * @remark      None
3297  */
3298 int bluetooth_force_hcidump(int timeout);
3299
3300 /**
3301  * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter)
3302  * @brief Register scan filter.
3303  *
3304  * This function registers the scan filter.
3305  *
3306  * This function is a synchronous call.
3307  *
3308  * @return      BLUETOOTH_ERROR_NONE - Success \n
3309  *
3310  * @param[in]   filter   scan filter to register
3311  *
3312  * @remark      None
3313  */
3314 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter);
3315
3316 /**
3317  * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3318                 int link_type, bt_rssi_threshold_t rssi_threshold)
3319  * @brief Enable RSSI monitoring
3320  *
3321  * This function enables RSSI monitoring and sets threshold for a connection
3322  *
3323  * @return      BLUETOOTH_ERROR_NONE - Success \n
3324  *
3325  * @remark      None
3326  * @see bluetooth_get_rssi_strength
3327  */
3328 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3329                 int link_type, bt_rssi_threshold_t *rssi_threshold);
3330
3331 /**
3332  * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3333  * @brief Gets Raw RSSI signal Strength
3334  *
3335  * This function gives the Raw RSSI signal strength for a connection.
3336  *
3337  * @return      BLUETOOTH_ERROR_NONE - Success \n
3338  *
3339  * @remark      None
3340  * @see bluetooth_enable_rssi
3341  */
3342 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3343
3344 int bluetooth_set_connectable(gboolean is_connectable);
3345
3346 int bluetooth_is_connectable(gboolean *is_connectable);
3347
3348 int bluetooth_disconnect_device(const bluetooth_device_address_t *device_address);
3349
3350 /**
3351  * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3352  * @brief Initiate a bonding process
3353  *
3354  *
3355  * This function initiates a bonding procedure with a peer device.  The bonding procedure
3356  * enables authentication and optionally encryption on the Bluetooth link.
3357  *
3358  * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3359  * inititate the bonding request to the devices already in the paired list.
3360  *
3361  * Usually we call this API after the device discovery.
3362  * This function is a asynchronous call.
3363  *
3364  * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3365  * mentioed result code
3366  * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3367  * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3368  * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3369  * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3370  * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3371  *
3372  * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3373  * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3374  * result code
3375  *
3376  * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3377  *
3378  *
3379  * @return      BLUETOOTH_ERROR_NONE - Success \n
3380  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3381  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3382  *              BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3383  *              BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3384  * @exception   None
3385  * @param[in]   device_address   This indicates an address of the device with which the pairing
3386  *                                      should be initiated
3387  * @remark      None
3388  * @see         bluetooth_cancel_bonding
3389  @code
3390 void bt_event_callback(int event, bluetooth_event_param_t *param)
3391 {
3392         switch(event)
3393         {
3394                 case BLUETOOTH_EVENT_BONDING_FINISHED:
3395                 {
3396                         TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3397                         if (param->result >= BLUETOOTH_ERROR_NONE)
3398                         {
3399                                 bluetooth_device_info_t *device_info = NULL;
3400                                 device_info  = (bluetooth_device_info_t *)param->param_data;
3401                                 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3402                                                         mjr[%#x] min[%#x] srv[%#x]",
3403                                                         device_info->device_name.name,
3404                                                         device_info->device_address.addr[0],
3405                                                         device_info->device_address.addr[1],
3406                                                         device_info->device_address.addr[2],
3407                                                         device_info->device_address.addr[3],
3408                                                         device_info->device_address.addr[4],
3409                                                         device_info->device_address.addr[5],
3410                                                         device_info->device_class.major_class,
3411                                                         device_info->device_class.minor_class,
3412                                                         device_info->device_class.service_class);
3413                         }
3414                         else
3415                         {
3416                                 //bonding failed
3417                         }
3418                         break;
3419                 }
3420         }
3421 }
3422
3423 ...
3424
3425 int ret = 0;
3426 bluetooth_device_address_t device_address={{0}};
3427
3428 ret = bluetooth_bond_device(&device_address);
3429
3430 @endcode
3431  */
3432 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3433
3434 /**
3435  * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3436  *                              bluetooth_conn_type_t conn_type)
3437  * @brief Initiate a bonding process
3438  *
3439  *
3440  * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3441  * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3442  *
3443  * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3444  * inititate the bonding request to the devices already in the paired list.
3445  *
3446  * Usually we call this API after the device discovery.
3447  * This function is a asynchronous call.
3448  *
3449  * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3450  * mentioed result code
3451  * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3452  * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3453  * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3454  * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3455  * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3456  *
3457  * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3458  * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3459  * result code
3460  *
3461  * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3462  *
3463  *
3464  * @return BLUETOOTH_ERROR_NONE - Success \n
3465  *             BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3466  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3467  *             BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3468  *             BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3469  * @exception None
3470  * @param[in] device_address This indicates an address of the device with which pairing
3471  *                                        should be initiated
3472  * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3473  *                                 dual mode devices
3474  * @remark None
3475  * @see bluetooth_cancel_bonding
3476  */
3477 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3478                                 bluetooth_conn_type_t conn_type);
3479
3480 /**
3481  * @fn int bluetooth_cancel_bonding(void)
3482  * @brief Cancel the on-going bonding process
3483  *
3484  * This API is called to cancel the on-going bonding procedure. It should be called before the
3485  * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3486  * This API is useful when the remote device is not responding to the bond request or we wish to
3487  * cancel the bonding request. In this case we need not wait for the timeout to happen.
3488  *
3489  * This function is a synchronous call.
3490  *
3491  * @return      BLUETOOTH_ERROR_NONE - Success \n
3492  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3493  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3494  * @exception   None
3495  * @remark      None
3496  * @see         bluetooth_bond_device
3497 @code
3498 ...
3499
3500 int ret = 0;
3501
3502 ret = bluetooth_cancel_bonding();
3503 @endcode
3504  */
3505 int bluetooth_cancel_bonding(void);
3506
3507 /**
3508  * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3509  * @brief Remove bonding
3510  *
3511  *
3512  * To communicate with remote device over bluetooth link, user should bond with peer device.
3513  * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3514  * API is used to remove peer device from the list. Please note that after removing the device
3515  * from bonded device list, you cannot communication with peer device until bonding happens again.
3516  *
3517  * User can call this function by passing bluetooth device address of any bonded device. Please note
3518  * that after successful return of this function, any bluetooth application running on your device
3519  * will not be able to communicate with unbonded device until bond operation happens again using
3520  * bluetooth_bond_device()
3521  *
3522  *
3523  * This function is a asynchronous call. The request to remove the specified device from the bonded
3524  * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3525  * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3526  * in case if there is a problem in locating given bluetooth device address in bonded devices list
3527  *
3528  *
3529  *
3530  * @return      BLUETOOTH_ERROR_NONE - Success \n
3531  *              BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3532  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3533  *              BLUETOOTH_ERROR_DEVICE_BUSY     - Bluetooth adapter is busy doing some operation \n
3534  *              BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3535  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3536  *                                              agent is not running \n
3537  *              BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3538  *                                              bonded device \n
3539  *
3540  * @param[in]   device_address   This indicates an address of the device to remove bonding
3541  *
3542  * @remark      None
3543  *
3544  * @see         bluetooth_bond_device, bluetooth_cancel_bonding
3545  *
3546 @code
3547 void bt_event_callback(int event, bluetooth_event_param_t *param)
3548 {
3549         switch(event) {
3550                 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3551                         bluetooth_device_address_t *dev_addr = NULL;
3552
3553                         if (param->result == BLUETOOTH_ERROR_NONE) {
3554                                 dev_addr = (bluetooth_device_address_t *)param->param_data;
3555                                 //Unbound scuccess
3556                                 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3557                                         dev_addr->addr[0], dev_addr->addr[1]
3558                                         dev_addr->addr[2], dev_addr->addr[3]
3559                                         dev_addr->addr[4], dev_addr->addr[5]
3560                         } else {
3561                                 //unbound failure
3562                         }
3563                 }
3564         }
3565 }
3566
3567 ...
3568
3569 int ret = 0;
3570 bluetooth_device_address_t *device_address;
3571
3572 // copy valid device address in device_address
3573
3574 ret = bluetooth_unbond_device(device_address);
3575 @endcode
3576  */
3577 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3578
3579 /**
3580  * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3581  * @brief Get bonded(paired) device list
3582  *
3583  *
3584  * This API gets all bonded device list.
3585  * The devices in the bonded device list further can be used to perform the authorization by calling
3586  * bluetooth_authorize_device API.
3587  *
3588  * This function is a synchronous call.
3589  * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3590  * there is no valid information in the dev_list.
3591  * The len field in the dev_list represents the number of bonded devices. The data structure for
3592  * bonded device information is bluetooth_device_info_t.
3593  *
3594  *
3595  * @return      BLUETOOTH_ERROR_NONE - Success \n
3596  *              BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3597  * @remark      None
3598  * @see         bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3599  @code
3600 void bt_get_bonded_devices(void)
3601 {
3602 ...
3603         int i;
3604         GPtrArray *devinfo = NULL;
3605         bluetooth_device_info_t *ptr;
3606
3607         // allocate the g_pointer_array
3608         devinfo = g_ptr_array_new();
3609
3610         ret = bluetooth_get_bonded_device_list(&devinfo);
3611         if (ret != BLUETOOTH_ERROR_NONE)
3612         {
3613                 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3614         }
3615         else
3616         {
3617                 printf("g pointer arrary count : [%d]", devinfo->len);
3618                 for (i=0; i<devinfo->len; i++)
3619                 {
3620                         ptr = g_ptr_array_index(devinfo, i);
3621                         if (ptr != NULL)
3622                         {
3623                                 printf("Name [%s]\n", ptr->device_name.name);
3624                                 printf("Major Class [%d]\n", ptr->device_class.major_class);
3625                                 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3626                                 printf("Service Class [%d]\n", ptr->device_class.service_class);
3627                                 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3628                                                                 ptr->device_address.addr[0],
3629                                 ptr->device_address.addr[1], ptr->device_address.addr[2],
3630                                                                 ptr->device_address.addr[3],
3631                                 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3632
3633                                 // handle
3634                                 ...
3635                         }
3636                 }
3637         }
3638         // free g_pointer_array
3639         g_ptr_array_free(devinfo, TRUE);
3640 }
3641
3642 @endcode
3643  */
3644 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3645
3646 int bluetooth_get_profile_connected_device_list(
3647                 const char *profile_uuid, GPtrArray **addr_list);
3648
3649 /**
3650  * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3651  *                                      bluetooth_device_info_t *dev_info)
3652  * @brief Get a bonded(paired) device
3653  *
3654  *
3655  * This API gets a bonded device.
3656  *
3657  * This function is a synchronous call.
3658  * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3659  * there is no valid information in the dev_info.
3660  * The data structure for bonded device information is bluetooth_device_info_t.
3661  *
3662  *
3663  * @return      BLUETOOTH_ERROR_NONE - Success \n
3664  *              BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3665  * @remark      None
3666  * @see         bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3667  @code
3668 void bt_get_bonded_device(void)
3669 {
3670 ...
3671         int i;
3672         bluetooth_device_info_t devinfo = {0};
3673         bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3674
3675         ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3676         if (ret != BLUETOOTH_ERROR_NONE)
3677         {
3678                 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3679         }
3680         else
3681         {
3682                 printf("Name [%s]\n", devinfo.device_name.name);
3683                 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3684                 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3685                 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3686                 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3687                 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3688                 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3689                 devinfo.device_address.addr[5]);
3690
3691                 // handle
3692                 ...
3693         }
3694 }
3695
3696 @endcode
3697  */
3698 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3699                                         bluetooth_device_info_t *dev_info);
3700
3701 /**
3702  * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3703  *                                      gboolean *is_alias_set)
3704  * @brief Get is_alias_set property of device
3705  *
3706  * This API gets is_alias_set property of a bonded device.
3707  *
3708  * This function is a synchronous call.
3709  * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3710  * If not,there is no valid information in the is_alias_set.
3711  *
3712  * @return      BLUETOOTH_ERROR_NONE - Success \n
3713  *                      BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3714  * @remark None
3715  @code
3716         int ret = 0;
3717         gboolean alias_set;
3718         bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3719
3720         ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3721  @endcode
3722  */
3723 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3724                                 gboolean *is_alias_set);
3725
3726 /**
3727  * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3728  * @brief set alias for bonded device
3729  *
3730  *
3731  * This function set alias for bonded device.
3732  *
3733  * This function is a synchronous call.
3734  *
3735  *
3736  * @return      BLUETOOTH_ERROR_NONE - Success \n
3737  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3738  * @param[in]   device_address   This indicates an address of the remote device
3739  * @param[in]   alias                   This indicates an alias to set
3740  * @remark      None
3741  * @see         None
3742 @code
3743 int ret = 0;
3744 ret = bluetooth_set_alias(&remote_address);
3745 @endcode
3746  */
3747 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3748                                 const char *alias);
3749
3750 /**
3751  * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3752  * @brief Get remote deivice
3753  *
3754  *
3755  * This function gets specific remote device.
3756  *
3757  * This function is a asynchronous call.
3758  * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3759  *
3760  *
3761  * @return      BLUETOOTH_ERROR_NONE - Success \n
3762  *              BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3763  * @param[in]   device_address   This indicates an address of the remote device
3764  * @remark      None
3765  * @see         None
3766 @code
3767 int ret = 0;
3768 ret = bluetooth_get_remote_device(&remote_address);
3769 @endcode
3770  */
3771 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3772
3773 /**
3774  * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3775  *                                      gboolean authorized)
3776  * @brief Authorize/Unauthorize a bonded device
3777  *
3778  *
3779  * This function authorizes/unauthorize a bonded device. It decides the device to connect
3780  * with/without user confirmation.
3781  *
3782  * If we select a paired device and make it authorized by calling this API with the authorized
3783  * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3784  * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3785  * then it will ask for the user conformation before the connection.
3786  *
3787  * This API supposed to be called on the paired devices. Which means we have to use this API only
3788  * after successful pairing.
3789  *
3790  * This function is a asynchronous call.
3791  * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3792  *
3793  * @return      BLUETOOTH_ERROR_NONE - Success \n
3794  * @exception   BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3795  * @param[in]   device_address   This indicates an address of the device to authorize \n
3796  * @param[in]   authorized      TRUE : authorize FALSE: unauthorize
3797  * @remark      None
3798  * @see         bluetooth_get_bonded_device_list
3799 @code
3800 void bt_event_callback(int event, bluetooth_event_param_t *param)
3801 {
3802         switch(event)
3803         {
3804                 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3805                 {
3806                         if (param->result == BLUETOOTH_ERROR_NONE)
3807                         {
3808                                 //Device authorized
3809                         }
3810                         //device authorization failed failure
3811                 }
3812         }
3813 }
3814
3815 ...
3816
3817 int ret = 0;
3818 bluetooth_device_address_t device_address={{0}};
3819 gboolean authorized;
3820
3821 authorized =TRUE;
3822
3823 ret = bluetooth_authorize_device(&device_address,authorized);
3824 @endcode
3825  */
3826 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3827                                        gboolean authorized);
3828
3829 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3830                                 const bluetooth_device_pin_code_t *pin_code);
3831
3832 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3833
3834 /**
3835  * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3836  *
3837  * @brief Receives Legacy Passkey\pin with following authentication response types
3838  *
3839  * @param[in]   passkey : This is the PIN or PASSKEY string required for remote device authentication
3840  * @param[in]   reply    TRUE : Accept AUthentication FALSE: Cancels authentication
3841  *
3842  */
3843 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3844
3845 /**
3846  * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3847  *
3848  * @brief This API sends user confirmation reply to the local adapter.
3849  *
3850  * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3851  *
3852  */
3853 int bluetooth_passkey_confirmation_reply(gboolean reply);
3854
3855 /**
3856  * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3857  * @brief Get all services supported by remote device
3858  *
3859  *
3860  * This API call initiates the search for the services supported by the specified device. Normally
3861  * the service search will take a couple of seconds to get it completed. Before calling this API
3862  * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3863  * perform the service search. We can get the device address by doing a device discovery operation.
3864  *
3865  *
3866  * This function is a asynchronous call.
3867  * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3868  *
3869  * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3870  * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3871  * event is generated with appropriate result code.
3872  *
3873  * @return      BLUETOOTH_ERROR_NONE - Success \n
3874  *              BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3875  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3876  * @param[in]   device_address   This indicates an address of the device
3877  *                               whose services need to be found
3878  * @remark      None
3879  * @see         bluetooth_cancel_service_search
3880  */
3881 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3882
3883 /**
3884  * @fn int bluetooth_cancel_service_search(void)
3885  * @brief Cancel the ongoing service search operation
3886  *
3887  *
3888  * This function cancel the ongoing service search operation. This API is usually calling after the
3889  * bluetooth_search_service API.
3890  * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3891  * if the user wish to cancel the Ongoing service search operation.
3892  *
3893  * This API should be called just after the bluetooth_search_service API and before the
3894  * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3895  *
3896  * This function is a synchronous call.
3897  *
3898  * @return      BLUETOOTH_ERROR_NONE - Success \n
3899  *              BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3900  *              BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3901  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3902  *
3903  * @remark      None
3904  * @see         bluetooth_search_service
3905 @code
3906 ...
3907
3908 int ret = 0;
3909 ret = bluetooth_cancel_service_search();
3910 @endcode
3911 */
3912 int bluetooth_cancel_service_search(void);
3913
3914 /**
3915  * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3916  * @brief Register rfcomm socket with a specific uuid
3917  *
3918  *
3919  * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3920  * descriptor of the server.
3921  * This is the first API which is called to create the server. Once we created the server socket,
3922  * we will listen on that return socket.
3923  * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3924  *
3925  *
3926  * @return  socket FD on Success \n
3927  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3928  *              BLUETOOTH_ERROR_INTERNAL - Internal error\n
3929  *              BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3930  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3931  * @param[in]   UUID (128 bits)
3932  *
3933  * @remark      None
3934  * @see       bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3935  *
3936  @code
3937
3938   const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3939   fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3940
3941  @endcode
3942  */
3943 int bluetooth_rfcomm_create_socket(const char *uuid);
3944
3945 /**
3946  * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3947  * @brief Register rfcomm socket with a specific uuid
3948  *
3949  *
3950  * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3951  * descriptor of the server.
3952  * This is the first API which is called to create the server. Once we created the server socket,
3953  * we will listen on that return socket.
3954  * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3955  *
3956  *
3957  * @return  socket FD on Success \n
3958  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3959  *              BLUETOOTH_ERROR_INTERNAL - Internal error\n
3960  *              BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3961  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3962  * @param[in]   UUID (128 bits)
3963  * @param[in]   bus_name (const char)
3964  * @param[in]   path (const char)
3965  *
3966  * @remark      None
3967  * @see       bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3968  *
3969  @code
3970
3971   const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3972   fd  = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3973
3974  @endcode
3975  */
3976 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3977
3978 /**
3979  * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3980  * @brief De-register the rfcomm socket
3981  *
3982  *
3983  * This API deregister rfcomm socket with the given socket fd and  UUID. If the remote device is
3984  * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3985  * descriptor else no event will come. We will call this API only after the
3986  * bluetooth_rfcomm_listen_and_accept.
3987  * This is a synchronous call.
3988  *
3989  * @return   BLUETOOTH_ERROR_NONE - Success \n
3990  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3991  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3992  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3993  * @param[in]  int socket_fd
3994  *
3995  * @remark      None
3996  * @see       bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3997  *
3998  @code
3999  void bt_event_callback(int event, bluetooth_event_param_t *param)
4000  {
4001         switch(event)
4002         {
4003                 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4004                 {
4005                         bluetooth_rfcomm_connection_t *discon_ind =
4006                                         (bluetooth_rfcomm_connection_t *)param->param_data;
4007
4008                         printf("\nDisconnected from FD %d",  discon_ind->socket_fd);
4009                 }
4010         }
4011  }
4012
4013  ...
4014
4015  int ret = 0;
4016  fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4017  ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4018  ....
4019  ret = bluetooth_rfcomm_remove_socket(fd);
4020  @endcode
4021  */
4022 int bluetooth_rfcomm_remove_socket(int socket_fd);
4023
4024 /**
4025  * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
4026  * @brief De-register the rfcomm socket
4027  *
4028  *
4029  * This API deregister rfcomm socket with the given socket UUID. If the remote device is
4030  * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
4031  * descriptor else no event will come. We will call this API only after the
4032  * bluetooth_rfcomm_listen_and_accept_ex.
4033  * This is a synchronous call.
4034  *
4035  * @return   BLUETOOTH_ERROR_NONE - Success \n
4036  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4037  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
4038  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4039  * @param[in]   UUID (128 bits)
4040  *
4041  * @remark      None
4042  * @see       bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
4043  *
4044  @code
4045  void bt_event_callback(int event, bluetooth_event_param_t *param)
4046  {
4047         switch(event)
4048         {
4049                 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
4050                 {
4051                         bluetooth_rfcomm_connection_t *discon_ind =
4052                                         (bluetooth_rfcomm_connection_t *)param->param_data;
4053
4054                         printf("\nDisconnected from FD %d",  discon_ind->socket_fd);
4055                 }
4056         }
4057  }
4058
4059  ...
4060
4061  int ret = 0;
4062  fd  = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
4063  ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4064  ....
4065  ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
4066  @endcode
4067  */
4068 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
4069
4070 /**
4071  * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
4072  * @brief Disconnect rfcomm connection
4073  *
4074  *
4075  * Disconnect a specific(device node fd)  RFCOMM connection. This is a Synchronous call and there
4076  * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4077  * remote server.
4078  *
4079  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4080  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4081  *              BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4082  * @param[in]  int socket_fd the sending socket fd
4083  *
4084  * @remark      None
4085  *
4086  @code
4087
4088   ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
4089   if (ret < 0)
4090         printf("Disconnection failed");
4091   else
4092   printf("Disconnection Success");
4093
4094  @endcode
4095  */
4096 int bluetooth_rfcomm_server_disconnect(int socket_fd);
4097
4098 /**
4099  * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
4100  * @brief Rfcomm socket listen
4101  *
4102  *
4103  * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4104  * after the bluetooth_rfcomm_create_socket API.
4105  * This API listen for the incomming connection and once it receives a connection, it will give
4106  * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4107  * event to the application. This is an Asynchronous API call.
4108  *
4109  *
4110  * @return  BLUETOOTH_ERROR_NONE - Success \n
4111  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4112  *              BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4113
4114  * @param[in]  int socket_fd
4115  * @param[in]  max pending connection.
4116  *
4117  * @remark      None
4118  * @see       bluetooth_rfcomm_create_socket
4119  *
4120   @code
4121   void bt_event_callback(int event, bluetooth_event_param_t* param)
4122  {
4123         switch(event)
4124         {
4125                 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4126                 {
4127                         bluetooth_rfcomm_connection_t *conn_ind =
4128                                                 (bluetooth_rfcomm_connection_t *)param->param_data;
4129
4130                         printf("\nConnected from FD %d",  conn_ind->socket_fd);
4131                 }
4132         }
4133  }
4134
4135  ...
4136
4137  int ret = 0;
4138  fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4139  ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
4140
4141  @endcode
4142  */
4143 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
4144
4145 /**
4146  * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
4147  * @brief Rfcomm socket listen
4148  *
4149  *
4150  * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4151  * after the bluetooth_rfcomm_create_socket API.
4152  * This API listen for the incomming connection and once it receives a connection, it will give
4153  * BLUETOOTH_EVENT_RFCOMM_CONNECTED
4154  * event to the application. This is an Asynchronous API call.
4155  *
4156  *
4157  * @return  BLUETOOTH_ERROR_NONE - Success \n
4158  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4159  *              BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4160
4161  * @param[in]  int socket_fd
4162  * @param[in]  max pending connection.
4163  * @param[in]  name
4164  * @param[in]  path
4165  *
4166  * @remark      None
4167  * @see       bluetooth_rfcomm_create_socket_ex
4168  *
4169   @code
4170   void bt_event_callback(int event, bluetooth_event_param_t* param)
4171  {
4172         switch(event)
4173         {
4174                 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4175                 {
4176                         bluetooth_rfcomm_connection_t *conn_ind =
4177                                                 (bluetooth_rfcomm_connection_t *)param->param_data;
4178
4179                         printf("\nConnected from FD %d",  conn_ind->socket_fd);
4180                 }
4181         }
4182  }
4183
4184  ...
4185
4186  int ret = 0;
4187  fd  = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
4188  ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
4189
4190  @endcode
4191  */
4192
4193 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
4194
4195 /**
4196  * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
4197  * @brief Rfcomm socket listen
4198  *
4199  *
4200  * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
4201  * after the bluetooth_rfcomm_create_socket API.
4202  * This API listen for the incomming connection and once it receives a connection, it will give
4203  * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
4204  * event to the application. This is an Asynchronous API call.
4205  *
4206  *
4207  * @return  BLUETOOTH_ERROR_NONE - Success \n
4208  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4209  *              BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4210
4211  * @param[in]  int socket_fd
4212  * @param[in]  max pending connection.
4213  *
4214  * @remark      None
4215  * @see       bluetooth_rfcomm_create_socket
4216  *
4217   @code
4218   void bt_event_callback(int event, bluetooth_event_param_t* param)
4219  {
4220         switch(event)
4221         {
4222                 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4223                 {
4224                         char *name = (char *)param->param_data;
4225
4226                         printf("\nConnected from %s",  name);
4227
4228                         bluetooth_rfcomm_accept_connection();
4229                 }
4230         }
4231  }
4232
4233  ...
4234
4235  int ret = 0;
4236  fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4237  ret = bluetooth_rfcomm_listen(fd, 1);
4238
4239  @endcode
4240  */
4241 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4242
4243 /**
4244  * @fn int bluetooth_rfcomm_accept_connection()
4245  * @brief Accepts the authorization request indicated by the event
4246   * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4247  *
4248  * This function is a synchronous call.
4249  *
4250  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4251  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
4252  *
4253  * @param[in]  the socket fd of the server
4254  * @param[out]  the socket fd of the client
4255  *
4256  * @exception   None
4257  * @remark       None
4258  * @see bluetooth_rfcomm_reject_connection
4259  */
4260 int bluetooth_rfcomm_accept_connection(int server_fd);
4261
4262 /**
4263  * @fn int bluetooth_rfcomm_reject_connection()
4264  * @brief Rejects the authorization request indicated by the event
4265   * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4266  *
4267  * This function is a synchronous call.
4268  *
4269  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4270  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
4271  *
4272  * @param[in]  the socket fd of the server
4273  *
4274  * @exception   None
4275  * @remark       None
4276  * @see bluetooth_rfcomm_accept_connection
4277  */
4278 int bluetooth_rfcomm_reject_connection(int server_fd);
4279
4280 /**
4281  * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4282  * @brief Informs whether rfcomm server uuid is available or not.
4283  *
4284  * This function is a synchronous call.
4285  *
4286  * @return   TRUE  - RFCOMM uuid is available \n
4287  *              FALSE - RFCOMM uuid is not available \n
4288  *
4289  * @param[in]  uuid UUID string
4290  *
4291  * @exception   None
4292  *
4293  * @remark       None
4294  */
4295 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4296
4297 /**
4298  * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t  *remote_bt_address,
4299  *                                                                      const char *remote_uuid)
4300  * @brief Connect to the remote device rfcomm *
4301  *
4302  * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4303  * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4304  * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4305  * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4306  * initiating a connection.
4307  *
4308  * @return  BLUETOOTH_ERROR_NONE  - Success \n
4309  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4310  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4311  *              BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4312  *              BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4313  * @param[in]  bluetooth_device_address_t remote bt_address
4314  * @param[in]  char remote uuid
4315  * @remark      None
4316  * @see         bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4317  *
4318  @code
4319
4320  void bt_event_callback(int event, bluetooth_event_param_t *param)
4321  {
4322         switch(event)
4323         {
4324                 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4325                 {
4326                         if (param->result >= BLUETOOTH_ERROR_NONE)
4327                         {
4328                                 bt_sdp_info_t *bt_sdp_info=param->param_data;
4329
4330                                 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4331                                         bt_sdp_info->device_addr.addr[0],
4332                                         bt_sdp_info->device_addr.addr[1],
4333                                         bt_sdp_info->device_addr.addr[2],
4334                                         bt_sdp_info->device_addr.addr[3],
4335                                         bt_sdp_info->device_addr.addr[4],
4336                                         bt_sdp_info->device_addr.addr[5]);
4337
4338                                         printf("Supported service list:\n");
4339                                         for(i=0; i<bt_sdp_info->service_index; i++)
4340                                                 printf("[%#x]\n",
4341                                                         bt_sdp_info->service_list_array[i]);
4342
4343                                 //Alternate method
4344                                 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4345                                                                                 //rfcomm_test_uuid);
4346                         }
4347                         break;
4348                 }
4349                 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4350                 {
4351                         bluetooth_rfcomm_connection_t *conn_ind =
4352                                                 (bluetooth_rfcomm_connection_t *)param->param_data;
4353
4354                         printf("\nConnected from FD %d, Role = %s",  conn_ind->socket_fd,
4355                                                 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4356                                                                         "SERVER" : "CLIENT");
4357                 }
4358         }
4359  }
4360
4361   bluetooth_device_address_t remote_address = {{0},};
4362   remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4363   remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19;  remote_address.addr[5]= 0x36;
4364   ret = bluetooth_search_service(&remote_address);
4365  if (ret < 0)
4366         printf("Seach failed, Reason = %d", ret);
4367   else
4368          printf("Search Success, Ret = %d", ret);
4369
4370   ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4371   if (ret < 0)
4372         printf("Connection failed, Reason = %d", ret);
4373   else
4374          printf("Connection Success, Ret = %d", ret);
4375
4376   @endcode
4377   */
4378 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4379                                      const char *remote_uuid);
4380
4381 /**
4382  * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4383  * @brief Disconnect rfcomm connection
4384  *
4385  *
4386  * Disconnect a specific(device node fd)  RFCOMM connection. This is a Synchronous call and there
4387  * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4388  * remote server.
4389  *
4390  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4391  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4392  *              BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4393  * @param[in]  char remote bt_address
4394  *
4395  * @remark      None
4396  * @see         bluetooth_rfcomm_connect
4397  *
4398  @code
4399
4400   ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4401   if (ret < 0)
4402         printf("Disconnection failed");
4403   else
4404   printf("Disconnection Success");
4405
4406  @endcode
4407  */
4408
4409 int bluetooth_rfcomm_disconnect(int socket_fd);
4410
4411 /**
4412  * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4413  * @brief Write to rfcomm connection
4414  *
4415  *
4416  * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4417  * API is used to send the data for server and the client.
4418  *
4419  * @return  BLUETOOTH_ERROR_NONE  - Success \n
4420  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4421  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4422  * @param[in]  int fd
4423  * @param[in]  const char *buff  Data buffer to send
4424  * @param[in]  int length Length of the data
4425  *
4426  * @remark      None
4427  * @see         bluetooth_rfcomm_connect
4428  *
4429   @code
4430   char *buff = "Test data 123456789"
4431   ret =  bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4432   if (ret < 0)
4433         printf("Send failed");
4434   else
4435    printf("Send success");
4436
4437  @endcode
4438  */
4439 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4440
4441 /**
4442  * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4443  * @brief Informs whether rfcomm client is connected.
4444  *
4445  * This function is a synchronous call.
4446  *
4447  * @return   TRUE  - RFCOMM client is connected \n
4448  *              FALSE - RFCOMM client is not connected \n
4449  *
4450  * @exception   None
4451  *
4452  * @remark       None
4453  */
4454 gboolean bluetooth_rfcomm_is_client_connected(void);
4455 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4456 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4457
4458 /**
4459  * @fn int bluetooth_network_activate_server(void)
4460  * @brief Activate the NAP (Network Access Point) service
4461  *
4462  * This function is a asynchronous call.
4463  * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4464  *
4465  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4466  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4467  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4468  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4469  *
4470  * @remark      None
4471   * @see        bluetooth_network_deactivate_server
4472  *
4473  */
4474 int bluetooth_network_activate_server(void);
4475
4476 /**
4477  * @fn int bluetooth_network_deactivate_server(void)
4478  * @brief Deactivate the NAP (Network Access Point) service
4479  *
4480  * This function is a asynchronous call.
4481  * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4482  *
4483  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4484  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4485  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4486  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4487  *
4488  * @remark      None
4489  * @see         bluetooth_network_activate_server
4490  *
4491  */
4492 int bluetooth_network_deactivate_server(void);
4493
4494 /**
4495  * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4496  *                                      bluetooth_network_role_t role,
4497  *                                      char  custom_uuid)
4498  * @brief Connect the network server in the peer
4499  *
4500  * This function is a asynchronous call.
4501  * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4502  *
4503  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4504  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4505  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4506  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4507  *
4508  * @exception   None
4509  * @param[in]  device_address   This indicates an address of the device with which the pairing
4510  *                              should be initiated
4511  * @param[in]  role   The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4512  *                      need to use the third parameter.
4513  * @param[in]  custom_uuid   If use the CUSTOM value in second parameter, use this parameter to
4514  *                              connect. UUID string
4515  * @remark      None
4516  * @see         bluetooth_network_disconnect
4517  */
4518 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4519                                       bluetooth_network_role_t role, char *custom_uuid);
4520
4521 /**
4522  * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4523  *                                                      bluetooth_network_role_t role,
4524  *                                                        char *custom_uuid)
4525  * @brief Connect the network server in the peer
4526  *
4527  * This function is a asynchronous call.
4528  * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4529  *
4530  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4531  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4532  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4533  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4534  *
4535  * @exception   None
4536  * @param[in]   device_address   This indicates an address of the device with which the pairing
4537  *                                      should be initiated
4538  * @remark       None
4539  * @see         bluetooth_network_connect
4540  */
4541 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4542
4543 /**
4544  * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4545  * @brief Disconnect the device from the network
4546  *
4547  * This function is an asynchronous call.
4548  * The network server disconnect request is responded by
4549  * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4550  *
4551  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4552  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4553  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4554  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4555  *
4556  * @exception   None
4557  * @param[in]   device_address   This indicates an address of the connected client device
4558  * @remark       None
4559  * @see         bluetooth_network_activate_server
4560  */
4561 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4562
4563 /*HDP - API's*/
4564
4565 /**
4566  * @fn int bluetooth_hdp_activate(unsigned short  data_type,
4567  *                                      bt_hdp_role_type_t role,
4568  *                                      bt_hdp_qos_type_t channel_type,
4569  *                                      char **app_handle)
4570  * @brief Activate the HDP service for a particular data type
4571  *
4572  * This function is a synchronous call.
4573  *
4574  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4575  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4576  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4577  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4578  *
4579  * @exception   None
4580  * @param[in]  data_type   The data type against corresponding service
4581  * @param[in]  role   The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4582  * @param[in]  channel_type   The QOS type for the channel.
4583  *                              HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4584  *                              For role = HDP_ROLE_SINK, the channel_type
4585  *                              should be HDP_QOS_ANY.
4586  * @param[out]  app_handle    The application handler against corresponding service
4587  * @remark       None
4588  * @see bluetooth_hdp_deactivate
4589  */
4590 int bluetooth_hdp_activate(unsigned short  data_type,
4591                                 bt_hdp_role_type_t role,
4592                                 bt_hdp_qos_type_t channel_type,
4593                                 char **app_handle);
4594 /**
4595  * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4596  * @brief Deactivate the HDP service for a particular service using the handler
4597  *
4598  * This function is a synchronous call.
4599  *
4600  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4601  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4602  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4603  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4604  *
4605  * @exception   None
4606  * @param[in]  app_handle   The application handler against corresponding service
4607  * @remark       None
4608  * @see bluetooth_hdp_deactivate
4609  */
4610 int bluetooth_hdp_deactivate(const char *app_handle);
4611
4612 /**
4613  * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4614  *                                      const char *buffer, unsigned int size)
4615  * @brief Send data to the remote HDP device
4616  *
4617  * This function is a synchronous call.
4618  *
4619  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4620  *             BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4621  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4622  *             BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4623  *             BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid  \n
4624  *
4625  * @exception   None
4626  * @param[in]  channel_id   The channel id for the connection.
4627  * @param[in]  buffer   The pdu buffer.
4628  * @param[in]  size   Size of the buffer.
4629  * @remark       None
4630  * @see bluetooth_hdp_connect
4631  */
4632 int bluetooth_hdp_send_data(unsigned int channel_id,
4633                                 const char *buffer, unsigned int size);
4634 /**
4635  * @fn int bluetooth_hdp_connect(const char *app_handle,
4636  *                              bt_hdp_qos_type_t channel_type,
4637  *                              const bluetooth_device_address_t *device_address)
4638  * @brief Connect to the remote device(Mainly used by source)
4639  *
4640  * This function is a asynchronous call.
4641  * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4642  *
4643  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4644  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4645  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4646  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4647  *              BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4648  *
4649  * @exception   None
4650  * @param[in]  app_handle   The application handler against corresponding service
4651  * @param[in]  channel_type   The QOS type for the channel.
4652  *                              HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4653  * @param[in]  device_address   The remote device Bd address.
4654  *
4655  * @remark       None
4656  * @see bluetooth_hdp_disconnect
4657  */
4658 int bluetooth_hdp_connect(const char *app_handle,
4659                         bt_hdp_qos_type_t channel_type,
4660                         const bluetooth_device_address_t *device_address);
4661 /**
4662  * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4663  *                      const bluetooth_device_address_t *device_address)
4664  * @brief Disconnect from the remote device(Mainly used by source)
4665  *
4666  * This function is a asynchronous call.
4667  * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4668  *
4669  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4670  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4671  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4672  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4673   *              BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4674  *
4675  * @exception   None
4676  * @param[in]  channel_id    The channel id for the connection.
4677  * @param[in]  device_address   The remote device Bd address.
4678  *
4679  * @remark       None
4680  * @see bluetooth_hdp_connect
4681  */
4682 int bluetooth_hdp_disconnect(unsigned int channel_id,
4683                         const bluetooth_device_address_t  *device_address);
4684
4685
4686 /**
4687  * @fn int bluetooth_opc_init(void)
4688  * @brief Initialize OPP client.
4689  *
4690  * This function is a synchronous call.
4691  * No event corresponding to this api
4692  *
4693  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4694  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4695  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4696  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4697   *             BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4698  *
4699  * @exception   None
4700  *
4701  * @remark       None
4702  * @see bluetooth_opc_deinit
4703  */
4704 int bluetooth_opc_init(void);
4705
4706 /**
4707  * @fn int bluetooth_opc_deinit(void)
4708  * @brief Deinitialize OPP client.
4709  *
4710  * This function is a synchronous call.
4711  * No event corresponding to this api
4712  *
4713  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4714  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4715  *              BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4716  *
4717  * @exception   None
4718  *
4719  * @remark       None
4720  * @see bluetooth_opc_init
4721  */
4722
4723 int bluetooth_opc_deinit(void);
4724
4725 /**
4726  * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4727                                         char **file_name_array)
4728  * @brief Send multiple files to a remote device.
4729  *
4730  * This function is a asynchronous call.
4731  * This api  is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4732  *
4733  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4734  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4735  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4736  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4737  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4738  *              BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4739  *              BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4740  *
4741  * @exception   None
4742  * @param[in]  device_address   The remote device Bd address.
4743  * @param[in]  file_name_array  Array of filepaths to be sent.
4744  *
4745  * @remark       None
4746  * @see bluetooth_opc_cancel_push
4747  */
4748
4749 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4750                                 char **file_name_array);
4751
4752 /**
4753  * @fn int bluetooth_opc_cancel_push(void)
4754  * @brief Cancels the ongoing file push.
4755  *
4756  * This function is a asynchronous call.
4757  * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4758  * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4759  *
4760  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4761  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4762  *              BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4763  *
4764  * @exception   None
4765  *
4766  * @remark       None
4767  * @see bluetooth_opc_push_files
4768  */
4769
4770 int bluetooth_opc_cancel_push(void);
4771
4772 /**
4773  * @fn gboolean bluetooth_opc_session_is_exist(void)
4774  * @brief Informs whether opc session exists or not.
4775  *
4776  * This function is a synchronous call.
4777  *
4778  * @return   TRUE  - OPC session exists \n
4779  *              FALSE - OPC session does not exist \n
4780  *
4781  * @exception   None
4782  *
4783  * @remark       None
4784  * @see None
4785  */
4786
4787 gboolean bluetooth_opc_session_is_exist(void);
4788
4789 /**
4790  * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4791  * @brief Informs whether opc session exists or not.
4792  *
4793  * This function is a synchronous call.
4794  *
4795  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4796  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4797  *               BLUETOOTH_ERROR_INTERNAL \n
4798  *
4799  * @exception   None
4800  * @param[out] is_sending The sending status: (@c TRUE = in sending , @c  false = not in sending)
4801  *
4802  * @remark       None
4803  * @see            None
4804  */
4805 int bluetooth_opc_is_sending(gboolean *is_sending);
4806
4807 /**
4808  * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4809                 int transfer_id, unsigned char *progress)
4810  * @brief Gets the percentage progress for ongoing transfers.
4811  *
4812  * This function is a synchronous call.
4813  *
4814  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4815  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4816  *               BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4817  *
4818  * @exception   None
4819  * @param[in] transfer_type     Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c  BLUETOOTH_TRANSFER_OUTBOUND = sending)
4820  * @param[in] transfer_id       Transfer ID
4821  * @param[out] progress         Percentage Progress
4822  * @remark       None
4823  * @see            None
4824  */
4825 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4826                 int transfer_id, unsigned char *progress);
4827
4828 /**
4829  * @fn int bluetooth_obex_server_init(const char *dst_path)
4830  * @brief Initialize OPP and FTP server.
4831  *
4832  * This function is a synchronous call.
4833  * No event corresponding to this api
4834  *
4835  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4836  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4837  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4838  *              BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4839  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4840  *
4841  * @exception   None
4842  * @param[in]  dst_path   OPS destination file path.
4843  * @remark       None
4844  * @see bluetooth_obex_server_deinit
4845  */
4846 int bluetooth_obex_server_init(const char *dst_path);
4847
4848
4849 /**
4850  * @fn int bluetooth_obex_server_deinit(void)
4851  * @brief Deinitialize OPP and FTP server.
4852  *
4853  * This function is a synchronous call.
4854  * No event corresponding to this api
4855  *
4856  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4857  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4858  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4859  *
4860  * @exception   None
4861  *
4862  * @remark       None
4863  * @see bluetooth_obex_server_init
4864  */
4865 int bluetooth_obex_server_deinit(void);
4866
4867
4868 /**
4869  * @fn gboolean bluetooth_obex_server_is_activated(void)
4870  * @brief Informs whether obex server is activated or not.
4871  *
4872  * This function is a synchronous call.
4873  *
4874  * @return   TRUE  - OBEX server is activated \n
4875  *              FALSE - OBEX server is not activated \n
4876  *
4877  * @exception   None
4878  *
4879  * @remark       None
4880  */
4881
4882 gboolean bluetooth_obex_server_is_activated(void);
4883
4884
4885 /**
4886  * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4887  * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4888  *
4889  * This function is a synchronous call.
4890  * No event corresponding to this api
4891  *
4892  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4893  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4894  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4895  *              BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4896  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4897  *
4898  *
4899  * @exception   None
4900  * @param[in]  dst_path   OPS destination file path.
4901  * @remark       None
4902  * @see bluetooth_obex_server_deinit_without_agent
4903  */
4904 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4905
4906
4907 /**
4908  * @fn int bluetooth_obex_server_deinit_without_agent(void)
4909  * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4910  *
4911  * This function is a synchronous call.
4912  * No event corresponding to this api
4913  *
4914  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4915  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4916  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4917  *
4918  * @exception   None
4919  *
4920  * @remark       None
4921  * @see bluetooth_obex_server_init_without_agent
4922  */
4923 int bluetooth_obex_server_deinit_without_agent(void);
4924
4925
4926 /**
4927  * @fn int bluetooth_obex_server_accept_connection(void)
4928  * @brief Accepts the authorization request indicated by the event
4929   * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4930  *
4931  * This function is a synchronous call.
4932  *
4933  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4934  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4935  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
4936  *
4937  * @exception   None
4938  * @remark       None
4939  * @see bluetooth_obex_server_reject_authorize
4940  */
4941 int bluetooth_obex_server_accept_connection(void);
4942
4943
4944 /**
4945  * @fn int bluetooth_obex_server_reject_connection(void)
4946  * @brief Rejects the authorization request indicated by the event
4947   * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4948  *
4949  * This function is a synchronous call.
4950  *
4951  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4952  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4953  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
4954  *
4955  * @exception   None
4956  * @remark       None
4957  * @see bluetooth_obex_server_reject_authorize
4958  */
4959 int bluetooth_obex_server_reject_connection(void);
4960
4961
4962 /**
4963  * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4964  * @brief Accepts the authorization request indicated by the event
4965   * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4966  *
4967  * This function is a asynchronous call.
4968  * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4969  *
4970  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4971  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4972  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4973  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4974  *
4975  * @exception   None
4976  * @param[in]  filename   Authorized filename.
4977
4978  * @remark       None
4979  * @see bluetooth_obex_server_reject_authorize
4980  */
4981
4982 int bluetooth_obex_server_accept_authorize(const char *filename);
4983
4984 /**
4985  * @fn int bluetooth_obex_server_reject_authorize(void)
4986  * @brief Reject the authorization request indicated by the event
4987   * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4988  *
4989  * This function is a asynchronous call.
4990  * No event for this api..
4991  *
4992  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4993  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4994  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4995  *
4996  * @exception   None
4997
4998  * @remark       None
4999  * @see bluetooth_obex_server_accept_authorize
5000  */
5001
5002 int bluetooth_obex_server_reject_authorize(void);
5003
5004 /**
5005  * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
5006  * @brief Set the OPS destination file path..
5007  *
5008  * This function is a asynchronous call.
5009  * No event for this api..
5010  *
5011  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5012  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5013  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5014  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
5015  *
5016  * @exception   None
5017  * @param[in]  dst_path   OPS destination file path.
5018
5019  * @remark       None
5020  * @see None
5021  */
5022
5023 int bluetooth_obex_server_set_destination_path(const char *dst_path);
5024
5025 /**
5026  * @fn int bluetooth_obex_server_set_root(const char *root)
5027  * @brief Set the FTS root folder..
5028  *
5029  * This function is a asynchronous call.
5030  * No event for this api..
5031  *
5032  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5033  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5034  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5035  *              BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
5036  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
5037  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5038  *
5039  * @exception  None
5040  * @param[in]   root   FTS root folder.
5041
5042  * @remark       None
5043  * @see None
5044  */
5045
5046 int bluetooth_obex_server_set_root(const char *root);
5047
5048 /**
5049  * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
5050  * @brief Cancel the transfer on server
5051  *
5052  * This function is an asynchronous call.
5053  * If the function call that cancels transfer is successful, the application would receive
5054  * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5055  * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5056  * the error code will be BLUETOOTH_ERROR_NONE
5057  *
5058  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5059  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5060  *               BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5061  *               BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5062  *               BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5063  *
5064  * @exception None
5065  * @param[in] transfer_id transfer ID
5066
5067  * @remark       None
5068  * @see None
5069  */
5070 int bluetooth_obex_server_cancel_transfer(int transfer_id);
5071
5072
5073 /**
5074  * @fn int bluetooth_obex_server_cancel_all_transfers(void)
5075  * @brief Cancel the transfer on server
5076  *
5077  * This function is an asynchronous call.
5078  * If the function call that cancels transfer is successful, the application would receive
5079  * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
5080  * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
5081  * the error code will be BLUETOOTH_ERROR_NONE
5082  *
5083  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5084  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5085  *               BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
5086  *               BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
5087  *               BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
5088  *
5089  * @exception None
5090  *
5091  * @remark       None
5092  * @see None
5093  */
5094 int bluetooth_obex_server_cancel_all_transfers(void);
5095
5096
5097 /**
5098  * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
5099  * @brief Informs whether obex server is receiving or not.
5100  *
5101  * This function is a synchronous call.
5102  *
5103  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5104  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
5105  *               BLUETOOTH_ERROR_INTERNAL \n
5106  *
5107  * @exception   None
5108  * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c  false = not in receiving)
5109  *
5110  * @remark       None
5111  * @see None
5112  */
5113 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
5114
5115
5116 /**
5117  * @fn int bluetooth_map_client_init(void)
5118  * @brief Initialize MAP client.
5119  *
5120  * This function is a synchronous call.
5121  * No event corresponding to this api
5122  *
5123  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5124  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5125  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5126  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
5127  *              BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
5128  *
5129  * @exception None
5130  *
5131  * @remark None
5132  * @see bluetooth_map_client_deinit
5133  */
5134 int bluetooth_map_client_init(void);
5135
5136 int bluetooth_map_client_deinit(void);
5137
5138 int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
5139
5140 int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
5141
5142 int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
5143
5144 int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
5145                         bt_map_client_list_folders_filter_t *filter);
5146
5147 /**
5148  * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
5149  * @brief Return all available fields that can be used in Fields filter.
5150  *
5151  * This function is a asynchronous call.
5152  *
5153  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5154  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
5155  *              BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
5156  *
5157  * @exception   None
5158  * @param[in]  session   Information about session.
5159  * @remark       None
5160  */
5161 int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
5162
5163 int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
5164                         const char *folder,
5165                         bt_map_client_list_messages_filter_t *filter);
5166
5167 int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
5168
5169 int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
5170                         const char *source_file,
5171                         const char *folder,
5172                         bt_map_client_push_message_args_t *args);
5173
5174 int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
5175                         const bt_map_client_message_object_t message_object,
5176                         const char *target_file,
5177                         bool attachment);
5178
5179
5180 /**
5181  * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
5182  * @brief Read the local Hash and Randmizer.
5183  *
5184  * This function is a synchronous call.
5185  *
5186  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5187  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5188  *
5189  * @exception  None
5190  * @param[in]  None.
5191  * @param[out] local_oob_data - Pointer to the local OOB data
5192  *
5193  * @remark       None
5194  * @see None
5195  */
5196
5197 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5198
5199
5200 /**
5201  * @fn int bluetooth_oob_add_remote_data(
5202  *                      const bluetooth_device_address_t *remote_device_address,
5203  *                      bluetooth_bdaddr_type_e address_type,
5204  *                      bt_oob_data_t *oob_data)
5205  * @brief Add/updated the remote device  Hash and Randmizer.
5206  *
5207  * This function is a synchronous call.
5208  * No event for this api..
5209  *
5210  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5211  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5212  *
5213  * @exception   None
5214  * @param[in] remote_device_address - Remote device address
5215   *           address_type - bdaddr type
5216  *            remote_oob_data - Ponter to Hash and Randomizer oob data structure
5217  *
5218  * @remark      None
5219  * @see         None
5220  */
5221
5222 int bluetooth_oob_add_remote_data(
5223                    const bluetooth_device_address_t *remote_device_address,
5224                    bluetooth_bdaddr_type_e address_type,
5225                    bt_oob_data_t *remote_oob_data);
5226
5227
5228 /**
5229  * @fn int bluetooth_oob_remove_remote_data(
5230  *                      const bluetooth_device_address_t *remote_device_address)
5231  * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5232  *
5233  * This function is a synchronous call.
5234  * No event for this api..
5235  *
5236  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5237  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5238  *
5239  * @exception  None
5240  * @param[in] remote_device_address - Remote device address
5241  *
5242  * @remark       None
5243  * @see None
5244  */
5245
5246 int bluetooth_oob_remove_remote_data(
5247                         const bluetooth_device_address_t *remote_device_address);
5248
5249
5250 /**
5251  * @fn int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data)
5252  * @brief Read the local Hash and Randmizer.
5253  *
5254  * This function is a synchronous call.
5255  *
5256  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5257  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5258  *
5259  * @exception  None
5260  * @param[in]  None.
5261  * @param[out] local_oob_data - Pointer to the local OOB data
5262  *
5263  * @remark       None
5264  * @see None
5265  */
5266 int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
5267
5268 /**
5269  * @fn int bluetooth_le_oob_add_remote_data(
5270  *                      const bluetooth_device_address_t *remote_device_address,
5271  *                      bluetooth_bdaddr_type_e address_type,
5272  *                      bt_oob_data_t *oob_data)
5273  * @brief Add/updated the remote device  Hash and Randmizer.
5274  *
5275  * This function is a synchronous call.
5276  * No event for this api..
5277  *
5278  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5279  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5280  *
5281  * @exception   None
5282  * @param[in] remote_device_address - Remote device address
5283   *           address_type - bdaddr type
5284  *            remote_oob_data - Ponter to Hash and Randomizer oob data structure
5285  *
5286  * @remark      None
5287  * @see         None
5288  */
5289 int bluetooth_le_oob_add_remote_data(
5290                         const bluetooth_device_address_t *remote_device_address,
5291                         bluetooth_bdaddr_type_e address_type,
5292                         bt_oob_data_t *remote_oob_data);
5293
5294 /**
5295  * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5296  *                                              bt_gatt_handle_info_t *prim_svc);
5297  *
5298  * @brief Gets the GATT based primary services handle supported by remote device
5299  *
5300  * This function is a synchronous call.
5301  * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5302  *
5303  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5304  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5305  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5306  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5307  *
5308  * @exception    None
5309  * @param[in]    address - Remote device address
5310  * @param[out] prim_svc - Structure containing remote service count and handle list.
5311  *
5312  * @remark      None
5313  * @see         bluetooth_gatt_free_primary_services()
5314  */
5315 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5316                                                 bt_gatt_handle_info_t *prim_svc);
5317
5318 /**
5319  * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5320  *
5321  * @brief Discovers the characteristics of GATT based service of remote device
5322  *
5323  * This function is an asynchronous call.
5324  * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5325  *
5326  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5327  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5328  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5329  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5330  *
5331  * @exception   None
5332  * @param[in]   service_handle - Handle for remote service.
5333  *
5334  * @remark      None
5335  * @see         None
5336  */
5337 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5338
5339 int bluetooth_gatt_set_service_change_watcher(
5340                 const bluetooth_device_address_t *address, gboolean enable);
5341
5342 /**
5343  * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5344  *                                              bt_gatt_service_property_t *service);
5345  *
5346  * @brief Gets the properties of GATT based service of remote device
5347  *
5348  * This function is a synchronous call.
5349  * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5350  *
5351  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5352  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5353  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5354  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5355  *
5356  * @exception   None
5357  * @param[in]   service_handle - Handle for remote service.
5358  * @param[out]  service - Structure containing remote service property.
5359  *
5360  * @remark      None
5361  * @see         bluetooth_gatt_free_service_property()
5362  */
5363 int bluetooth_gatt_get_service_property(const char *service_handle,
5364                                                 bt_gatt_service_property_t *service);
5365
5366 /**
5367  * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name)
5368  *
5369  * @brief Register to GATT based service to receive value change notification/indication.
5370  *
5371  * This function is a synchronous call.
5372  * No event for this api.
5373  *
5374  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5375  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5376  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5377  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5378  *
5379  * @exception   None
5380  * @param[in]   service_handle - Handle for remote service.
5381  * @param[in]   service_name - Friednly name of service uuid.
5382  *
5383  * @remark      None
5384  * @see None
5385  */
5386 int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name);
5387
5388 /**
5389  * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5390  *
5391  * @brief Unregister GATT based service to receive value change notification/indication.
5392  *
5393  * This function is a synchronous call.
5394  * No event for this api.
5395  *
5396  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5397  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5398  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5399  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5400  *
5401  * @exception   None
5402  * @param[in]   service_handle - Handle for remote service.
5403  *
5404  * @remark      None
5405  * @see         None
5406  */
5407 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5408
5409 /**
5410  * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5411  *                                              bt_gatt_char_property_t *characteristic);
5412  *
5413  * @brief Provides characteristic value along with properties.
5414  *
5415  * This function is a synchronous call.
5416  * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5417  *
5418  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5419  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5420  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5421  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5422  *
5423  * @exception   None
5424  * @param[in]   char_handle - Handle for Characteristic property.
5425  * @param[out] characteristic - Structure containing remote characteristic property.
5426  *
5427  * @remark      None
5428  * @see         bluetooth_gatt_free_char_property()
5429  */
5430 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5431                                                 bt_gatt_char_property_t *characteristic);
5432
5433 /**
5434  * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5435  *                                              bt_gatt_char_property_t *characteristic);
5436  *
5437  * @brief Provides characteristic descriptor value along with its UUID.
5438  *
5439  * This function is a synchronous call.
5440  * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5441  *
5442  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5443  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5444  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5445  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5446  *
5447  * @exception   None
5448  * @param[in]   desc_handle - Handle for Characteristic descriptor.
5449  * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5450  *
5451  * @remark      None
5452  * @see         bluetooth_gatt_free_desc_property()
5453  */
5454 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5455                                                 bt_gatt_char_descriptor_property_t *descriptor);
5456
5457
5458 /**
5459  * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5460  *                                              const guint8 *value, int length)
5461  *
5462  * @brief Set characteristic value.
5463  *
5464  * This function is a synchronous call.
5465  *
5466  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5467  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5468  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5469  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5470  *
5471  * @exception   None
5472  * @param[in]   char_handle - Handle for Characteristic property.
5473  * @param[in]   value - New value to set for characteristic property.
5474  * @param[in]   length - Length of the value to be set.
5475  *
5476  * @remark      None
5477  * @see         None
5478  */
5479 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5480                                                 const guint8 *value, int length);
5481
5482 /**
5483  * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5484  *                              const guint8 *value, int length, guint8 write_type)
5485  *
5486  * @brief Set characteristic value by write type.
5487  *
5488  * This function is a synchronous call if write type is "write without resonse"
5489  * and it is an asynchronous call if write type is "write with response"
5490  *
5491  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5492  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5493  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5494  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5495  *
5496  * @exception   None
5497  * @param[in]   char_handle - Handle for Characteristic property.
5498  * @param[in]   value - New value to set for characteristic property.
5499  * @param[in]   length - Length of the value to be set.
5500  * @param[in]   write_type - Type of write.
5501  *
5502  * @remark      None
5503  * @see         None
5504  */
5505 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5506                                         const guint8 *value, int length,
5507                                         guint8 write_type, gpointer app_data);
5508
5509
5510 /**
5511  * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5512  *                                              const guint8 *value, int length)
5513  *
5514  * @brief Set characteristic value request.
5515  *
5516  * This function is an asynchronous call.
5517  *
5518  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5519  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5520  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5521  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5522  *
5523  * @exception   None
5524  * @param[in]   char_handle - Handle for Characteristic property.
5525  * @param[in]   value - New value to set for characteristic property.
5526  * @param[in]   length - Length of the value to be set.
5527   *
5528  * @remark      None
5529  * @see         None
5530  */
5531 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5532                                                 const guint8 *value, int length);
5533
5534 /**
5535  * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5536  *
5537  * @brief Read characteristic value.
5538  *
5539  * This function is a asynchronous call.
5540  *
5541  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5542  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5543  *             BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5544  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5545  *
5546  * @exception  None
5547  * @param[in]  char_handle - Handle for Characteristic property.
5548  *
5549  * @remark     None
5550  * @see        None
5551  */
5552 int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
5553
5554 /**
5555  * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5556  *                                      const char *service_uuid,
5557  *                                      bt_gatt_service_property_t *service)
5558  *
5559  * @brief Gets the service property from a device based on a particular uuid
5560  *
5561  * This function is a synchronous call.
5562  *
5563  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5564  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5565  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5566  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5567  *
5568  * @exception   None
5569  * @param[in]   address - BD address of the remote device
5570  * @param[in]   service_uuid - uuid of the service.
5571  * @param[out] service - Structure containing the service property.
5572  *
5573  * @remark      None
5574  * @see         None
5575  */
5576 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5577                                         const char *service_uuid,
5578                                         bt_gatt_service_property_t *service);
5579
5580 /**
5581  * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5582  *                                                      const char *char_uuid)
5583  *
5584  * @brief Gets the characteristic property from a service based on a particular char uuid
5585  *
5586  * This function is an asynchronous call.
5587  * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5588  *
5589  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5590  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5591  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5592  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5593  *
5594  * @exception   None
5595  * @param[in]   service_handle - Service handle.
5596  * @param[in]   uuid - Characteristic uuid.
5597  *
5598  * @remark      None
5599  * @see         None
5600  */
5601 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5602                                                 const char *char_uuid);
5603
5604 /**
5605  * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5606  *
5607  * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5608  *
5609  * This function is a synchronous call.
5610  * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5611  *
5612  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5613  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5614  *
5615  * @exception   None
5616  * @param[in]   prim_svc - GATT handle info structure
5617  *
5618  * @remark      None
5619  * @see         bluetooth_gatt_get_primary_services()
5620  */
5621 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5622
5623 /**
5624  * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5625  *
5626  * @brief  Releases the memory allocated by bluetooth_gatt_get_service_property()
5627  *
5628  * This function is a synchronous call.
5629  * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5630  *
5631  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5632  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5633  *
5634  * @exception   None
5635  * @param[in]   svc_pty - GATT service property structure.
5636  *
5637  * @remark      None
5638  * @see         bluetooth_gatt_get_service_property()
5639  */
5640 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5641
5642 /**
5643  * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5644  *
5645  * @brief Provides characteristic value along with properties.
5646  *
5647  * This function is a synchronous call.
5648  * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5649  *
5650  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5651  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5652  *
5653  * @exception   None
5654  * @param[in]   char_pty - GATT characteristics property structure.
5655  *
5656  * @remark      None
5657  * @see         bluetooth_gatt_get_characteristics_property()
5658  */
5659 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5660
5661 /**
5662  * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5663  *
5664  * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5665  *
5666  * This function is a synchronous call.
5667  * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5668  *
5669  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5670  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5671  *
5672  * @exception   None
5673  * @param[in]   desc_pty - GATT characteristics descriptor property structure.
5674  *
5675  * @remark      None
5676  * @see         bluetooth_gatt_get_char_descriptor_property()
5677  */
5678 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5679
5680 int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
5681                                 gboolean auto_connect, int client_id);
5682
5683 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
5684                 int client_id);
5685
5686 int bluetooth_get_gatt_data_batching_available_packets(
5687         int *available_packets);
5688
5689 int bluetooth_enable_gatt_data_batching(
5690         const bluetooth_device_address_t *device_address, int packet_threshold, int timeout);
5691
5692 int bluetooth_disable_gatt_data_batching(
5693         const bluetooth_device_address_t *device_address);
5694
5695  /**
5696  * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5697  *
5698  * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5699  *
5700  * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5701  *
5702  * @return  BLUETOOTH_ERROR_NONE  - Success \n
5703  *                      BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5704  *
5705  * @exception   None
5706  * @param[in]   characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5707  *
5708  * @remark      None
5709  */
5710 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5711
5712 /**
5713  * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5714  *
5715  * @brief Read characteristic descriptor value.
5716  *
5717  * This function is a asynchronous call.
5718  *
5719  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5720  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5721  *             BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5722  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5723  *
5724  * @exception  None
5725  * @param[in]  desc_handle - Handle for Characteristic descriptor
5726  *
5727  * @remark     None
5728  * @see        None
5729  */
5730 int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
5731
5732 /**
5733  * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5734  *                      const guint8 *value, int length);
5735  *
5736  * @brief Set characteristic descriptor value.
5737  *
5738  * This function is a asynchronous call.
5739  *
5740  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5741  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5742  *             BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5743  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5744  *
5745  * @exception  None
5746  * @param[in]  desc_handle - Handle for Characteristic descriptor
5747  * @param[in]  value - New value to set for characteristic descriptor
5748  * @param[in]  length - Length of the value to be set.
5749  *
5750  * @remark     None
5751  * @see        None
5752  */
5753 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5754                         const guint8 *value, int length, gpointer app_data);
5755
5756 /* @fn int bluetooth_gatt_init(void)
5757 *
5758 * @brief Initializes the gatt service.
5759 *
5760 * This function is a synchronous call.
5761 * @return   BLUETOOTH_ERROR_NONE        - Success \n
5762 *       BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5763 *       BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5764 *       BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5765 *
5766 * @exception     None
5767 * @remark  Adapter should be enabled
5768 * @see  bluetooth_gatt_deinit()
5769 */
5770 int bluetooth_gatt_init(void);
5771
5772 /* @fn int bluetooth_gatt_init(void)
5773 *
5774 * @brief DeInitializes the gatt service.
5775 *
5776 * This function is a synchronous call.
5777 * @return   BLUETOOTH_ERROR_NONE        - Success \n
5778 *       BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5779 *       BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5780 *       BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5781 *
5782 * @exception     None
5783 * @remark  Adapter should be enabled
5784 * @see  bluetooth_gatt_init()
5785 */
5786 int bluetooth_gatt_deinit(void);
5787
5788 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5789                         unsigned char **svc_path)
5790 *
5791 * @brief Exports a new gatt service to the service interface.
5792 *
5793 * This function is a synchronous call.
5794 *
5795 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5796 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5797 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5798 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5799 *
5800 * @exception     None
5801 * @param[in]   svc_uuid  Gatt service uuid.
5802 * @param[out] svc_path  service object path of the exported service.
5803 * @remark  Adapter should be enabled
5804 * @see  bluetooth_gatt_init()
5805 */
5806 int bluetooth_gatt_add_service(const char *svc_uuid,
5807                         char **svc_path);
5808
5809 /* @fn int bluetooth_gatt_add_new_characteristic(
5810                         const char *svc_path, const char *char_uuid,
5811                         bt_gatt_permission_t permissions,
5812                         bt_gatt_characteristic_property_t properties,
5813                         int flags_length, char **char_path);;
5814 *
5815 * @brief Exports a new gatt characteristic to the characteristic interface.
5816 *
5817 * This function is a synchronous call.
5818 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5819 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5820 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5821 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5822 * @exception     None
5823 * @param[in]   svc_path service object path of the exported service.
5824 * @param[in]   char_uuid  Gatt service uuid.
5825 * @param[in]   properties       GATT characteristic properties.
5826 * @param[out] char_path characteristic object path of the exported characteristic.
5827 *
5828 * @remark  Adapter should be enabled
5829 * @see  bluetooth_gatt_add_service()
5830 */
5831 int bluetooth_gatt_add_new_characteristic(
5832                         const char *svc_path, const char *char_uuid,
5833                         bt_gatt_permission_t permissions,
5834                         bt_gatt_characteristic_property_t properties,
5835                         char **char_path);
5836
5837 /* @fn bluetooth_gatt_set_characteristic_value(
5838                         const char *characteristic, const char *char_value,
5839                         int value_length);
5840 *
5841 * @brief adds gatt charactertisic value to the given charactertistic path.
5842 *
5843 * This function is a synchronous call.
5844 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5845 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5846 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5847 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5848 * @exception     None
5849 * @param[in]   char_value Value of the GATT characteristic to be added.
5850 * @param[in]   value_length length of the chantacteristic value..
5851 * @param[out] characteristic characteristic object path..
5852 *
5853 * @remark  Adapter should be enabled
5854 * @see  bluetooth_gatt_add_service()
5855 */
5856 int bluetooth_gatt_set_characteristic_value(
5857                         const char *characteristic, const char *char_value,
5858                         int value_length);
5859
5860 /* @fn  int bluetooth_gatt_add_descriptor(
5861                         const char *char_path, const char *desc_uuid,
5862                         bt_gatt_permission_t permissions,
5863                         char **desc_path);
5864 *
5865 * @brief Exports a new gatt descriptor to the descriptor interface.
5866 *
5867 * This function is a synchronous call.
5868 *
5869 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5870 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5871 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5872 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5873 *
5874 * @exception    None
5875 * @param[in]    desc_uuid  Gatt descriptor uuid.
5876 * @param[in]    desc_value      GATT descriptor value.
5877 * @param[in]    value_length    Length of GATT descriptor value.
5878 * @param[in]    permissions     descriptor permissions.
5879 * @param[in]    properties      GATT descriptor properties.
5880 * @param[in]    char_path       characteristics object path of the exported character.
5881 *
5882 * @remark  Adapter should be enabled
5883 * @see  bluetooth_gatt_add_service()
5884 * @see  bluetooth_gatt_add_characteristics()
5885 */
5886 int bluetooth_gatt_add_descriptor(
5887                         const char *char_path, const char *desc_uuid,
5888                         bt_gatt_permission_t permissions,
5889                         char **desc_path);
5890
5891 /* @fn int bluetooth_gatt_set_descriptor_value(
5892                    const char *desc_path, const char *desc_value,
5893                    int value_length);
5894 *
5895 * @brief Adds value to the given descriptor handle.
5896 *
5897 * This function is a synchronous call.
5898 *
5899 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5900 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5901 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5902 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5903 *
5904 * @exception     None
5905 * @param[in]   desc_value       GATT descriptor value.
5906 * @param[in]   value_length     Length of GATT descriptor value.
5907 * @param[in]   desc_path descriptor path to which the value needs to be added.
5908 *
5909 * @remark  Adapter should be enabled
5910 * @see  bluetooth_gatt_add_service()
5911 * @see  bluetooth_gatt_add_characteristics()
5912 */
5913 int bluetooth_gatt_set_descriptor_value(
5914                    const char *desc_path, const char *desc_value,
5915                    int value_length);
5916
5917 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5918 *
5919 * @brief Reads the Service registered on manager interface.
5920 *
5921 * This function is a synchronous call.
5922 *
5923 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5924 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5925 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5926 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5927 *
5928 * @exception     None
5929 * @param[in]   svc_uuid  Gatt Service uuid.
5930 *
5931 * @remark  Adapter should be enabled and service should be registered.
5932 * @see  bluetooth_gatt_register_service()
5933 */
5934 int bluetooth_gatt_get_service(const char *svc_uuid);
5935
5936 /* @fn int bluetooth_gatt_register_service(const  char *svc_path)
5937 *
5938 * @brief Registers the given service path with the library.
5939 *
5940 * This function is a synchronous call.
5941 *
5942 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5943 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5944 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5945 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5946 *
5947 * @exception     None
5948 * @param[in] svc_path   service object path of the exported service.
5949 *
5950 * @remark  Adapter should be enabled
5951 * @see  bluetooth_gatt_add_service()
5952 * @see  bluetooth_gatt_add_characteristics()
5953 * @see  bluetooth_gatt_add_descriptor()
5954 * @see  bluetooth_gatt_register_application()
5955 */
5956 int bluetooth_gatt_register_service(const char *svc_path);
5957
5958 /* @fn int bluetooth_gatt_register_application(void)
5959 *
5960 * @brief Registers the application with the bluez gatt server.
5961 *
5962 * This function is a synchronous call.
5963 *
5964 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5965 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5966 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5967 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5968 *
5969 * @exception     None
5970 *
5971 * @remark  Adapter should be enabled
5972 * @see  bluetooth_gatt_init()
5973 * @see  bluetooth_gatt_add_service()
5974 * @see  bluetooth_gatt_add_characteristics()
5975 * @see  bluetooth_gatt_add_descriptor()
5976 * @see  bluetooth_gatt_register_service()
5977 */
5978 int bluetooth_gatt_register_application(void);
5979
5980 /* @fn int bluetooth_gatt_unregister_service(const  char *svc_path)
5981 *
5982 * @brief Removes(unregister) service from the bluez gatt server db.
5983 *
5984 * This function is a synchronous call.
5985 *
5986 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5987 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5988 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5989 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5990 *
5991 * @exception     None
5992 * @param[in] svc_path   service object path of the exported service.
5993 *
5994 * @remark  Adapter should be enabled
5995 * @see  bluetooth_gatt_add_service()
5996 * @see  bluetooth_gatt_add_characteristics()
5997 * @see  bluetooth_gatt_add_descriptor()
5998 * @see bluetooth_gatt_register_service()
5999 */
6000 int bluetooth_gatt_unregister_service(const char *svc_path);
6001
6002 /* @fn int bluetooth_gatt_unregister_application(void)
6003 *
6004 * @brief Removes(unregister) the application with the bluez gatt server,
6005 *        and deletes all the service registered.
6006 *
6007 * This function is a synchronous call.
6008 *
6009 * @return       BLUETOOTH_ERROR_NONE    - Success \n
6010 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6011 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6012 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6013 *
6014 * @exception     None
6015 *
6016 * @remark  Adapter should be enabled
6017 * @see  bluetooth_gatt_init()
6018 * @see  bluetooth_gatt_add_service()
6019 * @see  bluetooth_gatt_add_characteristics()
6020 * @see  bluetooth_gatt_add_descriptor()
6021 * @see  bluetooth_gatt_register_service()
6022 * @see  bluetooth_gatt_unregister_service()
6023 */
6024 int bluetooth_gatt_unregister_application(void);
6025
6026 /* @fn int bluetooth_gatt_send_response(int request_id,
6027 *                               int offset, char *value, int value_length)
6028 *
6029 * @brief Updates the attribute value in local attribute list.
6030 *
6031 * This function is a synchronous call.
6032 *
6033 * @return       BLUETOOTH_ERROR_NONE    - Success \n
6034 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6035 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6036 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6037 *
6038 * @exception     None
6039 * @param[in] request_id The identification of a read request
6040 * @param[in] req_type The identification of  request type (TRUE for Read request and FALSE for write request)
6041 * @param[in] resp_state The identification of response state
6042 * @param[in] offset The offset from where a value is read
6043 * @param[in] value The value to be sent. It will be sent from @a offset.
6044 *               If it is NULL, a requested GATT handle's value will be sent from @a offset.
6045 * @param[in] value_length Value Length.
6046 *
6047 * @remark  Adapter should be enabled
6048 * @see  bluetooth_gatt_add_service()
6049 * @see  bluetooth_gatt_add_characteristics()
6050 * @see  bluetooth_gatt_add_descriptor()
6051 * @see bluetooth_gatt_register_service()
6052 */
6053 int bluetooth_gatt_send_response(int request_id, guint req_type,
6054                                 int resp_state, int offset, char *value, int value_length);
6055
6056 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
6057 *
6058 * @brief Sets the notification property for a characteristic.
6059 *
6060 * This function is a synchronous call.
6061 *
6062 * @return       BLUETOOTH_ERROR_NONE    - Success \n
6063 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6064 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6065 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6066 *
6067 * @exception     None
6068 * @param[in] char_path characteristic object path.
6069 * @param[in]   unicast_address remote device address. if set notification is sent to only one device.
6070 *
6071 * @remark  Adapter should be enabled
6072 * @see  bluetooth_gatt_update_characteristic()
6073 */
6074 int bluetooth_gatt_server_set_notification(const char *char_path,
6075                                 bluetooth_device_address_t *unicast_address);
6076
6077 /* @fn int bluetooth_gatt_delete_services(void)
6078 *
6079 * @brief deletes (unregisters) all services from the gatt server database..
6080 *
6081 * This function is a synchronous call.
6082 *
6083 * @return       BLUETOOTH_ERROR_NONE    - Success \n
6084 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6085 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6086 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6087 *
6088 * @exception     None
6089 *
6090 * @remark  Adapter should be enabled
6091 * @see  bluetooth_gatt_add_service()
6092 * @see  bluetooth_gatt_add_characteristics()
6093 * @see  bluetooth_gatt_add_descriptor()
6094 * @see bluetooth_gatt_register_service()
6095 * @see bluetooth_gatt_unregister_service()
6096 */
6097 int bluetooth_gatt_delete_services(void);
6098
6099 /* @fn int bluetooth_gatt_update_characteristic(void)
6100 *
6101 * @brief updates the given characteristic with a new value
6102 *
6103 * This function is a synchronous call.
6104 *
6105 * @return       BLUETOOTH_ERROR_NONE    - Success \n
6106 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6107 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
6108 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
6109 *
6110 * @exception     None
6111 *
6112 * @remark  Adapter should be enabled
6113 * @see  bluetooth_gatt_add_service()
6114 * @see  bluetooth_gatt_add_characteristics()
6115 * @see  bluetooth_gatt_add_descriptor()
6116 * @see bluetooth_gatt_register_service()
6117 * @see bluetooth_gatt_unregister_service()
6118 */
6119 int bluetooth_gatt_update_characteristic(const char *char_path,
6120                 const char* char_value, int value_length);
6121
6122 /**
6123  * @fn int bluetooth_set_advertising(int handle, gboolean enable);
6124  *
6125  * @brief Set advertising status.
6126  *
6127  * This function is used to enable or disable LE advertising.
6128  * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6129  *
6130  * This function is a synchronous call.
6131  *
6132  * @return      BLUETOOTH_ERROR_NONE - Success \n
6133  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6134  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6135  *
6136  * @exception   None
6137  * @param[in]   enable - The status of advertising
6138  *
6139  * @remark      None
6140  * @see         bluetooth_set_advertising_data
6141  */
6142 int bluetooth_set_advertising(int handle, gboolean enable);
6143
6144 /**
6145  * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
6146  *
6147  * @brief Set advertising status along with interval value.
6148  *
6149  * This function is used to enable or disable LE advertising.
6150  * Interval_min and Interval_max is used to set the best advertising interval.
6151  * Once advertising is enabled, Advertising data is transmitted in the advertising packets
6152  *
6153  * This function is a synchronous call.
6154  *
6155  * @return      BLUETOOTH_ERROR_NONE - Success \n
6156  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6157  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6158  *
6159  * @exception   None
6160  * @param[in]   enable - The status of advertising
6161  * @param[in]   interval_min - Minimum interval of advertising (msec)
6162  * @param[in]   interval_max - Maximum interval of advertising (msec)
6163  * @param[in]   filter_policy - Advertising filter policy
6164  *
6165  * @remark      None
6166  * @see         bluetooth_set_advertising_data
6167  */
6168 int bluetooth_set_custom_advertising(int handle, gboolean enable,
6169                                         bluetooth_advertising_params_t *params);
6170
6171 /**
6172  * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6173  * @brief Get the advertising data
6174  *
6175  * This function is used to get advertising data.
6176  * Before calling this API, the adapter should be enabled.
6177  *
6178  * This function is a synchronous call.
6179  *
6180  * @return      BLUETOOTH_ERROR_NONE - Success \n
6181  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6182  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6183  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6184  *
6185  * @param[out]  value - Advertising data structure.
6186  * @param[out]  length - The length of Advertising data.
6187  *
6188  * @remark      None
6189 @code
6190 bluetooth_advertising_data_t *value = { {0} };
6191 int length;
6192 int ret = 0;
6193 ret = bluetooth_get_advertising_data(&value, &length);
6194 @endcode
6195  */
6196 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
6197
6198 /**
6199  * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6200  *
6201  * @brief Set advertising data with value
6202  *
6203  * This function is used to set advertising data and Maximum size of advertising data
6204  *  is 28 byte (Except Flag)
6205  *
6206  * This function is a synchronous call.
6207  *
6208  * @return      BLUETOOTH_ERROR_NONE - Success \n
6209  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6210  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6211  *
6212  * @exception   None
6213  * @param[in]   value - Advertising data structure.
6214  *
6215  * @remark      None
6216  */
6217 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
6218
6219 /**
6220  * @fn int bluetooth_check_privilege_advertising_parameter(void);
6221  *
6222  * @brief Check the privilege for advertising parameter setting
6223  *
6224  * This function is a synchronous call.
6225  *
6226  * @return      BLUETOOTH_ERROR_NONE - Success \n
6227  *              BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
6228  *
6229  * @exception   None
6230  *
6231  * @remark      None
6232  */
6233 int bluetooth_check_privilege_advertising_parameter(void);
6234
6235 /**
6236  * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6237  * @brief Get the LE scan response data
6238  *
6239  * This function is used to get scan response data.
6240  * Before calling this API, the adapter should be enabled.
6241  *
6242  * This function is a synchronous call.
6243  *
6244  * @return      BLUETOOTH_ERROR_NONE - Success \n
6245  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6246  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
6247  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6248  *
6249  * @param[out]  value - Scan response data structure.
6250  * @param[out]  length - The length of Scan response data.
6251  *
6252  * @remark      None
6253 @code
6254 bluetooth_scan_resp_data_t *value = { {0} };
6255 int length;
6256 int ret = 0;
6257 ret = bluetooth_get_scan_response_data(&value, &length);
6258 @endcode
6259  */
6260 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6261
6262 /**
6263  * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6264  *
6265  * @brief Set scan response data with value
6266  *
6267  * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6268  *
6269  * This function is a synchronous call.
6270  *
6271  * @return      BLUETOOTH_ERROR_NONE - Success \n
6272  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6273  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6274  *
6275  * @exception   None
6276  * @param[in]   value - LE Scan response data structure.
6277  *
6278  * @remark      None
6279  */
6280 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6281
6282 /**
6283  * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6284  *
6285  * @brief Set scan interval and window
6286  *
6287  * This function is used to set LE scan interval and window size
6288  *
6289  * This function is a synchronous call.
6290  *
6291  * @return      BLUETOOTH_ERROR_NONE - Success \n
6292  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6293  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6294  *
6295  * @exception   None
6296  * @param[in]   interval - Interval of LE scan (msec)
6297  * @param[in]   window - Window size of LE scan (msec)
6298  *
6299  * @remark      None
6300  */
6301 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6302
6303 /**
6304  * @fn intbluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6305  *ss
6306  * @brief Set scan type
6307  *
6308  * This function is used to set LE scan type
6309  *
6310  * This function is a synchronous call.
6311  *
6312  * @return      BLUETOOTH_ERROR_NONE - Success \n
6313  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6314  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6315  *
6316  * @exception   None
6317  * @param[in]   scan_type - LE scan type
6318  *
6319  * @remark      None
6320  */
6321 int bluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
6322
6323 /**
6324  * @fn int bluetooth_is_advertising(void)
6325  * @brief Check for the advertising is in-progress or not.
6326  *
6327  * This API is used to check the current status of the advertising procedure.
6328  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6329  * this API.
6330  *
6331  * This function checks whether the advertising is started or not.
6332  *
6333  * This function is a synchronous call.
6334  *
6335  * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c  false = not in progress)
6336  *
6337  * @return      BLUETOOTH_ERROR_NONE - Success \n
6338  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6339  *
6340  * @remark      None
6341  * @see         bluetooth_set_advertising, bluetooth_set_custom_advertising
6342
6343 @code
6344 int ret;
6345 gboolean is_advertising = 0;
6346
6347 ret = bluetooth_is_advertising(&is_advertising);
6348 @endcode
6349  */
6350 int bluetooth_is_advertising(gboolean *is_advertising);
6351
6352 /**
6353  * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6354  * @brief Add LE device to white list
6355  *
6356  * This API is used to add LE device to white list
6357  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6358  * this API.
6359  *
6360  *
6361  * This function is a synchronous call.
6362  *
6363  * @param[in] address The address of remote device
6364  *
6365  * @return      BLUETOOTH_ERROR_NONE - Success \n
6366  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6367  *
6368  * @remark      None
6369  * @see         bluetooth_set_custom_advertising
6370  */
6371 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6372
6373 /**
6374  * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6375  * @brief Remove LE device from white list
6376  *
6377  * This API is used to remove LE device from white list
6378  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6379  * this API.
6380  *
6381  *
6382  * This function is a synchronous call.
6383  *
6384  * @param[in] address The address of remote device
6385  *
6386  * @return      BLUETOOTH_ERROR_NONE - Success \n
6387  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6388  *
6389  * @remark      None
6390  * @see         bluetooth_set_custom_advertising
6391  */
6392 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6393
6394 /**
6395  * @fn int bluetooth_clear_white_list(void)
6396  * @brief Clear white list
6397  *
6398  * This API is used to clear white list
6399  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6400  * this API.
6401  *
6402  *
6403  * This function is a synchronous call.
6404  *
6405  * @param[in] address The address of remote device
6406  *
6407  * @return      BLUETOOTH_ERROR_NONE - Success \n
6408  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6409  *
6410  * @remark      None
6411  * @see         bluetooth_set_custom_advertising
6412  */
6413 int bluetooth_clear_white_list(void);
6414
6415 /**
6416  * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6417  *          const bluetooth_le_connection_param_t *parameters)
6418  * @brief update connection paramter of LE connection.
6419  *
6420  * This function is a synchronous call.
6421  *
6422  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6423  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6424  *
6425  * @exception  None
6426  * @param[in]  address - remote device address value.
6427  * @param[in]  parameters - new connection parameters.
6428  *
6429  * @remark       None
6430  * @see     bluetooth_bond_device
6431  */
6432 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6433                 const bluetooth_le_connection_param_t *parameters);
6434
6435 /**
6436  * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6437  *
6438  * @brief Enable/Disable LE Privacy feature.
6439  *
6440  * This function is used to enable or disable LE Privacy feature.
6441  * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6442  *
6443  * This function is a synchronous call.
6444  *
6445  * @return      BLUETOOTH_ERROR_NONE - Success \n
6446  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6447  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6448  *
6449  * @exception   None
6450  * @param[in]   enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6451  *
6452  * @remark      None
6453  */
6454 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6455
6456 /**
6457  * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6458  *
6459  * @brief Enable/Disable LE static random address.
6460  *
6461  * This function is used to enable or disable LE static random address.
6462  *
6463  * This function is a synchronous call.
6464  *
6465  * @return      BLUETOOTH_ERROR_NONE - Success \n
6466  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6467  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6468  *
6469  * @exception   None
6470  * @param[in]   enable - The status of LE static random address to be activated/deactivated[True/False].
6471  *
6472  * @remark      None
6473  */
6474 int bluetooth_set_le_static_random_address(gboolean enable);
6475
6476 /**
6477  * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6478  *                                             bluetooth_le_connection_mode_t mode)
6479  * @brief update connection paramter of LE connection.
6480  *
6481  * This function is a synchronous call.
6482  *
6483  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6484  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6485  *           BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6486  *
6487  * @exception  None
6488  * @param[in]  address - remote device address value.
6489  * @param[in]  mode - new connection mode.
6490  *
6491  * @remark       None
6492  */
6493 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6494                 bluetooth_le_connection_mode_t mode);
6495
6496 /**
6497  * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6498  * @brief Request for new ATT MTU value.
6499  *
6500  * This function is a asynchronous call.
6501  *
6502  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6503  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6504  *           BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6505  *
6506  * @exception  None
6507  * @param[in]  address - remote device address value.
6508  * @param[in]  mtu - MTU value to be set.
6509  *
6510  * @remark       None
6511  */
6512 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6513
6514 /**
6515  * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6516  *                              unsigned int *mtu)
6517  * @brief Gets the xisting MTU value set for a connection.
6518  *
6519  * This function is a synchronous call.
6520  *
6521  * @return       BLUETOOTH_ERROR_NONE  - Success \n
6522  *                       BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6523  *                       BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6524  *
6525  * @exception  None
6526  * @param[in]  address - remote device address value.
6527  * @param[out]  mtu - MTU value set for the connection.
6528  *
6529  * @remark               None
6530  */
6531 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6532                                 unsigned int *mtu);
6533
6534 /**
6535  * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6536  *                                      bluetooth_device_address_t *id_address)
6537  * @brief Gets the Identity address of remote device.
6538  *
6539  * This function is a synchronous call.
6540  *
6541  * @return              BLUETOOTH_ERROR_NONE  - Success \n
6542  *                      BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6543  *                      BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6544  *
6545  * @exception  None
6546  * @param[in]  device_rpa - remote Resolvable private address.
6547  * @param[out] id_address - remote Identity device address value.
6548  *
6549  * @remark               None
6550  */
6551 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6552         bluetooth_device_address_t *id_address);
6553
6554 /**
6555  * @fn int bluetooth_le_read_maximum_data_length()
6556  * @brief reads the maximum LE data length supported in the controller.
6557  *
6558  * This function is a synchronous call.
6559  *
6560  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6561  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6562  *
6563  * @exception  None
6564  *
6565  * @remark       None
6566  */
6567 int bluetooth_le_read_maximum_data_length(
6568                         bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6569 /**
6570  * @fn int bluetooth_le_write_host_suggested_default_data_length()
6571  * @brief writes the host suggested values for the controllers max transmitted no of payload
6572  * octects to be used for new connections.
6573  *
6574  * This function is a synchronous call.
6575  *
6576  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6577  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6578  *
6579  * @exception  None
6580  *
6581  * @remark       None
6582  */
6583 int bluetooth_le_write_host_suggested_default_data_length(
6584                 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6585
6586 int bluetooth_le_read_suggested_default_data_length(
6587         bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6588
6589 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6590         const unsigned int max_tx_octets, const unsigned int max_tx_time);
6591
6592 int bluetooth_pbap_init(void);
6593 int bluetooth_pbap_deinit(void);
6594 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6595 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6596 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6597                 bt_pbap_folder_t *folder);
6598 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6599                 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6600 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6601                 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6602 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6603                 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6604 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6605                 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6606
6607 /**
6608  * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6609  *
6610  * @brief Set manufacturer data with value
6611  *
6612  * This function is used to set manufacturer data.
6613  *
6614  * This function is a synchronous call.
6615  *
6616  * @return      BLUETOOTH_ERROR_NONE - Success \n
6617  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6618  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6619  *
6620  * @exception   None
6621  * @param[in]   value - Manufacturer data structure.
6622  *
6623  * @remark      None
6624  */
6625 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6626
6627 int bluetooth_set_passkey_notification(gboolean enable);
6628
6629 /**
6630  * @fn int bluetooth_dpm_is_mode_allowed(void);
6631  *
6632  * @brief Checks Restriction for BT mode(BT allowed or not)
6633  *
6634  * This function is a synchronous call.
6635  *
6636  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6637  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6638  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6639  *
6640  * @exception   None
6641  *  @param[in] None
6642  *
6643  * @remark      None
6644  */
6645 int bluetooth_dpm_is_mode_allowed(void);
6646
6647 /**
6648  * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6649  *
6650  * @brief Sets Restriction for BT mode(BT allowed or not)
6651  *
6652  * This function is a synchronous call.
6653  *
6654  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6655  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6656  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6657  *
6658  * @exception   None
6659  * @param[in]   value - BT Allow value.
6660  *              BLUETOOTH_DPM_ERROR  = -1,       < bluetooth allowance error
6661  *              BLUETOOTH_DPM_BT_ALLOWED,                < bluetooth allowance allowed
6662  *              BLUETOOTH_DPM_HANDSFREE_ONLY,  < bluetooth allowance handsfree only
6663  *              BLUETOOTH_DPM_BT_RESTRICTED,  < bluetooth allowance restricted
6664  *
6665  * @remark      None
6666  */
6667 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6668
6669 /**
6670  * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6671  *
6672  * @brief Reads the Restriction for BT mode(BT allowed or not)
6673  *
6674  * This function is a synchronous call.
6675  *
6676  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6677  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6678  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6679  *
6680  * @exception   None
6681  *  @param[in] None
6682  * @param[out]  value - BT Allow value.
6683  *              BLUETOOTH_DPM_ERROR      = -1,   < bluetooth allowance error
6684  *              BLUETOOTH_DPM_BT_ALLOWED,                < bluetooth allowance allowed
6685  *              BLUETOOTH_DPM_HANDSFREE_ONLY,  < bluetooth allowance handsfree only
6686  *              BLUETOOTH_DPM_BT_RESTRICTED,  < bluetooth allowance restricted
6687  *
6688  * @remark      None
6689  */
6690 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6691
6692 /**
6693  * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6694  *
6695  * @brief Sets the Restriction for device.
6696  *
6697  * This function is a synchronous call.
6698  *
6699  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6700  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6701  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6702  *
6703  * @exception   None
6704  * @param[in]   value - State value.
6705  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6706  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6707  *
6708  * @remark      None
6709  */
6710 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6711
6712 /**
6713  * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6714  *
6715  * @brief Reads the Restriction for device.
6716  *
6717  * This function is a synchronous call.
6718  *
6719  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6720  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6721  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6722  *
6723  * @exception   None
6724  * @param[in] None
6725  * @param[out]  value - State value.
6726  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6727  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6728  *
6729  * @remark      None
6730  */
6731 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6732
6733 /**
6734  * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6735  *
6736  * @brief Sets the Restriction for uuid.
6737  *
6738  * This function is a synchronous call.
6739  *
6740  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6741  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6742  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6743  *
6744  * @exception   None
6745  * @param[in]   value - State value.
6746  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6747  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6748  *
6749  * @remark      None
6750  */
6751 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6752
6753 /**
6754  * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6755  *
6756  * @brief Reads the Restriction for uuid.
6757  *
6758  * This function is a synchronous call.
6759  *
6760  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6761  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6762  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6763  *
6764  * @exception   None
6765  * @param[in] None
6766  * @param[out]  value - State value.
6767  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6768  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6769  *
6770  * @remark      None
6771  */
6772 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6773
6774 /**
6775  * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6776  *
6777  * @brief Adds the device to blacklist.
6778  *
6779  * This function is a synchronous call.
6780  *
6781  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6782  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6783  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6784  *
6785  * @exception   None
6786  * @param[in]   device_address - Device address
6787  *
6788  * @remark      None
6789  */
6790 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6791
6792 /**
6793  * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6794  *
6795  * @brief Adds the device to whitelist.
6796  *
6797  * This function is a synchronous call.
6798  *
6799  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6800  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6801  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6802  *
6803  * @exception   None
6804  * @param[in]   device_address - Device address
6805  *
6806  * @remark      None
6807  */
6808 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6809
6810 /**
6811  * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6812  *
6813  * @brief Adds the Service UUIDS to blacklist.
6814  *
6815  * This function is a synchronous call.
6816  *
6817  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6818  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6819  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6820  *
6821  * @exception   None
6822  * @param[in]   service_uuids - profile or custom service uuids
6823  *
6824  * @remark      None
6825  */
6826 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6827
6828 /**
6829  * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6830  *
6831  * @brief Adds the Service UUIDS to whitelist.
6832  *
6833  * This function is a synchronous call.
6834  *
6835  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6836  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6837  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6838  *
6839  * @exception   None
6840  * @param[in]   service_uuids - profile or custom service uuids
6841  *
6842  * @remark      None
6843  */
6844 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6845
6846 /**
6847  * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6848  *
6849  * @brief Clears the devices from blacklist.
6850  *
6851  * This function is a synchronous call.
6852  *
6853  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6854  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6855  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6856  *
6857  * @exception   None
6858  * @param[in]   None
6859  *
6860  * @remark      None
6861  */
6862 int bluetooth_dpm_clear_devices_from_blacklist(void);
6863
6864 /**
6865  * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6866  *
6867  * @brief Clears the devices from whitelist.
6868  *
6869  * This function is a synchronous call.
6870  *
6871  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6872  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6873  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6874  *
6875  * @exception   None
6876  * @param[in]   None
6877  *
6878  * @remark      None
6879  */
6880 int bluetooth_dpm_clear_devices_from_whitelist(void);
6881
6882 /**
6883  * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6884  *
6885  * @brief Clears the uuids from blacklist.
6886  *
6887  * This function is a synchronous call.
6888  *
6889  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6890  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6891  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6892  *
6893  * @exception   None
6894  * @param[in]   None
6895  *
6896  * @remark      None
6897  */
6898 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6899
6900 /**
6901  * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6902  *
6903  * @brief Clears the uuids from whitelist.
6904  *
6905  * This function is a synchronous call.
6906  *
6907  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6908  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6909  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6910  *
6911  * @exception   None
6912  * @param[in]   None
6913  *
6914  * @remark      None
6915  */
6916 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6917
6918 /**
6919  * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6920  *
6921  * @brief reads the devices from blacklist.
6922  *
6923  * This function is a synchronous call.
6924  *
6925  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6926  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6927  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6928  *
6929  * @exception   None
6930  * @param[out]  device_list - list of devices
6931  *
6932  * @remark      None
6933  */
6934 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6935
6936 /**
6937  * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6938  *
6939  * @brief reads the devices from whitelist.
6940  *
6941  * This function is a synchronous call.
6942  *
6943  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6944  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6945  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6946  *
6947  * @exception   None
6948  * @param[out]  device_list - list of devices
6949  *
6950  * @remark      None
6951  */
6952 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6953
6954 /**
6955  * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6956  *
6957  * @brief reads the uuids from blacklist.
6958  *
6959  * This function is a synchronous call.
6960  *
6961  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6962  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6963  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6964  *
6965  * @exception   None
6966  * @param[in]   uuid_list - list of uuids
6967  *
6968  * @remark      None
6969  */
6970 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6971
6972 /**
6973  * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6974  *
6975  * @brief reads the uuids from whitelist.
6976  *
6977  * This function is a synchronous call.
6978  *
6979  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6980  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6981  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6982  *
6983  * @exception   None
6984  * @param[in]   uuid_list - list of uuids
6985  *
6986  * @remark      None
6987  */
6988 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6989
6990 /**
6991  * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6992  *
6993  * @brief Removes the device from whitelist.
6994  *
6995  * This function is a synchronous call.
6996  *
6997  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6998  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6999  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7000  *
7001  * @exception   None
7002  * @param[in]   device_address - Device address
7003  *
7004  * @remark      None
7005  */
7006 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
7007
7008 /**
7009  * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
7010  *
7011  * @brief Removes the device from blacklist.
7012  *
7013  * This function is a synchronous call.
7014  *
7015  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7016  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7017  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7018  *
7019  * @exception   None
7020  * @param[in]   device_address - Device address
7021  *
7022  * @remark      None
7023  */
7024 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
7025
7026 /**
7027  * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
7028  *
7029  * @brief Removes the Service UUIDS from whitelist.
7030  *
7031  * This function is a synchronous call.
7032  *
7033  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7034  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7035  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7036  *
7037  * @exception   None
7038  * @param[in]   service_uuids - profile or custom service uuids
7039  *
7040  * @remark      None
7041  */
7042 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
7043
7044 /**
7045  * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
7046  *
7047  * @brief Removes the Service UUIDS from blacklist.
7048  *
7049  * This function is a synchronous call.
7050  *
7051  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7052  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7053  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7054  *
7055  * @exception   None
7056  * @param[in]   service_uuids - profile or custom service uuids
7057  *
7058  * @remark      None
7059  */
7060 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
7061
7062 /**
7063  * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7064  *
7065  * @brief Sets the Restriction for outgoing call.
7066  *
7067  * This function is a synchronous call.
7068  *
7069  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7070  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7071  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7072  *
7073  * @exception   None
7074  * @param[in]   value - State value.
7075  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7076  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7077  *
7078  * @remark      None
7079  */
7080 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
7081
7082 /**
7083  * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7084  *
7085  * @brief Reads the Restriction for  outgoing call.
7086  *
7087  * This function is a synchronous call.
7088  *
7089  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7090  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7091  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7092  *
7093  * @exception   None
7094  * @param[in] None
7095  * @param[out]  value - State value.
7096  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7097  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7098  *
7099  * @remark      None
7100  */
7101 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
7102
7103 /**
7104  * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7105  *
7106  * @brief Sets the Restriction for Pairing.
7107  *
7108  * This function is a synchronous call.
7109  *
7110  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7111  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7112  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7113  *
7114  * @exception   None
7115  * @param[in]   value - State value.
7116  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7117  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7118  *
7119  * @remark      None
7120  */
7121 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
7122
7123 /**
7124  * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7125  *
7126  * @brief Reads the Restriction for Pairing
7127  *
7128  * This function is a synchronous call.
7129  *
7130  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7131  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7132  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7133  *
7134  * @exception   None
7135  * @param[in] None
7136  * @param[out]  value - State value.
7137  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7138  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7139  *
7140  * @remark      None
7141  */
7142 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
7143
7144 /**
7145  * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7146  *
7147  * @brief Sets the Restriction for using Profiles.
7148  *
7149  * This function is a synchronous call.
7150  *
7151  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7152  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7153  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7154  *
7155  * @exception   None
7156  * @param[in]profile - Profile.
7157  *              BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7158  *              BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7159  *              BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7160  *              BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7161  *              BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7162  *              BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7163  *              BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7164  *              BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7165  *              BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7166  *              BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7167  *              BLUETOOTH_DPM_PROFILE_NONE
7168  * @param[in]   value - State value.
7169  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7170  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7171  *
7172  * @remark      None
7173  */
7174 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
7175
7176 /**
7177  * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7178  *
7179  * @brief Reads the Restriction for using Profiles.
7180  *
7181  * This function is a synchronous call.
7182  *
7183  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7184  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7185  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7186  *
7187  * @exception   None
7188  * @param[in]profile - Profile.
7189  *              BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
7190  *              BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
7191  *              BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
7192  *              BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
7193  *              BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
7194  *              BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
7195  *              BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
7196  *              BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
7197  *              BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
7198  *              BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
7199  *              BLUETOOTH_DPM_PROFILE_NONE
7200  * @param[out]  value - State value.
7201  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7202  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7203  *
7204  * @remark      None
7205  */
7206 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
7207
7208 /**
7209  * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7210  *
7211  * @brief Sets the Restriction for Desktop Connectivity.
7212  *
7213  * This function is a synchronous call.
7214  *
7215  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7216  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7217  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7218  *
7219  * @exception   None
7220  * @param[in]   value - State value.
7221  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7222  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7223  *
7224  * @remark      None
7225  */
7226 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
7227
7228 /**
7229  * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7230  *
7231  * @brief Reads the Restriction for Desktop Connectivity.
7232  *
7233  * This function is a synchronous call.
7234  *
7235  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7236  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7237  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7238  *
7239  * @exception   None
7240  * @param[in] None
7241  * @param[out]  value - State value.
7242  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7243  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7244  *
7245  * @remark      None
7246  */
7247 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
7248
7249 /**
7250  * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7251  *
7252  * @brief Sets the Restriction for Discoverable state.
7253  *
7254  * This function is a synchronous call.
7255  *
7256  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7257  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7258  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7259  *
7260  * @exception   None
7261  * @param[in]   value - State value.
7262  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7263  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7264  *
7265  * @remark      None
7266  */
7267 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7268
7269 /**
7270  * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7271  *
7272  * @brief Reads the Restriction for Discoverable state.
7273  *
7274  * This function is a synchronous call.
7275  *
7276  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7277  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7278  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7279  *
7280  * @exception   None
7281  * @param[in] None
7282  * @param[out]  value - State value.
7283  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7284  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7285  *
7286  * @remark      None
7287  */
7288 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7289
7290 /**
7291  * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7292  *
7293  * @brief Sets the Restriction for linited discoverable state..
7294  *
7295  * This function is a synchronous call.
7296  *
7297  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7298  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7299  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7300  *
7301  * @exception   None
7302  * @param[in]   value - State value.
7303  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7304  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7305  *
7306  * @remark      None
7307  */
7308 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7309
7310 /**
7311  * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7312  *
7313  * @brief Reads the Restriction for limited discoverable state.
7314  *
7315  * This function is a synchronous call.
7316  *
7317  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7318  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7319  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7320  *
7321  * @exception   None
7322  * @param[in] None
7323  * @param[out]  value - State value.
7324  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7325  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7326  *
7327  * @remark      None
7328  */
7329 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7330 /**
7331  * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7332  *
7333  * @brief Sets the Restriction for Data trasnfer.
7334  *
7335  * This function is a synchronous call.
7336  *
7337  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7338  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7339  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7340  *
7341  * @exception   None
7342  * @param[in]   value - State value.
7343  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7344  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7345  *
7346  * @remark      None
7347  */
7348 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7349
7350
7351 /**
7352  * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7353  *
7354  * @brief Reads the Restriction for Data trasnfer.
7355  *
7356  * This function is a synchronous call.
7357  *
7358  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7359  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7360  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7361  *
7362  * @exception   None
7363  * @param[in] None
7364  * @param[out]  value - State value.
7365  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7366  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7367  *
7368  * @remark      None
7369  */
7370 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7371
7372 /**
7373  * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7374  *                                              bluetooth_pxp_poperty_t property, int value);
7375  *
7376  * @brief Sets the Proximity alert level/properties for monitor role.
7377  *
7378  * This function is a synchronous call.
7379  *
7380  * @return   BLUETOOTH_ERROR_NONE - Success \n
7381  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7382  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7383  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7384  *
7385  * @exception   None
7386  * @param[in] device_address remote device address
7387  * @param[in] property proximity profile property
7388  * @param[in] value alert level/property value to be set
7389  * @param[out] None
7390  *
7391  * @remark      None
7392  */
7393 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7394                                                         bluetooth_pxp_poperty_t property, int value);
7395
7396 /**
7397  * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7398  *                                              bluetooth_pxp_poperty_t property, int *value);
7399  *
7400  * @brief Reads the Proximity alert level/properties for monitor role.
7401  *
7402  * This function is a synchronous call.
7403  *
7404  * @return   BLUETOOTH_ERROR_NONE - Success \n
7405  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7406  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7407  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7408  *
7409  * @exception   None
7410  * @param[in] device_address remote device address
7411  * @param[in] property proximity profile property
7412  * @param[out] value alert level/property value
7413  *
7414  * @remark      None
7415  */
7416 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7417                                                         bluetooth_pxp_poperty_t property, int *value);
7418
7419 /**
7420  * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7421  *                                              int *services_supported);
7422  *
7423  * @brief Reads the Proximity Monitor profile supported properties/services.
7424  *
7425  * This function is a synchronous call.
7426  *
7427  * @return       BLUETOOTH_ERROR_NONE - Success \n
7428  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7429  *                               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7430  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7431  *
7432  * @exception   None
7433  * @param[in] device_address remote device address
7434  * @param[out] services_supported proximity profile property/service
7435  *
7436  * @remark      None
7437  */
7438 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7439                                                         int *services_supported);
7440
7441 /**
7442  * @fn int bluetooth_proximity_reporter_register();
7443  *
7444  * @brief Register all proximity related services in BlueZ.
7445  *
7446  * This function is a synchronous call.
7447  *
7448  * @return       BLUETOOTH_ERROR_NONE - Success \n
7449  *                       BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7450  *
7451  * @exception   None
7452  *
7453  * @remark      None
7454  */
7455 int bluetooth_proximity_reporter_register(void);
7456
7457 /**
7458  * @fn int bluetooth_proximity_reporter_unregister();
7459  *
7460  * @brief Unregister all proximity related services in BlueZ.
7461  *
7462  * This function is a synchronous call.
7463  *
7464  * @return       BLUETOOTH_ERROR_NONE - Success \n
7465  *                       BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7466  *
7467  * @exception   None
7468  *
7469  * @remark      None
7470  */
7471 int bluetooth_proximity_reporter_unregister(void);
7472
7473 /**
7474  * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7475  *                                              bluetooth_pxp_poperty_t property, int *value);
7476  *
7477  * @brief Reads the Proximity alert level/properties for reporter role.
7478  *
7479  * This function is a synchronous call.
7480  *
7481  * @return       BLUETOOTH_ERROR_NONE - Success \n
7482  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7483  *                               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7484  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7485  *
7486  * @exception   None
7487  * @param[in] device_address remote device address
7488  * @param[in] property proximity profile property
7489  * @param[out] value alert level/property value
7490  *
7491  * @remark      None
7492  */
7493 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7494                                                         bluetooth_pxp_poperty_t property, int *value);
7495
7496 /**
7497  * @fn int bluetooth_tds_provider_register(void);
7498  *
7499  * @brief Register Transport Discovery Provider role.
7500  *
7501  * This function is a synchronous call.
7502  *
7503  * @return       BLUETOOTH_ERROR_NONE - Success \n
7504  *                               BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n
7505  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7506  *                               BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7507  *
7508  * @exception   None
7509  * @param[in] None
7510  * @param[out] None
7511  *
7512  * @remark      None
7513  */
7514 int bluetooth_tds_provider_register(void);
7515
7516 /**
7517  * @fn int bluetooth_tds_provider_unregister(void);
7518  *
7519  * @brief Unregister Transport Discovery Provider role.
7520  *
7521  * This function is a synchronous call.
7522  *
7523  * @return       BLUETOOTH_ERROR_NONE - Success \n
7524  *                               BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7525  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7526  *                               BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7527  *
7528  * @exception   None
7529  * @param[in] None
7530  * @param[out] None
7531  *
7532  * @remark      None
7533  */
7534 int bluetooth_tds_provider_unregister(void);
7535
7536 /**
7537  * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle);
7538  *
7539  * @brief Create Transport Discovery Provider for a transport.
7540  *
7541  * This function is a synchronous call.
7542  *
7543  * @return       BLUETOOTH_ERROR_NONE - Success \n
7544  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7545  *                               BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7546  *                               BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7547  *
7548  * @exception   None
7549  * @param[in] Transport (BT, CUSTOM etc.)
7550  * @param[in] Unique handle for TDS provider.
7551  * @param[out] None
7552  *
7553  * @remark      None
7554  */
7555 int bluetooth_tds_provider_create(int transport, unsigned int handle);
7556
7557 /**
7558  * @fn int bluetooth_tds_provider_destroy(unsigned int handle);
7559  *
7560  * @brief Remove previously created Transport Discovery Provider.
7561  *
7562  * This function is a synchronous call.
7563  *
7564  * @return       BLUETOOTH_ERROR_NONE - Success \n
7565  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7566  *
7567  * @exception   None
7568  * @param[in] Unique handle for previously created provider.
7569  * @param[out] None
7570  *
7571  * @remark      None
7572  */
7573 int bluetooth_tds_provider_destroy(unsigned int handle);
7574
7575 /**
7576  * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7577  *
7578  * @brief Set transport block for in advertisement and gatt db.
7579  *
7580  * This function is a synchronous call.
7581  *
7582  * @return       BLUETOOTH_ERROR_NONE - Success \n
7583  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7584  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7585  *                               BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7586  *
7587  * @exception   None
7588  * @param[in] Provider specific manufacturer data.
7589  * @param[in] Provider specific manufacturer data length.
7590  * @param[out] None
7591  *
7592  * @remark      None
7593  */
7594 int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length);
7595
7596 /**
7597  * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7598  *              bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7599  *
7600  * @brief Set transport block for in advertisement and gatt db.
7601  *
7602  * This function is a synchronous call.
7603  *
7604  * @return       BLUETOOTH_ERROR_NONE - Success \n
7605  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7606  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n
7607  *                               BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7608  *
7609  * @exception   None
7610  * @param[in] Unique handle for TDS provider.
7611  * @param[in] Transport state (On/Off/Not Available).
7612  * @param[in] Transport specific data block.
7613  * @param[in] Transport specific data block length.
7614  * @param[out] None
7615  *
7616  * @remark      None
7617  */
7618 int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle,
7619                 bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length);
7620
7621 /**
7622  * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7623  *              unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7624  *
7625  * @brief Send response to TDS activation request from remoted device.
7626  *
7627  * This function is a synchronous call.
7628  *
7629  * @return       BLUETOOTH_ERROR_NONE - Success \n
7630  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7631  *                               BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n
7632  *                               BLUETOOTH_ERROR_INTERNAL - Operation failed\n
7633  *
7634  * @exception   None
7635  * @param[in] Remote device BT address.
7636  * @param[in] Unique handle for TDS provider.
7637  * @param[in] Response for TDS activation request.
7638  * @param[in] Transport specific data block to be sent in activation response.
7639  * @param[in] Data block length.
7640  * @param[out] None
7641  *
7642  * @remark      None
7643  */
7644 int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address,
7645         unsigned int tds_handle, int response, unsigned char *buf, unsigned int length);
7646
7647 /**
7648  * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle);
7649  *
7650  * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database.
7651  *
7652  * This function is an asynchronous call.
7653  *
7654  * @return       BLUETOOTH_ERROR_NONE - Success \n
7655  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7656  *                               BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7657  *                               BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n
7658  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7659  *
7660  * @exception   None
7661  * @param[in] device_address remote device address
7662  * @param[in] handle attribute handle
7663  *
7664  * @remark      BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication
7665  * when TDS data is received from Remote provider
7666  */
7667 int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address,
7668                                                 const char *handle);
7669
7670 /**
7671  * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle);
7672  *
7673  * @brief Enables CCCD on Remote Provider.
7674  *
7675  * This function is an asynchronous call.
7676  *
7677  * @return       BLUETOOTH_ERROR_NONE - Success \n
7678  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7679  *                               BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7680  *                               BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7681  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7682  *
7683  * @exception   None
7684  * @param[in] device_address remote device address
7685  * @param[in] handle attribute handle
7686  *
7687  * @remark      BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application
7688  * when Indication is enabled on Remote provider
7689  */
7690 int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address,
7691                                                 const char *handle);
7692
7693 /**
7694  * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle
7695  *                                                      unsigned char *buf, int length);
7696  * @brief Sends activation request for Alternate Transport enable on Remote Provider
7697  *
7698  * This function is an asynchronous call.
7699  *
7700  * @return       BLUETOOTH_ERROR_NONE - Success \n
7701  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7702  *                               BLUETOOTH_ERROR_INTERNAL - Internal Error \n
7703  *                               BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n
7704  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7705  *
7706  * @exception   None
7707  * @param[in] device_address remote device address
7708  * @param[in] handle attribute handle
7709  * @param[in] buf Control point activation param
7710  * @param[in] param length
7711  *
7712  * @remark      BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response
7713  * is received from remote Provider
7714  */
7715 int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle,
7716                                                 unsigned char *buf, int length);
7717
7718 /**
7719  * @fn int bluetooth_otp_server_init(const char *directory);
7720  *
7721  * @brief Starts OTP server.
7722  *
7723  * This function is a synchronous call.
7724  *
7725  * @return
7726  *
7727  * @exception   None
7728  * @param[in] None
7729  * @param[out]  None
7730  *
7731  * @remark      None
7732  */
7733 int bluetooth_otp_server_init(const char *directory);
7734
7735 /**
7736  * @fn int bluetooth_otp_server_deinit();
7737  *
7738  * @brief Stops OTP server.
7739  *
7740  * This function is a synchronous call.
7741  *
7742  * @return
7743  *
7744  * @exception   None
7745  * @param[in] None
7746  * @param[out]  None
7747  *
7748  * @remark      None
7749  */
7750 int bluetooth_otp_server_deinit();
7751
7752 /**
7753  * @fn int bluetooth_otp_enable_notification(const char *handle);
7754  *
7755  * @brief Enable notification for remote OACP & OLCP characteristics.
7756  *
7757  * This function is a synchronous call.
7758  *
7759  * @return
7760  *
7761  * @exception   None
7762  * @param[in] None
7763  * @param[out]  None
7764  *
7765  * @remark      None
7766  */
7767 int bluetooth_otp_enable_notification(const char *handle);
7768
7769 /**
7770  * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
7771  *                                              unsigned char *buf, int length);
7772  *
7773  * @brief Write value on remote characteristics.
7774  *
7775  * This function is a synchronous call.
7776  *
7777  * @return
7778  *
7779  * @exception   None
7780  * @param[in] None
7781  * @param[out]  None
7782  *
7783  * @remark      None
7784  */
7785 int bluetooth_otp_write_characteristics_value(const char *handle,
7786                                         unsigned char *buf, int length);
7787
7788 /**
7789  * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
7790  *
7791  * @brief Read value for remote characteristics.
7792  *
7793  * This function is a synchronous call.
7794  *
7795  * @return
7796  *
7797  * @exception   None
7798  * @param[in] None
7799  * @param[out]  None
7800  *
7801  * @remark      None
7802  */
7803 int bluetooth_otp_read_characteristic_value(const char *handle);
7804
7805 /**
7806  * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7807  *
7808  * @brief Read value for remote characteristics.
7809  *
7810  * This function is a synchronous call.
7811  *
7812  * @return
7813  *
7814  * @exception   None
7815  * @param[in] None
7816  * @param[out]  None
7817  *
7818  * @remark      None
7819  */
7820 int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
7821
7822 /**
7823  * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7824  *
7825  * @brief Read value for remote characteristics.
7826  *
7827  * This function is a synchronous call.
7828  *
7829  * @return
7830  *
7831  * @exception   None
7832  * @param[in] None
7833  * @param[out]  None
7834  *
7835  * @remark      None
7836  */
7837 int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
7838
7839 /**
7840  * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
7841  * @brief Check if Adapter supports LE 2M PHY feature or not.
7842  *
7843  * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
7844  * in BT 5.0 specification.
7845  *
7846  * This function is a synchronous call.
7847  *
7848  * @return      BLUETOOTH_ERROR_NONE - Succeess \n
7849  *              BLUETOOTH_ERROR_INVALID_PARAM -  Invalid parameter (NULL buffer) \n
7850  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED -  Adapter is disabled \n
7851  *              BLUETOOTH_ERROR_INTERNAL -  Internal error \n
7852  * @param[out]  is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
7853  *
7854  * @remark      None
7855  */
7856 int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
7857
7858 /**
7859  * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
7860  * @brief Check if Adapter supports LE 2M CODED feature or not.
7861  *
7862  * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
7863  * in BT 5.0 specification.
7864  *
7865  * This function is a synchronous call.
7866  *
7867  * @return      BLUETOOTH_ERROR_NONE - Succeess \n
7868  *              BLUETOOTH_ERROR_INVALID_PARAM -  Invalid parameter (NULL buffer) \n
7869  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED -  Adapter is disabled \n
7870  *              BLUETOOTH_ERROR_INTERNAL -  Internal error \n
7871  * @param[out]  is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
7872  *
7873  * @remark      None
7874  */
7875 int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
7876
7877 /**
7878  * @}
7879  */
7880
7881 #ifdef __cplusplus
7882 }
7883 #endif                          /* __cplusplus */
7884 #endif                          /* _BLUETOOTH_API_H_*/