[bluetooth-frwk] listMessages
[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 maxcount;
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
1883 /**
1884  * Callback pointer type
1885  */
1886 typedef void (*bluetooth_cb_func_ptr) (int, bluetooth_event_param_t *, void *);
1887
1888 /**
1889  * @fn int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1890  * @brief Set the callback function pointer for bluetooth event
1891  *
1892  *
1893  * This API will register the callback function, when any response and event are received from
1894  * bluetooth framework. @n
1895  * this registered callback function will be get called with appropriate event and data structures.
1896  * This function is a synchronous call. An application developer can call
1897  * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1898  * type. This registered function will receive events of bluetooth_event_type_t type along with
1899  * data any.
1900  *
1901  *
1902  * @param[in]   callback_ptr    A pointer to the callback function
1903  * @param[in]   user_data    A pointer to user data
1904  * @return      BLUETOOTH_ERROR_NONE - Success
1905  * @remark      None
1906  * @see         None
1907 @code
1908 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
1909 {
1910         GMainLoop *main_loop = (GMainLoop*) user_data;
1911
1912         switch(event)
1913         {
1914                 // Code for each event
1915                 default:
1916                         g_main_loop_quit(main_loop);
1917                         break;
1918         }
1919 }
1920
1921 int main()
1922 {
1923         GMainLoop *main_loop = NULL;
1924         int ret = 0;
1925         g_type_init();
1926         main_loop = g_main_loop_new(NULL, FALSE);
1927         ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
1928         if (ret >= BLUETOOTH_ERROR_NONE)
1929         {
1930                 // bluetooth_register_callback returned Success
1931         }
1932         else
1933         {
1934                 // bluetooth_register_callback returned failiure
1935         }
1936         g_main_loop_run(main_loop);
1937 }
1938 @endcode
1939  */
1940 int bluetooth_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1941
1942 /**
1943  * @fn int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data)
1944  * @brief Set the callback function pointer for bluetooth le event
1945  *
1946  *
1947  * This API will register the callback function, when any response and event are received from
1948  * bluetooth framework. @n
1949  * this registered callback function will be get called with appropriate event and data structures.
1950  * This function is a synchronous call. An application developer can call
1951  * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1952  * type. This registered function will receive events of bluetooth_event_type_t type along with
1953  * data any.
1954  *
1955  *
1956  * @param[in]   callback_ptr    A pointer to the callback function
1957  * @param[in]   user_data    A pointer to user data
1958  * @return      BLUETOOTH_ERROR_NONE - Success
1959  * @remark      None
1960  * @see         None
1961  * */
1962 int bluetooth_le_register_callback(bluetooth_cb_func_ptr callback_ptr, void *user_data);
1963
1964 /**
1965  * @fn int bluetooth_le_unregister_callback(void)
1966  * @brief Set the callback function pointer for bluetooth le event
1967  *
1968  *
1969  * This API will register the callback function, when any response and event are received from
1970  * bluetooth framework. @n
1971  * this registered callback function will be get called with appropriate event and data structures.
1972  * This function is a synchronous call. An application developer can call
1973  * bluetooth_le_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1974  * type. This registered function will receive events of bluetooth_event_type_t type along with
1975  * data any.
1976  *
1977  *
1978  * @param[in]   none
1979  * @return      BLUETOOTH_ERROR_NONE - Success
1980  * @remark      None
1981  * @see         None
1982  * */
1983 int bluetooth_le_unregister_callback(void);
1984
1985 /**
1986  * @fn int bluetooth_deregister_callback(bluetooth_cb_func_ptr callback_ptr)
1987  * @brief Set the callback function pointer for bluetooth event
1988  *
1989  *
1990  * This API will register the callback function, when any response and event are received from
1991  * bluetooth framework. @n
1992  * this registered callback function will be get called with appropriate event and data structures.
1993  * This function is a synchronous call. An application developer can call
1994  * bluetooth_register_callback() function to register a callback function of bluetooth_cb_func_ptr
1995  * type. This registered function will receive events of bluetooth_event_type_t type along with
1996  * data any.
1997  *
1998  *
1999  * @param[in]   none
2000  * @return      BLUETOOTH_ERROR_NONE - Success
2001  * @remark      None
2002  * @see         None
2003 @code
2004 void bt_event_callback(int event, bluetooth_event_param_t *param, void *user_data)
2005 {
2006         GMainLoop *main_loop = (GMainLoop*) user_data;
2007
2008         switch(event)
2009         {
2010                 // Code for each event
2011                 default:
2012                         g_main_loop_quit(main_loop);
2013                         break;
2014         }
2015 }
2016
2017 int main()
2018 {
2019         GMainLoop *main_loop = NULL;
2020         int ret = 0;
2021         g_type_init();
2022         main_loop = g_main_loop_new(NULL, FALSE);
2023         ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop);
2024         if (ret >= BLUETOOTH_ERROR_NONE)
2025         {
2026                 // bluetooth_register_callback returned Success
2027         }
2028         else
2029         {
2030                 // bluetooth_register_callback returned failiure
2031         }
2032         ret = bluetooth_deregister_callback(void);
2033         g_main_loop_run(main_loop);
2034 }
2035 @endcode
2036  */
2037 int bluetooth_unregister_callback(void);
2038
2039 /**
2040  * @fn int bluetooth_enable_adapter(void)
2041  * @brief Enable the Bluetooth H/W
2042  *
2043  *
2044  * This API can be used to activate Bluetooth. It initializes Bluetooth protocol stack for use and
2045  * send request to bluetooth chip for activation.
2046  * This function is typically called at startup or when Bluetooth services are required.  This
2047  * function must be called before calling any other API of Bluetooth operations.
2048  *
2049  * Before performing any operations like Device discover, service search etc.., the adapter must be
2050  * enabled.
2051  *
2052  * This function is a asynchronous call.
2053  * If the call is success then the application will receive BLUETOOTH_EVENT_ENABLED event
2054  * through registered callback function with appropriate result code
2055  *                      BLUETOOTH_CHANGE_STATUS_TIMEOUT - Timeout has happen \n
2056  *                      BLUETOOTH_ERROR_NONE - Success \n
2057  *
2058  * If the adpter is not enabled with in 30 seconds then BLUETOOTH_EVENT_ENABLED with result code
2059  * BLUETOOTH_CHANGE_STATUS_TIMEOUT will come
2060  *
2061  * @return      BLUETOOTH_ERROR_NONE - Success\n
2062  *              BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED - Adapter already enabled\n
2063  *              BLUETOOTH_ERROR_ACCESS_DENIED - Enabling adapter is not allowed by MDM policy\n
2064  *              BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2065  * @exception   BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2066  * @remark      None
2067  * @see         bluetooth_check_adapter, bluetooth_disable_adapter
2068 @code
2069 void bt_event_callback(int event, bluetooth_event_param_t *param)
2070 {
2071         switch(event)
2072         {
2073                 case BLUETOOTH_EVENT_ENABLED:
2074                         if (param->result == BLUETOOTH_ERROR_NONE)
2075                         {
2076                                 // Successfully Enabled
2077                         }
2078                         else
2079                         {
2080                                 // Failed
2081                         }
2082                         break;
2083         }
2084 }
2085
2086 ...
2087
2088 int ret = 0;
2089 ret = bluetooth_enable_adapter();
2090
2091 @endcode
2092  */
2093 int bluetooth_enable_adapter(void);
2094
2095 /**
2096  * @fn int bluetooth_disable_adapter(void)
2097  * @brief Disable the Bluetooth H/W
2098  *
2099  *
2100  * This function disables Bluetooth protocol stack and hardware. This function is called when
2101  * Bluetooth is no longer used. It will internally free all resources and power off the RF radio.
2102  *
2103  * Bluetooth adapter should be disabled to switch off Bluetooth chip (and thereby saving power).
2104  * bluetooth_disable_adapter() API will do that job for you. After switching off Bluetooth,
2105  * BLUETOOTH_EVENT_DISABLED will be sent by SDK to application for confirmation with appropriate
2106  * error code.
2107  * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2108  * internal error.
2109  *
2110  * This function is a asynchronous call.
2111  * If this call is success then the applications will receive BLUETOOTH_EVENT_DISABLED event
2112  * through registered callback function.
2113  *
2114  *
2115  * @return      BLUETOOTH_ERROR_NONE - Success\n
2116  *              BLUETOOTH_ERROR_IN_PROGRESS - Adapter is activating or deactivating\n
2117  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled\n
2118  * @exception   BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2119  * @remark      None
2120  * @see         bluetooth_check_adapter, bluetooth_enable_adapter
2121 @code
2122 void bt_event_callback(int event, bluetooth_event_param_t *param)
2123 {
2124         switch(event)
2125         {
2126                 case BLUETOOTH_EVENT_DISABLED:
2127                         if (param->result == BLUETOOTH_ERROR_NONE)
2128                         {
2129                                 // Successfully disabled
2130                         }
2131                         else
2132                         {
2133                                 // Failed
2134                         }
2135                         break;
2136         }
2137 }
2138
2139 ...
2140
2141 int ret = 0;
2142 ret = bluetooth_disable_adapter();
2143 @endcode
2144  */
2145 int bluetooth_disable_adapter(void);
2146 int bluetooth_recover_adapter(void);
2147 int bluetooth_check_adapter_le(void);
2148 int bluetooth_enable_adapter_le(void);
2149
2150 int bluetooth_disable_adapter_le(void);
2151
2152 /**
2153  * @fn int bluetooth_reset_adapter(void)
2154  * @brief Reset the Bluetooth H/W and values
2155  *
2156  *
2157  * This function resets Bluetooth protocol stack and hardware. This function is called when
2158  * an user want to initialize Bluetooth environment.
2159  *
2160  * The various error codes are BLUETOOTH_ERROR_NONE for success and BLUETOOTH_ERROR_INTERNAL for
2161  * internal error.
2162  *
2163  * This function is a synchronous call.
2164  *
2165  * @return      BLUETOOTH_ERROR_NONE - Success\n
2166  * @exception   BLUETOOTH_ERROR_INTERNAL - Dbus proxy call is fail
2167  * @remark      None
2168  * @see         bluetooth_check_adapter, bluetooth_enable_adapter
2169 @code
2170 ...
2171
2172 int ret = 0;
2173 ret = bluetooth_reset_adapter();
2174 @endcode
2175  */
2176 int bluetooth_reset_adapter(void);
2177
2178 /**
2179  * @fn int bluetooth_is_supported(void)
2180  * @brief Check if the bluetooth is supported or not by the current target
2181  *
2182  * This API checks whether the bluetooth is supported or not.
2183  * This API only run by root permission.
2184  *
2185  * This function is a synchronous call.
2186  *
2187  * @return      0 - if bluetooth is not supported\n
2188  *              1 - if bluetooth is supported\n
2189  *              BLUETOOTH_ERROR_INTERNAL - Error in API internal
2190  * @remark      None
2191 @code
2192
2193 int ret = 0;
2194 ret = bluetooth_is_supported();
2195 @endcode
2196  */
2197 int bluetooth_is_supported(void);
2198
2199
2200 /**
2201  * @fn int bluetooth_check_adapter(void)
2202  * @brief Check the current status of the Bluetooth adapter
2203  *
2204  *
2205  * This API checks whether the Bluetooth adapter is enabled or not. Before performing any operations
2206  * the bluetooth adapter should be enabled. This API helps to find out the current state of the
2207  * bluetooth adapter.
2208  * This API get the adapter internal data structure and check current adapter status.
2209  *
2210  * This function is a synchronous call.
2211  *
2212  *
2213  * @return      BLUETOOTH_ADAPTER_DISABLED - if bluetooth adapter is disabled\n
2214  *              BLUETOOTH_ADAPTER_ENABLED - if bluetooth adapter is enabled\n
2215  * @remark      None
2216  * @see         bluetooth_enable_adapter, bluetooth_disable_adapter
2217 @code
2218
2219 int ret = 0;
2220 ret = bluetooth_check_adapter();
2221 @endcode
2222  */
2223 int bluetooth_check_adapter(void);
2224
2225 /**
2226  * @fn int bluetooth_get_local_address(bluetooth_device_address_t *local_address)
2227  * @brief Get the local adapter bluetooth address
2228  *
2229  *
2230  * This API is used, get the device address of the local bluetooth adapter. Before calling this API,
2231  * the adapter should be enabled.
2232  * In its output parameter, you can receive bluetooth_device_address_t type of pointer which will
2233  * contain Bluetooth address.
2234  * Since its inconvenient for user to remember the address, Bluetooth provides a method to have a
2235  * friendly name for each device.
2236  * There is no event callback for this API.
2237  *
2238  * This function is a synchronous call.
2239  *
2240  *
2241  * @return      BLUETOOTH_ERROR_NONE - Succeess \n
2242  *              BLUETOOTH_ERROR_INVALID_PARAM -  Invalid parameter (NULL buffer) \n
2243  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED -  Adapter is disabled \n
2244  * @param[out]  local_address   a device address of local bluetooth adapter
2245  * @remark      None
2246  * @see         None
2247 @code
2248
2249 bluetooth_device_address_t local_address={0,};
2250 int ret = 0;
2251
2252 ret = bluetooth_get_local_address(&local_address);
2253 @endcode
2254  */
2255 int bluetooth_get_local_address(bluetooth_device_address_t *local_address);
2256
2257 /**
2258  * @fn int bluetooth_get_local_version(bluetooth_version_t *version)
2259  * @brief Get the hci version
2260  *
2261  *
2262  * This function is used to get the bluetooth hci version
2263  * Before calling this API make sure that the adapter is enabled.
2264  *
2265  * This function is a synchronous call.
2266  *
2267  *
2268  * @return      BLUETOOTH_ERROR_NONE - Success \n
2269  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2270  * @param[out]  timeout   remain visibility timeout value
2271  * @remark      None
2272  @code
2273 bluetooth_version_t *version;
2274  int ret = 0;
2275  ret = bluetooth_get_local_version (&version);
2276  @endcode
2277  */
2278 int bluetooth_get_local_version(bluetooth_version_t *version);
2279
2280 /**
2281  * @fn int bluetooth_get_local_name(bluetooth_device_name_t* local_name)
2282  * @brief Get the local device name
2283  *
2284  *
2285  * This function is used, get the local device name. Since its difficult to remember the Adapter
2286  * address, the friendly name can be assigned to the adapter and we can get it using this API. This
2287  * friendly name is retrived by the remote device and displaying.
2288  * Before calling this API, the adapter should be enabled. There is no event callback for this API.
2289  *
2290  * This function is a synchronous call.
2291  *
2292  *
2293  * @return      BLUETOOTH_ERROR_NONE - Success \n
2294  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
2295  * @param[out]  local_name      a local device name
2296  * @remark      None
2297  * @see         None
2298 @code
2299 bluetooth_device_name_t local_name={0,}
2300 int ret = 0;
2301 ret = bluetooth_get_local_name (&local_name);
2302 @endcode
2303  */
2304 int bluetooth_get_local_name(bluetooth_device_name_t *local_name);
2305
2306 /**
2307  * @fn int bluetooth_set_local_name(const bluetooth_device_name_t *local_name)
2308  * @brief Set the local device name
2309  *
2310  *
2311  * This function is used to set the local device name. This is a human friendly name whose
2312  * length can be BLUETOOTH_DEVICE_NAME_LENGTH_MAX maximum
2313  *
2314  * This function is a synchronous call.
2315  *
2316  * @param[in]   local_name   bluetooth device name to set local device
2317  *
2318  * @return      BLUETOOTH_ERROR_NONE - Success \n
2319  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2320  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2321  *              BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
2322  *              BLUETOOTH_ERROR_NO_RESOURCES - Pre-allocated memory error \n
2323  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2324  *
2325  * @remark      None
2326
2327 @code
2328 bluetooth_device_name_t local_name={0,}
2329 int ret = 0;
2330 ret = bluetooth_set_local_name (&local_name);
2331 @endcode
2332  */
2333 int bluetooth_set_local_name(const bluetooth_device_name_t *local_name);
2334
2335
2336 /**
2337  * @fn int bluetooth_is_service_used(const char *service_uuid, gboolean *used)
2338  * @brief Check if the uuid is used or not
2339  *
2340  * This function is used to check if the uuid is used or not.
2341  *
2342  * This function is a synchronous call.
2343  *
2344  * @param[in]   service_uuid   service uuid (UUID 128 bit as string)
2345  * @param[out] used  if the uuid is used or not
2346  *
2347  * @return      BLUETOOTH_ERROR_NONE - Success \n
2348  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2349  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2350  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2351  *
2352  * @remark      None
2353  *
2354 @code
2355 gboolean used = FALSE;
2356 const char *uuid ="00001101-0000-1000-8000-00805F9B34FB";
2357 ret = bluetooth_is_service_used(uuid, &used);
2358 @endcode
2359  */
2360 int bluetooth_is_service_used(const char *service_uuid, gboolean *used);
2361
2362 /**
2363  * @fn int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address, bluetooth_service_type_t type, gboolean *is_connected)
2364  * @brief Check if the device is connected to the specific service
2365  *
2366  * This function is used to check if if the device is connected to the specific service.
2367  *
2368  * This function is a synchronous call.
2369  *
2370  * @param[in]   local_address   a device address of remote bluetooth device
2371  * @param[in]   type the service type
2372  * @param[out] is_connected  if the device is connected or not
2373  *
2374  * @return      BLUETOOTH_ERROR_NONE - Success \n
2375  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2376  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2377  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2378  *
2379  * @remark      None
2380  *
2381 @code
2382 gboolean is_connected = FALSE;
2383 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2384 ret = bluetooth_is_device_connected(&device_address, BLUETOOTH_HSP_SERVICE, &used);
2385 @endcode
2386  */
2387 int bluetooth_is_device_connected(const bluetooth_device_address_t *device_address,
2388                                 bluetooth_service_type_t type,
2389                                 gboolean *is_connected);
2390
2391 /**
2392  * @fn int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address, bluetooth_connected_link_t *connected_link)
2393  * @brief Gets device's connected link type
2394  *
2395  * This function is used to get device's connected link type
2396  *
2397  * This function is a synchronous call.
2398  *
2399  * @param[in]   device_address  a device address of remote bluetooth device
2400  * @param[out]  connected_link  a device's connected link type
2401  *
2402  * @return      BLUETOOTH_ERROR_NONE - Success \n
2403  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2404  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2405  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2406  *
2407  * @remark      None
2408  *
2409 @code
2410 bluetooth_connected_link_t *connected_link = BLUETOOTH_CONNECTED_LINK_NONE;
2411 bluetooth_device_address_t device_address={{0x00,0x0D,0xFD,0x24,0x5E,0xFF}};
2412 ret = bluetooth_get_connected_link(&device_address, &connected_link);
2413 @endcode
2414  */
2415 int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_address,
2416                                 bluetooth_connected_link_t *connected_link);
2417
2418 /**
2419  * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust)
2420  * @brief Sets a profile trusted for a device
2421  *
2422  * This function is used to Set a profile as trusted for a device
2423  *
2424  * This function is a synchronous call.
2425  *
2426  * @param[in]   device_address  a device address of remote bluetooth device
2427  * @param[in]   profile profile which is to be set as trusted[0-PBAP, 1-MAP, 2-SAP]
2428  * @param[in]   trust   to set as trusted or untrusted[1-trusted 0-untrusted]
2429  *
2430  * @return      BLUETOOTH_ERROR_NONE - Success \n
2431  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2432  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2433  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2434  *
2435  * @remark      None
2436  */
2437 int bluetooth_set_profile_trusted(
2438                 const bluetooth_device_address_t *device_address,
2439                 int profile, int trust);
2440
2441 /**
2442  * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust)
2443  * @brief Gets a profile is trusted for a device
2444  *
2445  * This function is used to Get a profile is trusted or not for a device
2446  *
2447  * This function is a synchronous call.
2448  *
2449  * @param[in]   device_address  a device address of remote bluetooth device
2450  * @param[in]   profile profile whose trust status is needed[0-PBAP, 1-MAP, 2-SAP]
2451  * @param[out]  trust   profile is set as trusted or untrusted[1-trusted 0-untrusted]
2452  *
2453  * @return      BLUETOOTH_ERROR_NONE - Success \n
2454  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2455  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2456  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2457  *
2458  * @remark      None
2459  */
2460 int bluetooth_get_profile_trusted(
2461                 const bluetooth_device_address_t *device_address,
2462                 int profile, int *trust);
2463
2464 /**
2465  * @fn int bluetooth_set_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int restricted)
2466  * @brief Sets a profile restricted connection for a device
2467  *
2468  * This function is used to Set a profile as restricted for a device
2469  *
2470  * This function is a synchronous call.
2471  *
2472  * @param[in]   device_address  a device address of remote bluetooth device
2473  * @param[in]   profile profile which is to be set as restricted[1-HFP_HS, 2-A2DP]
2474  * @param[in]   restricted      to set as restricted or not[1-restricted 0-permitted]
2475  *
2476  * @return      BLUETOOTH_ERROR_NONE - Success \n
2477  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2478  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2479  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2480  *
2481  * @remark      None
2482  */
2483 int bluetooth_set_profile_restricted(
2484                 const bluetooth_device_address_t *device_address,
2485                 int profile, int restricted);
2486
2487 /**
2488  * @fn int bluetooth_get_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int *restricted)
2489  * @brief Gets a restricted connection state
2490  *
2491  * This function is used to Get a profile is restricted or not for a device
2492  *
2493  * This function is a synchronous call.
2494  *
2495  * @param[in]   device_address  a device address of remote bluetooth device
2496  * @param[in]   profile profile whose restricted status is needed[1-HFP_HS, 2-A2DP]
2497  * @param[out]  restricted      profile is set as restricted or not[1-restricted 0-permitted]
2498  *
2499  * @return      BLUETOOTH_ERROR_NONE - Success \n
2500  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2501  *              BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
2502  *              BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
2503  *
2504  * @remark      None
2505  */
2506 int bluetooth_get_profile_restricted(
2507                 const bluetooth_device_address_t *device_address,
2508                 int profile, int *restricted);
2509
2510 /**
2511  * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
2512  * @brief Get the visibility mode
2513  *
2514  *
2515  * This function is used to get the discoverable mode (Visibility option). Depending upon the
2516  * visibity mode, the property of the device is determined whether it can be discoverable, non
2517  * discoverable, connectable etc. Before calling this API make sure that the adapter is enabled.
2518  *
2519  * This function is a synchronous call.
2520  *
2521  *
2522  * @return      BLUETOOTH_ERROR_NONE - Success \n
2523  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2524  *              BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2525  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2526  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2527  * @param[out]  discoverable_mode   current bluetooth discoverable mode
2528  * @remark      None
2529  * @see         bluetooth_set_discoverable_mode
2530  @code
2531  bluetooth_discoverable_mode_t discoverable_mode_ptr;
2532  int ret = 0;
2533  ret = bluetooth_get_discoverable_mode (&discoverable_mode_ptr);
2534  @endcode
2535  */
2536 int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr);
2537
2538 /**
2539  * @fn int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2540  *                                              int timeout)
2541  * @brief Set the visibility mode
2542  *
2543  *
2544  * This function is used to set the discoverable mode (Visibility option).
2545  *
2546  * Many times user may want to keep his device discoverable so that when peer device is performing
2547  * device search, he/she can find user's device. Application programmer can keep the mode as
2548  * BLUETOOTH_DISCOVERABLE_MODE_GENERAL_DISCOVERABLE or
2549  * BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE for the same purpose. However, all these
2550  * modes cause bluetooth adapter to consume more battery. Hence developer should generally
2551  * keep discoverable mode as BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE.
2552  *
2553  * This function is a synchronous call.
2554  *
2555  * @return      BLUETOOTH_ERROR_NONE - Success \n
2556  *              BLUETOOTH_ERROR_NOT_SUPPORT - Requested mode is not supported \n
2557  *
2558  * @param[in]  discoverable_mode   the bluetooth discoverable mode to set
2559  * @param[in]  timeout   discoverable time in only limited discoverable mode (second), default: 0
2560  * @remark      None
2561  * @see         bluetooth_get_discoverable_mode
2562
2563 @code
2564
2565 bluetooth_discoverable_mode_t mode;
2566 int ret = 0;
2567 mode= BLUETOOTH_DISCOVERABLE_MODE_TIME_LIMITED_DISCOVERABLE;
2568 ret = bluetooth_set_discoverable_mode (mode, 180);
2569
2570 @endcode
2571  */
2572 int bluetooth_set_discoverable_mode(bluetooth_discoverable_mode_t discoverable_mode,
2573                                             int timeout);
2574
2575
2576 /**
2577  * @fn int bluetooth_get_timeout_value(int *timeout)
2578  * @brief Get the visibility timeout value
2579  *
2580  *
2581  * This function is used to get the visibility timeout
2582  * Before calling this API make sure that the adapter is enabled.
2583  *
2584  * This function is a synchronous call.
2585  *
2586  *
2587  * @return      BLUETOOTH_ERROR_NONE - Success \n
2588  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2589  *              BLUETOOTH_ERROR_INVALID_DATA - Invalid data \n
2590  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2591  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
2592  * @param[out]  timeout   remain visibility timeout value
2593  * @remark      None
2594  * @see         bluetooth_set_discoverable_mode
2595  @code
2596  int timeout;
2597  int ret = 0;
2598  ret = bluetooth_get_timeout_value (&timeout);
2599  @endcode
2600  */
2601 int bluetooth_get_timeout_value(int *timeout);
2602
2603
2604 /**
2605  * @fn int bluetooth_start_discovery(unsigned short max_response, unsigned short discovery_duration,
2606  *                                      unsigned int  classOfDeviceMask)
2607  * @brief Start the generic device discovery which finds both the BR/EDR and LE devices.
2608  *
2609  * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2610  * name. You can search for Bluetooth devices in vicinity by bluetooth_start_discovery() API. It
2611  * first performs an inquiry and try to find both the BREDR and LE devices. For each device found
2612  * from the inquiry it gets the remote name of the device. Bluetooth device address and name are
2613  * given to Application via BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. In param_data of
2614  * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2615  * You will receive device address, device name, device class, rssi (received signal strength indicator).
2616  * please see bluetooth_device_info_t for more details.
2617  *
2618  *
2619  * This API provides searching options like max responses, discovery duration in seconds and class
2620  * of device mask to filter device search. some times there may be too many bluetooth devices in
2621  * vicinity of your device.in such scenario, application can request to reduce number of responces
2622  * (BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event) with help of max_response parameter. However if you
2623  * pass zero, bluetooth adapter will not restrict number of responses. you can also specify duration
2624  * of the seach in discovery_duration. bluetooth adapter will automatically stop device search after
2625  * application defined time. please note that discovery_duration should be mentioned in seconds.
2626  * Also note that search will end after 180 seconds automatically if you pass 0 in discovery
2627  * duration.
2628  *
2629  * Sometimes user may want to search for a particular kind of device. for ex, mobile or pc. in such
2630  * case, you can use classOfDeviceMask parameter. please see bluetooth_device_service_class_t,
2631  * bluetooth_device_major_class_t and bluetooth_device_minor_class_t enums
2632  *
2633  * This function is a asynchronous call.
2634  * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2635  * through registered callback function.
2636  *
2637  * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2638  * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2639  *
2640  * The completion or cancellation of the discovery is indicated by an
2641  * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2642  *
2643  * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2644  *
2645  *
2646  * @return      BLUETOOTH_ERROR_NONE - Success \n
2647  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2648  *              BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2649  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2650                                                 agent is not running \n
2651  *
2652  * @param[in] max_response              define the maximum response of the number of founded devices
2653                                         (0 means unlimited)
2654  * @param[in] discovery_duration        define bluetooth discovery duration (0 means 180s )
2655  * @param[in] classOfDeviceMask         define classes of the device mask which user wants
2656                                         (refer to class of device)
2657  * @remark      None
2658  * @see         bluetooth_start_custom_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2659
2660 @code
2661 void bt_event_callback(int event, bluetooth_event_param_t *param)
2662 {
2663         switch(event)
2664         {
2665                 case BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND:
2666                 {
2667                         bluetooth_device_info_t *device_info = NULL;
2668                         printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2669                                         param->result);
2670                         device_info  = (bluetooth_device_info_t *)param->param_data;
2671                         memcpy(&searched_device, &device_info->device_address,
2672                                                 sizeof(bluetooth_device_address_t));
2673                         printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2674                                 device_info->device_address.addr[0],
2675                                 device_info->device_address.addr[1],
2676                                 device_info->device_address.addr[2],
2677                                 device_info->device_address.addr[3],
2678                                 device_info->device_address.addr[4],
2679                                 device_info->device_address.addr[5]);
2680                         break;
2681                 }
2682                 case BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED:
2683                 {
2684                         bluetooth_device_info_t *device_info = NULL;
2685                         printf("BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED, result [0x%04x]",
2686                                                                                 param->result);
2687                         device_info  = (bluetooth_device_info_t *)param->param_data;
2688                         memcpy(&searched_device, &device_info->device_address,
2689                                                                 sizeof(bluetooth_device_address_t));
2690                         printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2691                                                         device_info->device_name.name,
2692                                                         device_info->device_address.addr[0],
2693                                                         device_info->device_address.addr[1],
2694                                                         device_info->device_address.addr[2],
2695                                                         device_info->device_address.addr[3],
2696                                                         device_info->device_address.addr[4],
2697                                                         device_info->device_address.addr[5]);
2698                         break;
2699                 }
2700
2701                 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2702                         printf("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2703                         break;
2704         }
2705 }
2706
2707 unsigned short max_response;
2708 unsigned short discovery_duration;
2709 unsigned classOfDeviceMask;
2710 int ret = 0;
2711
2712 max_response =0;
2713 discovery_duration =0;
2714 classOfDeviceMask =0;
2715
2716 ret = bluetooth_start_discovery(max_response,discovery_duration,classOfDeviceMask);
2717
2718 @endcode
2719  *
2720  */
2721 int bluetooth_start_discovery(unsigned short max_response,
2722                                       unsigned short discovery_duration,
2723                                       unsigned int classOfDeviceMask);
2724
2725 /**
2726  * @fn int bluetooth_start_custom_discovery(bt_discovery_role_type_t role
2727  *                                      unsigned short max_response,
2728  *                                      unsigned short discovery_duration,
2729  *                                      unsigned int  classOfDeviceMask)
2730  * @brief Start the custom device discovery with specific type such as BR/EDR, LE, LE+BR/EDR etc.
2731  *
2732  * Sometimes user may want to search for a particular kind of device. for ex, LE only or BR/EDR only.
2733  * In such case, you can use type parameter. This API is similar to that of bluetooth_start_discovery().
2734  * Please see bluetooth_start_discovery() for other parameters description.
2735  *
2736  * This function is a asynchronous call.
2737  * If the call is success then the application will receive BLUETOOTH_EVENT_DISCOVERY_STARTED event
2738  * through registered callback function.
2739  *
2740  * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event for each device it
2741  * found and a BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED event for its name updation.
2742  *
2743  * The completion or cancellation of the discovery is indicated by an
2744  * BLUETOOTH_EVENT_DISCOVERY_FINISHED event.
2745  *
2746  * The device discovery can be cancelled by calling bluetooth_stop_discovery().
2747  *
2748  *
2749  * @return      BLUETOOTH_ERROR_NONE - Success \n
2750  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2751  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
2752  *              BLUETOOTH_ERROR_IN_PROGRESS - Bluetooth adapter is busy with another discovery \n
2753  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2754                                                 agent is not running \n
2755  *
2756  * @param[in] role              define the role type of devices to be discovered. See enum bt_discovery_role_type_t.
2757                                         (DISCOVERY_ROLE_BREDR means BREDR only, DISCOVERY_ROLE_LE mean Low Energy only,
2758                                         DISCOVERY_ROLE_LE_BREDR means LE & BREDR - same as bluetooth_start_discovery())
2759  * @param[in] max_response              define the maximum response of the number of founded devices
2760                                         (0 means unlimited)
2761  * @param[in] discovery_duration        define bluetooth discovery duration (0 means 180s )
2762  * @param[in] classOfDeviceMask         define classes of the device mask which user wants
2763                                         (refer to class of device)
2764  * @remark      None
2765  * @see         bluetooth_start_discovery(), bluetooth_cancel_discovery, bluetooth_device_info_t
2766
2767 @code
2768 unsigned short type;
2769 unsigned short max_response;
2770 unsigned short discovery_duration;
2771 unsigned classOfDeviceMask;
2772 int ret = 0;
2773
2774 type = 1;
2775 max_response =0;
2776 discovery_duration =0;
2777 classOfDeviceMask =0;
2778
2779 ret = bluetooth_start_custom_discovery(type, max_response, discovery_duration, classOfDeviceMask);
2780
2781 @endcode
2782  *
2783  */
2784 int bluetooth_start_custom_discovery(bt_discovery_role_type_t role,
2785                                                 unsigned short max_response,
2786                                                 unsigned short discovery_duration,
2787                                                 unsigned int classOfDeviceMask);
2788
2789 /**
2790  * @fn int bluetooth_cancel_discovery (void)
2791  * @brief Cancel the on-going device discovery operation
2792  *
2793  *
2794  * This function stops the on-going device discovery operation. This API has to be called after the
2795  * bluetooth_start_discovery API and before the BLUETOOTH_EVENT_DISCOVERY_FINISHED event comes of
2796  * the bluetooth_start_discovery API
2797  *
2798  * Normally the device discovery takes a more time (~10.24 seconds) to get all the devices in its
2799  * vicinity and it recevies as BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND event. This API helps us to
2800  * cancel the discover request once the user received the device to which he wish to connect.
2801  *
2802  * This function is a asynchronous call.
2803  * If the call is success to cancel discovey then the application will receive
2804  * BLUETOOTH_EVENT_DISCOVERY_FINISHED event through registered callback function
2805  * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2806  * BLUETOOTH_ERROR_NONE
2807  *
2808  *
2809  * @return      BLUETOOTH_ERROR_NONE - Success \n
2810  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2811  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2812  *              BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2813                                                 other application \n
2814  *              BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2815  * @remark      None
2816  * @see         bluetooth_start_discovery
2817 @code
2818 void bt_event_callback(int event, bluetooth_event_param_t *param)
2819 {
2820         switch(event)
2821         {
2822                 case BLUETOOTH_EVENT_DISCOVERY_FINISHED:
2823                         TC_PRT("BLUETOOTH_EVENT_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2824                         break;
2825         }
2826 }
2827
2828 ..
2829
2830 int ret = 0;
2831
2832 ret = bluetooth_cancel_discovery();
2833 @endcode
2834  */
2835 int bluetooth_cancel_discovery(void);
2836
2837 /**
2838  * @fn int bluetooth_start_le_discovery(void)
2839  * @brief Start the generic device discovery which finds the LE devices.
2840  *
2841  * To connect connect to peer bluetooth device, you will need to know its bluetooth address and its
2842  * name. You can search for Bluetooth devices in vicinity by bluetooth_start_le_discovery() API.
2843  * It try to find LE devices. Bluetooth device address and name are
2844  * given to Application via BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event. In param_data of
2845  * bluetooth_event_param_t, you will receive a pointer to a structure of bluetooth_device_info_t type.
2846  * You will receive device address, device name, device class, rssi (received signal strength indicator).
2847  * please see bluetooth_device_info_t for more details.
2848  *
2849  * This function is a asynchronous call.
2850  * If the call is success then the application will receive BLUETOOTH_EVENT_LE_DISCOVERY_STARTED event
2851  * through registered callback function.
2852  *
2853  * The discovery is responded by an BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND event for each device it
2854  * found.
2855  *
2856  * The completion or cancellation of the discovery is indicated by an
2857  * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event.
2858  *
2859  * The device discovery can be cancelled by calling bluetooth_stop_le_discovery().
2860  *
2861  *
2862  * @return      BLUETOOTH_ERROR_NONE - Success \n
2863  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
2864  *              BLUETOOTH_ERROR_DEVICE_BUSY - Bluetooth adapter is busy doing some operation \n
2865  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
2866                                                 agent is not running \n
2867  *
2868  * @remark      None
2869  * @see         bluetooth_stop_le_discovery, bluetooth_device_info_t
2870
2871 @code
2872 void bt_event_callback(int event, bluetooth_event_param_t *param)
2873 {
2874         switch(event)
2875         {
2876                 case BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND:
2877                 {
2878                         bluetooth_device_info_t *device_info = NULL;
2879                         printf("BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, result [0x%04x]",
2880                                         param->result);
2881                         device_info  = (bluetooth_device_info_t *)param->param_data;
2882                         memcpy(&searched_device, &device_info->device_address,
2883                                                 sizeof(bluetooth_device_address_t));
2884                         printf("dev [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
2885                                 device_info->device_address.addr[0],
2886                                 device_info->device_address.addr[1],
2887                                 device_info->device_address.addr[2],
2888                                 device_info->device_address.addr[3],
2889                                 device_info->device_address.addr[4],
2890                                 device_info->device_address.addr[5]);
2891                         break;
2892                 }
2893
2894                 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2895                         printf("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2896                         break;
2897         }
2898 }
2899
2900 int ret = 0;
2901 ret = bluetooth_start_discovery();
2902
2903 @endcode
2904  *
2905  */
2906 int bluetooth_start_le_discovery(void);
2907
2908 /**
2909  * @fn int bluetooth_stop_le_discovery (void)
2910  * @brief Cancel the on-going device LE discovery operation
2911  *
2912  *
2913  * This function stops the on-going device discovery operation. This API has to be called after the
2914  * bluetooth_start_le_discovery API and before the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event comes of
2915  * the bluetooth_start_le_discovery API
2916  *
2917  *
2918  * This function is a asynchronous call.
2919  * If the call is success to cancel discovey then the application will receive
2920  * BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED event through registered callback function
2921  * with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure the error code will be
2922  * BLUETOOTH_ERROR_NONE
2923  *
2924  *
2925  * @return      BLUETOOTH_ERROR_NONE - Success \n
2926  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2927  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - No Discovery operation in progess to cancel \n
2928  *              BLUETOOTH_ERROR_ACCESS_DENIED - Currently in discovery but it is requested from
2929                                                 other application \n
2930  *              BLUETOOTH_ERROR_INTERNAL - Internel IPC error \n
2931  * @remark      None
2932  * @see         bluetooth_start_discovery
2933 @code
2934 void bt_event_callback(int event, bluetooth_event_param_t *param)
2935 {
2936         switch(event)
2937         {
2938                 case BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED:
2939                         TC_PRT("BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, result[0x%04x]", param->result);
2940                         break;
2941         }
2942 }
2943
2944 ..
2945
2946 int ret = 0;
2947
2948 ret = bluetooth_stop_le_discovery();
2949 @endcode
2950  */
2951 int bluetooth_stop_le_discovery(void);
2952
2953 /**
2954  * @fn int bluetooth_is_discovering(void)
2955  * @brief Check for the device discovery is in-progress or not.
2956  *
2957  * This API is used to check the current status of the Discovery operation.If discovery is in\
2958  * progress normally other operations are not allowed.
2959  * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2960  * for the BLUETOOTH_EVENT_DISCOVERY_FINISHED
2961  * event before performing other operations. This API is used to get for the current discovery
2962  * operation status and using bluetooth_cancel_discovery()
2963  * we can cancell the ongoing discovery process.
2964  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2965  * this API.
2966  *
2967  * This function checks whether the device discovery is started or not.
2968  *
2969  * This function is a synchronous call.
2970  *
2971  *
2972  * @return      BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
2973  *              BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
2974  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
2975  *
2976  * @remark      None
2977  * @see         bluetooth_start_discovery, bluetooth_cancel_discovery
2978
2979 @code
2980 int ret = 0;
2981 ret = bluetooth_is_discovering ();
2982 @endcode
2983  */
2984 int bluetooth_is_discovering(void);
2985
2986 /**
2987  * @fn int bluetooth_is_le_discovering(void)
2988  * @brief Check for the device LE discovery is in-progress or not.
2989  *
2990  * This API is used to check the current status of the LE Discovery operation.If discovery is in\
2991  * progress normally other operations are not allowed.
2992  * If a device discovery is in progress, we have to either cancel the discovery operation or wait
2993  * for the BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED
2994  * event before performing other operations. This API is used to get for the current discovery
2995  * operation status and using bluetooth_stop_le_discovery()
2996  * we can cancell the ongoing LE discovery process.
2997  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
2998  * this API.
2999  *
3000  * This function checks whether the device  LE discovery is started or not.
3001  *
3002  * This function is a synchronous call.
3003  *
3004  *
3005  * @return      BLUETOOTH_ERROR_NONE - Discovery is not in progress \n
3006  *              BLUETOOTH_ERROR_NONE+1 - Discovery in progress \n
3007  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3008  *
3009  * @remark      None
3010  * @see         bluetooth_start_le_discovery, bluetooth_stop_le_discovery
3011
3012 @code
3013 int ret = 0;
3014 ret = bluetooth_is_le_discovering ();
3015 @endcode
3016  */
3017 int bluetooth_is_le_discovering(void);
3018
3019 /**
3020  * @fn int bluetooth_is_le_scanning(void)
3021  * @brief Check for the device LE scan is in-progress or not.
3022  *
3023  * This API is used to check the current status of the LE Scan operation.If discovery is in\
3024  * progress normally other operations are not allowed.
3025  *
3026  * This function checks whether the device  LE Scan is started or not.
3027  *
3028  * This function is a synchronous call.
3029  *
3030  * @return   TRUE  - LE Scan in progress \n
3031  *              FALSE - LE Scan is not in progress \n
3032  *
3033  * @remark      None
3034
3035 @code
3036 gboolean is_le_scanning = 0;
3037 is_le_scanning = bluetooth_is_le_scanning ();
3038 @endcode
3039  */
3040 gboolean bluetooth_is_le_scanning(void);
3041
3042 gboolean bluetooth_is_scan_filter_supported(void);
3043
3044 /**
3045  * @fn int bluetooth_force_hcidump(int timeout)
3046  * @brief Enable /disable force-hcidump
3047  *
3048  * This function control force-hcidump.
3049  *
3050  * This function is a synchronous call.
3051  *
3052  * @return      BLUETOOTH_ERROR_NONE - Success \n
3053  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3054  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3055  *
3056  * @param[in]   start  To enable or disable force-hcidump[TRUE / FALSE]
3057  *
3058  *
3059  * @remark      None
3060  */
3061 int bluetooth_force_hcidump(int timeout);
3062
3063 /**
3064  * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
3065  * @brief Register scan filter.
3066  *
3067  * This function registers the scan filter.
3068  *
3069  * This function is a synchronous call.
3070  *
3071  * @return      BLUETOOTH_ERROR_NONE - Success \n
3072  *
3073  * @param[in]   filter   scan filter to register
3074  * @param[out]  slot_id  the slot ID of scan filter
3075  *
3076  * @remark      None
3077  */
3078 int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
3079
3080 /**
3081  * @fn int bluetooth_unregister_scan_filter(int slot_id)
3082  * @brief Register scan filter.
3083  *
3084  * This function unregisters the scan filter.
3085  *
3086  * This function is a synchronous call.
3087  *
3088  * @return      BLUETOOTH_ERROR_NONE - Success \n
3089  *
3090  * @param[in]   slot_id  the slot ID of scan filter
3091  *
3092  * @remark      None
3093  */
3094 int bluetooth_unregister_scan_filter(int slot_id);
3095
3096 /**
3097  * @fn int bluetooth_unregister_all_scan_filters(void)
3098  * @brief Register scan filter.
3099  *
3100  * This function usregisters all scan filters.
3101  *
3102  * This function is a synchronous call.
3103  *
3104  * @return      BLUETOOTH_ERROR_NONE - Success \n
3105  *
3106  * @remark      None
3107  */
3108 int bluetooth_unregister_all_scan_filters(void);
3109
3110 /**
3111  * @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3112                 int link_type, bt_rssi_threshold_t rssi_threshold)
3113  * @brief Enable RSSI monitoring
3114  *
3115  * This function enables RSSI monitoring and sets threshold for a connection
3116  *
3117  * @return      BLUETOOTH_ERROR_NONE - Success \n
3118  *
3119  * @remark      None
3120  * @see bluetooth_get_rssi_strength
3121  */
3122 int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
3123                 int link_type, bt_rssi_threshold_t *rssi_threshold);
3124
3125 /**
3126  * @fn int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type)
3127  * @brief Gets Raw RSSI signal Strength
3128  *
3129  * This function gives the Raw RSSI signal strength for a connection.
3130  *
3131  * @return      BLUETOOTH_ERROR_NONE - Success \n
3132  *
3133  * @remark      None
3134  * @see bluetooth_enable_rssi
3135  */
3136 int bluetooth_get_rssi_strength(const bluetooth_device_address_t *remote_address, int link_type);
3137
3138 int bluetooth_set_connectable(gboolean is_connectable);
3139
3140 int bluetooth_is_connectable(gboolean *is_connectable);
3141
3142 /**
3143  * @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
3144  * @brief Initiate a bonding process
3145  *
3146  *
3147  * This function initiates a bonding procedure with a peer device.  The bonding procedure
3148  * enables authentication and optionally encryption on the Bluetooth link.
3149  *
3150  * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3151  * inititate the bonding request to the devices already in the paired list.
3152  *
3153  * Usually we call this API after the device discovery.
3154  * This function is a asynchronous call.
3155  *
3156  * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3157  * mentioed result code
3158  * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3159  * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3160  * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3161  * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3162  * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3163  *
3164  * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3165  * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3166  * result code
3167  *
3168  * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3169  *
3170  *
3171  * @return      BLUETOOTH_ERROR_NONE - Success \n
3172  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3173  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3174  *              BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3175  *              BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3176  * @exception   None
3177  * @param[in]   device_address   This indicates an address of the device with which the pairing
3178  *                                      should be initiated
3179  * @remark      None
3180  * @see         bluetooth_cancel_bonding
3181  @code
3182 void bt_event_callback(int event, bluetooth_event_param_t *param)
3183 {
3184         switch(event)
3185         {
3186                 case BLUETOOTH_EVENT_BONDING_FINISHED:
3187                 {
3188                         TC_PRT("BLUETOOTH_EVENT_BONDING_FINISHED, result [0x%04x]", param->result);
3189                         if (param->result >= BLUETOOTH_ERROR_NONE)
3190                         {
3191                                 bluetooth_device_info_t *device_info = NULL;
3192                                 device_info  = (bluetooth_device_info_t *)param->param_data;
3193                                 printf("dev [%s] [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]
3194                                                         mjr[%#x] min[%#x] srv[%#x]",
3195                                                         device_info->device_name.name,
3196                                                         device_info->device_address.addr[0],
3197                                                         device_info->device_address.addr[1],
3198                                                         device_info->device_address.addr[2],
3199                                                         device_info->device_address.addr[3],
3200                                                         device_info->device_address.addr[4],
3201                                                         device_info->device_address.addr[5],
3202                                                         device_info->device_class.major_class,
3203                                                         device_info->device_class.minor_class,
3204                                                         device_info->device_class.service_class);
3205                         }
3206                         else
3207                         {
3208                                 //bonding failed
3209                         }
3210                         break;
3211                 }
3212         }
3213 }
3214
3215 ...
3216
3217 int ret = 0;
3218 bluetooth_device_address_t device_address={{0}};
3219
3220 ret = bluetooth_bond_device(&device_address);
3221
3222 @endcode
3223  */
3224 int bluetooth_bond_device(const bluetooth_device_address_t *device_address);
3225
3226 /**
3227  * @fn int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3228  *                              bluetooth_conn_type_t conn_type)
3229  * @brief Initiate a bonding process
3230  *
3231  *
3232  * This function initiates a bonding procedure with a peer device on the basis of connection type (BLE or BREDR).
3233  * The bonding procedure enables authentication and optionally encryption on the Bluetooth link.
3234  *
3235  * Bonding is applied to the discovered device to which we need a secure connection. We cannot
3236  * inititate the bonding request to the devices already in the paired list.
3237  *
3238  * Usually we call this API after the device discovery.
3239  * This function is a asynchronous call.
3240  *
3241  * Response will be received through BLUETOOTH_EVENT_BONDING_FINISHED event. It can any of the below
3242  * mentioed result code
3243  * BLUETOOTH_ERROR_PARING_FAILED - Pairing faied \n
3244  * BLUETOOTH_ERROR_ACCESS_DENIED - Authetication rejected \n
3245  * BLUETOOTH_ERROR_CANCEL_BY_USER - Cancelled by the user \n
3246  * BLUETOOTH_ERROR_PARING_FAILED - Pairing failed \n
3247  * BLUETOOTH_ERROR_TIMEOUT - Timeout has haapened \n
3248  *
3249  * If the remote user is not responding with in a specific time(60 seconds), then a timeout happens
3250  * and BLUETOOTH_EVENT_BONDING_FINISHED callback event is called with and BLUETOOTH_ERROR_TIMEOUT
3251  * result code
3252  *
3253  * The bonding operation can be cancelled by calling bluetooth_cancel_bonding().
3254  *
3255  *
3256  * @return BLUETOOTH_ERROR_NONE - Success \n
3257  *             BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3258  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3259  *             BLUETOOTH_ERROR_DEVICE_BUSY - Adapter is busy or Discovery is in Progress \n
3260  *             BLUETOOTH_ERROR_INVALID_DATA - Invalid BD address \n
3261  * @exception None
3262  * @param[in] device_address This indicates an address of the device with which pairing
3263  *                                        should be initiated
3264  * @param[in] conn_type This Indicates the connection type to be used for pairing in case of
3265  *                                 dual mode devices
3266  * @remark None
3267  * @see bluetooth_cancel_bonding
3268  */
3269 int bluetooth_bond_device_by_type(const bluetooth_device_address_t *device_address,
3270                                 bluetooth_conn_type_t conn_type);
3271
3272 /**
3273  * @fn int bluetooth_cancel_bonding(void)
3274  * @brief Cancel the on-going bonding process
3275  *
3276  * This API is called to cancel the on-going bonding procedure. It should be called before the
3277  * BLUETOOTH_EVENT_BONDING_FINISHED event comes.
3278  * This API is useful when the remote device is not responding to the bond request or we wish to
3279  * cancel the bonding request. In this case we need not wait for the timeout to happen.
3280  *
3281  * This function is a synchronous call.
3282  *
3283  * @return      BLUETOOTH_ERROR_NONE - Success \n
3284  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - No bonding request in progress \n
3285  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
3286  * @exception   None
3287  * @remark      None
3288  * @see         bluetooth_bond_device
3289 @code
3290 ...
3291
3292 int ret = 0;
3293
3294 ret = bluetooth_cancel_bonding();
3295 @endcode
3296  */
3297 int bluetooth_cancel_bonding(void);
3298
3299 /**
3300  * @fn int bluetooth_unbond_device(const bluetooth_device_address_t *device_address)
3301  * @brief Remove bonding
3302  *
3303  *
3304  * To communicate with remote device over bluetooth link, user should bond with peer device.
3305  * After bonding is over, peer device is added to list of bonded devices. bluetooth_unbond_device()
3306  * API is used to remove peer device from the list. Please note that after removing the device
3307  * from bonded device list, you cannot communication with peer device until bonding happens again.
3308  *
3309  * User can call this function by passing bluetooth device address of any bonded device. Please note
3310  * that after successful return of this function, any bluetooth application running on your device
3311  * will not be able to communicate with unbonded device until bond operation happens again using
3312  * bluetooth_bond_device()
3313  *
3314  *
3315  * This function is a asynchronous call. The request to remove the specified device from the bonded
3316  * list is responded by an BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED event. if the operation is success,
3317  * you will receive BLUETOOTH_ERROR_NONE. BLUETOOTH_ERROR_NOT_PAIRED may be received in result code
3318  * in case if there is a problem in locating given bluetooth device address in bonded devices list
3319  *
3320  *
3321  *
3322  * @return      BLUETOOTH_ERROR_NONE - Success \n
3323  *              BLUETOOTH_ERROR_INVALID_PARAM - Device address is not valid \n
3324  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth adapter is not enabled \n
3325  *              BLUETOOTH_ERROR_DEVICE_BUSY     - Bluetooth adapter is busy doing some operation \n
3326  *              BLUETOOTH_ERROR_INVALID_DATA - Device address provided is incorrect \n
3327  *              BLUETOOTH_ERROR_INTERNAL - System error like heap full has occured or bluetooth
3328  *                                              agent is not running \n
3329  *              BLUETOOTH_ERROR_NOT_PAIRED - Device address mentioned in the argument is not a
3330  *                                              bonded device \n
3331  *
3332  * @param[in]   device_address   This indicates an address of the device to remove bonding
3333  *
3334  * @remark      None
3335  *
3336  * @see         bluetooth_bond_device, bluetooth_cancel_bonding
3337  *
3338 @code
3339 void bt_event_callback(int event, bluetooth_event_param_t *param)
3340 {
3341         switch(event) {
3342                 case BLUETOOTH_EVENT_BONDED_DEVICE_REMOVED: {
3343                         bluetooth_device_address_t *dev_addr = NULL;
3344
3345                         if (param->result == BLUETOOTH_ERROR_NONE) {
3346                                 dev_addr = (bluetooth_device_address_t *)param->param_data;
3347                                 //Unbound scuccess
3348                                 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3349                                         dev_addr->addr[0], dev_addr->addr[1]
3350                                         dev_addr->addr[2], dev_addr->addr[3]
3351                                         dev_addr->addr[4], dev_addr->addr[5]
3352                         } else {
3353                                 //unbound failure
3354                         }
3355                 }
3356         }
3357 }
3358
3359 ...
3360
3361 int ret = 0;
3362 bluetooth_device_address_t *device_address;
3363
3364 // copy valid device address in device_address
3365
3366 ret = bluetooth_unbond_device(device_address);
3367 @endcode
3368  */
3369 int bluetooth_unbond_device(const bluetooth_device_address_t *device_address);
3370
3371 /**
3372  * @fn int bluetooth_get_bonded_device_list(GPtrArray **dev_list)
3373  * @brief Get bonded(paired) device list
3374  *
3375  *
3376  * This API gets all bonded device list.
3377  * The devices in the bonded device list further can be used to perform the authorization by calling
3378  * bluetooth_authorize_device API.
3379  *
3380  * This function is a synchronous call.
3381  * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3382  * there is no valid information in the dev_list.
3383  * The len field in the dev_list represents the number of bonded devices. The data structure for
3384  * bonded device information is bluetooth_device_info_t.
3385  *
3386  *
3387  * @return      BLUETOOTH_ERROR_NONE - Success \n
3388  *              BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3389  * @remark      None
3390  * @see         bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3391  @code
3392 void bt_get_bonded_devices(void)
3393 {
3394 ...
3395         int i;
3396         GPtrArray *devinfo = NULL;
3397         bluetooth_device_info_t *ptr;
3398
3399         // allocate the g_pointer_array
3400         devinfo = g_ptr_array_new();
3401
3402         ret = bluetooth_get_bonded_device_list(&devinfo);
3403         if (ret != BLUETOOTH_ERROR_NONE)
3404         {
3405                 printf("bluetooth_get_bonded_device_list failed with [%d]",ret);
3406         }
3407         else
3408         {
3409                 printf("g pointer arrary count : [%d]", devinfo->len);
3410                 for (i=0; i<devinfo->len; i++)
3411                 {
3412                         ptr = g_ptr_array_index(devinfo, i);
3413                         if (ptr != NULL)
3414                         {
3415                                 printf("Name [%s]\n", ptr->device_name.name);
3416                                 printf("Major Class [%d]\n", ptr->device_class.major_class);
3417                                 printf("Minor Class [%d]\n", ptr->device_class.minor_class);
3418                                 printf("Service Class [%d]\n", ptr->device_class.service_class);
3419                                 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
3420                                                                 ptr->device_address.addr[0],
3421                                 ptr->device_address.addr[1], ptr->device_address.addr[2],
3422                                                                 ptr->device_address.addr[3],
3423                                 ptr->device_address.addr[4], ptr->device_address.addr[5]);
3424
3425                                 // handle
3426                                 ...
3427                         }
3428                 }
3429         }
3430         // free g_pointer_array
3431         g_ptr_array_free(devinfo, TRUE);
3432 }
3433
3434 @endcode
3435  */
3436 int bluetooth_get_bonded_device_list(GPtrArray **dev_list);
3437
3438 int bluetooth_get_profile_connected_device_list(
3439                 const char *profile_uuid, GPtrArray **addr_list);
3440
3441 /**
3442  * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3443  *                                      bluetooth_device_info_t *dev_info)
3444  * @brief Get a bonded(paired) device
3445  *
3446  *
3447  * This API gets a bonded device.
3448  *
3449  * This function is a synchronous call.
3450  * Information for bonded devices can be obtained when result code is BLUETOOTH_ERROR_NONE. If not,
3451  * there is no valid information in the dev_info.
3452  * The data structure for bonded device information is bluetooth_device_info_t.
3453  *
3454  *
3455  * @return      BLUETOOTH_ERROR_NONE - Success \n
3456  *              BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3457  * @remark      None
3458  * @see         bluetooth_bond_device, bluetooth_unbond_device, bluetooth_authorize_device
3459  @code
3460 void bt_get_bonded_device(void)
3461 {
3462 ...
3463         int i;
3464         bluetooth_device_info_t devinfo = {0};
3465         bluetooth_device_address_t device_address={{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3466
3467         ret = bluetooth_get_bonded_device(&device_address, &devinfo);
3468         if (ret != BLUETOOTH_ERROR_NONE)
3469         {
3470                 printf("bluetooth_get_bonded_device failed with [%d]",ret);
3471         }
3472         else
3473         {
3474                 printf("Name [%s]\n", devinfo.device_name.name);
3475                 printf("Major Class [%d]\n", devinfo.device_class.major_class);
3476                 printf("Minor Class [%d]\n", devinfo.device_class.minor_class);
3477                 printf("Service Class [%d]\n", devinfo.device_class.service_class);
3478                 printf("%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", devinfo.device_address.addr[0],
3479                 devinfo.device_address.addr[1], devinfo.device_address.addr[2],
3480                 devinfo.device_address.addr[3], devinfo.device_address.addr[4],
3481                 devinfo.device_address.addr[5]);
3482
3483                 // handle
3484                 ...
3485         }
3486 }
3487
3488 @endcode
3489  */
3490 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
3491                                         bluetooth_device_info_t *dev_info);
3492
3493
3494 /**
3495  * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3496  *                                      gboolean *is_alias_set)
3497  * @brief Get is_alias_set property of device
3498  *
3499  * This API gets is_alias_set property of a bonded device.
3500  *
3501  * This function is a synchronous call.
3502  * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE.
3503  * If not,there is no valid information in the is_alias_set.
3504  *
3505  * @return      BLUETOOTH_ERROR_NONE - Success \n
3506  *                      BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n
3507  * @remark None
3508  @code
3509         int ret = 0;
3510         gboolean alias_set;
3511         bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}};
3512
3513         ret = bluetooth_get_is_alias_set(&device_address, &alias_set);
3514  @endcode
3515  */
3516 int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
3517                                 gboolean *is_alias_set);
3518
3519 /**
3520  * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias)
3521  * @brief set alias for bonded device
3522  *
3523  *
3524  * This function set alias for bonded device.
3525  *
3526  * This function is a synchronous call.
3527  *
3528  *
3529  * @return      BLUETOOTH_ERROR_NONE - Success \n
3530  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3531  * @param[in]   device_address   This indicates an address of the remote device
3532  * @param[in]   alias                   This indicates an alias to set
3533  * @remark      None
3534  * @see         None
3535 @code
3536 int ret = 0;
3537 ret = bluetooth_set_alias(&remote_address);
3538 @endcode
3539  */
3540 int bluetooth_set_alias(const bluetooth_device_address_t *device_address,
3541                                 const char *alias);
3542
3543 /**
3544  * @fn int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address)
3545  * @brief Get remote deivice
3546  *
3547  *
3548  * This function gets specific remote device.
3549  *
3550  * This function is a asynchronous call.
3551  * This API is responded by an BLUETOOTH_EVENT_REMOTE_DEVICE_READ event.
3552  *
3553  *
3554  * @return      BLUETOOTH_ERROR_NONE - Success \n
3555  *              BLUETOOTH_ERROR_NOT_SUPPORT - Operation not supported \n
3556  * @param[in]   device_address   This indicates an address of the remote device
3557  * @remark      None
3558  * @see         None
3559 @code
3560 int ret = 0;
3561 ret = bluetooth_get_remote_device(&remote_address);
3562 @endcode
3563  */
3564 int bluetooth_get_remote_device(const bluetooth_device_address_t *device_address);
3565
3566 /**
3567  * @fn int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3568  *                                      gboolean authorized)
3569  * @brief Authorize/Unauthorize a bonded device
3570  *
3571  *
3572  * This function authorizes/unauthorize a bonded device. It decides the device to connect
3573  * with/without user confirmation.
3574  *
3575  * If we select a paired device and make it authorized by calling this API with the authorized
3576  * parameter to TRUE, then it will not ask for the user conformation before connecting. Similarly
3577  * if we unauthorize the paired device by calling this API with the authorized parameter to FALSE,
3578  * then it will ask for the user conformation before the connection.
3579  *
3580  * This API supposed to be called on the paired devices. Which means we have to use this API only
3581  * after successful pairing.
3582  *
3583  * This function is a asynchronous call.
3584  * Response will be received through BLUETOOTH_EVENT_DEVICE_AUTHORIZED event.
3585  *
3586  * @return      BLUETOOTH_ERROR_NONE - Success \n
3587  * @exception   BLUETOOTH_ERROR_INTERNAL - Cannot get the interal DBUS proxy \n
3588  * @param[in]   device_address   This indicates an address of the device to authorize \n
3589  * @param[in]   authorized      TRUE : authorize FALSE: unauthorize
3590  * @remark      None
3591  * @see         bluetooth_get_bonded_device_list
3592 @code
3593 void bt_event_callback(int event, bluetooth_event_param_t *param)
3594 {
3595         switch(event)
3596         {
3597                 case BLUETOOTH_EVENT_DEVICE_AUTHORIZED :
3598                 {
3599                         if (param->result == BLUETOOTH_ERROR_NONE)
3600                         {
3601                                 //Device authorized
3602                         }
3603                         //device authorization failed failure
3604                 }
3605         }
3606 }
3607
3608 ...
3609
3610 int ret = 0;
3611 bluetooth_device_address_t device_address={{0}};
3612 gboolean authorized;
3613
3614 authorized =TRUE;
3615
3616 ret = bluetooth_authorize_device(&device_address,authorized);
3617 @endcode
3618  */
3619 int bluetooth_authorize_device(const bluetooth_device_address_t *device_address,
3620                                        gboolean authorized);
3621
3622 int bluetooth_set_pin_code(const bluetooth_device_address_t *device_address,
3623                                 const bluetooth_device_pin_code_t *pin_code);
3624
3625 int bluetooth_unset_pin_code(const bluetooth_device_address_t *device_address);
3626
3627 /**
3628  * @fn int bluetooth_passkey_reply(char *passkey, gboolean reply)
3629  *
3630  * @brief Receives Legacy Passkey\pin with following authentication response types
3631  *
3632  * @param[in]   passkey : This is the PIN or PASSKEY string required for remote device authentication
3633  * @param[in]   reply    TRUE : Accept AUthentication FALSE: Cancels authentication
3634  *
3635  */
3636 int bluetooth_passkey_reply(char *passkey, gboolean reply);
3637
3638 /**
3639  * @fn int bluetooth_passkey_confirmation_reply(gboolean reply);
3640  *
3641  * @brief This API sends user confirmation reply to the local adapter.
3642  *
3643  * @param[in] reply TRUE : Accept AUthentication FALSE: Cancels authentication
3644  *
3645  */
3646 int bluetooth_passkey_confirmation_reply(gboolean reply);
3647
3648 /**
3649  * @fn int bluetooth_search_service(const bluetooth_device_address_t *device_address)
3650  * @brief Get all services supported by remote device
3651  *
3652  *
3653  * This API call initiates the search for the services supported by the specified device. Normally
3654  * the service search will take a couple of seconds to get it completed. Before calling this API
3655  * make sure that the Adapter is enabled. We have to give the device address of the remote device to
3656  * perform the service search. We can get the device address by doing a device discovery operation.
3657  *
3658  *
3659  * This function is a asynchronous call.
3660  * The service search request is responded by BLUETOOTH_EVENT_SERVICE_SEARCHED event.
3661  *
3662  * There is a timeout associated with the service search. The default time out is 40 seconds. If the
3663  * remove device did not respond with in the time out period the BLUETOOTH_EVENT_SERVICE_SEARCHED
3664  * event is generated with appropriate result code.
3665  *
3666  * @return      BLUETOOTH_ERROR_NONE - Success \n
3667  *              BLUETOOTH_ERROR_SERVICE_SEARCH_ERROR - Service search error (NULL device address) \n
3668  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
3669  * @param[in]   device_address   This indicates an address of the device
3670  *                               whose services need to be found
3671  * @remark      None
3672  * @see         bluetooth_cancel_service_search
3673  */
3674 int bluetooth_search_service(const bluetooth_device_address_t *device_address);
3675
3676 /**
3677  * @fn int bluetooth_cancel_service_search(void)
3678  * @brief Cancel the ongoing service search operation
3679  *
3680  *
3681  * This function cancel the ongoing service search operation. This API is usually calling after the
3682  * bluetooth_search_service API.
3683  * Normally service search will take a more time (> 5 seconds) to complete. This API will be called
3684  * if the user wish to cancel the Ongoing service search operation.
3685  *
3686  * This API should be called just after the bluetooth_search_service API and before the
3687  * BLUETOOTH_EVENT_SERVICE_SEARCHED event
3688  *
3689  * This function is a synchronous call.
3690  *
3691  * @return      BLUETOOTH_ERROR_NONE - Success \n
3692  *              BLUETOOTH_ERROR_CANCEL - Error in service search cancel operation \n
3693  *              BLUETOOTH_ERROR_NOT_PAIRED - Not paired device \n
3694  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - Searching service is not in operation \n
3695  *
3696  * @remark      None
3697  * @see         bluetooth_search_service
3698 @code
3699 ...
3700
3701 int ret = 0;
3702 ret = bluetooth_cancel_service_search();
3703 @endcode
3704 */
3705 int bluetooth_cancel_service_search(void);
3706
3707 /**
3708  * @fn int bluetooth_rfcomm_create_socket(const char *uuid)
3709  * @brief Register rfcomm socket with a specific uuid
3710  *
3711  *
3712  * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3713  * descriptor of the server.
3714  * This is the first API which is called to create the server. Once we created the server socket,
3715  * we will listen on that return socket.
3716  * So a bluetooth_rfcomm_listen_and_accept should follow this API call. This is a synchronous call.
3717  *
3718  *
3719  * @return  socket FD on Success \n
3720  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3721  *              BLUETOOTH_ERROR_INTERNAL - Internal error\n
3722  *              BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3723  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3724  * @param[in]   UUID (128 bits)
3725  *
3726  * @remark      None
3727  * @see       bluetooth_rfcomm_listen_and_accept, bluetooth_rfcomm_remove_socket
3728  *
3729  @code
3730
3731   const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3732   fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3733
3734  @endcode
3735  */
3736 int bluetooth_rfcomm_create_socket(const char *uuid);
3737
3738 /**
3739  * @fn int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path)
3740  * @brief Register rfcomm socket with a specific uuid
3741  *
3742  *
3743  * This API register rfcomm socket with the given UUID. The return value of this API is the socket
3744  * descriptor of the server.
3745  * This is the first API which is called to create the server. Once we created the server socket,
3746  * we will listen on that return socket.
3747  * So a bluetooth_rfcomm_listen_and_accept_ex should follow this API call. This is a synchronous call.
3748  *
3749  *
3750  * @return  socket FD on Success \n
3751  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3752  *              BLUETOOTH_ERROR_INTERNAL - Internal error\n
3753  *              BLUETOOTH_ERROR_MAX_CONNECTION - Maximum connection reached\n
3754  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3755  * @param[in]   UUID (128 bits)
3756  * @param[in]   bus_name (const char)
3757  * @param[in]   path (const char)
3758  *
3759  * @remark      None
3760  * @see       bluetooth_rfcomm_listen_and_accept_ex, bluetooth_rfcomm_remove_socket
3761  *
3762  @code
3763
3764   const char *rfcomm_test_uuid="00001101-0000-1000-8000-00805F9B34FB";
3765   fd  = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, bus_name, path);
3766
3767  @endcode
3768  */
3769 int bluetooth_rfcomm_create_socket_ex(const char *uuid, const char *bus_name, const char *path);
3770
3771 /**
3772  * @fn int bluetooth_rfcomm_remove_socket(int socket_fd, const char *uuid)
3773  * @brief De-register the rfcomm socket
3774  *
3775  *
3776  * This API deregister rfcomm socket with the given socket fd and  UUID. If the remote device is
3777  * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3778  * descriptor else no event will come. We will call this API only after the
3779  * bluetooth_rfcomm_listen_and_accept.
3780  * This is a synchronous call.
3781  *
3782  * @return   BLUETOOTH_ERROR_NONE - Success \n
3783  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3784  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3785  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3786  * @param[in]  int socket_fd
3787  *
3788  * @remark      None
3789  * @see       bluetooth_rfcomm_create_socket, bluetooth_rfcomm_listen_and_accept
3790  *
3791  @code
3792  void bt_event_callback(int event, bluetooth_event_param_t *param)
3793  {
3794         switch(event)
3795         {
3796                 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3797                 {
3798                         bluetooth_rfcomm_connection_t *discon_ind =
3799                                         (bluetooth_rfcomm_connection_t *)param->param_data;
3800
3801                         printf("\nDisconnected from FD %d",  discon_ind->socket_fd);
3802                 }
3803         }
3804  }
3805
3806  ...
3807
3808  int ret = 0;
3809  fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3810  ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3811  ....
3812  ret = bluetooth_rfcomm_remove_socket(fd);
3813  @endcode
3814  */
3815 int bluetooth_rfcomm_remove_socket(int socket_fd);
3816
3817 /**
3818  * @fn int bluetooth_rfcomm_remove_socket(const char *uuid)
3819  * @brief De-register the rfcomm socket
3820  *
3821  *
3822  * This API deregister rfcomm socket with the given socket UUID. If the remote device is
3823  * already connected then we will receive the BLUETOOTH_EVENT_RFCOMM_DISCONNECTED with socket
3824  * descriptor else no event will come. We will call this API only after the
3825  * bluetooth_rfcomm_listen_and_accept_ex.
3826  * This is a synchronous call.
3827  *
3828  * @return   BLUETOOTH_ERROR_NONE - Success \n
3829  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
3830  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
3831  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3832  * @param[in]   UUID (128 bits)
3833  *
3834  * @remark      None
3835  * @see       bluetooth_rfcomm_create_socket_ex, bluetooth_rfcomm_listen_and_accept_ex
3836  *
3837  @code
3838  void bt_event_callback(int event, bluetooth_event_param_t *param)
3839  {
3840         switch(event)
3841         {
3842                 case BLUETOOTH_EVENT_RFCOMM_DISCONNECTED:
3843                 {
3844                         bluetooth_rfcomm_connection_t *discon_ind =
3845                                         (bluetooth_rfcomm_connection_t *)param->param_data;
3846
3847                         printf("\nDisconnected from FD %d",  discon_ind->socket_fd);
3848                 }
3849         }
3850  }
3851
3852  ...
3853
3854  int ret = 0;
3855  fd  = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid, path, bus_name);
3856  ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3857  ....
3858  ret = bluetooth_rfcomm_remove_socket_ex(rfcomm_test_uuid);
3859  @endcode
3860  */
3861 int bluetooth_rfcomm_remove_socket_ex(const char *uuid);
3862
3863 /**
3864  * @fn int bluetooth_rfcomm_server_disconnect(int socket_fd)
3865  * @brief Disconnect rfcomm connection
3866  *
3867  *
3868  * Disconnect a specific(device node fd)  RFCOMM connection. This is a Synchronous call and there
3869  * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
3870  * remote server.
3871  *
3872  * @return   BLUETOOTH_ERROR_NONE  - Success \n
3873  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3874  *              BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
3875  * @param[in]  int socket_fd the sending socket fd
3876  *
3877  * @remark      None
3878  *
3879  @code
3880
3881   ret = bluetooth_rfcomm_server_disconnect(g_ret_fd);
3882   if (ret < 0)
3883         printf("Disconnection failed");
3884   else
3885   printf("Disconnection Success");
3886
3887  @endcode
3888  */
3889 int bluetooth_rfcomm_server_disconnect(int socket_fd);
3890
3891 /**
3892  * @fn int bluetooth_rfcomm_listen_and_accept(int socket_fd,int max_pending_connection)
3893  * @brief Rfcomm socket listen
3894  *
3895  *
3896  * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3897  * after the bluetooth_rfcomm_create_socket API.
3898  * This API listen for the incomming connection and once it receives a connection, it will give
3899  * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3900  * event to the application. This is an Asynchronous API call.
3901  *
3902  *
3903  * @return  BLUETOOTH_ERROR_NONE - Success \n
3904  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3905  *              BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3906
3907  * @param[in]  int socket_fd
3908  * @param[in]  max pending connection.
3909  *
3910  * @remark      None
3911  * @see       bluetooth_rfcomm_create_socket
3912  *
3913   @code
3914   void bt_event_callback(int event, bluetooth_event_param_t* param)
3915  {
3916         switch(event)
3917         {
3918                 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3919                 {
3920                         bluetooth_rfcomm_connection_t *conn_ind =
3921                                                 (bluetooth_rfcomm_connection_t *)param->param_data;
3922
3923                         printf("\nConnected from FD %d",  conn_ind->socket_fd);
3924                 }
3925         }
3926  }
3927
3928  ...
3929
3930  int ret = 0;
3931  fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
3932  ret = bluetooth_rfcomm_listen_and_accept(fd, 1);
3933
3934  @endcode
3935  */
3936 int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection);
3937
3938 /**
3939  * @fn int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path)
3940  * @brief Rfcomm socket listen
3941  *
3942  *
3943  * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3944  * after the bluetooth_rfcomm_create_socket API.
3945  * This API listen for the incomming connection and once it receives a connection, it will give
3946  * BLUETOOTH_EVENT_RFCOMM_CONNECTED
3947  * event to the application. This is an Asynchronous API call.
3948  *
3949  *
3950  * @return  BLUETOOTH_ERROR_NONE - Success \n
3951  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
3952  *              BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
3953
3954  * @param[in]  int socket_fd
3955  * @param[in]  max pending connection.
3956  * @param[in]  name
3957  * @param[in]  path
3958  *
3959  * @remark      None
3960  * @see       bluetooth_rfcomm_create_socket_ex
3961  *
3962   @code
3963   void bt_event_callback(int event, bluetooth_event_param_t* param)
3964  {
3965         switch(event)
3966         {
3967                 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
3968                 {
3969                         bluetooth_rfcomm_connection_t *conn_ind =
3970                                                 (bluetooth_rfcomm_connection_t *)param->param_data;
3971
3972                         printf("\nConnected from FD %d",  conn_ind->socket_fd);
3973                 }
3974         }
3975  }
3976
3977  ...
3978
3979  int ret = 0;
3980  fd  = bluetooth_rfcomm_create_socket_ex(rfcomm_test_uuid);
3981  ret = bluetooth_rfcomm_listen_and_accept_ex(rfcomm_test_uuid, 1, bus_name, path);
3982
3983  @endcode
3984  */
3985
3986 int bluetooth_rfcomm_listen_and_accept_ex(const char *uuid, int max_pending_connection, const char *bus_name, const char *path);
3987
3988 /**
3989  * @fn int bluetooth_rfcomm_listen(int socket_fd,int max_pending_connection)
3990  * @brief Rfcomm socket listen
3991  *
3992  *
3993  * This API make rfcomm socket listen and accept with socket. We will call this API immediatly
3994  * after the bluetooth_rfcomm_create_socket API.
3995  * This API listen for the incomming connection and once it receives a connection, it will give
3996  * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE
3997  * event to the application. This is an Asynchronous API call.
3998  *
3999  *
4000  * @return  BLUETOOTH_ERROR_NONE - Success \n
4001  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4002  *              BLUETOOTH_ERROR_CONNECTION_ERROR - Listen failed \n
4003
4004  * @param[in]  int socket_fd
4005  * @param[in]  max pending connection.
4006  *
4007  * @remark      None
4008  * @see       bluetooth_rfcomm_create_socket
4009  *
4010   @code
4011   void bt_event_callback(int event, bluetooth_event_param_t* param)
4012  {
4013         switch(event)
4014         {
4015                 case BLUETOOTH_EVENT_RFCOMM_AUTHORIZE:
4016                 {
4017                         char *name = (char *)param->param_data;
4018
4019                         printf("\nConnected from %s",  name);
4020
4021                         bluetooth_rfcomm_accept_connection();
4022                 }
4023         }
4024  }
4025
4026  ...
4027
4028  int ret = 0;
4029  fd  = bluetooth_rfcomm_create_socket(rfcomm_test_uuid);
4030  ret = bluetooth_rfcomm_listen(fd, 1);
4031
4032  @endcode
4033  */
4034 int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection);
4035
4036 /**
4037  * @fn int bluetooth_rfcomm_accept_connection()
4038  * @brief Accepts the authorization request indicated by the event
4039   * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4040  *
4041  * This function is a synchronous call.
4042  *
4043  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4044  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
4045  *
4046  * @param[in]  the socket fd of the server
4047  * @param[out]  the socket fd of the client
4048  *
4049  * @exception   None
4050  * @remark       None
4051  * @see bluetooth_rfcomm_reject_connection
4052  */
4053 int bluetooth_rfcomm_accept_connection(int server_fd);
4054
4055 /**
4056  * @fn int bluetooth_rfcomm_reject_connection()
4057  * @brief Rejects the authorization request indicated by the event
4058   * BLUETOOTH_EVENT_RFCOMM_AUTHORIZE.
4059  *
4060  * This function is a synchronous call.
4061  *
4062  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4063  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
4064  *
4065  * @param[in]  the socket fd of the server
4066  *
4067  * @exception   None
4068  * @remark       None
4069  * @see bluetooth_rfcomm_accept_connection
4070  */
4071 int bluetooth_rfcomm_reject_connection(int server_fd);
4072
4073 /**
4074  * @fn gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid)
4075  * @brief Informs whether rfcomm server uuid is available or not.
4076  *
4077  * This function is a synchronous call.
4078  *
4079  * @return   TRUE  - RFCOMM uuid is available \n
4080  *              FALSE - RFCOMM uuid is not available \n
4081  *
4082  * @param[in]  uuid UUID string
4083  *
4084  * @exception   None
4085  *
4086  * @remark       None
4087  */
4088 gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uuid);
4089
4090 /**
4091  * @fn int bluetooth_rfcomm_connect(const bluetooth_device_address_t  *remote_bt_address,
4092  *                                                                      const char *remote_uuid)
4093  * @brief Connect to the remote device rfcomm *
4094  *
4095  * Connect to a specific RFCOMM based service on a remote device UUID. This is a Async call. Once
4096  * the connection is successful callback BLUETOOTH_EVENT_RFCOMM_CONNECTED events is generated,
4097  * which contains the socket_fd, device role (RFCOMM_ROLE_SERVER/RFCOMM_ROLE_CLIENT), device addess
4098  * etc. The socket_fd can be further used to send the data. It better to do a sevice search before
4099  * initiating a connection.
4100  *
4101  * @return  BLUETOOTH_ERROR_NONE  - Success \n
4102  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4103  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4104  *              BLUETOOTH_ERROR_CONNECTION_BUSY - Connection in progress \n
4105  *              BLUETOOTH_ERROR_INTERNAL - Internal Error\n
4106  * @param[in]  bluetooth_device_address_t remote bt_address
4107  * @param[in]  char remote uuid
4108  * @remark      None
4109  * @see         bluetooth_rfcomm_disconnect, bluetooth_rfcomm_write, bluetooth_search_service
4110  *
4111  @code
4112
4113  void bt_event_callback(int event, bluetooth_event_param_t *param)
4114  {
4115         switch(event)
4116         {
4117                 case BLUETOOTH_EVENT_SERVICE_SEARCHED:
4118                 {
4119                         if (param->result >= BLUETOOTH_ERROR_NONE)
4120                         {
4121                                 bt_sdp_info_t *bt_sdp_info=param->param_data;
4122
4123                                 printf("Dev add = %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n",
4124                                         bt_sdp_info->device_addr.addr[0],
4125                                         bt_sdp_info->device_addr.addr[1],
4126                                         bt_sdp_info->device_addr.addr[2],
4127                                         bt_sdp_info->device_addr.addr[3],
4128                                         bt_sdp_info->device_addr.addr[4],
4129                                         bt_sdp_info->device_addr.addr[5]);
4130
4131                                         printf("Supported service list:\n");
4132                                         for(i=0; i<bt_sdp_info->service_index; i++)
4133                                                 printf("[%#x]\n",
4134                                                         bt_sdp_info->service_list_array[i]);
4135
4136                                 //Alternate method
4137                                 //ret = bluetooth_rfcomm_connect(bt_sdp_info->device_addr,
4138                                                                                 //rfcomm_test_uuid);
4139                         }
4140                         break;
4141                 }
4142                 case BLUETOOTH_EVENT_RFCOMM_CONNECTED:
4143                 {
4144                         bluetooth_rfcomm_connection_t *conn_ind =
4145                                                 (bluetooth_rfcomm_connection_t *)param->param_data;
4146
4147                         printf("\nConnected from FD %d, Role = %s",  conn_ind->socket_fd,
4148                                                 (conn_ind->device_role == RFCOMM_ROLE_SERVER) ?
4149                                                                         "SERVER" : "CLIENT");
4150                 }
4151         }
4152  }
4153
4154   bluetooth_device_address_t remote_address = {{0},};
4155   remote_address.addr[0] = 0x0; remote_address.addr[1] = 0x0A; remote_address.addr[2] = 0x3A;
4156   remote_address.addr[3]= 0x54; remote_address.addr[4] = 0x19;  remote_address.addr[5]= 0x36;
4157   ret = bluetooth_search_service(&remote_address);
4158  if (ret < 0)
4159         printf("Seach failed, Reason = %d", ret);
4160   else
4161          printf("Search Success, Ret = %d", ret);
4162
4163   ret = bluetooth_rfcomm_connect(&remote_address, rfcomm_test_uuid);
4164   if (ret < 0)
4165         printf("Connection failed, Reason = %d", ret);
4166   else
4167          printf("Connection Success, Ret = %d", ret);
4168
4169   @endcode
4170   */
4171 int bluetooth_rfcomm_connect(const bluetooth_device_address_t *remote_bt_address,
4172                                      const char *remote_uuid);
4173
4174 /**
4175  * @fn int bluetooth_rfcomm_disconnect(int socket_fd)
4176  * @brief Disconnect rfcomm connection
4177  *
4178  *
4179  * Disconnect a specific(device node fd)  RFCOMM connection. This is a Synchronous call and there
4180  * is no cabbback events for this API. We have to provice the valid client fd to disconnect from the
4181  * remote server.
4182  *
4183  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4184  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4185  *              BLUETOOTH_ERROR_NOT_CONNECTED - Not connected \n
4186  * @param[in]  char remote bt_address
4187  *
4188  * @remark      None
4189  * @see         bluetooth_rfcomm_connect
4190  *
4191  @code
4192
4193   ret = bluetooth_rfcomm_disconnect(g_ret_fd);
4194   if (ret < 0)
4195         printf("Disconnection failed");
4196   else
4197   printf("Disconnection Success");
4198
4199  @endcode
4200  */
4201
4202 int bluetooth_rfcomm_disconnect(int socket_fd);
4203
4204 /**
4205  * @fn int bluetooth_rfcomm_write (int fd, const char *buff, int length)
4206  * @brief Write to rfcomm connection
4207  *
4208  *
4209  * This API is used to send the data over the rfcomm connection. This is a synchronous API. The same
4210  * API is used to send the data for server and the client.
4211  *
4212  * @return  BLUETOOTH_ERROR_NONE  - Success \n
4213  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4214  *              BLUETOOTH_ERROR_NOT_IN_OPERATION - The Fd is currently not in operation\n
4215  * @param[in]  int fd
4216  * @param[in]  const char *buff  Data buffer to send
4217  * @param[in]  int length Length of the data
4218  *
4219  * @remark      None
4220  * @see         bluetooth_rfcomm_connect
4221  *
4222   @code
4223   char *buff = "Test data 123456789"
4224   ret =  bluetooth_rfcomm_write(g_ret_fd, buff, 15);
4225   if (ret < 0)
4226         printf("Send failed");
4227   else
4228    printf("Send success");
4229
4230  @endcode
4231  */
4232 int bluetooth_rfcomm_write(int fd, const char *buf, int length);
4233
4234 /**
4235  * @fn gboolean bluetooth_rfcomm_is_client_connected(void)
4236  * @brief Informs whether rfcomm client is connected.
4237  *
4238  * This function is a synchronous call.
4239  *
4240  * @return   TRUE  - RFCOMM client is connected \n
4241  *              FALSE - RFCOMM client is not connected \n
4242  *
4243  * @exception   None
4244  *
4245  * @remark       None
4246  */
4247 gboolean bluetooth_rfcomm_is_client_connected(void);
4248 int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4249 int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected);
4250
4251 /**
4252  * @fn int bluetooth_network_activate_server(void)
4253  * @brief Activate the NAP (Network Access Point) service
4254  *
4255  * This function is a asynchronous call.
4256  * The activate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_ACTIVATED event.
4257  *
4258  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4259  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4260  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4261  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4262  *
4263  * @remark      None
4264   * @see        bluetooth_network_deactivate_server
4265  *
4266  */
4267 int bluetooth_network_activate_server(void);
4268
4269 /**
4270  * @fn int bluetooth_network_deactivate_server(void)
4271  * @brief Deactivate the NAP (Network Access Point) service
4272  *
4273  * This function is a asynchronous call.
4274  * The deactivate server request is responded by BLUETOOTH_EVENT_NETWORK_SERVER_DEACTIVATED event.
4275  *
4276  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4277  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4278  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4279  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4280  *
4281  * @remark      None
4282  * @see         bluetooth_network_activate_server
4283  *
4284  */
4285 int bluetooth_network_deactivate_server(void);
4286
4287 /**
4288  * @fn int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4289  *                                      bluetooth_network_role_t role,
4290  *                                      char  custom_uuid)
4291  * @brief Connect the network server in the peer
4292  *
4293  * This function is a asynchronous call.
4294  * The network connect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4295  *
4296  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4297  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4298  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4299  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4300  *
4301  * @exception   None
4302  * @param[in]  device_address   This indicates an address of the device with which the pairing
4303  *                              should be initiated
4304  * @param[in]  role   The role to connect. PANU / GN / NAP / CUSTOM. If use the CUSTOM value,
4305  *                      need to use the third parameter.
4306  * @param[in]  custom_uuid   If use the CUSTOM value in second parameter, use this parameter to
4307  *                              connect. UUID string
4308  * @remark      None
4309  * @see         bluetooth_network_disconnect
4310  */
4311 int bluetooth_network_connect(const bluetooth_device_address_t *device_address,
4312                                       bluetooth_network_role_t role, char *custom_uuid);
4313
4314 /**
4315  * @fn int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address,
4316  *                                                      bluetooth_network_role_t role,
4317  *                                                        char *custom_uuid)
4318  * @brief Connect the network server in the peer
4319  *
4320  * This function is a asynchronous call.
4321  * The network disconnect request is responded by BLUETOOTH_EVENT_NETWORK_CONNECTED event.
4322  *
4323  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4324  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4325  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4326  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4327  *
4328  * @exception   None
4329  * @param[in]   device_address   This indicates an address of the device with which the pairing
4330  *                                      should be initiated
4331  * @remark       None
4332  * @see         bluetooth_network_connect
4333  */
4334 int bluetooth_network_disconnect(const bluetooth_device_address_t *device_address);
4335
4336 /**
4337  * @fn int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address)
4338  * @brief Disconnect the device from the network
4339  *
4340  * This function is an asynchronous call.
4341  * The network server disconnect request is responded by
4342  * BLUETOOTH_EVENT_NETWORK_SERVER_DISCONNECTED event.
4343  *
4344  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4345  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4346  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4347  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4348  *
4349  * @exception   None
4350  * @param[in]   device_address   This indicates an address of the connected client device
4351  * @remark       None
4352  * @see         bluetooth_network_activate_server
4353  */
4354 int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device_address);
4355
4356 /*HDP - API's*/
4357
4358 /**
4359  * @fn int bluetooth_hdp_activate(unsigned short  data_type,
4360  *                                      bt_hdp_role_type_t role,
4361  *                                      bt_hdp_qos_type_t channel_type,
4362  *                                      char **app_handle)
4363  * @brief Activate the HDP service for a particular data type
4364  *
4365  * This function is a synchronous call.
4366  *
4367  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4368  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4369  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4370  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4371  *
4372  * @exception   None
4373  * @param[in]  data_type   The data type against corresponding service
4374  * @param[in]  role   The role of HDP. HDP_ROLE_SOURCE/HDP_ROLE_SINK.
4375  * @param[in]  channel_type   The QOS type for the channel.
4376  *                              HDP_QOS_RELIABLE/HDP_QOS_STREAMING/HDP_QOS_ANY.
4377  *                              For role = HDP_ROLE_SINK, the channel_type
4378  *                              should be HDP_QOS_ANY.
4379  * @param[out]  app_handle    The application handler against corresponding service
4380  * @remark       None
4381  * @see bluetooth_hdp_deactivate
4382  */
4383 int bluetooth_hdp_activate(unsigned short  data_type,
4384                                 bt_hdp_role_type_t role,
4385                                 bt_hdp_qos_type_t channel_type,
4386                                 char **app_handle);
4387 /**
4388  * @fn int bluetooth_hdp_deactivate(const char *app_handle)
4389  * @brief Deactivate the HDP service for a particular service using the handler
4390  *
4391  * This function is a synchronous call.
4392  *
4393  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4394  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4395  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4396  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4397  *
4398  * @exception   None
4399  * @param[in]  app_handle   The application handler against corresponding service
4400  * @remark       None
4401  * @see bluetooth_hdp_deactivate
4402  */
4403 int bluetooth_hdp_deactivate(const char *app_handle);
4404
4405 /**
4406  * @fn int bluetooth_hdp_send_data(unsigned int channel_id,
4407  *                                      const char *buffer, unsigned int size)
4408  * @brief Send data to the remote HDP device
4409  *
4410  * This function is a synchronous call.
4411  *
4412  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4413  *             BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4414  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4415  *             BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4416  *             BLUETOOTH_ERROR_NOT_IN_OPERATION - FD is invalid  \n
4417  *
4418  * @exception   None
4419  * @param[in]  channel_id   The channel id for the connection.
4420  * @param[in]  buffer   The pdu buffer.
4421  * @param[in]  size   Size of the buffer.
4422  * @remark       None
4423  * @see bluetooth_hdp_connect
4424  */
4425 int bluetooth_hdp_send_data(unsigned int channel_id,
4426                                 const char *buffer, unsigned int size);
4427 /**
4428  * @fn int bluetooth_hdp_connect(const char *app_handle,
4429  *                              bt_hdp_qos_type_t channel_type,
4430  *                              const bluetooth_device_address_t *device_address)
4431  * @brief Connect to the remote device(Mainly used by source)
4432  *
4433  * This function is a asynchronous call.
4434  * The HDP activate is responded by BLUETOOTH_EVENT_HDP_CONNECTED event.
4435  *
4436  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4437  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4438  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4439  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4440  *              BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4441  *
4442  * @exception   None
4443  * @param[in]  app_handle   The application handler against corresponding service
4444  * @param[in]  channel_type   The QOS type for the channel.
4445  *                              HDP_QOS_RELIABLE/HDP_QOS_STREAMING.
4446  * @param[in]  device_address   The remote device Bd address.
4447  *
4448  * @remark       None
4449  * @see bluetooth_hdp_disconnect
4450  */
4451 int bluetooth_hdp_connect(const char *app_handle,
4452                         bt_hdp_qos_type_t channel_type,
4453                         const bluetooth_device_address_t *device_address);
4454 /**
4455  * @fn int bluetooth_hdp_disconnect(unsigned int channel_id,
4456  *                      const bluetooth_device_address_t *device_address)
4457  * @brief Disconnect from the remote device(Mainly used by source)
4458  *
4459  * This function is a asynchronous call.
4460  * The HDP activate is responded by BLUETOOTH_EVENT_HDP_DISCONNECTED event.
4461  *
4462  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4463  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4464  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4465  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4466   *              BLUETOOTH_ERROR_MEMORY_ALLOCATION -Memory allocation failed \n
4467  *
4468  * @exception   None
4469  * @param[in]  channel_id    The channel id for the connection.
4470  * @param[in]  device_address   The remote device Bd address.
4471  *
4472  * @remark       None
4473  * @see bluetooth_hdp_connect
4474  */
4475 int bluetooth_hdp_disconnect(unsigned int channel_id,
4476                         const bluetooth_device_address_t  *device_address);
4477
4478
4479 /**
4480  * @fn int bluetooth_opc_init(void)
4481  * @brief Initialize OPP client.
4482  *
4483  * This function is a synchronous call.
4484  * No event corresponding to this api
4485  *
4486  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4487  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4488  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4489  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4490   *             BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4491  *
4492  * @exception   None
4493  *
4494  * @remark       None
4495  * @see bluetooth_opc_deinit
4496  */
4497 int bluetooth_opc_init(void);
4498
4499 /**
4500  * @fn int bluetooth_opc_deinit(void)
4501  * @brief Deinitialize OPP client.
4502  *
4503  * This function is a synchronous call.
4504  * No event corresponding to this api
4505  *
4506  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4507  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4508  *              BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4509  *
4510  * @exception   None
4511  *
4512  * @remark       None
4513  * @see bluetooth_opc_init
4514  */
4515
4516 int bluetooth_opc_deinit(void);
4517
4518 /**
4519  * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4520                                         char **file_name_array)
4521  * @brief Send multiple files to a remote device.
4522  *
4523  * This function is a asynchronous call.
4524  * This api  is responded by BLUETOOTH_EVENT_OPC_CONNECTED event.
4525  *
4526  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4527  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4528  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4529  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4530  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4531  *              BLUETOOTH_ERROR_IN_PROGRESS -Already one push in progress \n
4532  *              BLUETOOTH_ERROR_ACCESS_DENIED - Not allowed by MDM policy \n
4533  *
4534  * @exception   None
4535  * @param[in]  device_address   The remote device Bd address.
4536  * @param[in]  file_name_array  Array of filepaths to be sent.
4537  *
4538  * @remark       None
4539  * @see bluetooth_opc_cancel_push
4540  */
4541
4542 int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address,
4543                                 char **file_name_array);
4544
4545 /**
4546  * @fn int bluetooth_opc_cancel_push(void)
4547  * @brief Cancels the ongoing file push.
4548  *
4549  * This function is a asynchronous call.
4550  * This api is responded with either BLUETOOTH_EVENT_OPC_CONNECTED or
4551  * BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETED event.
4552  *
4553  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4554  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4555  *              BLUETOOTH_ERROR_ACCESS_DENIED - No push in progress \n
4556  *
4557  * @exception   None
4558  *
4559  * @remark       None
4560  * @see bluetooth_opc_push_files
4561  */
4562
4563 int bluetooth_opc_cancel_push(void);
4564
4565 /**
4566  * @fn gboolean bluetooth_opc_session_is_exist(void)
4567  * @brief Informs whether opc session exists or not.
4568  *
4569  * This function is a synchronous call.
4570  *
4571  * @return   TRUE  - OPC session exists \n
4572  *              FALSE - OPC session does not exist \n
4573  *
4574  * @exception   None
4575  *
4576  * @remark       None
4577  * @see None
4578  */
4579
4580 gboolean bluetooth_opc_session_is_exist(void);
4581
4582 /**
4583  * @fn int bluetooth_opc_is_sending(gboolean *is_sending)
4584  * @brief Informs whether opc session exists or not.
4585  *
4586  * This function is a synchronous call.
4587  *
4588  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4589  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4590  *               BLUETOOTH_ERROR_INTERNAL \n
4591  *
4592  * @exception   None
4593  * @param[out] is_sending The sending status: (@c TRUE = in sending , @c  false = not in sending)
4594  *
4595  * @remark       None
4596  * @see            None
4597  */
4598 int bluetooth_opc_is_sending(gboolean *is_sending);
4599
4600 /**
4601  * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4602                 int transfer_id, unsigned char *progress)
4603  * @brief Gets the percentage progress for ongoing transfers.
4604  *
4605  * This function is a synchronous call.
4606  *
4607  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4608  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4609  *               BLUETOOTH_ERROR_NOT_FOUND - Not found \n
4610  *
4611  * @exception   None
4612  * @param[in] transfer_type     Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c  BLUETOOTH_TRANSFER_OUTBOUND = sending)
4613  * @param[in] transfer_id       Transfer ID
4614  * @param[out] progress         Percentage Progress
4615  * @remark       None
4616  * @see            None
4617  */
4618 int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type,
4619                 int transfer_id, unsigned char *progress);
4620
4621 /**
4622  * @fn int bluetooth_obex_server_init(const char *dst_path)
4623  * @brief Initialize OPP and FTP server.
4624  *
4625  * This function is a synchronous call.
4626  * No event corresponding to this api
4627  *
4628  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4629  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4630  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4631  *              BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4632  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4633  *
4634  * @exception   None
4635  * @param[in]  dst_path   OPS destination file path.
4636  * @remark       None
4637  * @see bluetooth_obex_server_deinit
4638  */
4639 int bluetooth_obex_server_init(const char *dst_path);
4640
4641
4642 /**
4643  * @fn int bluetooth_obex_server_deinit(void)
4644  * @brief Deinitialize OPP and FTP server.
4645  *
4646  * This function is a synchronous call.
4647  * No event corresponding to this api
4648  *
4649  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4650  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4651  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4652  *
4653  * @exception   None
4654  *
4655  * @remark       None
4656  * @see bluetooth_obex_server_init
4657  */
4658 int bluetooth_obex_server_deinit(void);
4659
4660
4661 /**
4662  * @fn gboolean bluetooth_obex_server_is_activated(void)
4663  * @brief Informs whether obex server is activated or not.
4664  *
4665  * This function is a synchronous call.
4666  *
4667  * @return   TRUE  - OBEX server is activated \n
4668  *              FALSE - OBEX server is not activated \n
4669  *
4670  * @exception   None
4671  *
4672  * @remark       None
4673  */
4674
4675 gboolean bluetooth_obex_server_is_activated(void);
4676
4677
4678 /**
4679  * @fn int bluetooth_obex_server_init_without_agent(const char *dst_path)
4680  * @brief Initialize OPP and FTP server without the conneciton authorization of the agent
4681  *
4682  * This function is a synchronous call.
4683  * No event corresponding to this api
4684  *
4685  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4686  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4687  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4688  *              BLUETOOTH_ERROR_AGENT_ALREADY_EXIST - Obex agent already registered \n
4689  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4690  *
4691  *
4692  * @exception   None
4693  * @param[in]  dst_path   OPS destination file path.
4694  * @remark       None
4695  * @see bluetooth_obex_server_deinit_without_agent
4696  */
4697 int bluetooth_obex_server_init_without_agent(const char *dst_path);
4698
4699
4700 /**
4701  * @fn int bluetooth_obex_server_deinit_without_agent(void)
4702  * @brief Deinitialize OPP and FTP server without the conneciton authorization of the agent
4703  *
4704  * This function is a synchronous call.
4705  * No event corresponding to this api
4706  *
4707  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4708  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4709  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4710  *
4711  * @exception   None
4712  *
4713  * @remark       None
4714  * @see bluetooth_obex_server_init_without_agent
4715  */
4716 int bluetooth_obex_server_deinit_without_agent(void);
4717
4718
4719 /**
4720  * @fn int bluetooth_obex_server_accept_connection(void)
4721  * @brief Accepts the authorization request indicated by the event
4722   * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4723  *
4724  * This function is a synchronous call.
4725  *
4726  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4727  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4728  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
4729  *
4730  * @exception   None
4731  * @remark       None
4732  * @see bluetooth_obex_server_reject_authorize
4733  */
4734 int bluetooth_obex_server_accept_connection(void);
4735
4736
4737 /**
4738  * @fn int bluetooth_obex_server_reject_connection(void)
4739  * @brief Rejects the authorization request indicated by the event
4740   * BLUETOOTH_EVENT_OBEX_SERVER_CONNECTION_AUTHORIZE.
4741  *
4742  * This function is a synchronous call.
4743  *
4744  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4745  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4746  *              BLUETOOTH_ERROR_INTERNAL - Internal error \n
4747  *
4748  * @exception   None
4749  * @remark       None
4750  * @see bluetooth_obex_server_reject_authorize
4751  */
4752 int bluetooth_obex_server_reject_connection(void);
4753
4754
4755 /**
4756  * @fn int bluetooth_obex_server_accept_authorize(const char *filename)
4757  * @brief Accepts the authorization request indicated by the event
4758   * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4759  *
4760  * This function is a asynchronous call.
4761  * This api will be responded with the event BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED.
4762  *
4763  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4764  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4765  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4766  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4767  *
4768  * @exception   None
4769  * @param[in]  filename   Authorized filename.
4770
4771  * @remark       None
4772  * @see bluetooth_obex_server_reject_authorize
4773  */
4774
4775 int bluetooth_obex_server_accept_authorize(const char *filename);
4776
4777 /**
4778  * @fn int bluetooth_obex_server_reject_authorize(void)
4779  * @brief Reject the authorization request indicated by the event
4780   * BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE.
4781  *
4782  * This function is a asynchronous call.
4783  * No event for this api..
4784  *
4785  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4786  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4787  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4788  *
4789  * @exception   None
4790
4791  * @remark       None
4792  * @see bluetooth_obex_server_accept_authorize
4793  */
4794
4795 int bluetooth_obex_server_reject_authorize(void);
4796
4797 /**
4798  * @fn int bluetooth_obex_server_set_destination_path(const char *dst_path)
4799  * @brief Set the OPS destination file path..
4800  *
4801  * This function is a asynchronous call.
4802  * No event for this api..
4803  *
4804  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4805  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4806  *              BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4807  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid Param \n
4808  *
4809  * @exception   None
4810  * @param[in]  dst_path   OPS destination file path.
4811
4812  * @remark       None
4813  * @see None
4814  */
4815
4816 int bluetooth_obex_server_set_destination_path(const char *dst_path);
4817
4818 /**
4819  * @fn int bluetooth_obex_server_set_root(const char *root)
4820  * @brief Set the FTS root folder..
4821  *
4822  * This function is a asynchronous call.
4823  * No event for this api..
4824  *
4825  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4826  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4827  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4828  *              BLUETOOTH_ERROR_ACCESS_DENIED - Operation not allowed \n
4829  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
4830  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4831  *
4832  * @exception  None
4833  * @param[in]   root   FTS root folder.
4834
4835  * @remark       None
4836  * @see None
4837  */
4838
4839 int bluetooth_obex_server_set_root(const char *root);
4840
4841 /**
4842  * @fn int bluetooth_obex_server_cancel_transfer(int transfer_id)
4843  * @brief Cancel the transfer on server
4844  *
4845  * This function is an asynchronous call.
4846  * If the function call that cancels transfer is successful, the application would receive
4847  * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4848  * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4849  * the error code will be BLUETOOTH_ERROR_NONE
4850  *
4851  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4852  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4853  *               BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4854  *               BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4855  *               BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4856  *
4857  * @exception None
4858  * @param[in] transfer_id transfer ID
4859
4860  * @remark       None
4861  * @see None
4862  */
4863 int bluetooth_obex_server_cancel_transfer(int transfer_id);
4864
4865
4866 /**
4867  * @fn int bluetooth_obex_server_cancel_all_transfers(void)
4868  * @brief Cancel the transfer on server
4869  *
4870  * This function is an asynchronous call.
4871  * If the function call that cancels transfer is successful, the application would receive
4872  * BLUETOOTH_EVENT_TRANSFER_COMPLETED event through registered callback
4873  * function with an error code BLUETOOTH_ERROR_CANCEL. In the case of failure
4874  * the error code will be BLUETOOTH_ERROR_NONE
4875  *
4876  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4877  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4878  *               BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST -Obex agent not registered \n
4879  *               BLUETOOTH_ERROR_INTERNAL - internal error (proxy does not exist) \n
4880  *               BLUETOOTH_ERROR_NOT_FOUND - The transfer is not found \n
4881  *
4882  * @exception None
4883  *
4884  * @remark       None
4885  * @see None
4886  */
4887 int bluetooth_obex_server_cancel_all_transfers(void);
4888
4889
4890 /**
4891  * @fn int bluetooth_obex_server_is_receiving(gboolean *is_receiving)
4892  * @brief Informs whether obex server is receiving or not.
4893  *
4894  * This function is a synchronous call.
4895  *
4896  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4897  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n
4898  *               BLUETOOTH_ERROR_INTERNAL \n
4899  *
4900  * @exception   None
4901  * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c  false = not in receiving)
4902  *
4903  * @remark       None
4904  * @see None
4905  */
4906 int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
4907
4908
4909 /**
4910  * @fn int bluetooth_map_client_init(void)
4911  * @brief Initialize MAP client.
4912  *
4913  * This function is a synchronous call.
4914  * No event corresponding to this api
4915  *
4916  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4917  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4918  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
4919  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
4920  *              BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
4921  *
4922  * @exception   None
4923  *
4924  * @remark       None
4925  * @see           bluetooth_map_client_deinit
4926  */
4927 int bluetooth_map_client_init(void);
4928
4929 int bluetooth_map_client_deinit(void);
4930
4931 int bluetooth_map_client_create_session(
4932    bt_map_client_session_info_s *session
4933 );
4934
4935 int bluetooth_map_client_destroy_session(
4936     bt_map_client_session_info_s *session
4937 );
4938
4939 int bluetooth_map_client_set_folder(
4940     bt_map_client_session_info_s *session,
4941     const char *name
4942 );
4943
4944 int bluetooth_map_client_list_folders(
4945     bt_map_client_session_info_s *session,
4946     int offset,
4947     int maxcount
4948 );
4949
4950 /**
4951  * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
4952  * @brief Return all available fields that can be used in Fields filter.
4953  *
4954  * This function is a asynchronous call.
4955  *
4956  * @return   BLUETOOTH_ERROR_NONE  - Success \n
4957  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
4958  *              BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
4959  *
4960  * @exception   None
4961  * @param[in]  session   Information about session.
4962  * @remark       None
4963  */
4964 int bluetooth_map_client_list_filter_fields(
4965     bt_map_client_session_info_s *session
4966 );
4967
4968 int bluetooth_map_client_list_messages(
4969     bt_map_client_session_info_s *session,
4970     const char *folder,
4971     GVariant *filter
4972 );
4973
4974 int bluetooth_map_client_update_inbox(
4975     bt_map_client_session_info_s *session
4976 );
4977
4978 int bluetooth_map_client_push_message(
4979     bt_map_client_session_info_s *session,
4980     const char *source_file,
4981     const char *folder,
4982     GVariant *args
4983 );
4984
4985 int bluetooth_map_client_get_message(
4986     bt_map_client_session_info_s *session,
4987     const char *message_object_name,
4988     const char *target_file,
4989     bool attachment
4990 );
4991
4992
4993 /**
4994  * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data)
4995  * @brief Read the local Hash and Randmizer.
4996  *
4997  * This function is a synchronous call.
4998  *
4999  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5000  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5001  *
5002  * @exception  None
5003  * @param[in]  None.
5004  * @param[out] local_oob_data - Pointer to the local OOB data
5005  *
5006  * @remark       None
5007  * @see None
5008  */
5009
5010 int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data);
5011
5012
5013 /**
5014  * @fn int bluetooth_oob_add_remote_data(
5015  *                      const bluetooth_device_address_t *remote_device_address,
5016  *                      bt_oob_data_t *oob_data)
5017  * @brief Add/updated the remote device  Hash and Randmizer.
5018  *
5019  * This function is a synchronous call.
5020  * No event for this api..
5021  *
5022  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5023  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5024  *
5025  * @exception   None
5026  * @param[in] remote_device_address - Remote device address
5027  *            remote_oob_data - Ponter to Hash and Randomizer oob data structure
5028  *
5029  * @remark      None
5030  * @see         None
5031  */
5032
5033 int bluetooth_oob_add_remote_data(
5034                    const bluetooth_device_address_t *remote_device_address,
5035                    bt_oob_data_t *remote_oob_data);
5036
5037
5038 /**
5039  * @fn int bluetooth_oob_remove_remote_data(
5040  *                      const bluetooth_device_address_t *remote_device_address)
5041  * @brief Delete the Hash and Randomizer w.r.t the remote device address.
5042  *
5043  * This function is a synchronous call.
5044  * No event for this api..
5045  *
5046  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5047  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5048  *
5049  * @exception  None
5050  * @param[in] remote_device_address - Remote device address
5051  *
5052  * @remark       None
5053  * @see None
5054  */
5055
5056 int bluetooth_oob_remove_remote_data(
5057                         const bluetooth_device_address_t *remote_device_address);
5058
5059 /**
5060  * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5061  *                                              bt_gatt_handle_info_t *prim_svc);
5062  *
5063  * @brief Gets the GATT based primary services handle supported by remote device
5064  *
5065  * This function is a synchronous call.
5066  * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5067  *
5068  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5069  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5070  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5071  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5072  *
5073  * @exception    None
5074  * @param[in]    address - Remote device address
5075  * @param[out] prim_svc - Structure containing remote service count and handle list.
5076  *
5077  * @remark      None
5078  * @see         bluetooth_gatt_free_primary_services()
5079  */
5080 int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
5081                                                 bt_gatt_handle_info_t *prim_svc);
5082
5083 /**
5084  * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
5085  *
5086  * @brief Discovers the characteristics of GATT based service of remote device
5087  *
5088  * This function is an asynchronous call.
5089  * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
5090  *
5091  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5092  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5093  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5094  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5095  *
5096  * @exception   None
5097  * @param[in]   service_handle - Handle for remote service.
5098  *
5099  * @remark      None
5100  * @see         None
5101  */
5102 int bluetooth_gatt_discover_service_characteristics(const char *service_handle);
5103
5104 int bluetooth_gatt_set_service_change_watcher(
5105                 const bluetooth_device_address_t *address, gboolean enable);
5106
5107 /**
5108  * @fn int bluetooth_gatt_get_service_property(const char *service_handle,
5109  *                                              bt_gatt_service_property_t *service);
5110  *
5111  * @brief Gets the properties of GATT based service of remote device
5112  *
5113  * This function is a synchronous call.
5114  * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
5115  *
5116  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5117  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5118  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5119  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5120  *
5121  * @exception   None
5122  * @param[in]   service_handle - Handle for remote service.
5123  * @param[out]  service - Structure containing remote service property.
5124  *
5125  * @remark      None
5126  * @see         bluetooth_gatt_free_service_property()
5127  */
5128 int bluetooth_gatt_get_service_property(const char *service_handle,
5129                                                 bt_gatt_service_property_t *service);
5130
5131 /**
5132  * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
5133  *
5134  * @brief Register to GATT based service to receive value change notification/indication.
5135  *
5136  * This function is a synchronous call.
5137  * No event for this api.
5138  *
5139  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5140  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5141  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5142  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5143  *
5144  * @exception   None
5145  * @param[in]   service_handle - Handle for remote service.
5146  *
5147  * @remark      None
5148  * @see None
5149  */
5150 int bluetooth_gatt_watch_characteristics(const char *service_handle);
5151
5152 /**
5153  * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
5154  *
5155  * @brief Unregister GATT based service to receive value change notification/indication.
5156  *
5157  * This function is a synchronous call.
5158  * No event for this api.
5159  *
5160  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5161  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5162  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5163  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5164  *
5165  * @exception   None
5166  * @param[in]   service_handle - Handle for remote service.
5167  *
5168  * @remark      None
5169  * @see         None
5170  */
5171 int bluetooth_gatt_unwatch_characteristics(const char *service_handle);
5172
5173 /**
5174  * @fn int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5175  *                                              bt_gatt_char_property_t *characteristic);
5176  *
5177  * @brief Provides characteristic value along with properties.
5178  *
5179  * This function is a synchronous call.
5180  * The output parameter needs to be freed by calling bluetooth_gatt_free_char_property()
5181  *
5182  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5183  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5184  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5185  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5186  *
5187  * @exception   None
5188  * @param[in]   char_handle - Handle for Characteristic property.
5189  * @param[out] characteristic - Structure containing remote characteristic property.
5190  *
5191  * @remark      None
5192  * @see         bluetooth_gatt_free_char_property()
5193  */
5194 int bluetooth_gatt_get_characteristics_property(const char *char_handle,
5195                                                 bt_gatt_char_property_t *characteristic);
5196
5197 /**
5198  * @fn int bluetooth_gatt_get_char_descriptor_property(const char *char_handle,
5199  *                                              bt_gatt_char_property_t *characteristic);
5200  *
5201  * @brief Provides characteristic descriptor value along with its UUID.
5202  *
5203  * This function is a synchronous call.
5204  * The output parameter needs to be freed by calling bluetooth_gatt_free_desc_property()
5205  *
5206  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5207  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5208  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5209  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5210  *
5211  * @exception   None
5212  * @param[in]   desc_handle - Handle for Characteristic descriptor.
5213  * @param[out] descriptor - Structure containing remote characteristic descriptor property.
5214  *
5215  * @remark      None
5216  * @see         bluetooth_gatt_free_desc_property()
5217  */
5218 int bluetooth_gatt_get_char_descriptor_property(const char *desc_handle,
5219                                                 bt_gatt_char_descriptor_property_t *descriptor);
5220
5221
5222 /**
5223  * @fn int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5224  *                                              const guint8 *value, int length)
5225  *
5226  * @brief Set characteristic value.
5227  *
5228  * This function is a synchronous call.
5229  *
5230  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5231  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5232  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5233  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5234  *
5235  * @exception   None
5236  * @param[in]   char_handle - Handle for Characteristic property.
5237  * @param[in]   value - New value to set for characteristic property.
5238  * @param[in]   length - Length of the value to be set.
5239  *
5240  * @remark      None
5241  * @see         None
5242  */
5243 int bluetooth_gatt_set_characteristics_value(const char *char_handle,
5244                                                 const guint8 *value, int length);
5245
5246 /**
5247  * @fn int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5248  *                              const guint8 *value, int length, guint8 write_type)
5249  *
5250  * @brief Set characteristic value by write type.
5251  *
5252  * This function is a synchronous call if write type is "write without resonse"
5253  * and it is an asynchronous call if write type is "write with response"
5254  *
5255  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5256  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5257  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5258  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5259  *
5260  * @exception   None
5261  * @param[in]   char_handle - Handle for Characteristic property.
5262  * @param[in]   value - New value to set for characteristic property.
5263  * @param[in]   length - Length of the value to be set.
5264  * @param[in]   write_type - Type of write.
5265  *
5266  * @remark      None
5267  * @see         None
5268  */
5269 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
5270                                 const guint8 *value, int length, guint8 write_type);
5271
5272
5273 /**
5274  * @fn int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5275  *                                              const guint8 *value, int length)
5276  *
5277  * @brief Set characteristic value request.
5278  *
5279  * This function is an asynchronous call.
5280  *
5281  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5282  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5283  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5284  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5285  *
5286  * @exception   None
5287  * @param[in]   char_handle - Handle for Characteristic property.
5288  * @param[in]   value - New value to set for characteristic property.
5289  * @param[in]   length - Length of the value to be set.
5290   *
5291  * @remark      None
5292  * @see         None
5293  */
5294 int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
5295                                                 const guint8 *value, int length);
5296
5297 /**
5298  * @fn int bluetooth_gatt_read_characteristic_value(const char *char_handle)
5299  *
5300  * @brief Read characteristic value.
5301  *
5302  * This function is a asynchronous call.
5303  *
5304  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5305  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5306  *             BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5307  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5308  *
5309  * @exception  None
5310  * @param[in]  char_handle - Handle for Characteristic property.
5311  *
5312  * @remark     None
5313  * @see        None
5314  */
5315 int bluetooth_gatt_read_characteristic_value(const char *char_handle);
5316
5317 /**
5318  * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5319  *                                      const char *service_uuid,
5320  *                                      bt_gatt_service_property_t *service)
5321  *
5322  * @brief Gets the service property from a device based on a particular uuid
5323  *
5324  * This function is a synchronous call.
5325  *
5326  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5327  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5328  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5329  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5330  *
5331  * @exception   None
5332  * @param[in]   address - BD address of the remote device
5333  * @param[in]   service_uuid - uuid of the service.
5334  * @param[out] service - Structure containing the service property.
5335  *
5336  * @remark      None
5337  * @see         None
5338  */
5339 int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
5340                                         const char *service_uuid,
5341                                         bt_gatt_service_property_t *service);
5342
5343 /**
5344  * @fn int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5345  *                                                      const char *char_uuid)
5346  *
5347  * @brief Gets the characteristic property from a service based on a particular char uuid
5348  *
5349  * This function is an asynchronous call.
5350  * This API is responded with BLUETOOTH_EVENT_GATT_GET_CHAR_FROM_UUID
5351  *
5352  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5353  *              BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5354  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5355  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5356  *
5357  * @exception   None
5358  * @param[in]   service_handle - Service handle.
5359  * @param[in]   uuid - Characteristic uuid.
5360  *
5361  * @remark      None
5362  * @see         None
5363  */
5364 int bluetooth_gatt_get_char_from_uuid(const char *service_handle,
5365                                                 const char *char_uuid);
5366
5367 /**
5368  * @fn int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5369  *
5370  * @brief Releases the memory allocated by bluetooth_gatt_get_primary_services()
5371  *
5372  * This function is a synchronous call.
5373  * The input parameter is obtained by calling bluetooth_gatt_get_primary_services()
5374  *
5375  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5376  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5377  *
5378  * @exception   None
5379  * @param[in]   prim_svc - GATT handle info structure
5380  *
5381  * @remark      None
5382  * @see         bluetooth_gatt_get_primary_services()
5383  */
5384 int bluetooth_gatt_free_primary_services(bt_gatt_handle_info_t *prim_svc);
5385
5386 /**
5387  * @fn int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5388  *
5389  * @brief  Releases the memory allocated by bluetooth_gatt_get_service_property()
5390  *
5391  * This function is a synchronous call.
5392  * The input parameter is obtained by calling bluetooth_gatt_get_service_property()
5393  *
5394  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5395  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5396  *
5397  * @exception   None
5398  * @param[in]   svc_pty - GATT service property structure.
5399  *
5400  * @remark      None
5401  * @see         bluetooth_gatt_get_service_property()
5402  */
5403 int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty);
5404
5405 /**
5406  * @fn int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5407  *
5408  * @brief Provides characteristic value along with properties.
5409  *
5410  * This function is a synchronous call.
5411  * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5412  *
5413  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5414  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5415  *
5416  * @exception   None
5417  * @param[in]   char_pty - GATT characteristics property structure.
5418  *
5419  * @remark      None
5420  * @see         bluetooth_gatt_get_characteristics_property()
5421  */
5422 int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
5423
5424 /**
5425  * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5426  *
5427  * @brief Releases the memory allocated by bluetooth_gatt_get_char_descriptor_property()
5428  *
5429  * This function is a synchronous call.
5430  * The input parameter is obtained by calling bluetooth_gatt_get_char_descriptor_property()
5431  *
5432  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5433  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5434  *
5435  * @exception   None
5436  * @param[in]   desc_pty - GATT characteristics descriptor property structure.
5437  *
5438  * @remark      None
5439  * @see         bluetooth_gatt_get_char_descriptor_property()
5440  */
5441 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
5442
5443 int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
5444
5445 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
5446
5447  /**
5448  * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5449  *
5450  * @brief Discovers the characteristic descriptor value of a characteristic within its definition, asynchronously
5451  *
5452  * The input parameter is obtained by calling bluetooth_gatt_get_characteristics_property()
5453  *
5454  * @return  BLUETOOTH_ERROR_NONE  - Success \n
5455  *                      BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5456  *
5457  * @exception   None
5458  * @param[in]   characteristic_handle - The characteristic handle for which characteristic descriptor has to be discovered.
5459  *
5460  * @remark      None
5461  */
5462 int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
5463
5464 /**
5465  * @fn int bluetooth_gatt_read_descriptor_value(const char *desc_handle)
5466  *
5467  * @brief Read characteristic descriptor value.
5468  *
5469  * This function is a asynchronous call.
5470  *
5471  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5472  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5473  *             BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5474  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5475  *
5476  * @exception  None
5477  * @param[in]  desc_handle - Handle for Characteristic descriptor
5478  *
5479  * @remark     None
5480  * @see        None
5481  */
5482 int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
5483
5484 /**
5485  * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5486  *                      const guint8 *value, int length);
5487  *
5488  * @brief Set characteristic descriptor value.
5489  *
5490  * This function is a asynchronous call.
5491  *
5492  * @return   BLUETOOTH_ERROR_NONE  - Success \n
5493  *             BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5494  *             BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5495  *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5496  *
5497  * @exception  None
5498  * @param[in]  desc_handle - Handle for Characteristic descriptor
5499  * @param[in]  value - New value to set for characteristic descriptor
5500  * @param[in]  length - Length of the value to be set.
5501  *
5502  * @remark     None
5503  * @see        None
5504  */
5505 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
5506                         const guint8 *value, int length);
5507
5508 /* @fn int bluetooth_gatt_init(void)
5509 *
5510 * @brief Initializes the gatt service.
5511 *
5512 * This function is a synchronous call.
5513 * @return   BLUETOOTH_ERROR_NONE        - Success \n
5514 *       BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5515 *       BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5516 *       BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5517 *
5518 * @exception     None
5519 * @remark  Adapter should be enabled
5520 * @see  bluetooth_gatt_deinit()
5521 */
5522 int bluetooth_gatt_init(void);
5523
5524 /* @fn int bluetooth_gatt_init(void)
5525 *
5526 * @brief DeInitializes the gatt service.
5527 *
5528 * This function is a synchronous call.
5529 * @return   BLUETOOTH_ERROR_NONE        - Success \n
5530 *       BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5531 *       BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5532 *       BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5533 *
5534 * @exception     None
5535 * @remark  Adapter should be enabled
5536 * @see  bluetooth_gatt_init()
5537 */
5538 int bluetooth_gatt_deinit(void);
5539
5540 /* @fn int bluetooth_gatt_add_service(const char *svc_uuid,
5541                         unsigned char **svc_path)
5542 *
5543 * @brief Exports a new gatt service to the service interface.
5544 *
5545 * This function is a synchronous call.
5546 *
5547 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5548 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5549 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5550 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5551 *
5552 * @exception     None
5553 * @param[in]   svc_uuid  Gatt service uuid.
5554 * @param[out] svc_path  service object path of the exported service.
5555 * @remark  Adapter should be enabled
5556 * @see  bluetooth_gatt_init()
5557 */
5558 int bluetooth_gatt_add_service(const char *svc_uuid,
5559                         char **svc_path);
5560
5561 /* @fn int bluetooth_gatt_add_new_characteristic(
5562                         const char *svc_path, const char *char_uuid,
5563                         bt_gatt_permission_t permissions,
5564                         bt_gatt_characteristic_property_t properties,
5565                         int flags_length, char **char_path);;
5566 *
5567 * @brief Exports a new gatt characteristic to the characteristic interface.
5568 *
5569 * This function is a synchronous call.
5570 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5571 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5572 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5573 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5574 * @exception     None
5575 * @param[in]   svc_path service object path of the exported service.
5576 * @param[in]   char_uuid  Gatt service uuid.
5577 * @param[in]   properties       GATT characteristic properties.
5578 * @param[out] char_path characteristic object path of the exported characteristic.
5579 *
5580 * @remark  Adapter should be enabled
5581 * @see  bluetooth_gatt_add_service()
5582 */
5583 int bluetooth_gatt_add_new_characteristic(
5584                         const char *svc_path, const char *char_uuid,
5585                         bt_gatt_permission_t permissions,
5586                         bt_gatt_characteristic_property_t properties,
5587                         char **char_path);
5588
5589 /* @fn bluetooth_gatt_set_characteristic_value(
5590                         const char *characteristic, const char *char_value,
5591                         int value_length);
5592 *
5593 * @brief adds gatt charactertisic value to the given charactertistic path.
5594 *
5595 * This function is a synchronous call.
5596 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5597 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5598 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5599 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5600 * @exception     None
5601 * @param[in]   char_value Value of the GATT characteristic to be added.
5602 * @param[in]   value_length length of the chantacteristic value..
5603 * @param[out] characteristic characteristic object path..
5604 *
5605 * @remark  Adapter should be enabled
5606 * @see  bluetooth_gatt_add_service()
5607 */
5608 int bluetooth_gatt_set_characteristic_value(
5609                         const char *characteristic, const char *char_value,
5610                         int value_length);
5611
5612 /* @fn  int bluetooth_gatt_add_descriptor(
5613                         const char *char_path, const char *desc_uuid,
5614                         bt_gatt_permission_t permissions,
5615                         char **desc_path);
5616 *
5617 * @brief Exports a new gatt descriptor to the descriptor interface.
5618 *
5619 * This function is a synchronous call.
5620 *
5621 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5622 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5623 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5624 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5625 *
5626 * @exception    None
5627 * @param[in]    desc_uuid  Gatt descriptor uuid.
5628 * @param[in]    desc_value      GATT descriptor value.
5629 * @param[in]    value_length    Length of GATT descriptor value.
5630 * @param[in]    permissions     descriptor permissions.
5631 * @param[in]    properties      GATT descriptor properties.
5632 * @param[in]    char_path       characteristics object path of the exported character.
5633 *
5634 * @remark  Adapter should be enabled
5635 * @see  bluetooth_gatt_add_service()
5636 * @see  bluetooth_gatt_add_characteristics()
5637 */
5638 int bluetooth_gatt_add_descriptor(
5639                         const char *char_path, const char *desc_uuid,
5640                         bt_gatt_permission_t permissions,
5641                         char **desc_path);
5642
5643 /* @fn int bluetooth_gatt_set_descriptor_value(
5644                    const char *desc_path, const char *desc_value,
5645                    int value_length);
5646 *
5647 * @brief Adds value to the given descriptor handle.
5648 *
5649 * This function is a synchronous call.
5650 *
5651 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5652 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5653 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5654 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5655 *
5656 * @exception     None
5657 * @param[in]   desc_value       GATT descriptor value.
5658 * @param[in]   value_length     Length of GATT descriptor value.
5659 * @param[in]   desc_path descriptor path to which the value needs to be added.
5660 *
5661 * @remark  Adapter should be enabled
5662 * @see  bluetooth_gatt_add_service()
5663 * @see  bluetooth_gatt_add_characteristics()
5664 */
5665 int bluetooth_gatt_set_descriptor_value(
5666                    const char *desc_path, const char *desc_value,
5667                    int value_length);
5668
5669 /* @fn int bluetooth_gatt_get_service(const char *svc_uuid);
5670 *
5671 * @brief Reads the Service registered on manager interface.
5672 *
5673 * This function is a synchronous call.
5674 *
5675 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5676 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5677 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5678 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5679 *
5680 * @exception     None
5681 * @param[in]   svc_uuid  Gatt Service uuid.
5682 *
5683 * @remark  Adapter should be enabled and service should be registered.
5684 * @see  bluetooth_gatt_register_service()
5685 */
5686 int bluetooth_gatt_get_service(const char *svc_uuid);
5687
5688 /* @fn int bluetooth_gatt_register_service(const  char *svc_path)
5689 *
5690 * @brief Registers the given service path with the library.
5691 *
5692 * This function is a synchronous call.
5693 *
5694 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5695 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5696 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5697 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5698 *
5699 * @exception     None
5700 * @param[in] svc_path   service object path of the exported service.
5701 *
5702 * @remark  Adapter should be enabled
5703 * @see  bluetooth_gatt_add_service()
5704 * @see  bluetooth_gatt_add_characteristics()
5705 * @see  bluetooth_gatt_add_descriptor()
5706 * @see  bluetooth_gatt_register_application()
5707 */
5708 int bluetooth_gatt_register_service(const char *svc_path);
5709
5710 /* @fn int bluetooth_gatt_register_application(void)
5711 *
5712 * @brief Registers the application with the bluez gatt server.
5713 *
5714 * This function is a synchronous call.
5715 *
5716 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5717 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5718 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5719 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5720 *
5721 * @exception     None
5722 *
5723 * @remark  Adapter should be enabled
5724 * @see  bluetooth_gatt_init()
5725 * @see  bluetooth_gatt_add_service()
5726 * @see  bluetooth_gatt_add_characteristics()
5727 * @see  bluetooth_gatt_add_descriptor()
5728 * @see  bluetooth_gatt_register_service()
5729 */
5730 int bluetooth_gatt_register_application(void);
5731
5732 /* @fn int bluetooth_gatt_unregister_service(const  char *svc_path)
5733 *
5734 * @brief Removes(unregister) service from the bluez gatt server db.
5735 *
5736 * This function is a synchronous call.
5737 *
5738 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5739 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5740 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5741 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5742 *
5743 * @exception     None
5744 * @param[in] svc_path   service object path of the exported service.
5745 *
5746 * @remark  Adapter should be enabled
5747 * @see  bluetooth_gatt_add_service()
5748 * @see  bluetooth_gatt_add_characteristics()
5749 * @see  bluetooth_gatt_add_descriptor()
5750 * @see bluetooth_gatt_register_service()
5751 */
5752 int bluetooth_gatt_unregister_service(const char *svc_path);
5753
5754 /* @fn int bluetooth_gatt_unregister_application(void)
5755 *
5756 * @brief Removes(unregister) the application with the bluez gatt server,
5757 *        and deletes all the service registered.
5758 *
5759 * This function is a synchronous call.
5760 *
5761 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5762 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5763 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5764 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5765 *
5766 * @exception     None
5767 *
5768 * @remark  Adapter should be enabled
5769 * @see  bluetooth_gatt_init()
5770 * @see  bluetooth_gatt_add_service()
5771 * @see  bluetooth_gatt_add_characteristics()
5772 * @see  bluetooth_gatt_add_descriptor()
5773 * @see  bluetooth_gatt_register_service()
5774 * @see  bluetooth_gatt_unregister_service()
5775 */
5776 int bluetooth_gatt_unregister_application(void);
5777
5778 /* @fn int bluetooth_gatt_send_response(int request_id,
5779 *                               int offset, char *value, int value_length)
5780 *
5781 * @brief Updates the attribute value in local attribute list.
5782 *
5783 * This function is a synchronous call.
5784 *
5785 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5786 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5787 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5788 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5789 *
5790 * @exception     None
5791 * @param[in] request_id The identification of a read request
5792 * @param[in] req_type The identification of  request type (TRUE for Read request and FALSE for write request)
5793 * @param[in] resp_state The identification of response state
5794 * @param[in] offset The offset from where a value is read
5795 * @param[in] value The value to be sent. It will be sent from @a offset.
5796 *               If it is NULL, a requested GATT handle's value will be sent from @a offset.
5797 * @param[in] value_length Value Length.
5798 *
5799 * @remark  Adapter should be enabled
5800 * @see  bluetooth_gatt_add_service()
5801 * @see  bluetooth_gatt_add_characteristics()
5802 * @see  bluetooth_gatt_add_descriptor()
5803 * @see bluetooth_gatt_register_service()
5804 */
5805 int bluetooth_gatt_send_response(int request_id, guint req_type,
5806                                 int resp_state, int offset, char *value, int value_length);
5807
5808 /* @fn bluetooth_gatt_server_set_notification(const char *char_path)
5809 *
5810 * @brief Sets the notification property for a characteristic.
5811 *
5812 * This function is a synchronous call.
5813 *
5814 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5815 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5816 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5817 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5818 *
5819 * @exception     None
5820 * @param[in] char_path characteristic object path.
5821 * @param[in]   unicast_address remote device address. if set notification is sent to only one device.
5822 *
5823 * @remark  Adapter should be enabled
5824 * @see  bluetooth_gatt_update_characteristic()
5825 */
5826 int bluetooth_gatt_server_set_notification(const char *char_path,
5827                                 bluetooth_device_address_t *unicast_address);
5828
5829 /* @fn int bluetooth_gatt_delete_services(void)
5830 *
5831 * @brief deletes (unregisters) all services from the gatt server database..
5832 *
5833 * This function is a synchronous call.
5834 *
5835 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5836 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5837 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5838 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5839 *
5840 * @exception     None
5841 *
5842 * @remark  Adapter should be enabled
5843 * @see  bluetooth_gatt_add_service()
5844 * @see  bluetooth_gatt_add_characteristics()
5845 * @see  bluetooth_gatt_add_descriptor()
5846 * @see bluetooth_gatt_register_service()
5847 * @see bluetooth_gatt_unregister_service()
5848 */
5849 int bluetooth_gatt_delete_services(void);
5850
5851 /* @fn int bluetooth_gatt_update_characteristic(void)
5852 *
5853 * @brief updates the given characteristic with a new value
5854 *
5855 * This function is a synchronous call.
5856 *
5857 * @return       BLUETOOTH_ERROR_NONE    - Success \n
5858 *        BLUETOOTH_ERROR_INTERNAL - Internal Error \n
5859 *        BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
5860 *        BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
5861 *
5862 * @exception     None
5863 *
5864 * @remark  Adapter should be enabled
5865 * @see  bluetooth_gatt_add_service()
5866 * @see  bluetooth_gatt_add_characteristics()
5867 * @see  bluetooth_gatt_add_descriptor()
5868 * @see bluetooth_gatt_register_service()
5869 * @see bluetooth_gatt_unregister_service()
5870 */
5871 int bluetooth_gatt_update_characteristic(const char *char_path,
5872                 const char* char_value, int value_length);
5873
5874 /**
5875  * @fn int bluetooth_set_advertising(int handle, gboolean enable);
5876  *
5877  * @brief Set advertising status.
5878  *
5879  * This function is used to enable or disable LE advertising.
5880  * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5881  *
5882  * This function is a synchronous call.
5883  *
5884  * @return      BLUETOOTH_ERROR_NONE - Success \n
5885  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5886  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5887  *
5888  * @exception   None
5889  * @param[in]   enable - The status of advertising
5890  *
5891  * @remark      None
5892  * @see         bluetooth_set_advertising_data
5893  */
5894 int bluetooth_set_advertising(int handle, gboolean enable);
5895
5896 /**
5897  * @fn int bluetooth_set_custom_advertising(int handle, gboolean enable, bluetooth_advertising_params_t *params);
5898  *
5899  * @brief Set advertising status along with interval value.
5900  *
5901  * This function is used to enable or disable LE advertising.
5902  * Interval_min and Interval_max is used to set the best advertising interval.
5903  * Once advertising is enabled, Advertising data is transmitted in the advertising packets
5904  *
5905  * This function is a synchronous call.
5906  *
5907  * @return      BLUETOOTH_ERROR_NONE - Success \n
5908  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5909  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5910  *
5911  * @exception   None
5912  * @param[in]   enable - The status of advertising
5913  * @param[in]   interval_min - Minimum interval of advertising (msec)
5914  * @param[in]   interval_max - Maximum interval of advertising (msec)
5915  * @param[in]   filter_policy - Advertising filter policy
5916  *
5917  * @remark      None
5918  * @see         bluetooth_set_advertising_data
5919  */
5920 int bluetooth_set_custom_advertising(int handle, gboolean enable,
5921                                         bluetooth_advertising_params_t *params);
5922
5923 /**
5924  * @fn int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5925  * @brief Get the advertising data
5926  *
5927  * This function is used to get advertising data.
5928  * Before calling this API, the adapter should be enabled.
5929  *
5930  * This function is a synchronous call.
5931  *
5932  * @return      BLUETOOTH_ERROR_NONE - Success \n
5933  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5934  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5935  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5936  *
5937  * @param[out]  value - Advertising data structure.
5938  * @param[out]  length - The length of Advertising data.
5939  *
5940  * @remark      None
5941 @code
5942 bluetooth_advertising_data_t *value = { {0} };
5943 int length;
5944 int ret = 0;
5945 ret = bluetooth_get_advertising_data(&value, &length);
5946 @endcode
5947  */
5948 int bluetooth_get_advertising_data(bluetooth_advertising_data_t *value, int *length);
5949
5950 /**
5951  * @fn int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5952  *
5953  * @brief Set advertising data with value
5954  *
5955  * This function is used to set advertising data and Maximum size of advertising data
5956  *  is 28 byte (Except Flag)
5957  *
5958  * This function is a synchronous call.
5959  *
5960  * @return      BLUETOOTH_ERROR_NONE - Success \n
5961  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5962  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
5963  *
5964  * @exception   None
5965  * @param[in]   value - Advertising data structure.
5966  *
5967  * @remark      None
5968  */
5969 int bluetooth_set_advertising_data(int handle, const bluetooth_advertising_data_t *value, int length);
5970
5971 /**
5972  * @fn int bluetooth_check_privilege_advertising_parameter(void);
5973  *
5974  * @brief Check the privilege for advertising parameter setting
5975  *
5976  * This function is a synchronous call.
5977  *
5978  * @return      BLUETOOTH_ERROR_NONE - Success \n
5979  *              BLUETOOTH_ERROR_PERMISSION_DEINED - Permission deined \n
5980  *
5981  * @exception   None
5982  *
5983  * @remark      None
5984  */
5985 int bluetooth_check_privilege_advertising_parameter(void);
5986
5987 /**
5988  * @fn int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
5989  * @brief Get the LE scan response data
5990  *
5991  * This function is used to get scan response data.
5992  * Before calling this API, the adapter should be enabled.
5993  *
5994  * This function is a synchronous call.
5995  *
5996  * @return      BLUETOOTH_ERROR_NONE - Success \n
5997  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
5998  *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer)\n
5999  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6000  *
6001  * @param[out]  value - Scan response data structure.
6002  * @param[out]  length - The length of Scan response data.
6003  *
6004  * @remark      None
6005 @code
6006 bluetooth_scan_resp_data_t *value = { {0} };
6007 int length;
6008 int ret = 0;
6009 ret = bluetooth_get_scan_response_data(&value, &length);
6010 @endcode
6011  */
6012 int bluetooth_get_scan_response_data(bluetooth_scan_resp_data_t *value, int *length);
6013
6014 /**
6015  * @fn int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6016  *
6017  * @brief Set scan response data with value
6018  *
6019  * This function is used to set scan response data and Maximum size of scan response data is 31 byte
6020  *
6021  * This function is a synchronous call.
6022  *
6023  * @return      BLUETOOTH_ERROR_NONE - Success \n
6024  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6025  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6026  *
6027  * @exception   None
6028  * @param[in]   value - LE Scan response data structure.
6029  *
6030  * @remark      None
6031  */
6032 int bluetooth_set_scan_response_data(int handle, const bluetooth_scan_resp_data_t *value, int length);
6033
6034 /**
6035  * @fn int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6036  *
6037  * @brief Set scan interval and window
6038  *
6039  * This function is used to set LE scan interval and window size
6040  *
6041  * This function is a synchronous call.
6042  *
6043  * @return      BLUETOOTH_ERROR_NONE - Success \n
6044  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6045  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6046  *
6047  * @exception   None
6048  * @param[in]   interval - Interval of LE scan (msec)
6049  * @param[in]   window - Window size of LE scan (msec)
6050  *
6051  * @remark      None
6052  */
6053 int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
6054
6055 /**
6056  * @fn int bluetooth_is_advertising(void)
6057  * @brief Check for the advertising is in-progress or not.
6058  *
6059  * This API is used to check the current status of the advertising procedure.
6060  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6061  * this API.
6062  *
6063  * This function checks whether the advertising is started or not.
6064  *
6065  * This function is a synchronous call.
6066  *
6067  * @param[out] is_advertising The advertising status: (@c TRUE = in progress, @c  false = not in progress)
6068  *
6069  * @return      BLUETOOTH_ERROR_NONE - Success \n
6070  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6071  *
6072  * @remark      None
6073  * @see         bluetooth_set_advertising, bluetooth_set_custom_advertising
6074
6075 @code
6076 int ret;
6077 gboolean is_advertising = 0;
6078
6079 ret = bluetooth_is_advertising(&is_advertising);
6080 @endcode
6081  */
6082 int bluetooth_is_advertising(gboolean *is_advertising);
6083
6084 /**
6085  * @fn int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6086  * @brief Add LE device to white list
6087  *
6088  * This API is used to add LE device to white list
6089  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6090  * this API.
6091  *
6092  *
6093  * This function is a synchronous call.
6094  *
6095  * @param[in] address The address of remote device
6096  *
6097  * @return      BLUETOOTH_ERROR_NONE - Success \n
6098  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6099  *
6100  * @remark      None
6101  * @see         bluetooth_set_custom_advertising
6102  */
6103 int bluetooth_add_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6104
6105 /**
6106  * @fn int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type)
6107  * @brief Remove LE device from white list
6108  *
6109  * This API is used to remove LE device from white list
6110  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6111  * this API.
6112  *
6113  *
6114  * This function is a synchronous call.
6115  *
6116  * @param[in] address The address of remote device
6117  *
6118  * @return      BLUETOOTH_ERROR_NONE - Success \n
6119  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6120  *
6121  * @remark      None
6122  * @see         bluetooth_set_custom_advertising
6123  */
6124 int bluetooth_remove_white_list(bluetooth_device_address_t *address, bluetooth_device_address_type_t address_type);
6125
6126 /**
6127  * @fn int bluetooth_clear_white_list(void)
6128  * @brief Clear white list
6129  *
6130  * This API is used to clear white list
6131  * Before calling this API, make sure that the adapter is enabled. There is no callback event for
6132  * this API.
6133  *
6134  *
6135  * This function is a synchronous call.
6136  *
6137  * @param[in] address The address of remote device
6138  *
6139  * @return      BLUETOOTH_ERROR_NONE - Success \n
6140  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6141  *
6142  * @remark      None
6143  * @see         bluetooth_set_custom_advertising
6144  */
6145 int bluetooth_clear_white_list(void);
6146
6147 /**
6148  * @fn int bluetooth_le_conn_update(bluetooth_device_address_t *address,
6149  *          const bluetooth_le_connection_param_t *parameters)
6150  * @brief update connection paramter of LE connection.
6151  *
6152  * This function is a synchronous call.
6153  *
6154  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6155  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6156  *
6157  * @exception  None
6158  * @param[in]  address - remote device address value.
6159  * @param[in]  parameters - new connection parameters.
6160  *
6161  * @remark       None
6162  * @see     bluetooth_bond_device
6163  */
6164 int bluetooth_le_conn_update(const bluetooth_device_address_t *address,
6165                 const bluetooth_le_connection_param_t *parameters);
6166
6167 /**
6168  * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy);
6169  *
6170  * @brief Enable/Disable LE Privacy feature.
6171  *
6172  * This function is used to enable or disable LE Privacy feature.
6173  * Once Privacy feature is enabled, Adapter can use Random Address for more security.
6174  *
6175  * This function is a synchronous call.
6176  *
6177  * @return      BLUETOOTH_ERROR_NONE - Success \n
6178  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6179  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6180  *
6181  * @exception   None
6182  * @param[in]   enable_privacy - The status of Privacy feature to be activated/deactivated[True/False].
6183  *
6184  * @remark      None
6185  */
6186 int bluetooth_enable_le_privacy(gboolean enable_privacy);
6187
6188 /**
6189  * @fn int bluetooth_set_le_static_random_address(gboolean enable);
6190  *
6191  * @brief Enable/Disable LE static random address.
6192  *
6193  * This function is used to enable or disable LE static random address.
6194  *
6195  * This function is a synchronous call.
6196  *
6197  * @return      BLUETOOTH_ERROR_NONE - Success \n
6198  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6199  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6200  *
6201  * @exception   None
6202  * @param[in]   enable - The status of LE static random address to be activated/deactivated[True/False].
6203  *
6204  * @remark      None
6205  */
6206 int bluetooth_set_le_static_random_address(gboolean enable);
6207
6208 /**
6209  * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address,
6210  *                                             bluetooth_le_connection_mode_t mode)
6211  * @brief update connection paramter of LE connection.
6212  *
6213  * This function is a synchronous call.
6214  *
6215  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6216  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6217  *           BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6218  *
6219  * @exception  None
6220  * @param[in]  address - remote device address value.
6221  * @param[in]  mode - new connection mode.
6222  *
6223  * @remark       None
6224  */
6225 int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *address,
6226                 bluetooth_le_connection_mode_t mode);
6227
6228 /**
6229  * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu)
6230  * @brief Request for new ATT MTU value.
6231  *
6232  * This function is a asynchronous call.
6233  *
6234  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6235  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6236  *           BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6237  *
6238  * @exception  None
6239  * @param[in]  address - remote device address value.
6240  * @param[in]  mtu - MTU value to be set.
6241  *
6242  * @remark       None
6243  */
6244 int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu);
6245
6246 /**
6247  * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6248  *                              unsigned int *mtu)
6249  * @brief Gets the xisting MTU value set for a connection.
6250  *
6251  * This function is a synchronous call.
6252  *
6253  * @return       BLUETOOTH_ERROR_NONE  - Success \n
6254  *                       BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6255  *                       BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6256  *
6257  * @exception  None
6258  * @param[in]  address - remote device address value.
6259  * @param[out]  mtu - MTU value set for the connection.
6260  *
6261  * @remark               None
6262  */
6263 int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address,
6264                                 unsigned int *mtu);
6265
6266 /**
6267  * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6268  *                                      bluetooth_device_address_t *id_address)
6269  * @brief Gets the Identity address of remote device.
6270  *
6271  * This function is a synchronous call.
6272  *
6273  * @return              BLUETOOTH_ERROR_NONE  - Success \n
6274  *                      BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6275  *                      BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n
6276  *
6277  * @exception  None
6278  * @param[in]  device_rpa - remote Resolvable private address.
6279  * @param[out] id_address - remote Identity device address value.
6280  *
6281  * @remark               None
6282  */
6283 int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa,
6284         bluetooth_device_address_t *id_address);
6285
6286 /**
6287  * @fn int bluetooth_le_read_maximum_data_length()
6288  * @brief reads the maximum LE data length supported in the controller.
6289  *
6290  * This function is a synchronous call.
6291  *
6292  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6293  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6294  *
6295  * @exception  None
6296  *
6297  * @remark       None
6298  */
6299 int bluetooth_le_read_maximum_data_length(
6300                         bluetooth_le_read_maximum_data_length_t *max_le_datalength);
6301 /**
6302  * @fn int bluetooth_le_write_host_suggested_default_data_length()
6303  * @brief writes the host suggested values for the controllers max transmitted no of payload
6304  * octects to be used for new connections.
6305  *
6306  * This function is a synchronous call.
6307  *
6308  * @return   BLUETOOTH_ERROR_NONE  - Success \n
6309  *           BLUETOOTH_ERROR_INTERNAL - Internal Error \n
6310  *
6311  * @exception  None
6312  *
6313  * @remark       None
6314  */
6315 int bluetooth_le_write_host_suggested_default_data_length(
6316                 const unsigned int def_tx_Octets, const unsigned int def_tx_Time);
6317
6318 int bluetooth_le_read_suggested_default_data_length(
6319         bluetooth_le_read_host_suggested_data_length_t *le_data_length);
6320
6321 int bluetooth_le_set_data_length(bluetooth_device_address_t *address,
6322         const unsigned int max_tx_octets, const unsigned int max_tx_time);
6323
6324 int bluetooth_pbap_init(void);
6325 int bluetooth_pbap_deinit(void);
6326 int bluetooth_pbap_connect(const bluetooth_device_address_t *address);
6327 int bluetooth_pbap_disconnect(const bluetooth_device_address_t *address);
6328 int bluetooth_pbap_get_phonebook_size(const bluetooth_device_address_t *address,
6329                 bt_pbap_folder_t *folder);
6330 int bluetooth_pbap_get_phonebook(const bluetooth_device_address_t *address,
6331                 bt_pbap_folder_t *folder, bt_pbap_pull_parameters_t *app_param);
6332 int bluetooth_pbap_get_list(const bluetooth_device_address_t *address,
6333                 bt_pbap_folder_t *folder, bt_pbap_list_parameters_t *app_param);
6334 int bluetooth_pbap_pull_vcard(const bluetooth_device_address_t *address,
6335                 bt_pbap_folder_t *folder, bt_pbap_pull_vcard_parameters_t *app_param);
6336 int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address,
6337                 bt_pbap_folder_t *folder, bt_pbap_search_parameters_t *app_param);
6338
6339 /**
6340  * @fn int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6341  *
6342  * @brief Set manufacturer data with value
6343  *
6344  * This function is used to set manufacturer data.
6345  *
6346  * This function is a synchronous call.
6347  *
6348  * @return      BLUETOOTH_ERROR_NONE - Success \n
6349  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
6350  *              BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n
6351  *
6352  * @exception   None
6353  * @param[in]   value - Manufacturer data structure.
6354  *
6355  * @remark      None
6356  */
6357 int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value);
6358
6359 int bluetooth_set_passkey_notification(gboolean enable);
6360
6361 /**
6362  * @fn int bluetooth_dpm_is_mode_allowed(void);
6363  *
6364  * @brief Checks Restriction for BT mode(BT allowed or not)
6365  *
6366  * This function is a synchronous call.
6367  *
6368  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6369  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6370  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6371  *
6372  * @exception   None
6373  *  @param[in] None
6374  *
6375  * @remark      None
6376  */
6377 int bluetooth_dpm_is_mode_allowed(void);
6378
6379 /**
6380  * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6381  *
6382  * @brief Sets Restriction for BT mode(BT allowed or not)
6383  *
6384  * This function is a synchronous call.
6385  *
6386  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6387  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6388  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6389  *
6390  * @exception   None
6391  * @param[in]   value - BT Allow value.
6392  *              BLUETOOTH_DPM_ERROR  = -1,       < bluetooth allowance error
6393  *              BLUETOOTH_DPM_BT_ALLOWED,                < bluetooth allowance allowed
6394  *              BLUETOOTH_DPM_HANDSFREE_ONLY,  < bluetooth allowance handsfree only
6395  *              BLUETOOTH_DPM_BT_RESTRICTED,  < bluetooth allowance restricted
6396  *
6397  * @remark      None
6398  */
6399 int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value);
6400
6401 /**
6402  * @fn int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t value);
6403  *
6404  * @brief Reads the Restriction for BT mode(BT allowed or not)
6405  *
6406  * This function is a synchronous call.
6407  *
6408  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6409  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6410  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6411  *
6412  * @exception   None
6413  *  @param[in] None
6414  * @param[out]  value - BT Allow value.
6415  *              BLUETOOTH_DPM_ERROR      = -1,   < bluetooth allowance error
6416  *              BLUETOOTH_DPM_BT_ALLOWED,                < bluetooth allowance allowed
6417  *              BLUETOOTH_DPM_HANDSFREE_ONLY,  < bluetooth allowance handsfree only
6418  *              BLUETOOTH_DPM_BT_RESTRICTED,  < bluetooth allowance restricted
6419  *
6420  * @remark      None
6421  */
6422 int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value);
6423
6424 /**
6425  * @fn int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6426  *
6427  * @brief Sets the Restriction for device.
6428  *
6429  * This function is a synchronous call.
6430  *
6431  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6432  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6433  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6434  *
6435  * @exception   None
6436  * @param[in]   value - State value.
6437  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6438  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6439  *
6440  * @remark      None
6441  */
6442 int bluetooth_dpm_activate_device_restriction(bt_dpm_status_t value);
6443
6444 /**
6445  * @fn int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6446  *
6447  * @brief Reads the Restriction for device.
6448  *
6449  * This function is a synchronous call.
6450  *
6451  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6452  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6453  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6454  *
6455  * @exception   None
6456  * @param[in] None
6457  * @param[out]  value - State value.
6458  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6459  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6460  *
6461  * @remark      None
6462  */
6463 int bluetooth_dpm_is_device_restriction_active(bt_dpm_status_t *value);
6464
6465 /**
6466  * @fn int bluetooth_dpm_activate_bluetoooth_uuid_restriction(bt_dpm_status_t value);
6467  *
6468  * @brief Sets the Restriction for uuid.
6469  *
6470  * This function is a synchronous call.
6471  *
6472  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6473  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6474  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6475  *
6476  * @exception   None
6477  * @param[in]   value - State value.
6478  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6479  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6480  *
6481  * @remark      None
6482  */
6483 int bluetooth_dpm_activate_uuid_restriction(bt_dpm_status_t value);
6484
6485 /**
6486  * @fn int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6487  *
6488  * @brief Reads the Restriction for uuid.
6489  *
6490  * This function is a synchronous call.
6491  *
6492  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6493  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6494  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6495  *
6496  * @exception   None
6497  * @param[in] None
6498  * @param[out]  value - State value.
6499  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6500  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6501  *
6502  * @remark      None
6503  */
6504 int bluetooth_dpm_is_uuid_restriction_active(bt_dpm_status_t *value);
6505
6506 /**
6507  * @fn int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6508  *
6509  * @brief Adds the device to blacklist.
6510  *
6511  * This function is a synchronous call.
6512  *
6513  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6514  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6515  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6516  *
6517  * @exception   None
6518  * @param[in]   device_address - Device address
6519  *
6520  * @remark      None
6521  */
6522 int bluetooth_dpm_add_devices_to_blacklist(const bluetooth_device_address_t *device_address);
6523
6524 /**
6525  * @fn int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6526  *
6527  * @brief Adds the device to whitelist.
6528  *
6529  * This function is a synchronous call.
6530  *
6531  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6532  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6533  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6534  *
6535  * @exception   None
6536  * @param[in]   device_address - Device address
6537  *
6538  * @remark      None
6539  */
6540 int bluetooth_dpm_add_devices_to_whitelist(const bluetooth_device_address_t *device_address);
6541
6542 /**
6543  * @fn int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6544  *
6545  * @brief Adds the Service UUIDS to blacklist.
6546  *
6547  * This function is a synchronous call.
6548  *
6549  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6550  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6551  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6552  *
6553  * @exception   None
6554  * @param[in]   service_uuids - profile or custom service uuids
6555  *
6556  * @remark      None
6557  */
6558 int bluetooth_dpm_add_uuids_to_blacklist(const char *service_uuid);
6559
6560 /**
6561  * @fn int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6562  *
6563  * @brief Adds the Service UUIDS to whitelist.
6564  *
6565  * This function is a synchronous call.
6566  *
6567  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6568  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6569  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6570  *
6571  * @exception   None
6572  * @param[in]   service_uuids - profile or custom service uuids
6573  *
6574  * @remark      None
6575  */
6576 int bluetooth_dpm_add_uuids_to_whitelist(const char *service_uuid);
6577
6578 /**
6579  * @fn int bluetooth_dpm_clear_devices_from_blacklist();
6580  *
6581  * @brief Clears the devices from blacklist.
6582  *
6583  * This function is a synchronous call.
6584  *
6585  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6586  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6587  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6588  *
6589  * @exception   None
6590  * @param[in]   None
6591  *
6592  * @remark      None
6593  */
6594 int bluetooth_dpm_clear_devices_from_blacklist(void);
6595
6596 /**
6597  * @fn int bluetooth_dpm_clear_devices_from_whitelist();
6598  *
6599  * @brief Clears the devices from whitelist.
6600  *
6601  * This function is a synchronous call.
6602  *
6603  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6604  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6605  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6606  *
6607  * @exception   None
6608  * @param[in]   None
6609  *
6610  * @remark      None
6611  */
6612 int bluetooth_dpm_clear_devices_from_whitelist(void);
6613
6614 /**
6615  * @fn int bluetooth_dpm_clear_uuids_from_blacklist();
6616  *
6617  * @brief Clears the uuids from blacklist.
6618  *
6619  * This function is a synchronous call.
6620  *
6621  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6622  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6623  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6624  *
6625  * @exception   None
6626  * @param[in]   None
6627  *
6628  * @remark      None
6629  */
6630 int bluetooth_dpm_clear_uuids_from_blacklist(void);
6631
6632 /**
6633  * @fn int bluetooth_dpm_clear_uuids_from_whitelist();
6634  *
6635  * @brief Clears the uuids from whitelist.
6636  *
6637  * This function is a synchronous call.
6638  *
6639  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6640  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6641  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6642  *
6643  * @exception   None
6644  * @param[in]   None
6645  *
6646  * @remark      None
6647  */
6648 int bluetooth_dpm_clear_uuids_from_whitelist(void);
6649
6650 /**
6651  * @fn int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6652  *
6653  * @brief reads the devices from blacklist.
6654  *
6655  * This function is a synchronous call.
6656  *
6657  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6658  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6659  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6660  *
6661  * @exception   None
6662  * @param[out]  device_list - list of devices
6663  *
6664  * @remark      None
6665  */
6666 int bluetooth_dpm_get_devices_from_blacklist(bt_dpm_device_list_t *device_list);
6667
6668 /**
6669  * @fn int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6670  *
6671  * @brief reads the devices from whitelist.
6672  *
6673  * This function is a synchronous call.
6674  *
6675  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6676  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6677  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6678  *
6679  * @exception   None
6680  * @param[out]  device_list - list of devices
6681  *
6682  * @remark      None
6683  */
6684 int bluetooth_dpm_get_devices_from_whitelist(bt_dpm_device_list_t *device_list);
6685
6686 /**
6687  * @fn int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6688  *
6689  * @brief reads the uuids from blacklist.
6690  *
6691  * This function is a synchronous call.
6692  *
6693  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6694  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6695  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6696  *
6697  * @exception   None
6698  * @param[in]   uuid_list - list of uuids
6699  *
6700  * @remark      None
6701  */
6702 int bluetooth_dpm_get_uuids_from_blacklist(bt_dpm_uuids_list_t *uuid_list);
6703
6704 /**
6705  * @fn int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6706  *
6707  * @brief reads the uuids from whitelist.
6708  *
6709  * This function is a synchronous call.
6710  *
6711  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6712  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6713  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6714  *
6715  * @exception   None
6716  * @param[in]   uuid_list - list of uuids
6717  *
6718  * @remark      None
6719  */
6720 int bluetooth_dpm_get_uuids_from_whitelist(bt_dpm_uuids_list_t *uuid_list);
6721
6722 /**
6723  * @fn int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6724  *
6725  * @brief Removes the device from whitelist.
6726  *
6727  * This function is a synchronous call.
6728  *
6729  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6730  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6731  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6732  *
6733  * @exception   None
6734  * @param[in]   device_address - Device address
6735  *
6736  * @remark      None
6737  */
6738 int bluetooth_dpm_remove_device_from_whitelist(const bluetooth_device_address_t *device_address);
6739
6740 /**
6741  * @fn int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6742  *
6743  * @brief Removes the device from blacklist.
6744  *
6745  * This function is a synchronous call.
6746  *
6747  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6748  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6749  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6750  *
6751  * @exception   None
6752  * @param[in]   device_address - Device address
6753  *
6754  * @remark      None
6755  */
6756 int bluetooth_dpm_remove_device_from_blacklist(const bluetooth_device_address_t *device_address);
6757
6758 /**
6759  * @fn int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6760  *
6761  * @brief Removes the Service UUIDS from whitelist.
6762  *
6763  * This function is a synchronous call.
6764  *
6765  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6766  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6767  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6768  *
6769  * @exception   None
6770  * @param[in]   service_uuids - profile or custom service uuids
6771  *
6772  * @remark      None
6773  */
6774 int bluetooth_dpm_remove_uuid_from_whitelist(const char *service_uuid);
6775
6776 /**
6777  * @fn int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6778  *
6779  * @brief Removes the Service UUIDS from blacklist.
6780  *
6781  * This function is a synchronous call.
6782  *
6783  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6784  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6785  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6786  *
6787  * @exception   None
6788  * @param[in]   service_uuids - profile or custom service uuids
6789  *
6790  * @remark      None
6791  */
6792 int bluetooth_dpm_remove_uuid_from_blacklist(const char *service_uuid);
6793
6794 /**
6795  * @fn int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6796  *
6797  * @brief Sets the Restriction for outgoing call.
6798  *
6799  * This function is a synchronous call.
6800  *
6801  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6802  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6803  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6804  *
6805  * @exception   None
6806  * @param[in]   value - State value.
6807  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6808  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6809  *
6810  * @remark      None
6811  */
6812 int bluetooth_dpm_set_allow_outgoing_call(bt_dpm_status_t value);
6813
6814 /**
6815  * @fn int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6816  *
6817  * @brief Reads the Restriction for  outgoing call.
6818  *
6819  * This function is a synchronous call.
6820  *
6821  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6822  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6823  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6824  *
6825  * @exception   None
6826  * @param[in] None
6827  * @param[out]  value - State value.
6828  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6829  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6830  *
6831  * @remark      None
6832  */
6833 int bluetooth_dpm_get_allow_outgoing_call(bt_dpm_status_t *value);
6834
6835 /**
6836  * @fn int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6837  *
6838  * @brief Sets the Restriction for Pairing.
6839  *
6840  * This function is a synchronous call.
6841  *
6842  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6843  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6844  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6845  *
6846  * @exception   None
6847  * @param[in]   value - State value.
6848  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6849  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6850  *
6851  * @remark      None
6852  */
6853 int bluetooth_dpm_set_pairing_state(bt_dpm_status_t value);
6854
6855 /**
6856  * @fn int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6857  *
6858  * @brief Reads the Restriction for Pairing
6859  *
6860  * This function is a synchronous call.
6861  *
6862  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6863  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6864  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6865  *
6866  * @exception   None
6867  * @param[in] None
6868  * @param[out]  value - State value.
6869  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6870  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6871  *
6872  * @remark      None
6873  */
6874 int bluetooth_dpm_get_pairing_state(bt_dpm_status_t *value);
6875
6876 /**
6877  * @fnint bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6878  *
6879  * @brief Sets the Restriction for using Profiles.
6880  *
6881  * This function is a synchronous call.
6882  *
6883  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6884  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6885  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6886  *
6887  * @exception   None
6888  * @param[in]profile - Profile.
6889  *              BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6890  *              BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6891  *              BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6892  *              BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6893  *              BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6894  *              BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6895  *              BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6896  *              BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6897  *              BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6898  *              BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6899  *              BLUETOOTH_DPM_PROFILE_NONE
6900  * @param[in]   value - State value.
6901  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6902  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6903  *
6904  * @remark      None
6905  */
6906 int bluetooth_dpm_set_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t value);
6907
6908 /**
6909  * @fn int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6910  *
6911  * @brief Reads the Restriction for using Profiles.
6912  *
6913  * This function is a synchronous call.
6914  *
6915  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6916  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6917  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6918  *
6919  * @exception   None
6920  * @param[in]profile - Profile.
6921  *              BLUETOOTH_DPM_POLICY_A2DP_PROFILE_STATE,
6922  *              BLUETOOTH_DPM_POLICY_AVRCP_PROFILE_STATE,
6923  *              BLUETOOTH_DPM_POLICY_BPP_PROFILE_STATE,
6924  *              BLUETOOTH_DPM_POLICY_DUN_PROFILE_STATE,
6925  *              BLUETOOTH_DPM_POLICY_FTP_PROFILE_STATE,
6926  *              BLUETOOTH_DPM_POLICY_HFP_PROFILE_STATE,
6927  *              BLUETOOTH_DPM_POLICY_HSP_PROFILE_STATE,
6928  *              BLUETOOTH_DPM_POLICY_PBAP_PROFILE_STATE,
6929  *              BLUETOOTH_DPM_POLICY_SAP_PROFILE_STATE,
6930  *              BLUETOOTH_DPM_POLICY_SPP_PROFILE_STATE,
6931  *              BLUETOOTH_DPM_PROFILE_NONE
6932  * @param[out]  value - State value.
6933  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6934  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6935  *
6936  * @remark      None
6937  */
6938 int bluetooth_dpm_get_profile_state(bt_dpm_profile_t profile, bt_dpm_status_t *value);
6939
6940 /**
6941  * @fn int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6942  *
6943  * @brief Sets the Restriction for Desktop Connectivity.
6944  *
6945  * This function is a synchronous call.
6946  *
6947  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6948  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6949  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6950  *
6951  * @exception   None
6952  * @param[in]   value - State value.
6953  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6954  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6955  *
6956  * @remark      None
6957  */
6958 int bluetooth_dpm_set_desktop_connectivity_state(bt_dpm_status_t value);
6959
6960 /**
6961  * @fn int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6962  *
6963  * @brief Reads the Restriction for Desktop Connectivity.
6964  *
6965  * This function is a synchronous call.
6966  *
6967  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6968  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6969  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6970  *
6971  * @exception   None
6972  * @param[in] None
6973  * @param[out]  value - State value.
6974  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6975  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6976  *
6977  * @remark      None
6978  */
6979 int bluetooth_dpm_get_desktop_connectivity_state(bt_dpm_status_t *value);
6980
6981 /**
6982  * @fn int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
6983  *
6984  * @brief Sets the Restriction for Discoverable state.
6985  *
6986  * This function is a synchronous call.
6987  *
6988  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
6989  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
6990  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
6991  *
6992  * @exception   None
6993  * @param[in]   value - State value.
6994  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
6995  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
6996  *
6997  * @remark      None
6998  */
6999 int bluetooth_dpm_set_discoverable_state(bt_dpm_status_t value);
7000
7001 /**
7002  * @fn int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7003  *
7004  * @brief Reads the Restriction for Discoverable state.
7005  *
7006  * This function is a synchronous call.
7007  *
7008  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7009  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7010  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7011  *
7012  * @exception   None
7013  * @param[in] None
7014  * @param[out]  value - State value.
7015  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7016  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7017  *
7018  * @remark      None
7019  */
7020 int bluetooth_dpm_get_discoverable_state(bt_dpm_status_t *value);
7021
7022 /**
7023  * @fn int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7024  *
7025  * @brief Sets the Restriction for linited discoverable state..
7026  *
7027  * This function is a synchronous call.
7028  *
7029  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7030  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7031  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7032  *
7033  * @exception   None
7034  * @param[in]   value - State value.
7035  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7036  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7037  *
7038  * @remark      None
7039  */
7040 int bluetooth_dpm_set_limited_discoverable_state(bt_dpm_status_t value);
7041
7042 /**
7043  * @fn int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7044  *
7045  * @brief Reads the Restriction for limited discoverable state.
7046  *
7047  * This function is a synchronous call.
7048  *
7049  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7050  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7051  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7052  *
7053  * @exception   None
7054  * @param[in] None
7055  * @param[out]  value - State value.
7056  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7057  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7058  *
7059  * @remark      None
7060  */
7061 int bluetooth_dpm_get_limited_discoverable_state(bt_dpm_status_t *value);
7062 /**
7063  * @fn int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7064  *
7065  * @brief Sets the Restriction for Data trasnfer.
7066  *
7067  * This function is a synchronous call.
7068  *
7069  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7070  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7071  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7072  *
7073  * @exception   None
7074  * @param[in]   value - State value.
7075  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7076  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7077  *
7078  * @remark      None
7079  */
7080 int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value);
7081
7082
7083 /**
7084  * @fn int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7085  *
7086  * @brief Reads the Restriction for Data trasnfer.
7087  *
7088  * This function is a synchronous call.
7089  *
7090  * @return      BLUETOOTH_DPM_RESULT_SUCCESS - Success \n
7091  *              BLUETOOTH_DPM_RESULT_ACCESS_DENIED - BT restricted \n
7092  *              BLUETOOTH_DPM_RESULT_FAIL - Internal error \n
7093  *
7094  * @exception   None
7095  * @param[in] None
7096  * @param[out]  value - State value.
7097  *              BLUETOOTH_DPM_ALLOWED           = 0,    < DPM Policy status allowed.
7098  *              BLUETOOTH_DPM_RESTRICTED                = 1,    < DPM Policy status restricted.
7099  *
7100  * @remark      None
7101  */
7102 int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
7103
7104 /**
7105  * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7106  *                                              bluetooth_pxp_poperty_t property, int value);
7107  *
7108  * @brief Sets the Proximity alert level/properties for monitor role.
7109  *
7110  * This function is a synchronous call.
7111  *
7112  * @return   BLUETOOTH_ERROR_NONE - Success \n
7113  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7114  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7115  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7116  *
7117  * @exception   None
7118  * @param[in] device_address remote device address
7119  * @param[in] property proximity profile property
7120  * @param[in] value alert level/property value to be set
7121  * @param[out] None
7122  *
7123  * @remark      None
7124  */
7125 int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
7126                                                         bluetooth_pxp_poperty_t property, int value);
7127
7128 /**
7129  * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7130  *                                              bluetooth_pxp_poperty_t property, int *value);
7131  *
7132  * @brief Reads the Proximity alert level/properties for monitor role.
7133  *
7134  * This function is a synchronous call.
7135  *
7136  * @return   BLUETOOTH_ERROR_NONE - Success \n
7137  *               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7138  *               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7139  *               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7140  *
7141  * @exception   None
7142  * @param[in] device_address remote device address
7143  * @param[in] property proximity profile property
7144  * @param[out] value alert level/property value
7145  *
7146  * @remark      None
7147  */
7148 int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
7149                                                         bluetooth_pxp_poperty_t property, int *value);
7150
7151 /**
7152  * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7153  *                                              int *services_supported);
7154  *
7155  * @brief Reads the Proximity Monitor profile supported properties/services.
7156  *
7157  * This function is a synchronous call.
7158  *
7159  * @return       BLUETOOTH_ERROR_NONE - Success \n
7160  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7161  *                               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7162  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7163  *
7164  * @exception   None
7165  * @param[in] device_address remote device address
7166  * @param[out] services_supported proximity profile property/service
7167  *
7168  * @remark      None
7169  */
7170 int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
7171                                                         int *services_supported);
7172
7173 /**
7174  * @fn int bluetooth_proximity_reporter_register();
7175  *
7176  * @brief Register all proximity related services in BlueZ.
7177  *
7178  * This function is a synchronous call.
7179  *
7180  * @return       BLUETOOTH_ERROR_NONE - Success \n
7181  *                       BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7182  *
7183  * @exception   None
7184  *
7185  * @remark      None
7186  */
7187 int bluetooth_proximity_reporter_register(void);
7188
7189 /**
7190  * @fn int bluetooth_proximity_reporter_unregister();
7191  *
7192  * @brief Unregister all proximity related services in BlueZ.
7193  *
7194  * This function is a synchronous call.
7195  *
7196  * @return       BLUETOOTH_ERROR_NONE - Success \n
7197  *                       BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7198  *
7199  * @exception   None
7200  *
7201  * @remark      None
7202  */
7203 int bluetooth_proximity_reporter_unregister(void);
7204
7205 /**
7206  * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7207  *                                              bluetooth_pxp_poperty_t property, int *value);
7208  *
7209  * @brief Reads the Proximity alert level/properties for reporter role.
7210  *
7211  * This function is a synchronous call.
7212  *
7213  * @return       BLUETOOTH_ERROR_NONE - Success \n
7214  *                               BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
7215  *                               BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
7216  *                               BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
7217  *
7218  * @exception   None
7219  * @param[in] device_address remote device address
7220  * @param[in] property proximity profile property
7221  * @param[out] value alert level/property value
7222  *
7223  * @remark      None
7224  */
7225 int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address,
7226                                                         bluetooth_pxp_poperty_t property, int *value);
7227
7228 /**
7229  * @}
7230  */
7231
7232 #ifdef __cplusplus
7233 }
7234 #endif                          /* __cplusplus */
7235 #endif                          /* _BLUETOOTH_API_H_*/