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