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