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