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