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