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