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