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