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