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