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