378ce02d300bfeaa2faa2fdd177ef1acc5615344
[platform/core/api/bluetooth.git] / include / bluetooth.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 __TIZEN_NETWORK_BLUETOOTH_H__
19 #define __TIZEN_NETWORK_BLUETOOTH_H__
20
21 #include <stdlib.h>
22 #include <unistd.h>
23 #include <stdbool.h>
24 #include <tizen_error.h>
25 #include <tizen.h>
26
27 #include <bluetooth_type.h>
28
29 #ifndef TIZEN_DEPRECATED_API
30 #define TIZEN_DEPRECATED_API __attribute__((__visibility__("default"), deprecated))
31 #endif
32
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #endif /* __cplusplus */
37
38 /**
39  * @file        bluetooth.h
40  * @brief       API to control the Bluetooth adapter and devices and communications.
41  * @ingroup     CAPI_NETWORK_BLUETOOTH_MODULE
42  */
43
44
45 /**
46  * @ingroup CAPI_NETWORK_BLUETOOTH_MODULE
47  * @brief Initializes the Bluetooth API.
48  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
49  *
50  * @remarks This function must be called before Bluetooth API starts. \n
51  * You must free all resources of the Bluetooth service by calling bt_deinitialize() if Bluetooth service is no longer needed.
52  *
53  * @return 0 on success, otherwise a negative error value.
54  * @retval #BT_ERROR_NONE  Successful
55  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
56  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
57  *
58  * @see  bt_deinitialize()
59  */
60 int bt_initialize(void);
61
62
63 /**
64  * @ingroup CAPI_NETWORK_BLUETOOTH_MODULE
65  * @brief Releases all resources of the Bluetooth API.
66  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
67  *
68  * @remarks This function must be called if Bluetooth API is no longer needed.
69  *
70  * @return 0 on success, otherwise a negative error value.
71  * @retval #BT_ERROR_NONE  Successful
72  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
73  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
74  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
75  *
76  * @pre Bluetooth API must be initialized with bt_initialize().
77  *
78  * @see bt_initialize()
79  */
80 int bt_deinitialize(void);
81
82 /**
83  * @ingroup CAPI_NETWORK_BLUETOOTH_MODULE
84  * @brief Gets the specification name for the given UUID.
85  * @since_tizen 3.0
86  *
87  * @remarks The @a name must be released using free().
88  *
89  * @param[in] uuid The UUID
90  * @param[out] name The specification name defined at www.bluetooth.com
91  * @return  0 on success, otherwise a negative error value.
92  * @retval #BT_ERROR_NONE  Successful
93  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
94  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
95  *
96  * @see bt_gatt_get_uuid()
97  */
98 int bt_get_uuid_name(const char *uuid, char **name);
99
100 /**
101  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
102  * @brief Gets the current state of local Bluetooth adapter.
103  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
104  *
105  * @param[out] adapter_state The current adapter state
106  *
107  * @return 0 on success, otherwise a negative error value.
108  * @retval #BT_ERROR_NONE  Successful
109  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
110  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
111  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
112  *
113  * @pre Bluetooth service must be initialized with bt_initialize().
114  *
115  * @see bt_initialize()
116  */
117 int bt_adapter_get_state(bt_adapter_state_e *adapter_state);
118
119 /**
120  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
121  * @brief Gets the address of local Bluetooth adapter.
122  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
123  *
124  * @remarks The @a local_address must be released with free() by you.
125  *
126  * @param[out] local_address The device address of local Bluetooth adapter
127  *
128  * @return 0 on success, otherwise a negative error value.
129  * @retval #BT_ERROR_NONE Successful
130  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
131  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
132  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
133  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
134  * @retval #BT_ERROR_OPERATION_FAILED Operation failed
135  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
136  *
137  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
138  * @see bt_adapter_get_name()
139  */
140 int bt_adapter_get_address(char **local_address);
141
142 /**
143  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
144  * @brief Gets the name of local Bluetooth adapter.
145  *
146  * @details Use this function to get the friendly name associated with Bluetooth \n
147  * device, retrieved by the remote Bluetooth devices.
148  *
149  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
150  *
151  * @remarks The @a local_name must be released with free() by you.
152  *
153  * @param[out] local_name  The local device name
154  *
155  * @return 0 on success, otherwise a negative error value.
156  * @retval #BT_ERROR_NONE  Successful
157  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
158  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
159  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
160  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
161  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
162  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
163  *
164  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
165  *
166  * @see bt_adapter_set_name()
167  */
168 int bt_adapter_get_name(char **local_name);
169
170 /**
171  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
172  * @brief Sets the name of local Bluetooth adapter.
173  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
174  * @privlevel public
175  * @privilege %http://tizen.org/privilege/bluetooth
176  *
177  * @param[in] local_name The name of the Bluetooth device. \n
178  *                   The maximum length is 248 characters.
179  *
180  * @return 0 on success, otherwise a negative error value.
181  * @retval #BT_ERROR_NONE  Successful
182  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
183  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
184  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
185  * @retval #BT_ERROR_OPERATION_FAILED Operation failed
186  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
187  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
188  *
189  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
190  * @post bt_adapter_name_changed_cb() will be invoked if this function returns #BT_ERROR_NONE.
191  *
192  * @see bt_adapter_get_name()
193  * @see bt_adapter_name_changed_cb()
194  * @see bt_adapter_set_name_changed_cb()
195  * @see bt_adapter_unset_name_changed_cb()
196  */
197 int bt_adapter_set_name(const char *local_name);
198
199 /**
200  * @ingroup  CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
201  * @brief  Gets the visibility mode of local Bluetooth adapter.
202  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
203  * @param[out] mode  The visibility mode of the Bluetooth device
204  * @param[out] duration  The duration until the visibility mode is changed to #BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE (in seconds).
205  * @a duration is valid only if @a mode is #BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE. This value can be NULL.
206  * @return 0 on success, otherwise a negative error value.
207  * @retval #BT_ERROR_NONE  Successful
208  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
209  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
210  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
211  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
212  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
213  *
214  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
215  */
216 int bt_adapter_get_visibility(bt_adapter_visibility_mode_e *mode, int *duration);
217
218 /**
219  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
220  * @brief Starts the device discovery, asynchronously.
221  *
222  * @details If a device is discovered, bt_adapter_device_discovery_state_changed_cb() will be invoked \n
223  * with #BT_ADAPTER_DEVICE_DISCOVERY_FOUND, and then bt_adapter_device_discovery_state_changed_cb() \n
224  * will be called with #BT_ADAPTER_DEVICE_DISCOVERY_FINISHED in case of the completion or cancellation of the discovery.
225  *
226  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
227  * @privlevel public
228  * @privilege %http://tizen.org/privilege/bluetooth
229  * @remarks To connect to peer Bluetooth device, you need to know its Bluetooth address. \n
230  * The device discovery can be stopped by bt_adapter_stop_device_discovery().
231  *
232  * @return 0 on success, otherwise a negative error value.
233  * @retval #BT_ERROR_NONE  Successful
234  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
235  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
236  * @retval #BT_ERROR_NOW_IN_PROGRESS  Operation is now in progress
237  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
238  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
239  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
240  *
241  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
242  * @post This function invokes bt_adapter_device_discovery_state_changed_cb().
243  *
244  * @see bt_adapter_is_discovering()
245  * @see bt_adapter_stop_device_discovery()
246  * @see bt_adapter_device_discovery_state_changed_cb()
247  * @see bt_adapter_set_device_discovery_state_changed_cb()
248  * @see bt_adapter_unset_device_discovery_state_changed_cb()
249  */
250 int bt_adapter_start_device_discovery(void);
251
252 /**
253  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
254  * @brief Stops the device discovery, asynchronously.
255  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
256  * @privlevel public
257  * @privilege %http://tizen.org/privilege/bluetooth
258  * @remarks The device discovery process will take 10 ~ 20 seconds to get all the devices in vicinity.
259  *
260  * @return 0 on success, otherwise a negative error value.
261  * @retval #BT_ERROR_NONE  Successful
262  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
263  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
264  * @retval #BT_ERROR_NOT_IN_PROGRESS  Operation is not in progress
265  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
266  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
267  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
268  *
269  * @pre The device discovery must be in progress with bt_adapter_start_device_discovery().
270  * @post This function invokes bt_adapter_device_discovery_state_changed_cb().
271  *
272  * @see bt_adapter_is_discovering()
273  * @see bt_adapter_start_device_discovery()
274  * @see bt_adapter_set_device_discovery_state_changed_cb()
275  * @see bt_adapter_unset_device_discovery_state_changed_cb()
276  * @see bt_adapter_device_discovery_state_changed_cb()
277  */
278 int bt_adapter_stop_device_discovery(void);
279
280 /**
281  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
282  * @brief Checks for the device discovery is in progress or not.
283  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
284  *
285  * @remarks If Bluetooth discovery is in progress, other operations are not allowed and \n
286  * you have to either stop the discovery operation, or wait for it to be finished, \n
287  * before performing other operations.
288
289  * @param[out] is_discovering The discovering status: (@c true = in progress , @c  false = not in progress )
290  *
291  * @return 0 on success, otherwise a negative error value.
292  * @retval #BT_ERROR_NONE  Successful
293  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
294  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
295  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
296  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
297  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
298  *
299  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
300  *
301  * @see bt_adapter_start_device_discovery()
302  * @see bt_adapter_stop_device_discovery()
303  */
304 int bt_adapter_is_discovering(bool *is_discovering);
305
306 /**
307  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
308  * @brief Gets the service mask from the UUID list.
309  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
310  *
311  * @param[in] uuids The UUID list of the device.
312  * @param[in] no_of_service The number of the UUID list count.
313  * @param[out] service_mask_list Service mask list converted from the given UUID list.
314  *
315  * @return 0 on success, otherwise a negative error value.
316  * @retval #BT_ERROR_NONE  Successful
317  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
318  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
319  *
320  * @see bt_service_class_t
321  */
322 int bt_device_get_service_mask_from_uuid_list(char **uuids,
323                                       int no_of_service,
324                                       bt_service_class_t *service_mask_list);
325
326 /**
327  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
328  * @brief Retrieves the device information of all bonded devices.
329  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
330  *
331  * @param[in] callback The callback function to invoke
332  * @param[in] user_data The user data passed from the foreach function
333  *
334  * @return 0 on success, otherwise a negative error value.
335  * @retval #BT_ERROR_NONE  Successful
336  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
337  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
338  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
339  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
340  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
341  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
342  *
343  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
344  * @post This function invokes bt_adapter_bonded_device_cb().
345  *
346  * @see bt_adapter_bonded_device_cb()
347  */
348 int bt_adapter_foreach_bonded_device(bt_adapter_bonded_device_cb callback, void *user_data);
349
350 /**
351  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
352  * @brief Gets the device information of a bonded device.
353  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
354  * @remarks The @a device_info must be released with bt_adapter_free_device_info() by you .
355  *
356  * @param[in] remote_address The address of remote device
357  * @param[out] device_info The bonded device information
358  *
359  * @return 0 on success, otherwise a negative error value.
360  * @retval #BT_ERROR_NONE  Successful
361  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
362  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
363  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
364  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
365  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
366  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED  Remote device not bonded
367  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
368  *
369  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
370  * @post This function invokes bt_adapter_bonded_device_cb().
371  *
372  * @see bt_adapter_bonded_device_cb()
373  */
374 int bt_adapter_get_bonded_device_info(const char *remote_address, bt_device_info_s **device_info);
375
376 /**
377  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
378  * @brief Frees device info.
379  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
380  *
381  * @param[in] device_info The bonded device information
382  *
383  * @return 0 on success, otherwise a negative error value.
384  * @retval #BT_ERROR_NONE  Successful
385  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
386  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
387  *
388  * @see bt_adapter_get_bonded_device_info()
389  */
390 int bt_adapter_free_device_info(bt_device_info_s *device_info);
391
392 /**
393  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
394  * @brief Checks whether the UUID of service is used or not.
395  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
396  * @param[in] service_uuid The UUID of service
397  * @param[out] used Indicates whether the service is used or not
398  * @return true on success, otherwise false.
399  * @return 0 on success, otherwise a negative error value.
400  * @retval #BT_ERROR_NONE  Successful
401  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
402  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
403  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
404  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
405  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
406  */
407 int bt_adapter_is_service_used(const char *service_uuid, bool *used);
408
409 /**
410  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
411  * @brief  Registers a callback function to be invoked when the Bluetooth adapter state changes.
412  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
413  *
414  * @param[in] callback The callback function to invoke
415  * @param[in] user_data The user data to be passed to the callback function
416  *
417  * @return   0 on success, otherwise a negative error value.
418  * @retval #BT_ERROR_NONE  Successful
419  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
420  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
421  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
422  *
423  * @pre The Bluetooth service must be initialized with bt_initialize().
424  * @post bt_adapter_state_changed_cb() will be invoked.
425  *
426  * @see bt_initialize()
427  * @see bt_adapter_state_changed_cb()
428  * @see bt_adapter_unset_state_changed_cb()
429  */
430 int bt_adapter_set_state_changed_cb(bt_adapter_state_changed_cb callback, void *user_data);
431
432 /**
433  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
434  * @brief Unregisters the callback function.
435  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
436  *
437  * @return 0 on success, otherwise a negative error value.
438  * @retval #BT_ERROR_NONE  Successful
439  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
440  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
441  *
442  * @pre The Bluetooth service must be initialized with bt_initialize().
443  *
444  * @see bt_initialize()
445  * @see bt_adapter_set_state_changed_cb()
446  */
447 int bt_adapter_unset_state_changed_cb(void);
448
449 /**
450  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
451  * @brief  Registers a callback function to be invoked when the name of Bluetooth adapter changes.
452  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
453  *
454  * @param[in] callback The callback function to invoke
455  * @param[in] user_data The user data to be passed to the callback function
456  *
457  * @return   0 on success, otherwise a negative error value.
458  * @retval #BT_ERROR_NONE  Successful
459  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
460  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
461  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
462  *
463  * @pre The Bluetooth service must be initialized with bt_initialize().
464  * @post  bt_adapter_name_changed_cb() will be invoked.
465  *
466  * @see bt_initialize()
467  * @see bt_adapter_name_changed_cb()
468  * @see bt_adapter_unset_name_changed_cb()
469  */
470 int bt_adapter_set_name_changed_cb(bt_adapter_name_changed_cb callback, void *user_data);
471
472 /**
473  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
474  * @brief       Unregisters the callback function.
475  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
476  *
477  * @return      0 on success, otherwise a negative error value.
478  * @retval #BT_ERROR_NONE  Successful
479  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
480  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
481  *
482  * @pre The Bluetooth service must be initialized with bt_initialize().
483  *
484  * @see bt_initialize()
485  * @see bt_adapter_set_name_changed_cb()
486  */
487 int bt_adapter_unset_name_changed_cb(void);
488
489 /**
490  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
491  * @brief  Registers a callback function to be invoked when the visibility mode changes.
492  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
493  *
494  * @param[in] callback The callback function to register
495  * @param[in] user_data The user data to be passed to the callback function
496  *
497  * @return   0 on success, otherwise a negative error value.
498  * @retval #BT_ERROR_NONE  Successful
499  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
500  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
501  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
502  *
503  * @pre The Bluetooth service must be initialized with bt_initialize().
504  * @post bt_adapter_visibility_mode_changed_cb() will be invoked.
505  *
506  * @see bt_initialize()
507  * @see bt_adapter_visibility_mode_changed_cb()
508  * @see bt_adapter_unset_visibility_mode_changed_cb()
509  */
510 int bt_adapter_set_visibility_mode_changed_cb(bt_adapter_visibility_mode_changed_cb callback, void *user_data);
511
512 /**
513  * @ingroup  CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
514  * @brief  Unregisters the callback function.
515  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
516  *
517  * @return  0 on success, otherwise a negative error value.
518  * @retval  #BT_ERROR_NONE  Successful
519  * @retval  #BT_ERROR_NOT_INITIALIZED  Not initialized
520  * @retval  #BT_ERROR_NOT_SUPPORTED  Not supported
521  *
522  * @pre  The Bluetooth service must be initialized with bt_initialize().
523  *
524  * @see  bt_initialize()
525  * @see  bt_adapter_set_visibility_mode_changed_cb()
526  */
527 int bt_adapter_unset_visibility_mode_changed_cb(void);
528
529 /**
530  * @ingroup  CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
531  * @brief  Registers a callback function to be invoked every second.
532  *
533  * @details  When you set visibility mode as #BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE, \n
534  * @a callback will be called every second until visibility mode is changed to #BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE.
535  *
536  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
537  * until the visibility mode is changed from #BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE
538  * to #BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE.
539  * @param[in]  callback  The callback function to register
540  * @param[in]  user_data  The user data to be passed to the callback function
541  * @return  0 on success, otherwise a negative error value.
542  * @retval  #BT_ERROR_NONE  Successful
543  * @retval  #BT_ERROR_NOT_INITIALIZED  Not initialized
544  * @retval  #BT_ERROR_INVALID_PARAMETER  Invalid parameter
545  * @retval  #BT_ERROR_NOT_SUPPORTED  Not supported
546  *
547  * @pre  The Bluetooth service must be initialized by bt_initialize().
548  * @post  bt_adapter_visibility_duration_changed_cb() will be invoked.
549  * @see  bt_initialize()
550  * @see  bt_adapter_visibility_duration_changed_cb()
551  * @see  bt_adapter_unset_visibility_duration_changed_cb()
552  */
553 int bt_adapter_set_visibility_duration_changed_cb(bt_adapter_visibility_duration_changed_cb callback, void *user_data);
554
555 /**
556  * @ingroup  CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
557  * @brief        Unregisters the callback function.
558  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
559  * @return  0 on success, otherwise a negative error value.
560  * @retval  #BT_ERROR_NONE  Successful
561  * @retval  #BT_ERROR_NOT_INITIALIZED  Not initialized
562  * @retval  #BT_ERROR_NOT_SUPPORTED  Not supported
563  *
564  * @pre  The Bluetooth service must be initialized with bt_initialize().
565  * @see  bt_initialize()
566  * @see  bt_adapter_set_visibility_duration_changed_cb()
567  */
568 int bt_adapter_unset_visibility_duration_changed_cb(void);
569
570 /**
571  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
572  * @brief  Registers a callback function to be invoked when the device discovery state changes.
573  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
574  *
575  * @param[in] callback The callback function to register
576  * @param[in] user_data The user data to be passed to the callback function
577  *
578  * @return   0 on success, otherwise a negative error value.
579  * @retval #BT_ERROR_NONE  Successful
580  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
581  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
582  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
583  *
584  * @pre The Bluetooth service must be initialized with bt_initialize().
585  * @post bt_adapter_device_discovery_state_changed_cb() will be invoked.
586  *
587  * @see bt_initialize()
588  * @see bt_adapter_device_discovery_state_changed_cb()
589  * @see bt_adapter_unset_device_discovery_state_changed_cb()
590  */
591 int bt_adapter_set_device_discovery_state_changed_cb(bt_adapter_device_discovery_state_changed_cb callback, void *user_data);
592
593 /**
594  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
595  * @brief       Unregisters the callback function.
596  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
597  *
598  * @return      0 on success, otherwise a negative error value.
599  * @retval #BT_ERROR_NONE  Successful
600  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
601  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
602  *
603  * @pre The Bluetooth service must be initialized with bt_initialize().
604  *
605  * @see bt_initialize()
606  * @see bt_adapter_set_device_discovery_state_changed_cb()
607  */
608 int bt_adapter_unset_device_discovery_state_changed_cb(void);
609
610 /**
611  * @ingroup CAPI_NETWORK_BLUETOOTH_OOB_MODULE
612  * @brief Gets the Hash and Randomizer value, synchronously.
613  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
614  * @privlevel public
615  * @privilege %http://tizen.org/privilege/bluetooth
616  * @remarks %http://tizen.org/privilege/bluetooth (public level privilege) is required to use this API since 5.5.
617  *
618  * @param[out] hash The hash value received from the controller
619  * @param[out] randomizer The hash value received from the controller
620  * @param[out] hash_len The length of the hash value
621  * @param[out] randomizer_len The length of the randomizer value
622  * @return 0 on success, otherwise a negative error value.
623  * @retval #BT_ERROR_NONE  Successful
624  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
625  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
626  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
627  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
628  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
629  *
630  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
631  * @pre The Bluetooth service must be initialized with bt_initialize().
632  * @see bt_initialize()
633  */
634 int bt_adapter_get_local_oob_data(unsigned char **hash, unsigned char **randomizer,
635                                         int *hash_len, int *randomizer_len);
636
637 /**
638  * @ingroup CAPI_NETWORK_BLUETOOTH_OOB_MODULE
639  * @brief Sets the Hash and Randomizer value, synchronously.
640  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
641  * @privlevel public
642  * @privilege %http://tizen.org/privilege/bluetooth
643  *
644  * @param[in] remote_address Remote device address
645  * @param[in] hash The hash value received from the controller
646  * @param[in] randomizer The hash value received from the controller
647  * @param[in] hash_len The length of the hash value. Allowed value is 16
648  * @param[in] randomizer_len The length of the randomizer value. Allowed value is 16
649  * @return 0 on success, otherwise a negative error value.
650  * @retval #BT_ERROR_NONE  Successful
651  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
652  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
653  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
654  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
655  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
656  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
657  *
658  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
659  * @pre The Bluetooth service must be initialized with bt_initialize().
660  * @see bt_initialize()
661  */
662 int bt_adapter_set_remote_oob_data(const char *remote_address,
663                                 unsigned char *hash, unsigned char *randomizer,
664                                 int hash_len, int randomizer_len);
665
666 /**
667  * @ingroup CAPI_NETWORK_BLUETOOTH_OOB_MODULE
668  * @brief Gets the Hash and Randomizer value, synchronously.
669  * @since_tizen 3.0
670  * @privlevel public
671  * @privilege %http://tizen.org/privilege/bluetooth
672  *
673  * @remarks %http://tizen.org/privilege/bluetooth (public level privilege) is required to use this API since 5.5.
674  * @remarks The @a hash192, randomizer192, hash256 and randomizer256 must be released using free().
675  *
676  * @param[out] hash192 The hash value derived from the P-192 public key
677  * @param[out] randomizer192 The randomizer value associated with the P-192 public key
678  * @param[out] hash192_len The length of @a hash192
679  * @param[out] randomizer192_len The length of @a randomizer192
680  * @param[out] hash256 The hash value derived from the P-256 public key
681  * @param[out] randomizer256 The randomizer value associated with the P-256 public key
682  * @param[out] hash256_len The length of @a hash256
683  * @param[out] randomizer256_len The length of @a randomizer256
684  * @return 0 on success, otherwise a negative error value.
685  * @retval #BT_ERROR_NONE  Successful
686  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
687  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
688  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
689  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
690  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
691  *
692  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
693  * @pre The Bluetooth service must be initialized with bt_initialize().
694  * @see bt_initialize()
695  */
696 int bt_adapter_get_local_oob_ext_data(unsigned char **hash192, unsigned char **randomizer192,
697                 int *hash192_len, int *randomizer192_len,
698                 unsigned char **hash256, unsigned char **randomizer256,
699                 int *hash256_len, int *randomizer256_len);
700
701 /**
702  * @ingroup CAPI_NETWORK_BLUETOOTH_OOB_MODULE
703  * @brief Sets the Hash and Randomizer value, synchronously.
704  * @since_tizen 3.0
705  * @privlevel public
706  * @privilege %http://tizen.org/privilege/bluetooth
707  *
708  * @param[in] remote_address Remote device address
709  * @param[in] hash192 The P-192 hash value received via OOB from remote device
710  * @param[in] randomizer192 The P-192 randomizer value received via OOB from remote device
711  * @param[in] hash192_len The length of @a hash192
712  * @param[in] randomizer192_len The length of @a randomizer192
713  * @param[in] hash256 The P-256 hash value received via OOB from remote device
714  * @param[in] randomizer256 The P-256 randomizer value received via OOB from remote device
715  * @param[in] hash256_len The length of @a hash256
716  * @param[in] randomizer256_len The length of @a randomizer256
717  * @return 0 on success, otherwise a negative error value.
718  * @retval #BT_ERROR_NONE  Successful
719  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
720  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
721  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
722  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
723  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
724  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
725  *
726  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
727  * @pre The Bluetooth service must be initialized with bt_initialize().
728  * @see bt_initialize()
729  */
730 int bt_adapter_set_remote_oob_ext_data(const char *remote_address,
731                 const unsigned char *hash192, const unsigned char *randomizer192,
732                 int hash192_len, int randomizer192_len,
733                 const unsigned char *hash256, const unsigned char *randomizer256,
734                 int hash256_len, int randomizer256_len);
735
736 /**
737  * @ingroup CAPI_NETWORK_BLUETOOTH_OOB_MODULE
738  * @brief Deletes the Hash and Randomizer value, synchronously.
739  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
740  * @privlevel public
741  * @privilege %http://tizen.org/privilege/bluetooth
742  *
743  * @param[in] remote_address Remote device address
744  * @return 0 on success, otherwise a negative error value.
745  * @retval #BT_ERROR_NONE  Successful
746  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
747  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
748  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
749  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
750  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
751  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
752  *
753  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
754  * @pre The Bluetooth service must be initialized with bt_initialize().
755  * @see bt_initialize()
756  */
757 int bt_adapter_remove_remote_oob_data(const char *remote_address);
758
759 /**
760  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
761  * @brief Checks for the LE device discovery is in progress or not.
762  * @since_tizen @if MOBILE 2.3 @else 6.0 @endif
763  *
764  * @remarks If Bluetooth LE scan is in progress, other operations are not allowed and \n
765  * you have to either stop the LE scan operation, or wait for it to be finished, \n
766  * before performing other operations.
767  *
768  * @param[out] is_discovering The discovering status: (@c true = in progress , @c  false = not in progress )
769  *
770  * @return 0 on success, otherwise a negative error value.
771  * @retval #BT_ERROR_NONE  Successful
772  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
773  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
774  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
775  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
776  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
777  *
778  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
779  */
780 int bt_adapter_le_is_discovering(bool *is_discovering);
781
782 /**
783  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
784  * @brief Starts the LE scan to find LE advertisement.
785  *
786  * @details If a LE advertisement is found, bt_adapter_le_scan_result_cb() will be invoked.
787  *
788  * @since_tizen 2.3.1
789  * @privlevel public
790  * @privilege %http://tizen.org/privilege/bluetooth
791  * @param[in] cb The callback to report the result of this function
792  * @param[in] user_data The user data to be passed when callback is called
793  *
794  * @return 0 on success, otherwise a negative error value.
795  * @retval #BT_ERROR_NONE  Successful
796  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
797  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
798  * @retval #BT_ERROR_NOW_IN_PROGRESS  Operation is now in progress
799  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
800  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
801  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
802  *
803  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
804  * @post This function invokes bt_adapter_le_scan_result_cb().
805  *
806  * @see bt_adapter_le_scan_result_cb()
807  */
808 int bt_adapter_le_start_scan(bt_adapter_le_scan_result_cb cb, void *user_data);
809
810 /**
811  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
812  * @brief Stops the LE scan.
813  * @since_tizen 2.3.1
814  * @privlevel public
815  * @privilege %http://tizen.org/privilege/bluetooth
816  *
817  * @return 0 on success, otherwise a negative error value.
818  * @retval #BT_ERROR_NONE  Successful
819  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
820  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
821  * @retval #BT_ERROR_NOT_IN_PROGRESS  Operation is not in progress
822  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
823  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
824  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
825  *
826  * @pre The LE scan must be in progress with bt_adapter_le_start_scan().
827  *
828  * @see bt_adapter_le_start_scan()
829  */
830 int bt_adapter_le_stop_scan(void);
831
832 /**
833  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
834  * @brief Gets the service UUID list from the scan result information.
835  * @since_tizen 2.3.1
836  *
837  * @remarks The @a uuids must be iterated as count and each pointed data must be released with free().
838  * Then @a uuids must be released with free(). \n
839  * 16-bit service UUID or 128-bit service UUID is supported. (e.g. 180F, 0000180F-0000-1000-8000-00805F9B34FB)
840  *
841  * @param[in] info The scan result information
842  * @param[in] pkt_type The packet type
843  * @param[out] uuids The list of string of the service UUID
844  * @param[out] count The count of the service UUIDs
845  *
846  * @return 0 on success, otherwise a negative error value.
847  * @retval #BT_ERROR_NONE  Successful
848  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
849  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
850  * @retval #BT_ERROR_NO_DATA  No data available
851  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
852  *
853  * @pre The Bluetooth service must be initialized with bt_initialize().
854  *
855  * @see bt_adapter_le_scan_result_cb()
856  */
857 int bt_adapter_le_get_scan_result_service_uuids(const bt_adapter_le_device_scan_result_info_s *info,
858                         bt_adapter_le_packet_type_e pkt_type, char ***uuids, int *count);
859
860 /**
861  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
862  * @brief Gets the device name from the scan result information.
863  * @since_tizen 2.3.1
864  *
865  * @remarks The @a name must be released with free() by you.
866  *
867  * @param[in] info The scan result information
868  * @param[in] pkt_type The packet type
869  * @param[out] name The device name
870  *
871  * @return 0 on success, otherwise a negative error value.
872  * @retval #BT_ERROR_NONE  Successful
873  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
874  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
875  * @retval #BT_ERROR_NO_DATA  No data available
876  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
877  *
878  * @pre The Bluetooth service must be initialized with bt_initialize().
879  *
880  * @see bt_adapter_le_scan_result_cb()
881  */
882 int bt_adapter_le_get_scan_result_device_name(const bt_adapter_le_device_scan_result_info_s *info,
883                         bt_adapter_le_packet_type_e pkt_type, char **name);
884
885 /**
886  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
887  * @brief Gets the transmission power level from the scan result information.
888  * @since_tizen 2.3.1
889  *
890  * @param[in] info The scan result information
891  * @param[in] pkt_type The packet type
892  * @param[out] power_level The transmission power level in dBm
893  *
894  * @return 0 on success, otherwise a negative error value.
895  * @retval #BT_ERROR_NONE  Successful
896  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
897  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
898  * @retval #BT_ERROR_NO_DATA  No data available
899  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
900  *
901  * @pre The Bluetooth service must be initialized with bt_initialize().
902  *
903  * @see bt_adapter_le_scan_result_cb()
904  */
905 int bt_adapter_le_get_scan_result_tx_power_level(const bt_adapter_le_device_scan_result_info_s *info,
906                         bt_adapter_le_packet_type_e pkt_type, int *power_level);
907
908 /**
909  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
910  * @brief Gets the service solicitation UUID list from the scan result information.
911  * @since_tizen 2.3.1
912  *
913  * @remarks The @a uuids must be iterated as count and each pointed data must be released with free().
914  * Then @a uuids must be released with free(). \n
915  * 16-bit service solicitation UUID or 128-bit service solicitation UUID is supported.
916  * (e.g. 180F, 0000180F-0000-1000-8000-00805F9B34FB)
917  *
918  * @param[in] info The scan result information
919  * @param[in] pkt_type The packet type
920  * @param[out] uuids The list of string of the service solicitation UUID
921  * @param[out] count The count of the service UUIDs
922  *
923  * @return 0 on success, otherwise a negative error value.
924  * @retval #BT_ERROR_NONE  Successful
925  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
926  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
927  * @retval #BT_ERROR_NO_DATA  No data available
928  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
929  *
930  * @pre The Bluetooth service must be initialized with bt_initialize().
931  *
932  * @see bt_adapter_le_scan_result_cb()
933  */
934 int bt_adapter_le_get_scan_result_service_solicitation_uuids(const bt_adapter_le_device_scan_result_info_s *info,
935                         bt_adapter_le_packet_type_e pkt_type, char ***uuids, int *count);
936
937 /**
938  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
939  * @brief Gets the service data list from the scan result information.
940  * @since_tizen 2.3.1
941  *
942  * @remarks The @a data_list must be released with bt_adapter_le_free_service_data_list() by you .
943  *
944  * @param[in] info The scan result information
945  * @param[in] pkt_type The packet type
946  * @param[out] data_list The list of the service data
947  * @param[out] count The count of the service data list
948  *
949  * @return 0 on success, otherwise a negative error value.
950  * @retval #BT_ERROR_NONE  Successful
951  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
952  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
953  * @retval #BT_ERROR_NO_DATA  No data available
954  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
955  *
956  * @pre The Bluetooth service must be initialized with bt_initialize().
957  *
958  * @see bt_adapter_le_scan_result_cb()
959  */
960 int bt_adapter_le_get_scan_result_service_data_list(const bt_adapter_le_device_scan_result_info_s *info,
961                         bt_adapter_le_packet_type_e pkt_type, bt_adapter_le_service_data_s **data_list, int *count);
962
963 /**
964  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
965  * @brief Frees service data list.
966  * @since_tizen 2.3.1
967  *
968  * @param[in] data_list The list of the service data
969  * @param[in] count The count of the service data list
970  *
971  * @return 0 on success, otherwise a negative error value.
972  * @retval #BT_ERROR_NONE  Successful
973  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
974  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
975  *
976  * @see bt_adapter_le_get_scan_result_service_data_list()
977  */
978 int bt_adapter_le_free_service_data_list(bt_adapter_le_service_data_s *data_list, int count);
979
980 /**
981  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
982  * @brief Gets the appearance from the scan result information.
983  * @since_tizen 2.3.1
984  *
985  * @param[in] info The scan result information
986  * @param[in] pkt_type The packet type
987  * @param[out] appearance The appearance
988  *
989  * @return 0 on success, otherwise a negative error value.
990  * @retval #BT_ERROR_NONE  Successful
991  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
992  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
993  * @retval #BT_ERROR_NO_DATA  No data available
994  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
995  *
996  * @pre The Bluetooth service must be initialized with bt_initialize().
997  *
998  * @see bt_adapter_le_scan_result_cb()
999  */
1000 int bt_adapter_le_get_scan_result_appearance(const bt_adapter_le_device_scan_result_info_s *info,
1001                         bt_adapter_le_packet_type_e pkt_type, int *appearance);
1002
1003 /**
1004  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1005  * @brief Gets the manufacturer data from the scan result information.
1006  * @since_tizen 2.3.1
1007  *
1008  * @remarks The @a manufacturer_data must be released with free() by you.
1009  *
1010  * @param[in] info The scan result information
1011  * @param[in] pkt_type The packet type
1012  * @param[out] manufacturer_id The manufacturer ID
1013  * @param[out] manufacturer_data The manufacturer data (byte array)
1014  * @param[out] manufacturer_data_len The length of manufacturer data
1015  *
1016  * @return 0 on success, otherwise a negative error value.
1017  * @retval #BT_ERROR_NONE  Successful
1018  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1019  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1020  * @retval #BT_ERROR_NO_DATA  No data available
1021  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1022  *
1023  * @pre The Bluetooth service must be initialized with bt_initialize().
1024  *
1025  * @see bt_adapter_le_scan_result_cb()
1026  */
1027 int bt_adapter_le_get_scan_result_manufacturer_data(const bt_adapter_le_device_scan_result_info_s *info,
1028                         bt_adapter_le_packet_type_e pkt_type, int *manufacturer_id, char **manufacturer_data, int *manufacturer_data_len);
1029
1030 /**
1031  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1032  * @brief Gets iBeacon format's data from the scan result information.
1033  * @since_tizen 4.0
1034  *
1035  * @remarks The @a ibeacon_info must be released with bt_adapter_le_free_ibeacon_report().
1036  *
1037  * @param[in] info The scan result information
1038  * @param[in] pkt_type The packet type
1039  * @param[out] ibeacon_info The iBeacon format's scan result data
1040  *
1041  * @return 0 on success, otherwise a negative error value.
1042  * @retval #BT_ERROR_NONE  Successful
1043  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1044  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1045  * @retval #BT_ERROR_NO_DATA  No data available
1046  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1047  *
1048  * @pre The Bluetooth service must be initialized with bt_initialize().
1049  *
1050  * @see bt_adapter_le_scan_result_cb()
1051  */
1052 int bt_adapter_le_get_scan_result_ibeacon_report(const bt_adapter_le_device_scan_result_info_s *info,
1053                         bt_adapter_le_packet_type_e pkt_type,
1054                         bt_adapter_le_ibeacon_scan_result_info_s **ibeacon_info);
1055
1056 /**
1057  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1058  * @brief Frees iBeacon information.
1059  * @since_tizen 4.0
1060  *
1061  * @param[in] ibeacon_info The iBeacon format's scan result data
1062  *
1063  * @return 0 on success, otherwise a negative error value.
1064  * @retval #BT_ERROR_NONE  Successful
1065  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1066  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1067  *
1068  * @see bt_adapter_le_get_scan_result_service_data_list()
1069  */
1070 int bt_adapter_le_free_ibeacon_report(bt_adapter_le_ibeacon_scan_result_info_s *ibeacon_info);
1071
1072 /**
1073  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1074  * @brief Creates advertiser to advertise device's existence or respond to LE scanning request.
1075  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1076  *
1077  * @param[out] advertiser The handle of advertiser
1078  *
1079  * @return 0 on success, otherwise a negative error value.
1080  * @retval #BT_ERROR_NONE  Successful
1081  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1082  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1083  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
1084  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1085  *
1086  * @pre The Bluetooth service must be initialized with bt_initialize().
1087  *
1088  * @see bt_adapter_le_destroy_advertiser()
1089  */
1090 int bt_adapter_le_create_advertiser(bt_advertiser_h *advertiser);
1091
1092 /**
1093  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1094  * @brief Destroys advertiser.
1095  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1096  *
1097  * @param[out] advertiser The handle of advertiser
1098  *
1099  * @return 0 on success, otherwise a negative error value.
1100  * @retval #BT_ERROR_NONE  Successful
1101  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1102  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1103  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1104  *
1105  * @pre The Bluetooth service must be initialized with bt_initialize().
1106  *
1107  * @see bt_adapter_le_create_advertiser()
1108  */
1109 int bt_adapter_le_destroy_advertiser(bt_advertiser_h advertiser);
1110
1111 /**
1112  * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE
1113  * @brief Initializes the Bluetooth IPSP (Internet Protocol Support Profile) service.
1114  * @since_tizen 4.0
1115  * @param[in] callback The callback called when the initialization is finished
1116  * @param[in] user_data The user data to be passed to the callback function
1117  * @return 0 on success, otherwise a negative error value.
1118  * @retval #BT_ERROR_NONE  Successful
1119  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1120  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1121  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1122  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
1123  *
1124  * @pre The Bluetooth service must be initialized with bt_initialize().
1125  * @see bt_initialize()
1126  */
1127 int bt_ipsp_initialize(bt_ipsp_init_state_changed_cb callback, void *user_data);
1128
1129 /**
1130  * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE
1131  * @brief Deinitializes the Bluetooth IPSP (Internet Protocol Support Profile) service.
1132  * @since_tizen 4.0
1133  * @return 0 on success, otherwise a negative error value.
1134  * @retval #BT_ERROR_NONE  Successful
1135  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1136  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1137  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
1138  *
1139  * @pre The Bluetooth service must be initialized with bt_initialize().
1140  * @see bt_initialize()
1141  */
1142 int bt_ipsp_deinitialize(void);
1143
1144 /**
1145  * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE
1146  * @brief Connects to a remote device's IPSP service over LE, asynchronously.
1147  * @since_tizen 4.0
1148  * @privlevel public
1149  * @privilege %http://tizen.org/privilege/bluetooth
1150  * @param[in] remote_address  The remote address
1151  * @return 0 on success, otherwise a negative error value.
1152  * @retval #BT_ERROR_NONE  Successful
1153  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1154  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1155  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1156  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1157  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
1158  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
1159  *
1160  * @post bt_ipsp_set_connection_state_changed_cb() will be invoked.
1161  * @see bt_ipsp_set_connection_state_changed_cb()
1162  */
1163 int bt_ipsp_connect(const char *remote_address);
1164
1165 /**
1166  * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE
1167  * @brief Disconnects from a remote device's IPSP service, asynchronously.
1168  * @since_tizen 4.0
1169  * @privlevel public
1170  * @privilege %http://tizen.org/privilege/bluetooth
1171  * @param[in] remote_address  The remote address
1172  * @return 0 on success, otherwise a negative error value.
1173  * @retval #BT_ERROR_NONE  Successful
1174  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1175  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1176  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1177  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
1178  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1179  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
1180  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
1181  *
1182  * @pre The remote device must be connected by bt_ipsp_connect().
1183  * @post bt_ipsp_set_connection_state_changed_cb() will be invoked.
1184  * @see bt_ipsp_connect()
1185  * @see bt_ipsp_set_connection_state_changed_cb()
1186  */
1187 int bt_ipsp_disconnect(const char *remote_address);
1188
1189 /**
1190  * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE
1191  * @brief  Registers a callback function that will be invoked when the connection state changes.
1192  * @since_tizen 4.0
1193  * @param[in] callback The callback function to register
1194  * @param[in] user_data The user data to be passed to the callback function
1195  * @return   0 on success, otherwise a negative error value.
1196  * @retval #BT_ERROR_NONE  Successful
1197  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1198  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1199  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
1200  *
1201  * @pre The Bluetooth service must be initialized with bt_initialize().
1202  * @see bt_initialize()
1203  */
1204 int bt_ipsp_set_connection_state_changed_cb(bt_ipsp_connection_state_changed_cb callback,
1205                                                 void *user_data);
1206
1207 /**
1208  * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE
1209  * @brief       Unregisters the callback function called when the connection state changes.
1210  * @since_tizen 4.0
1211  * @return      0 on success, otherwise a negative error value.
1212  * @retval #BT_ERROR_NONE  Successful
1213  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1214  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
1215  *
1216  * @pre The Bluetooth service must be initialized with bt_initialize().
1217  * @see bt_initialize()
1218  */
1219 int bt_ipsp_unset_connection_state_changed_cb(void);
1220
1221 /**
1222  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1223  * @brief Adds a service UUID to advertise or scan response data.
1224  *        The maximum advertised or responded data size is 31 bytes
1225  *        including data type and system wide data.
1226  * @since_tizen 2.3.1
1227  *
1228  * @remarks 16-bit UUID or 128-bit UUID is supported.
1229  *          (e.g. 180F, 0000180F-0000-1000-8000-00805F9B34FB).
1230  *          16-bit UUID is advertised as 16-bit UUID.
1231  *          128-bit UUID made from base UUID(00000000-0000-1000-8000-00805F9B34FB)
1232  *          is converted to the 16-bit equivalent form and advertised as such.
1233  *          (e.g. 0000180F-0000-1000-8000-00805F9B34FB is converted to 180F 16-bit form).
1234  *          Any other 128-bit UUID is advertised as 128-bit UUID.
1235  *
1236  * @param[in] advertiser The handle of advertiser
1237  * @param[in] pkt_type The packet type
1238  * @param[in] uuid The string of the service UUID.
1239  *
1240  * @return 0 on success, otherwise a negative error value.
1241  * @retval #BT_ERROR_NONE  Successful
1242  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1243  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1244  * @retval #BT_ERROR_QUOTA_EXCEEDED  Quota exceeded
1245  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1246  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1247  *
1248  * @pre The Bluetooth service must be initialized with bt_initialize().
1249  *
1250  * @see bt_adapter_le_clear_advertising_data()
1251  */
1252 int bt_adapter_le_add_advertising_service_uuid(bt_advertiser_h advertiser,
1253                 bt_adapter_le_packet_type_e pkt_type, const char *uuid);
1254
1255 /**
1256  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1257  * @brief Adds a service solicitation UUID to advertise or scan response data.
1258  *        The maximum advertised or responded data size is 31 bytes
1259  *        including data type and system wide data.
1260  * @since_tizen 2.3.1
1261  *
1262  * @remarks 16-bit service solicitation UUID or 128-bit service solicitation UUID is supported.
1263  *          (e.g. 180F, 0000180F-0000-1000-8000-00805F9B34FB).
1264  *          16-bit UUID is advertised as 16-bit UUID.
1265  *          128-bit UUID made from base UUID(00000000-0000-1000-8000-00805F9B34FB)
1266  *          is converted to the 16-bit equivalent form and advertised as such.
1267  *          (e.g. 0000180F-0000-1000-8000-00805F9B34FB is converted to 180F 16-bit form).
1268  *          Any other 128-bit UUID is advertised as 128-bit UUID.
1269  *
1270  * @param[in] advertiser The handle of advertiser
1271  * @param[in] pkt_type The packet type
1272  * @param[in] uuid The string of the service solicitation UUID.
1273  *
1274  * @return 0 on success, otherwise a negative error value.
1275  * @retval #BT_ERROR_NONE  Successful
1276  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1277  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1278  * @retval #BT_ERROR_QUOTA_EXCEEDED  Quota exceeded
1279  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1280  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1281  *
1282  * @pre The Bluetooth service must be initialized with bt_initialize().
1283  *
1284  * @see bt_adapter_le_clear_advertising_data()
1285  */
1286 int bt_adapter_le_add_advertising_service_solicitation_uuid(bt_advertiser_h advertiser,
1287                 bt_adapter_le_packet_type_e pkt_type, const char *uuid);
1288
1289 /**
1290  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1291  * @brief Adds service data to advertise or scan response data.
1292  *        The maximum advertised or responded data size is 31 bytes
1293  *        including data type and system wide data.
1294  * @since_tizen 2.3.1
1295  *
1296  * @remarks 16-bit UUID is supported. (e.g. 180F).
1297  *
1298  * @param[in] advertiser The handle of advertiser
1299  * @param[in] pkt_type The packet type
1300  * @param[in] uuid 16-bit UUID of the service
1301  * @param[in] service_data The service data
1302  * @param[in] service_data_len The data length of service data
1303  *
1304  * @return 0 on success, otherwise a negative error value.
1305  * @retval #BT_ERROR_NONE  Successful
1306  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1307  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1308  * @retval #BT_ERROR_QUOTA_EXCEEDED  Quota exceeded
1309  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1310  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1311  *
1312  * @pre The Bluetooth service must be initialized with bt_initialize().
1313  *
1314  * @see bt_adapter_le_clear_advertising_data()
1315  */
1316 int bt_adapter_le_add_advertising_service_data(bt_advertiser_h advertiser,
1317                 bt_adapter_le_packet_type_e pkt_type, const char *uuid,
1318                 const char *service_data, int service_data_len);
1319
1320 /**
1321  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1322  * @brief Sets the external appearance of this device to advertise or scan response data.
1323  *        Please refer to the adopted Bluetooth specification for the the appearance.
1324  * @since_tizen 2.3.1
1325  *
1326  * @param[in] advertiser The handle of advertiser
1327  * @param[in] pkt_type The packet type
1328  * @param[in] appearance The external appearance of device
1329  *
1330  * @return 0 on success, otherwise a negative error value.
1331  * @retval #BT_ERROR_NONE  Successful
1332  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1333  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1334  * @retval #BT_ERROR_QUOTA_EXCEEDED  Quota exceeded
1335  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1336  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1337  *
1338  * @pre The Bluetooth service must be initialized with bt_initialize().
1339  *
1340  * @see bt_adapter_le_clear_advertising_data()
1341  */
1342 int bt_adapter_le_set_advertising_appearance(bt_advertiser_h advertiser,
1343                 bt_adapter_le_packet_type_e pkt_type, int appearance);
1344
1345 /**
1346  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1347  * @brief Adds manufacturer specific data to advertise or scan response data.
1348  *        Please refer to the Bluetooth Assigned Numbers provided by the Bluetooth SIG for a list of existing company identifiers.
1349  *        The maximum advertised or responded data size is 31 bytes
1350  *        including data type and system wide data.
1351  * @since_tizen 2.3.1
1352  *
1353  *
1354  * @param[in] advertiser The handle of advertiser
1355  * @param[in] pkt_type The packet type
1356  * @param[in] manufacturer_id Manufacturer identifier
1357  * @param[in] manufacturer_data The manufacturer specific data
1358  * @param[in] manufacturer_data_len The data length of manufacturer data
1359  *
1360  * @return 0 on success, otherwise a negative error value.
1361  * @retval #BT_ERROR_NONE  Successful
1362  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1363  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1364  * @retval #BT_ERROR_QUOTA_EXCEEDED  Quota exceeded
1365  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1366  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1367  *
1368  * @pre The Bluetooth service must be initialized with bt_initialize().
1369  *
1370  * @see bt_adapter_le_clear_advertising_data()
1371  */
1372 int bt_adapter_le_add_advertising_manufacturer_data(bt_advertiser_h advertiser,
1373                 bt_adapter_le_packet_type_e pkt_type, int manufacturer_id, const char *manufacturer_data, int manufacturer_data_len);
1374
1375 /**
1376  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1377  * @brief Sets whether the device name should be included in advertise or scan response data.
1378  *        The maximum advertised or responded data size is 31 bytes
1379  *        including data type and system wide data.
1380  * @since_tizen 2.3.1
1381  *
1382  * @param[in] advertiser The handle of advertiser
1383  * @param[in] pkt_type The packet type
1384  * @param[in] include_name Whether the device name should be included
1385  *
1386  * @return 0 on success, otherwise a negative error value.
1387  * @retval #BT_ERROR_NONE  Successful
1388  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1389  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1390  * @retval #BT_ERROR_QUOTA_EXCEEDED  Quota exceeded
1391  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1392  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1393  *
1394  * @pre The Bluetooth service must be initialized with bt_initialize().
1395  *
1396  * @see bt_adapter_le_clear_advertising_data()
1397  */
1398 int bt_adapter_le_set_advertising_device_name(bt_advertiser_h advertiser,
1399                 bt_adapter_le_packet_type_e pkt_type, bool include_name);
1400
1401 /**
1402  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1403  * @brief Sets whether the transmission power level should be included in advertise or scan response data.
1404  *        The maximum advertised or responded data size is 31 bytes
1405  *        including data type and system wide data.
1406  * @since_tizen 2.3.1
1407  *
1408  * @param[in] advertiser The handle of advertiser
1409  * @param[in] pkt_type The packet type
1410  * @param[in] include_tx_power Whether the transmission power level should be included
1411  *
1412  * @return 0 on success, otherwise a negative error value.
1413  * @retval #BT_ERROR_NONE  Successful
1414  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1415  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1416  * @retval #BT_ERROR_QUOTA_EXCEEDED  Quota exceeded
1417  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1418  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1419  *
1420  * @pre The Bluetooth service must be initialized with bt_initialize().
1421  *
1422  * @see bt_adapter_le_clear_advertising_data()
1423  */
1424 int bt_adapter_le_set_advertising_tx_power_level(bt_advertiser_h advertiser,
1425                 bt_adapter_le_packet_type_e pkt_type, bool include_tx_power);
1426
1427 /**
1428  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1429  * @brief Clears all data to be advertised or responded to scan request from LE scanning device.
1430  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1431  *
1432  * @param[in] advertiser The handle of advertiser
1433  * @param[in] pkt_type The packet type to be cleared
1434  *
1435  * @return 0 on success, otherwise a negative error value.
1436  * @retval #BT_ERROR_NONE  Successful
1437  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1438  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1439  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1440  *
1441  * @pre The Bluetooth service must be initialized with bt_initialize().
1442  */
1443 int bt_adapter_le_clear_advertising_data(bt_advertiser_h advertiser, bt_adapter_le_packet_type_e pkt_type);
1444
1445 /**
1446  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1447  * @brief Stops the advertising.
1448  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1449  * @privlevel public
1450  * @privilege %http://tizen.org/privilege/bluetooth
1451  *
1452  * @param[in] advertiser The handle of advertiser
1453  *
1454  * @return 0 on success, otherwise a negative error value.
1455  * @retval #BT_ERROR_NONE  Successful
1456  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1457  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1458  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1459  * @retval #BT_ERROR_NOT_IN_PROGRESS  Operation is not in progress
1460  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1461  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
1462  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1463  *
1464  * @pre The advertising must be going on with bt_adapter_le_start_advertising_new().
1465  * @post This function invokes bt_adapter_le_advertising_state_changed_cb().
1466  *
1467  * @see bt_adapter_le_start_advertising_new()
1468  * @see bt_adapter_le_advertising_state_changed_cb()
1469  */
1470 int bt_adapter_le_stop_advertising(bt_advertiser_h advertiser);
1471
1472 /**
1473  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1474  * @brief Starts advertising with passed advertiser and advertising parameters.
1475  *
1476  * @details Once Bluetooth advertising is started, nearby Bluetooth LE (Low Energy) supported \n
1477  * devices can know this device's existence. And one of them can make a connection request, \n
1478  * if it is allowed.
1479  *
1480  * @since_tizen 2.3.1
1481  * @privlevel public
1482  * @privilege %http://tizen.org/privilege/bluetooth
1483  * @param[in] advertiser The handle of advertiser
1484  * @param[in] cb The callback to report the result of this function
1485  * @param[in] user_data The user data to be passed when callback is called
1486  *
1487  * @return 0 on success, otherwise a negative error value.
1488  * @retval #BT_ERROR_NONE  Successful
1489  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1490  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1491  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1492  * @retval #BT_ERROR_NOW_IN_PROGRESS  Operation is now in progress
1493  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1494  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
1495  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1496  *
1497  * @pre The Bluetooth service must be initialized with bt_initialize().
1498  * @post This function invokes bt_adapter_le_advertising_state_changed_cb().
1499  *
1500  * @see bt_adapter_le_stop_advertising()
1501  * @see bt_adapter_le_advertising_state_changed_cb()
1502  */
1503 int bt_adapter_le_start_advertising_new(bt_advertiser_h advertiser, bt_adapter_le_advertising_state_changed_cb cb, void *user_data);
1504
1505 /**
1506  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1507  * @brief Sets advertising mode to control the advertising power and latency.
1508  * @since_tizen 2.3.1
1509  * @privlevel public
1510  * @privilege %http://tizen.org/privilege/bluetooth
1511  *
1512  * @param[in] advertiser The handle of advertiser
1513  * @param[in] mode The mode of advertising
1514  *
1515  * @return 0 on success, otherwise a negative error value.
1516  * @retval #BT_ERROR_NONE  Successful
1517  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1518  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1519  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1520  * @retval #BT_ERROR_NOW_IN_PROGRESS  Operation is now in progress
1521  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
1522  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1523  *
1524  * @pre The Bluetooth service must be initialized with bt_initialize().
1525  *
1526  * @see bt_adapter_le_start_advertising_new()
1527  */
1528 int bt_adapter_le_set_advertising_mode(bt_advertiser_h advertiser, bt_adapter_le_advertising_mode_e mode);
1529
1530 /**
1531  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1532  * @brief Sets whether the advertising type should be connectable or non-connectable.
1533  * @since_tizen 2.3.1
1534  * @privlevel public
1535  * @privilege %http://tizen.org/privilege/bluetooth
1536  *
1537  * @param[in] advertiser The handle of advertiser
1538  * @param[in] connectable The type of advertising
1539  *
1540  * @return 0 on success, otherwise a negative error value.
1541  * @retval #BT_ERROR_NONE  Successful
1542  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1543  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1544  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1545  * @retval #BT_ERROR_NOW_IN_PROGRESS  Operation is now in progress
1546  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
1547  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1548  *
1549  * @pre The Bluetooth service must be initialized with bt_initialize().
1550  *
1551  * @see bt_adapter_le_start_advertising_new()
1552  */
1553 int bt_adapter_le_set_advertising_connectable(bt_advertiser_h advertiser, bool connectable);
1554
1555 /**
1556  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1557  * @brief Sets Bluetooth LE scan mode.
1558  * @since_tizen 3.0
1559  * @privlevel public
1560  * @privilege %http://tizen.org/privilege/bluetooth
1561  * @param[in] scan_mode The scan mode
1562  *
1563  * @return 0 on success, otherwise a negative error value.
1564  * @retval #BT_ERROR_NONE Successful
1565  * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
1566  * @retval #BT_ERROR_INVALID_PARAMETER Parameter is invalid
1567  * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1568  * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1569  * @pre The state of local bluetooth must be #BT_ADAPTER_ENABLED.
1570  * @pre The bluetooth service must be initialized with bt_initialize().
1571  * @see bt_initialize()
1572  */
1573 int bt_adapter_le_set_scan_mode(bt_adapter_le_scan_mode_e scan_mode);
1574
1575 /**
1576  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1577  * @brief Creates a bond with a remote Bluetooth device, asynchronously.
1578  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1579  * @privlevel public
1580  * @privilege %http://tizen.org/privilege/bluetooth
1581  *
1582  * @remarks A bond can be destroyed by bt_device_destroy_bond().\n
1583  * The bonding request can be cancelled by bt_device_cancel_bonding().
1584  *
1585  * @param[in] remote_address The address of the remote Bluetooth device with which the bond should be created
1586  *
1587  * @return 0 on success, otherwise a negative error value.
1588  * @retval #BT_ERROR_NONE  Successful
1589  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1590  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1591  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1592  * @retval #BT_ERROR_RESOURCE_BUSY  Device or resource busy
1593  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1594  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
1595  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1596  *
1597  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1598  * @pre The remote device must be discoverable with bt_adapter_start_device_discovery().
1599  * @post This function invokes bt_device_bond_created_cb().
1600  *
1601  * @see bt_adapter_start_device_discovery()
1602  * @see bt_device_bond_created_cb()
1603  * @see bt_device_cancel_bonding()
1604  * @see bt_device_destroy_bond()
1605  * @see bt_device_set_bond_created_cb()
1606  * @see bt_device_unset_bond_created_cb()
1607  */
1608 int bt_device_create_bond(const char *remote_address);
1609
1610 /**
1611  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1612  * @brief Cancels the bonding process.
1613  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1614  * @privlevel public
1615  * @privilege %http://tizen.org/privilege/bluetooth
1616  *
1617  * @remarks Use this function when the remote Bluetooth device is not responding to the \n
1618  * bond request or you wish to cancel the bonding request.
1619  *
1620  * @return 0 on success, otherwise a negative error value.
1621  * @retval #BT_ERROR_NONE  Successful
1622  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1623  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1624  * @retval #BT_ERROR_NOT_IN_PROGRESS  Operation not in progress
1625  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
1626  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1627  *
1628  * @pre The creating a bond must be in progress by bt_device_create_bond().
1629  *
1630  * @see bt_device_create_bond()
1631  * @see bt_device_bond_created_cb()
1632  * @see bt_device_set_bond_created_cb()
1633  * @see bt_device_unset_bond_created_cb()
1634  */
1635 int bt_device_cancel_bonding(void);
1636
1637 /**
1638  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1639  * @brief Destroys the bond, asynchronously.
1640  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1641  * @privlevel public
1642  * @privilege %http://tizen.org/privilege/bluetooth
1643  *
1644  * @param[in] remote_address The address of the remote Bluetooth device to remove bonding
1645  *
1646  * @return 0 on success, otherwise a negative error value.
1647  * @retval #BT_ERROR_NONE  Successful
1648  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1649  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1650  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1651  * @retval #BT_ERROR_RESOURCE_BUSY  Device or resource busy
1652  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED  Remote device not bonded
1653  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1654  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
1655  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1656  *
1657  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1658  * @pre The bond with the remote device must be created with bt_device_create_bond().
1659  * @post This function invokes bt_device_bond_destroyed_cb().
1660  *
1661  * @see bt_device_create_bond()
1662  * @see bt_device_bond_destroyed_cb()
1663  * @see bt_device_set_bond_destroyed_cb()
1664  * @see bt_device_unset_bond_destroyed_cb()
1665  */
1666 int bt_device_destroy_bond(const char *remote_address);
1667
1668 /**
1669  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1670  * @brief Sets an alias for the bonded device.
1671  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1672  * @privlevel public
1673  * @privilege %http://tizen.org/privilege/bluetooth
1674  *
1675  * @param[in] remote_address The address of the remote Bluetooth device
1676  * @param[in] alias The alias of the remote Bluetooth device
1677  *
1678  * @return 0 on success, otherwise a negative error value.
1679  * @retval #BT_ERROR_NONE  Successful
1680  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1681  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1682  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1683  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED  Remote device not bonded
1684  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1685  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
1686  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1687  *
1688  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1689  * @pre The bond with the remote device must be created with bt_device_create_bond().
1690  *
1691  * @see bt_device_create_bond()
1692  */
1693 int bt_device_set_alias(const char *remote_address, const char *alias);
1694
1695 /**
1696  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1697  * @brief Sets the authorization of a bonded device, asynchronously.
1698  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1699  * @privlevel public
1700  * @privilege %http://tizen.org/privilege/bluetooth
1701  *
1702  * @remarks Once a device is authorized, you don't need to receive a confirmation.
1703  *
1704  * @param[in] remote_address The address of the remote Bluetooth device to authorize
1705  * @param[in] authorization_state The Bluetooth authorization state
1706  *
1707  * @return 0 on success, otherwise a negative error value.
1708  * @retval #BT_ERROR_NONE  Successful
1709  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1710  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1711  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1712  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED  Remote device not bonded
1713  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
1714  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
1715  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1716  *
1717  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1718  * @pre The bond with the remote device must be created with bt_device_create_bond().
1719  * @post bt_device_authorization_changed_cb() will be invoked.
1720  *
1721  * @see bt_device_create_bond()
1722  * @see bt_device_authorization_changed_cb()
1723  * @see bt_device_set_authorization_changed_cb()
1724  * @see bt_device_unset_authorization_changed_cb()
1725  */
1726 int bt_device_set_authorization(const char *remote_address, bt_device_authorization_e authorization_state);
1727
1728 /**
1729  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1730  * @brief Starts the search for services supported by the specified device, asynchronously.
1731  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1732  * @privlevel public
1733  * @privilege %http://tizen.org/privilege/bluetooth
1734  *
1735  * @remarks If creating a bond succeeds, which means bt_device_bond_created_cb() is called with result #BT_ERROR_NONE, \n
1736  * then you don't need to run this function.\n
1737  * The service search takes a couple of seconds to complete normally.
1738  *
1739  * @param[in] remote_address The address of the remote Bluetooth device whose services need to be checked
1740  *
1741  * @return 0 on success, otherwise a negative error value.
1742  * @retval #BT_ERROR_NONE  Successful
1743  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1744  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1745  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1746  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED  Remote device not bonded
1747  * @retval #BT_ERROR_SERVICE_SEARCH_FAILED  Service search failed
1748  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
1749  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1750  *
1751  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1752  * @pre The remote device must be discoverable with bt_adapter_start_device_discovery().
1753  * @pre The bond with the remote device must be created with bt_device_create_bond().
1754  * @post This function invokes bt_device_service_searched_cb().
1755  *
1756  * @see bt_adapter_start_device_discovery()
1757  * @see bt_device_create_bond()
1758  * @see bt_device_bond_created_cb()
1759  * @see bt_device_service_searched_cb()
1760  * @see bt_device_set_service_searched_cb()
1761  * @see bt_device_unset_service_searched_cb()
1762  */
1763 int bt_device_start_service_search(const char *remote_address);
1764
1765 /**
1766  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1767  * @brief Gets the connected profiles.
1768  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1769  * @param[in] remote_address The address of the remote device
1770  * @param[in] callback The callback function to invoke
1771  * @param[in] user_data The user data to be passed to the callback function
1772  * @return 0 on success, otherwise a negative error value.
1773  * @retval #BT_ERROR_NONE  Successful
1774  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1775  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1776  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1777  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1778  *
1779  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1780  * @post bt_device_connected_profile() will be invoked.
1781  * @see bt_device_connected_profile()
1782  */
1783 int bt_device_foreach_connected_profiles(const char *remote_address, bt_device_connected_profile callback, void *user_data);
1784
1785 /**
1786  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1787  * @brief Gets the profile connected status.
1788  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1789  * @param[in] remote_address The address of the remote device
1790  * @param[in] bt_profile wish to know bt_profile
1791  * @param[out] connected_status the connected status
1792  * @return 0 on success, otherwise a negative error value.
1793  * @retval #BT_ERROR_NONE  Successful
1794  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1795  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1796  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1797  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED   Remote device not bonded
1798  * @retval #BT_ERROR_OPERATION_FAILED   Operation failed
1799  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1800  *
1801  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1802  */
1803 int bt_device_is_profile_connected(const char *remote_address, bt_profile_e bt_profile,
1804                                         bool *connected_status);
1805
1806 /**
1807  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1808  * @brief Updates a LE connection mode.
1809  * @since_tizen 3.0
1810  * @privlevel public
1811  * @privilege %http://tizen.org/privilege/bluetooth
1812  *
1813  * @param[in] remote_address The address of the remote Bluetooth device
1814  * @param[in] mode The LE connection mode
1815  *
1816  * @return 0 on success, otherwise a negative error value.
1817  * @retval #BT_ERROR_NONE  Successful
1818  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1819  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1820  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
1821  * @retval #BT_ERROR_OPERATION_FAILED   Operation failed
1822  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
1823  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1824  */
1825 int bt_device_update_le_connection_mode(const char *remote_address, bt_device_le_connection_mode_e mode);
1826
1827 /**
1828  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1829  * @brief  Registers a callback function to be invoked when the bond creates.
1830  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1831  * @param[in] callback The callback function to register
1832  * @param[in] user_data The user data to be passed to the callback function
1833  * @return   0 on success, otherwise a negative error value.
1834  * @retval #BT_ERROR_NONE  Successful
1835  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1836  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1837  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1838  *
1839  * @pre The Bluetooth service must be initialized with bt_initialize().
1840  * @post  bt_device_bond_created_cb() will be invoked.
1841  * @see bt_initialize()
1842  * @see bt_device_bond_created_cb()
1843  * @see bt_device_unset_bond_created_cb()
1844  */
1845 int bt_device_set_bond_created_cb(bt_device_bond_created_cb callback, void *user_data);
1846
1847 /**
1848  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1849  * @brief       Unregisters the callback function.
1850  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1851  * @return      0 on success, otherwise a negative error value.
1852  * @retval #BT_ERROR_NONE  Successful
1853  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1854  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1855  *
1856  * @pre The Bluetooth service must be initialized with bt_initialize().
1857  * @see bt_initialize()
1858  * @see bt_device_set_bond_created_cb()
1859  */
1860 int bt_device_unset_bond_created_cb(void);
1861
1862 /**
1863  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1864  * @brief  Registers a callback function to be invoked when the bond destroys.
1865  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1866  * @param[in] callback The callback function to register
1867  * @param[in] user_data The user data to be passed to the callback function
1868  * @return   0 on success, otherwise a negative error value.
1869  * @retval #BT_ERROR_NONE  Successful
1870  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1871  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1872  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1873  *
1874  * @pre The Bluetooth service must be initialized with bt_initialize().
1875  * @post  bt_device_bond_destroyed_cb() will be invoked.
1876  * @see bt_initialize()
1877  * @see bt_device_bond_destroyed_cb()
1878  * @see bt_device_unset_bond_destroyed_cb()
1879  */
1880 int bt_device_set_bond_destroyed_cb(bt_device_bond_destroyed_cb callback, void *user_data);
1881
1882 /**
1883  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1884  * @brief       Unregisters the callback function.
1885  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1886  * @return      0 on success, otherwise a negative error value.
1887  * @retval #BT_ERROR_NONE  Successful
1888  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1889  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1890  *
1891  * @pre The Bluetooth service must be initialized with bt_initialize().
1892  * @see bt_initialize()
1893  * @see bt_device_set_bond_destroyed_cb()
1894  */
1895 int bt_device_unset_bond_destroyed_cb(void);
1896
1897 /**
1898  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1899  * @brief  Registers a callback function to be invoked when the authorization of device changes.
1900  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1901  * @param[in] callback The callback function to register
1902  * @param[in] user_data The user data to be passed to the callback function
1903  * @return   0 on success, otherwise a negative error value.
1904  * @retval #BT_ERROR_NONE  Successful
1905  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1906  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1907  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1908  *
1909  * @pre The Bluetooth service must be initialized with bt_initialize().
1910  * @post  bt_device_authorization_changed_cb() will be invoked.
1911  * @see bt_initialize()
1912  * @see bt_device_authorization_changed_cb()
1913  * @see bt_device_unset_authorization_changed_cb()
1914  */
1915 int bt_device_set_authorization_changed_cb(bt_device_authorization_changed_cb callback, void *user_data);
1916
1917 /**
1918  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1919  * @brief       Unregisters the callback function.
1920  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1921  * @return      0 on success, otherwise a negative error value.
1922  * @retval #BT_ERROR_NONE  Successful
1923  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1924  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1925  *
1926  * @pre The Bluetooth service must be initialized with bt_initialize().
1927  * @see bt_initialize()
1928  * @see bt_device_set_authorization_changed_cb()
1929  */
1930 int bt_device_unset_authorization_changed_cb(void);
1931
1932 /**
1933  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1934  * @brief  Registers a callback function to be invoked when the process of service search finishes.
1935  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1936  * @param[in] callback The callback function to register
1937  * @param[in] user_data The user data to be passed to the callback function
1938  * @return   0 on success, otherwise a negative error value.
1939  * @retval #BT_ERROR_NONE  Successful
1940  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1941  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1942  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1943  *
1944  * @pre The Bluetooth service must be initialized with bt_initialize().
1945  * @post  bt_device_service_searched_cb() will be invoked.
1946  * @see bt_initialize()
1947  * @see bt_device_service_searched_cb()
1948  * @see bt_device_unset_service_searched_cb()
1949  */
1950 int bt_device_set_service_searched_cb(bt_device_service_searched_cb callback, void *user_data);
1951
1952 /**
1953  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1954  * @brief       Unregisters the callback function.
1955  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1956  * @return      0 on success, otherwise a negative error value.
1957  * @retval #BT_ERROR_NONE  Successful
1958  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1959  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1960  *
1961  * @pre The Bluetooth service must be initialized with bt_initialize().
1962  * @see bt_initialize()
1963  * @see bt_device_set_service_searched_cb()
1964  */
1965 int bt_device_unset_service_searched_cb(void);
1966
1967 /**
1968  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1969  * @brief  Registers a callback function to be invoked when the connection state is changed.
1970  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1971  * @param[in] callback The callback function to register
1972  * @param[in] user_data The user data to be passed to the callback function
1973  * @return 0 on success, otherwise a negative error value.
1974  * @retval #BT_ERROR_NONE  Successful
1975  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1976  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
1977  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1978  *
1979  * @pre The Bluetooth service must be initialized with bt_initialize().
1980  * @post bt_device_connection_state_changed_cb() will be invoked.
1981  * @see bt_initialize()
1982  * @see bt_device_connection_state_changed_cb()
1983  * @see bt_device_unset_connection_state_changed_cb()
1984  */
1985 int bt_device_set_connection_state_changed_cb(bt_device_connection_state_changed_cb callback, void *user_data);
1986
1987 /**
1988  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1989  * @brief       Unregisters the callback function to be invoked when the connection state is changed.
1990  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1991  * @return 0 on success, otherwise a negative error value.
1992  * @retval #BT_ERROR_NONE  Successful
1993  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
1994  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
1995  *
1996  * @pre The Bluetooth service must be initialized with bt_initialize().
1997  * @see bt_initialize()
1998  * @see bt_device_set_connection_state_changed_cb()
1999  */
2000 int bt_device_unset_connection_state_changed_cb(void);
2001
2002 /**
2003  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2004  * @brief Registers a RFCOMM server socket with a specific UUID.
2005  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2006  * @privlevel public
2007  * @privilege %http://tizen.org/privilege/bluetooth
2008  *
2009  * @remarks A socket can be destroyed by bt_socket_destroy_rfcomm().
2010  *
2011  * @param[in] service_uuid The 128-bit UUID of service to provide
2012  * @param[out] socket_fd The file descriptor of socket to listen
2013  * @return 0 on success, otherwise a negative error value.
2014  *
2015  * @retval #BT_ERROR_NONE  Successful
2016  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2017  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2018  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2019  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2020  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2021  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
2022  *
2023  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
2024  *
2025  * @see bt_socket_listen_and_accept_rfcomm()
2026  * @see bt_socket_destroy_rfcomm()
2027  */
2028 int bt_socket_create_rfcomm(const char *service_uuid, int *socket_fd);
2029
2030 /**
2031  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2032  * @brief Removes the RFCOMM server socket which was created using bt_socket_create_rfcomm().
2033  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2034  * @privlevel public
2035  * @privilege %http://tizen.org/privilege/bluetooth
2036  * @remarks If callback function bt_socket_connection_state_changed_cb() is set and the remote Bluetooth device is connected, \n
2037  * then bt_socket_connection_state_changed_cb() will be called when this function is finished successfully.
2038  *
2039  * @param[in] socket_fd The file descriptor of socket (which was created using bt_socket_create_rfcomm()) to destroy
2040  * @return 0 on success, otherwise a negative error value.
2041  * @retval #BT_ERROR_NONE  Successful
2042  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2043  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2044  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2045  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2046  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2047  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
2048  *
2049  * @pre The socket must be created with bt_socket_create_rfcomm().
2050  * @post If callback function bt_socket_connection_state_changed_cb() is set and the remote Bluetooth device is connected,
2051  * then bt_socket_connection_state_changed_cb() will be called.
2052  * @see bt_socket_create_rfcomm()
2053  * @see bt_socket_connection_state_changed_cb()
2054  * @see bt_socket_set_connection_state_changed_cb()
2055  * @see bt_socket_unset_connection_state_changed_cb()
2056  */
2057 int bt_socket_destroy_rfcomm(int socket_fd);
2058
2059 /**
2060  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2061  * @brief Starts listening on passed RFCOMM socket and accepts connection requests.
2062  * @details Pop-up is shown automatically when a RFCOMM connection is requested. \n
2063  * bt_socket_connection_state_changed_cb() will be called with \n
2064  * #BT_SOCKET_CONNECTED if you click "yes" and connection is finished successfully.
2065  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2066  * @privlevel public
2067  * @privilege %http://tizen.org/privilege/bluetooth
2068  * @param[in] socket_fd The file descriptor of socket on which start to listen
2069  * @param[in] max_pending_connections The maximum number of pending connections
2070  * @return 0 on success, otherwise a negative error value.
2071  * @retval #BT_ERROR_NONE  Successful
2072  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2073  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2074  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2075  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2076  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2077  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
2078  *
2079  * @pre The socket must be created with bt_socket_create_rfcomm().
2080  * @post If callback function bt_socket_connection_state_changed_cb() is set,
2081  * then bt_socket_connection_state_changed_cb() will be called when the remote Bluetooth device is connected.
2082  * @see bt_socket_create_rfcomm()
2083  * @see bt_socket_connection_state_changed_cb()
2084  * @see bt_socket_set_connection_state_changed_cb()
2085  * @see bt_socket_unset_connection_state_changed_cb()
2086  */
2087 int bt_socket_listen_and_accept_rfcomm(int socket_fd, int max_pending_connections);
2088
2089 /**
2090  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2091  * @brief Connects to a specific RFCOMM based service on a remote Bluetooth device UUID, asynchronously.
2092  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2093  * @privlevel public
2094  * @privilege %http://tizen.org/privilege/bluetooth
2095  *
2096  * @remarks A connection can be disconnected by bt_socket_disconnect_rfcomm().
2097  *
2098  * @param[in] remote_address The address of the remote Bluetooth device
2099  * @param[in] service_uuid The UUID of service provided by the remote Bluetooth device
2100  *
2101  * @return 0 on success, otherwise a negative error value.
2102  * @retval #BT_ERROR_NONE  Successful
2103  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2104  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2105  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2106  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2107  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2108  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
2109  *
2110  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
2111  * @pre The remote device must be discoverable with bt_adapter_start_device_discovery().
2112  * @pre The bond with the remote device must be created with bt_device_create_bond().
2113  * @post This function invokes bt_socket_connection_state_changed_cb().
2114  *
2115  * @see bt_device_create_bond()
2116  * @see bt_adapter_start_device_discovery()
2117  * @see bt_device_start_service_search()
2118  * @see bt_socket_disconnect_rfcomm()
2119  * @see bt_socket_connection_state_changed_cb()
2120  * @see bt_socket_set_connection_state_changed_cb()
2121  * @see bt_socket_unset_connection_state_changed_cb()
2122  */
2123 int bt_socket_connect_rfcomm(const char *remote_address, const char *service_uuid);
2124
2125 /**
2126  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2127  * @brief Disconnects the RFCOMM connection with the given file descriptor of connected socket.
2128  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2129  * @privlevel public
2130  * @privilege %http://tizen.org/privilege/bluetooth
2131  * @param[in] socket_fd  The file descriptor of socket to close which was received using bt_socket_connection_state_changed_cb().
2132  * @return 0 on success, otherwise a negative error value.
2133  * @retval #BT_ERROR_NONE  Successful
2134  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2135  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2136  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2137  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2138  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
2139  *
2140  * @pre The connection must be established.
2141  *
2142  * @see bt_socket_connection_state_changed_cb()
2143  * @see bt_socket_set_connection_state_changed_cb()
2144  * @see bt_socket_unset_connection_state_changed_cb()
2145  */
2146 int bt_socket_disconnect_rfcomm(int socket_fd);
2147
2148 /**
2149  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2150  * @brief Sends data to the connected device.
2151  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2152  * @privlevel public
2153  * @privilege %http://tizen.org/privilege/bluetooth
2154  * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
2155  *
2156  * @param[in] socket_fd The file descriptor of connected socket which was received using bt_socket_connection_state_changed_cb()
2157  * @param[in] data The data to be sent
2158  * @param[in] length The length of data to be sent
2159  *
2160  * @return the number of bytes written (zero indicates nothing was written).
2161  * @retval On error, -1 is returned, and errno is set appropriately. See write 2 man page.
2162  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2163  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2164  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2165  * @exception BT_ERROR_PERMISSION_DENIED  Permission denied
2166  * @exception BT_ERROR_AGAIN  Resource temporarily unavailable
2167  *
2168  * @pre The connection must be established.
2169  *
2170  * @see bt_socket_connection_state_changed_cb()
2171  * @see bt_socket_set_connection_state_changed_cb()
2172  * @see bt_socket_unset_connection_state_changed_cb()
2173  */
2174 int bt_socket_send_data(int socket_fd, const char *data, int length);
2175
2176 /**
2177  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2178  * @brief  Registers a callback function that will be invoked when you receive data.
2179  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2180  * @param[in] callback The callback function to register
2181  * @param[in] user_data The user data to be passed to the callback function
2182  * @return   0 on success, otherwise a negative error value.
2183  * @retval #BT_ERROR_NONE  Successful
2184  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2185  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2186  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2187  *
2188  * @pre The Bluetooth service must be initialized with bt_initialize().
2189  * @post  bt_socket_data_received_cb() will be invoked.
2190  * @see bt_initialize()
2191  * @see bt_socket_data_received_cb()
2192  * @see bt_socket_unset_data_received_cb()
2193  */
2194 int bt_socket_set_data_received_cb(bt_socket_data_received_cb callback, void *user_data);
2195
2196 /**
2197  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2198  * @brief       Unregisters the callback function.
2199  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2200  * @return      0 on success, otherwise a negative error value.
2201  * @retval #BT_ERROR_NONE  Successful
2202  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2203  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2204  *
2205  * @pre The Bluetooth service must be initialized with bt_initialize().
2206  * @see bt_initialize()
2207  * @see bt_socket_data_received_cb()
2208  * @see bt_socket_set_data_received_cb()
2209  */
2210 int bt_socket_unset_data_received_cb(void);
2211
2212 /**
2213  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2214  * @brief  Registers a callback function that will be invoked when a RFCOMM connection is requested.
2215  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2216  * @param[in] callback The callback function to register
2217  * @param[in] user_data The user data to be passed to the callback function
2218  * @return   0 on success, otherwise a negative error value.
2219  * @retval #BT_ERROR_NONE  Successful
2220  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2221  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2222  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2223  *
2224  * @pre The Bluetooth service must be initialized with bt_initialize().
2225  * @post bt_socket_connection_requested_cb() will be invoked.
2226  * @see bt_initialize()
2227  * @see bt_socket_unset_connection_requested_cb()
2228  */
2229 int bt_socket_set_connection_requested_cb(bt_socket_connection_requested_cb callback, void *user_data);
2230
2231 /**
2232  * @ingroup  CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2233  * @brief  Unregisters the callback function.
2234  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2235  * @return  0 on success, otherwise a negative error value.
2236  * @retval  #BT_ERROR_NONE  Successful
2237  * @retval  #BT_ERROR_NOT_INITIALIZED  Not initialized
2238  * @retval  #BT_ERROR_NOT_SUPPORTED   Not supported
2239  *
2240  * @pre  The Bluetooth service must be initialized with bt_initialize().
2241  * @see  bt_initialize()
2242  * @see  bt_socket_set_connection_requested_cb()
2243  * @see  bt_socket_connection_requested_cb()
2244  */
2245 int bt_socket_unset_connection_requested_cb(void);
2246
2247 /**
2248  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2249  * @brief  Registers a callback function that will be invoked when the connection state changes.
2250  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2251  * @param[in] callback The callback function to register
2252  * @param[in] user_data The user data to be passed to the callback function
2253  * @return   0 on success, otherwise a negative error value.
2254  * @retval #BT_ERROR_NONE  Successful
2255  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2256  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2257  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2258  *
2259  * @pre The Bluetooth service must be initialized with bt_initialize().
2260  * @post bt_socket_connection_state_changed_cb() will be invoked.
2261  * @see bt_initialize()
2262  * @see bt_socket_connection_state_changed_cb()
2263  * @see bt_socket_unset_connection_state_changed_cb()
2264  */
2265 int bt_socket_set_connection_state_changed_cb(bt_socket_connection_state_changed_cb callback, void *user_data);
2266
2267 /**
2268  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2269  * @brief       Unregisters the callback function.
2270  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2271  * @return      0 on success, otherwise a negative error value.
2272  * @retval #BT_ERROR_NONE  Successful
2273  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2274  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2275  *
2276  * @pre The Bluetooth service must be initialized with bt_initialize().
2277  * @see bt_initialize()
2278  * @see bt_socket_connection_state_changed_cb()
2279  * @see bt_socket_set_connection_state_changed_cb()
2280  */
2281 int bt_socket_unset_connection_state_changed_cb(void);
2282
2283 /**
2284  * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2285  * @brief Initializes the Bluetooth OPP server requested by bt_opp_server_connection_requested_cb().
2286  * @details No popup appears when an OPP connection is requested from a remote device. \n
2287  * Instead, @a connection_requested_cb() will be called. \n
2288  * At that time, you can call either bt_opp_server_accept() or bt_opp_server_reject().
2289  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2290  * @remarks This function must be called to start Bluetooth OPP server. \n
2291  * You must free all resources of the Bluetooth service by calling bt_opp_server_deinitialize() if Bluetooth OPP service is no longer needed.
2292  * @param[in] destination  The destination path
2293  * @param[in] connection_requested_cb  The callback called when an OPP connection is requested
2294  * @param[in] user_data The user data to be passed to the callback function
2295  * @return 0 on success, otherwise a negative error value.
2296  * @retval #BT_ERROR_NONE  Successful
2297  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2298  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2299  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2300  * @retval #BT_ERROR_RESOURCE_BUSY  Device or resource busy
2301  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2302  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2303  *
2304  * @see  bt_opp_server_connection_requested_cb()
2305  * @see  bt_opp_server_deinitialize()
2306  * @see  bt_opp_server_accept()
2307  * @see  bt_opp_server_reject()
2308  */
2309 int bt_opp_server_initialize_by_connection_request(const char *destination, bt_opp_server_connection_requested_cb connection_requested_cb, void *user_data);
2310
2311 /**
2312  * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2313  * @brief Deinitializes the Bluetooth OPP server.
2314  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2315  * @return 0 on success, otherwise a negative error value.
2316  * @retval #BT_ERROR_NONE  Successful
2317  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2318  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2319  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2320  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2321  *
2322  * @see  bt_opp_server_initialize_by_connection_request()
2323  */
2324 int bt_opp_server_deinitialize(void);
2325
2326 /**
2327  * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2328  * @brief Accepts the push request from the remote device.
2329  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2330  * @privlevel public
2331  * @privilege %http://tizen.org/privilege/bluetooth
2332  * @remarks If you initialize OPP server by bt_opp_server_initialize_by_connection_request(), then name is ignored.
2333  * You can cancel the pushes by bt_opp_server_cancel_transfer() with transfer_id.
2334  * @param[in] progress_cb  The callback called when a file is being transferred
2335  * @param[in] finished_cb  The callback called when a transfer is finished
2336  * @param[in] name  The name to store. This can be NULL if you initialize OPP server by bt_opp_server_initialize_by_connection_request().
2337  * @param[in] user_data The user data to be passed to the callback function
2338  * @param[out]  transfer_id  The ID of transfer
2339  * @return 0 on success, otherwise a negative error value.
2340  * @retval #BT_ERROR_NONE  Successful
2341  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2342  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2343  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2344  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2345  * @retval #BT_ERROR_NOW_IN_PROGRESS  Operation now in progress
2346  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2347  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2348  *
2349  * @see  bt_opp_server_reject()
2350  */
2351 int bt_opp_server_accept(bt_opp_server_transfer_progress_cb progress_cb,
2352         bt_opp_server_transfer_finished_cb finished_cb, const char *name,
2353         void *user_data, int *transfer_id);
2354
2355 /**
2356  * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2357  * @brief Rejects the push request from the remote device.
2358  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2359  * @privlevel public
2360  * @privilege %http://tizen.org/privilege/bluetooth
2361  * @return 0 on success, otherwise a negative error value.
2362  * @retval #BT_ERROR_NONE  Successful
2363  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2364  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2365  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2366  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2367  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2368  *
2369  * @see  bt_opp_server_accept()
2370  */
2371 int bt_opp_server_reject(void);
2372
2373 /**
2374  * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2375  * @brief Cancels the transfer.
2376  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2377  * @privlevel public
2378  * @privilege %http://tizen.org/privilege/bluetooth
2379  * @param[in] transfer_id  The ID of transfer
2380  * @return 0 on success, otherwise a negative error value.
2381  * @retval #BT_ERROR_NONE  Successful
2382  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2383  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2384  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2385  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2386  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2387  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2388  *
2389  * @see  bt_opp_server_accept()
2390  */
2391 int bt_opp_server_cancel_transfer(int transfer_id);
2392
2393 /**
2394  * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2395  * @brief Sets the destination path of file to be pushed.
2396  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2397  * @privlevel public
2398  * @privilege %http://tizen.org/privilege/bluetooth
2399  * @param[in] destination  The destination path of file to be pushed
2400  * @return 0 on success, otherwise a negative error value.
2401  * @retval #BT_ERROR_NONE  Successful
2402  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2403  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2404  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2405  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2406  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2407  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2408  */
2409 int bt_opp_server_set_destination(const char *destination);
2410
2411 /**
2412  * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2413  * @brief Initializes the Bluetooth OPP client.
2414  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2415  * @remarks This function must be called before Bluetooth OPP client starts. \n
2416  * You must free all resources of the Bluetooth service by calling bt_opp_client_deinitialize() \n
2417  * if Bluetooth OPP service is no longer needed.
2418  * @return 0 on success, otherwise a negative error value.
2419  * @retval #BT_ERROR_NONE  Successful
2420  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2421  * @retval #BT_ERROR_RESOURCE_BUSY  Device or resource busy
2422  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2423  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2424  *
2425  * @see  bt_opp_client_deinitialize()
2426  */
2427 int bt_opp_client_initialize(void);
2428
2429 /**
2430  * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2431  * @brief Deinitializes the Bluetooth OPP client.
2432  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2433  * @return 0 on success, otherwise a negative error value.
2434  * @retval #BT_ERROR_NONE  Successful
2435  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2436  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2437  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2438  *
2439  * @see  bt_opp_client_initialize()
2440  */
2441 int bt_opp_client_deinitialize(void);
2442
2443 /**
2444  * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2445  * @brief Adds file to be pushed.
2446  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2447  * @param[in] file  The path of file to be pushed
2448  * @return 0 on success, otherwise a negative error value.
2449  * @retval #BT_ERROR_NONE  Successful
2450  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2451  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2452  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2453  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2454  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2455  *
2456  * @see  bt_opp_client_clear_files()
2457  * @see  bt_opp_client_push_files()
2458  */
2459 int bt_opp_client_add_file(const char *file);
2460
2461 /**
2462  * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2463  * @brief Adds file to be pushed.
2464  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2465  * @return 0 on success, otherwise a negative error value.
2466  * @retval #BT_ERROR_NONE  Successful
2467  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2468  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2469  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2470  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2471  *
2472  * @see  bt_opp_client_add_file()
2473  * @see  bt_opp_client_push_files()
2474  */
2475 int bt_opp_client_clear_files(void);
2476
2477 /**
2478  * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2479  * @brief Pushes the file to the remote device, asynchronously.
2480  *
2481  * @details At first, bt_opp_client_push_responded_cb() will be called when OPP server responds to the push request. \n
2482  * After connection is established, bt_opp_client_push_progress_cb() will be called repeatedly until a file is transferred completely. \n
2483  * If you send several files, then bt_opp_client_push_progress_cb() with another file will be called repeatedly until the file is transferred completely. \n
2484  * bt_opp_client_push_finished_cb() will be called when the push request is finished.
2485  *
2486  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2487  * @privlevel public
2488  * @privilege %http://tizen.org/privilege/bluetooth
2489  * @param[in] remote_address The remote address
2490  * @param[in] responded_cb  The callback called when OPP server responds to the push request
2491  * @param[in] progress_cb  The callback called when each file is being transferred
2492  * @param[in] finished_cb  The callback called when the push request is finished
2493  * @param[in] user_data The user data to be passed to the callback function
2494  * @return 0 on success, otherwise a negative error value.
2495  * @retval #BT_ERROR_NONE  Successful
2496  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2497  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2498  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2499  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2500  * @retval #BT_ERROR_NOW_IN_PROGRESS  Operation now in progress
2501  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2502  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2503  *
2504  * @see bt_opp_client_initialize()
2505  * @see bt_opp_client_cancel_push()
2506  */
2507 int bt_opp_client_push_files(const char *remote_address,
2508         bt_opp_client_push_responded_cb responded_cb,
2509         bt_opp_client_push_progress_cb progress_cb,
2510         bt_opp_client_push_finished_cb finished_cb,
2511         void *user_data);
2512
2513 /**
2514  * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2515  * @brief Cancels the push request in progress, asynchronously.
2516  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2517  * @privlevel public
2518  * @privilege %http://tizen.org/privilege/bluetooth
2519  * @return 0 on success, otherwise a negative error value.
2520  * @retval #BT_ERROR_NONE  Successful
2521  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2522  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2523  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2524  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2525  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2526  *
2527  * @pre bt_opp_client_push_files() must be called.
2528  * @post bt_opp_client_push_finished_cb() will be invoked with result #BT_ERROR_CANCELLED,
2529  * which is a parameter of bt_opp_client_push_files().
2530  * @see bt_opp_client_initialize()
2531  * @see bt_opp_client_push_files()
2532  */
2533 int bt_opp_client_cancel_push(void);
2534
2535 /**
2536  * @if WEARABLE
2537  * @addtogroup CAPI_NETWORK_BLUETOOTH_HID_HOST_MODULE
2538  * @else
2539  * @addtogroup CAPI_NETWORK_BLUETOOTH_HID_MODULE
2540  * @endif
2541  * @{
2542  */
2543
2544 /**
2545  * @brief Initializes the Bluetooth HID (Human Interface Device) Host.
2546  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2547  * @remarks This function must be called before Bluetooth HID Host starts. \n
2548  * You must free all resources of the Bluetooth service by calling bt_hid_host_deinitialize() \n
2549  * if Bluetooth HID Host service is no longer needed.
2550  * @param[in] connection_cb  The callback called when the connection state is changed
2551  * @param[in] user_data The user data to be passed to the callback function
2552  * @return 0 on success, otherwise a negative error value.
2553  * @retval #BT_ERROR_NONE  Successful
2554  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2555  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2556  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2557  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2558  *
2559  * @pre The Bluetooth service must be initialized with bt_initialize().
2560  * @see bt_initialize()
2561  * @see  bt_hid_host_deinitialize()
2562  */
2563 int bt_hid_host_initialize(bt_hid_host_connection_state_changed_cb connection_cb, void *user_data);
2564
2565 /**
2566  * @brief Deinitializes the Bluetooth HID (Human Interface Device) Host.
2567  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2568  * @return 0 on success, otherwise a negative error value.
2569  * @retval #BT_ERROR_NONE  Successful
2570  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2571  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2572  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2573  *
2574  * @pre The Bluetooth HID service must be initialized with bt_hid_host_initialize().
2575  * @see  bt_hid_host_initialize()
2576  */
2577 int bt_hid_host_deinitialize(void);
2578
2579 /**
2580  * @brief Connects the remote device with the HID (Human Interface Device) service, asynchronously.
2581  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2582  * @privlevel public
2583  * @privilege %http://tizen.org/privilege/bluetooth
2584  * @param[in] remote_address  The remote address
2585  * @return 0 on success, otherwise a negative error value.
2586  * @retval #BT_ERROR_NONE  Successful
2587  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2588  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2589  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2590  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2591  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2592  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2593  *
2594  * @pre The local device must be bonded with the remote device by bt_device_create_bond().
2595  * @pre The Bluetooth HID service must be initialized with bt_hid_host_initialize().
2596  * @post bt_hid_host_connection_state_changed_cb() will be invoked.
2597  * @see bt_hid_host_disconnect()
2598  * @see bt_hid_host_connection_state_changed_cb()
2599  */
2600 int bt_hid_host_connect(const char *remote_address);
2601
2602 /**
2603  * @brief Disconnects the remote device with the HID (Human Interface Device) service, asynchronously.
2604  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2605  * @privlevel public
2606  * @privilege %http://tizen.org/privilege/bluetooth
2607  * @param[in] remote_address  The remote address
2608  * @return 0 on success, otherwise a negative error value.
2609  * @retval #BT_ERROR_NONE  Successful
2610  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2611  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2612  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2613  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
2614  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2615  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2616  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2617  *
2618  * @pre The remote device must be connected by bt_hid_host_connect().
2619  * @post bt_hid_host_connection_state_changed_cb() will be invoked.
2620  * @see bt_hid_host_connect()
2621  * @see bt_hid_host_connection_state_changed_cb()
2622  */
2623 int bt_hid_host_disconnect(const char *remote_address);
2624
2625 /**
2626  * @}
2627  */
2628
2629 /**
2630  * @WEARABLE_ONLY
2631  * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2632  * @brief Activates the Bluetooth HID Device role.
2633  * @since_tizen @if WEARABLE 3.0 @endif
2634  * @privlevel public
2635  * @privilege %http://tizen.org/privilege/bluetooth
2636  *
2637  * @remarks This function must be called to register HID UUID. \n
2638  * Only then a remote device is able to identify this one as a HID device.
2639  *
2640  * @param[in] callback  The callback called when the connection state is changed
2641  * @param[in] user_data The user data to be passed to the callback function
2642  * @return 0 on success, otherwise a negative error value.
2643  * @retval #BT_ERROR_NONE  Successful
2644  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2645  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2646  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2647  * @retval #BT_ERROR_NOW_IN_PROGRESS  Already activated
2648  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2649  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2650  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2651  *
2652  * @pre The Bluetooth service must be initialized with bt_initialize().
2653  * @see bt_initialize()
2654  * @see bt_hid_device_deactivate()
2655  */
2656 int bt_hid_device_activate(bt_hid_device_connection_state_changed_cb callback, void *user_data);
2657
2658 /**
2659  * @WEARABLE_ONLY
2660  * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2661  * @brief Deactivates the Bluetooth HID Device role.
2662  * @since_tizen @if WEARABLE 3.0 @endif
2663  * @privlevel public
2664  * @privilege %http://tizen.org/privilege/bluetooth
2665  *
2666  * @remarks This function must be called to deregister the HID UUID.
2667  *
2668  * @return 0 on success, otherwise a negative error value.
2669  * @retval #BT_ERROR_NONE  Successful
2670  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2671  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2672  * @retval #BT_ERROR_NOT_IN_PROGRESS  Not activated
2673  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2674  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2675  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2676  *
2677  * @pre The Bluetooth service must be initialized with bt_initialize().
2678  * @see bt_initialize()
2679  * @see bt_hid_device_activate()
2680  */
2681 int bt_hid_device_deactivate(void);
2682
2683 /**
2684  * @WEARABLE_ONLY
2685  * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2686  * @brief Initiates the HID device connection with the Device role, asynchronously.
2687  * @since_tizen @if WEARABLE 3.0 @endif
2688  * @privlevel public
2689  * @privilege %http://tizen.org/privilege/bluetooth
2690  *
2691  * @remarks This function must be called to Initiate the HID device role connection.
2692  *
2693  * @param[in] remote_address The remote device's address.
2694
2695  * @return 0 on success, otherwise a negative error value.
2696  * @retval #BT_ERROR_NONE  Successful
2697  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2698  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2699  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2700  * @retval #BT_ERROR_NOT_IN_PROGRESS  Not activated
2701  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2702  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2703  * @retval #BT_ERROR_ALREADY_DONE   Already connected
2704  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2705  *
2706  * @pre The Bluetooth service must be initialized with bt_initialize().
2707  * @pre The local device must be bonded with the remote device by bt_device_create_bond().
2708  * @see bt_initialize()
2709  * @see bt_hid_device_activate()
2710  */
2711 int bt_hid_device_connect(const char *remote_address);
2712
2713 /**
2714  * @WEARABLE_ONLY
2715  * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2716  * @brief Disconnects from the HID Host device, asynchronously.
2717  * @since_tizen @if WEARABLE 3.0 @endif
2718  * @privlevel public
2719  * @privilege %http://tizen.org/privilege/bluetooth
2720  *
2721  * @param[in] remote_address The remote device's address.
2722  * @return 0 on success, otherwise a negative error value.
2723  * @retval #BT_ERROR_NONE  Successful
2724  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2725  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2726  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2727  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
2728  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2729  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2730  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2731  *
2732  * @pre The Bluetooth service must be initialized with bt_initialize().
2733  * @see bt_initialize()
2734  * @see bt_hid_device_connection_state_changed_cb()
2735  */
2736 int bt_hid_device_disconnect(const char *remote_address);
2737
2738 /**
2739  * @WEARABLE_ONLY
2740  * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2741  * @brief Sends the mouse event data to the remote device.
2742  * @since_tizen @if WEARABLE 3.0 @endif
2743  * @privlevel public
2744  * @privilege %http://tizen.org/privilege/bluetooth
2745  *
2746  * @param[in] remote_address The remote device's address.
2747  * @param[in] mouse_data The mouse data to be passed to the remote device.
2748  *
2749  * @return the number of bytes written (zero indicates nothing was written).
2750  * @retval On error, -1 is returned, and errno is set appropriately. See write 2 man page.
2751  * @retval #BT_ERROR_NONE  Successful
2752  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2753  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2754  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2755  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2756  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2757  *
2758  * @pre The HID connection must be established.
2759  * @see bt_hid_device_connection_state_changed_cb()
2760  */
2761 int bt_hid_device_send_mouse_event(const char *remote_address,
2762                                         const bt_hid_mouse_data_s *mouse_data);
2763
2764 /**
2765  * @WEARABLE_ONLY
2766  * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2767  * @brief Sends the keyboard event data to the remote device.
2768  * @since_tizen @if WEARABLE 3.0 @endif
2769  * @privlevel public
2770  * @privilege %http://tizen.org/privilege/bluetooth
2771  *
2772  * @param[in] remote_address The remote device's address.
2773  * @param[in] key_data The key data to be passed to the remote device
2774  *
2775  * @return the number of bytes written (zero indicates nothing was written).
2776  * @retval On error, -1 is returned, and errno is set appropriately. See write 2 man page.
2777  * @retval #BT_ERROR_NONE  Successful
2778  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2779  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2780  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2781  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2782  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2783  *
2784  * @pre The HID connection must be established.
2785  * @see bt_hid_device_connection_state_changed_cb()
2786  */
2787 int bt_hid_device_send_key_event(const char *remote_address,
2788                                         const bt_hid_key_data_s *key_data);
2789
2790 /**
2791  * @WEARABLE_ONLY
2792  * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2793  * @brief Sets the callback called when the device receives data from the HID Host.
2794  * @since_tizen @if WEARABLE 3.0 @endif
2795  *
2796  * @param[in] callback The callback function to be set when data is received.
2797  * @param[in] user_data The user data to be passed to the callback.
2798  * @return 0 on success, otherwise a negative error value.
2799  * @retval #BT_ERROR_NONE  Successful
2800  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2801  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2802  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2803  *
2804  * @see bt_hid_device_connection_state_changed_cb()
2805  */
2806 int bt_hid_device_set_data_received_cb(bt_hid_device_data_received_cb callback, void *user_data);
2807
2808 /**
2809  * @WEARABLE_ONLY
2810  * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2811  * @brief Unsets the data received callback.
2812  * @since_tizen @if WEARABLE 3.0 @endif
2813  *
2814  * @return 0 on success, otherwise a negative error value.
2815  * @retval #BT_ERROR_NONE  Successful
2816  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2817  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2818  *
2819  * @see bt_hid_device_connection_state_changed_cb()
2820  */
2821 int bt_hid_device_unset_data_received_cb(void);
2822
2823 /**
2824  * @WEARABLE_ONLY
2825  * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2826  * @brief Responds to reports from the HID Host.
2827  * @since_tizen @if WEARABLE 3.0 @endif
2828  * @privlevel public
2829  * @privilege %http://tizen.org/privilege/bluetooth
2830  *
2831  * @param[in] remote_address The remote device's address.
2832  * @param[in] header_type The response header type
2833  * @param[in] param_type The response parameter type
2834  * @param[in] data The response data
2835  * @param[in] data_len The length of the response data
2836  *
2837  * @return the number of bytes written (zero indicates nothing was written).
2838  * @retval On error, -1 is returned, and errno is set appropriately. See write 2 man page.
2839  * @retval #BT_ERROR_NONE  Successful
2840  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2841  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2842  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2843  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2844  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2845  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2846  *
2847  * @pre The HID connection must be established.
2848  * @see bt_hid_device_connection_state_changed_cb()
2849  */
2850 int bt_hid_device_reply_to_report(const char *remote_address,
2851                                 bt_hid_header_type_e header_type,
2852                                 bt_hid_param_type_e param_type,
2853                                 const char *data, unsigned int data_len);
2854
2855 /**
2856  * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2857  * @brief Initializes the Bluetooth profiles related with audio.
2858  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2859  * @remarks This function must be called before Bluetooth profiles related with audio starts. \n
2860  * You must free all resources of the this service by calling bt_audio_deinitialize() \n
2861  * if Bluetooth profiles related with audio service is no longer needed.
2862  * @return 0 on success, otherwise a negative error value.
2863  * @retval #BT_ERROR_NONE  Successful
2864  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2865  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2866  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2867  *
2868  * @pre The Bluetooth service must be initialized with bt_initialize().
2869  * @see bt_initialize()
2870  * @see bt_audio_deinitialize()
2871  */
2872 int bt_audio_initialize(void);
2873
2874 /**
2875  * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2876  * @brief Deinitializes the Bluetooth profiles related with audio.
2877  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2878  * @return 0 on success, otherwise a negative error value.
2879  * @retval #BT_ERROR_NONE  Successful
2880  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2881  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2882  * @retval #BT_ERROR_NOT_SUPPORTED   Not supported
2883  *
2884  * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2885  * @see bt_audio_initialize()
2886  */
2887 int bt_audio_deinitialize(void);
2888
2889 /**
2890  * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2891  * @brief Connects the remote device with the given audio profile, asynchronously.
2892  * @details If you input type as #BT_AUDIO_PROFILE_TYPE_ALL and connection request succeeds, then bt_audio_connection_state_changed_cb() will be called twice \n
2893  * when #BT_AUDIO_PROFILE_TYPE_HSP_HFP is connected and #BT_AUDIO_PROFILE_TYPE_A2DP is connected.
2894  *
2895  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2896  * @privlevel public
2897  * @privilege %http://tizen.org/privilege/bluetooth
2898  * @param[in] remote_address  The remote address
2899  * @param[in] type  The type of audio profile
2900  * @return 0 on success, otherwise a negative error value.
2901  * @retval #BT_ERROR_NONE  Successful
2902  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2903  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2904  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2905  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2906  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2907  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
2908
2909  * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2910  * @pre The local device must be bonded with the remote device by bt_device_create_bond().
2911  * @post bt_audio_connection_state_changed_cb() will be invoked.
2912  * @see bt_audio_disconnect()
2913  * @see bt_audio_connection_state_changed_cb()
2914  */
2915 int bt_audio_connect(const char *remote_address, bt_audio_profile_type_e type);
2916
2917 /**
2918  * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2919  * @brief Disconnects the remote device with the given audio profile, asynchronously.
2920  * @details If you input type as #BT_AUDIO_PROFILE_TYPE_ALL and disconnection request succeeds, then bt_audio_connection_state_changed_cb() will be called twice \n
2921  * when #BT_AUDIO_PROFILE_TYPE_HSP_HFP is disconnected and #BT_AUDIO_PROFILE_TYPE_A2DP is disconnected.
2922  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2923  * @privlevel public
2924  * @privilege %http://tizen.org/privilege/bluetooth
2925  * @param[in] remote_address  The remote address
2926  * @param[in] type  The type of audio profile
2927  * @return 0 on success, otherwise a negative error value.
2928  * @retval #BT_ERROR_NONE  Successful
2929  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2930  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2931  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
2932  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2933  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
2934  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
2935  *
2936  * @pre The remote device must be connected by bt_audio_connect().
2937  * @post bt_audio_connection_state_changed_cb() will be invoked.
2938  * @see bt_audio_connect()
2939  * @see bt_audio_connection_state_changed_cb()
2940  */
2941 int bt_audio_disconnect(const char *remote_address, bt_audio_profile_type_e type);
2942
2943 /**
2944  * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2945  * @brief  Registers a callback function that will be invoked when the connection state is changed.
2946  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2947  * @param[in] callback The callback function to register
2948  * @param[in] user_data The user data to be passed to the callback function
2949  * @return   0 on success, otherwise a negative error value.
2950  * @retval #BT_ERROR_NONE  Successful
2951  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2952  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2953  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
2954  *
2955  * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2956  * @see bt_audio_initialize()
2957  * @see bt_audio_connection_state_changed_cb()
2958  */
2959 int bt_audio_set_connection_state_changed_cb(bt_audio_connection_state_changed_cb callback, void *user_data);
2960
2961 /**
2962  * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2963  * @brief  Unregisters a callback function that will be invoked when the connection state is changed.
2964  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2965  * @return   0 on success, otherwise a negative error value.
2966  * @retval #BT_ERROR_NONE  Successful
2967  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2968  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
2969  *
2970  * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2971  * @see bt_audio_initialize()
2972  * @see bt_audio_connection_state_changed_cb()
2973  * @see bt_audio_set_connection_state_changed_cb()
2974  */
2975 int bt_audio_unset_connection_state_changed_cb(void);
2976
2977 /**
2978  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
2979  * @brief Initializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) target service.
2980  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
2981  * @remarks This function must be called before any other AVRCP target functions are called. \n
2982  * You must free all resources of the this service by calling bt_avrcp_target_deinitialize() \n
2983  * if Bluetooth AVRCP service is no longer needed.
2984  * @param[in] callback The callback function called when the connection state is changed
2985  * @param[in] user_data The user data to be passed to the callback function
2986  * @return 0 on success, otherwise a negative error value.
2987  * @retval #BT_ERROR_NONE  Successful
2988  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
2989  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
2990  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
2991  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
2992  *
2993  * @pre The Bluetooth service must be initialized with bt_initialize().
2994  * @see bt_initialize()
2995  * @see bt_avrcp_target_deinitialize()
2996  */
2997 int bt_avrcp_target_initialize(bt_avrcp_target_connection_state_changed_cb callback, void *user_data);
2998
2999 /**
3000  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3001  * @brief Deinitializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) target service.
3002  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3003  * @return 0 on success, otherwise a negative error value.
3004  * @retval #BT_ERROR_NONE  Successful
3005  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3006  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3007  *
3008  * @pre The Bluetooth audio service must be initialized with bt_avrcp_target_initialize().
3009  * @see bt_avrcp_target_initialize()
3010  */
3011 int bt_avrcp_target_deinitialize(void);
3012
3013 /**
3014  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3015  * @brief  Notifies the equalizer state to the remote device.
3016  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3017  * @privlevel public
3018  * @privilege %http://tizen.org/privilege/bluetooth
3019  * @param[in] state The state of equalizer
3020  * @return   0 on success, otherwise a negative error value.
3021  * @retval #BT_ERROR_NONE  Successful
3022  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3023  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3024  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3025  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3026  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3027  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3028  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3029  *
3030  * @pre The remote device must be connected.
3031  * @see bt_avrcp_target_connection_state_changed_cb()
3032  * @see bt_avrcp_target_initialize()
3033  */
3034 int bt_avrcp_target_notify_equalizer_state(bt_avrcp_equalizer_state_e state);
3035
3036 /**
3037  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3038  * @brief  Notifies the repeat mode to the remote device.
3039  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3040  * @privlevel public
3041  * @privilege %http://tizen.org/privilege/bluetooth
3042  * @param[in] mode The repeat mode
3043  * @return   0 on success, otherwise a negative error value.
3044  * @retval #BT_ERROR_NONE  Successful
3045  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3046  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3047  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3048  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3049  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3050  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3051  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3052  *
3053  * @pre The remote device must be connected.
3054  * @see bt_avrcp_target_connection_state_changed_cb()
3055  * @see bt_avrcp_target_initialize()
3056  */
3057 int bt_avrcp_target_notify_repeat_mode(bt_avrcp_repeat_mode_e mode);
3058
3059 /**
3060  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3061  * @brief  Notifies the shuffle mode to the remote device.
3062  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3063  * @privlevel public
3064  * @privilege %http://tizen.org/privilege/bluetooth
3065  * @param[in] mode The repeat mode
3066  * @return   0 on success, otherwise a negative error value.
3067  * @retval #BT_ERROR_NONE  Successful
3068  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3069  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3070  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3071  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3072  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3073  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3074  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3075  *
3076  * @pre The remote device must be connected.
3077  * @see bt_avrcp_target_connection_state_changed_cb()
3078  * @see bt_avrcp_target_initialize()
3079  */
3080 int bt_avrcp_target_notify_shuffle_mode(bt_avrcp_shuffle_mode_e mode);
3081
3082 /**
3083  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3084  * @brief  Notifies the scan mode to the remote device.
3085  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3086  * @privlevel public
3087  * @privilege %http://tizen.org/privilege/bluetooth
3088  * @param[in] mode The scan mode
3089  * @return   0 on success, otherwise a negative error value.
3090  * @retval #BT_ERROR_NONE  Successful
3091  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3092  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3093  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3094  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3095  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3096  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3097  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3098  *
3099  * @pre The remote device must be connected.
3100  * @see bt_avrcp_target_connection_state_changed_cb()
3101  * @see bt_avrcp_target_initialize()
3102  */
3103 int bt_avrcp_target_notify_scan_mode(bt_avrcp_scan_mode_e mode);
3104
3105 /**
3106  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3107  * @brief  Notifies the player state to the remote device.
3108  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3109  * @privlevel public
3110  * @privilege %http://tizen.org/privilege/bluetooth
3111  * @param[in] state The player state
3112  * @return   0 on success, otherwise a negative error value.
3113  * @retval #BT_ERROR_NONE  Successful
3114  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3115  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3116  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3117  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3118  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3119  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3120  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3121  *
3122  * @pre The remote device must be connected.
3123  * @see bt_avrcp_target_connection_state_changed_cb()
3124  * @see bt_avrcp_target_initialize()
3125  */
3126 int bt_avrcp_target_notify_player_state(bt_avrcp_player_state_e state);
3127
3128 /**
3129  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3130  * @brief  Notifies the current position of song to the remote device.
3131  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3132  * @privlevel public
3133  * @privilege %http://tizen.org/privilege/bluetooth
3134  * @param[in] position The current position in milliseconds
3135  * @return  0 on success, otherwise a negative error value.
3136  * @retval #BT_ERROR_NONE  Successful
3137  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3138  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3139  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3140  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3141  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3142  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3143  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3144  *
3145  * @pre The remote device must be connected.
3146  * @see bt_avrcp_target_connection_state_changed_cb()
3147  * @see bt_avrcp_target_initialize()
3148  */
3149 int bt_avrcp_target_notify_position(unsigned int position);
3150
3151 /**
3152  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3153  * @brief  Notifies the track to the remote device.
3154  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3155  * @privlevel public
3156  * @privilege %http://tizen.org/privilege/bluetooth
3157  * @param[in] title The title of track
3158  * @param[in] artist The artist of track
3159  * @param[in] album The album of track
3160  * @param[in] genre The genre of track
3161  * @param[in] track_num The track number
3162  * @param[in] total_tracks The number of all tracks
3163  * @param[in] duration The duration of track in milliseconds
3164  * @return   0 on success, otherwise a negative error value.
3165  * @retval #BT_ERROR_NONE  Successful
3166  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3167  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3168  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3169  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3170  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3171  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3172  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3173  *
3174  * @pre The remote device must be connected.
3175  * @see bt_avrcp_target_connection_state_changed_cb()
3176  * @see bt_avrcp_target_initialize()
3177  */
3178 int bt_avrcp_target_notify_track(const char *title, const char *artist, const char *album, const char *genre, unsigned int track_num, unsigned int total_tracks, unsigned int duration);
3179
3180 /**
3181  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3182  * @brief  Registers a callback function that will be invoked when the equalizer state is changed. (e.g., by a TV remote control or other input devices).
3183  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3184  * @param[in] callback The callback function to register
3185  * @param[in] user_data The user data to be passed to the callback function
3186  * @return   0 on success, otherwise a negative error value.
3187  * @retval #BT_ERROR_NONE  Successful
3188  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3189  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3190  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3191  *
3192  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3193  * @see bt_avrcp_target_initialize()
3194  * @see bt_avrcp_control_initialize()
3195  * @see bt_avrcp_unset_equalizer_state_changed_cb()
3196  */
3197 int bt_avrcp_set_equalizer_state_changed_cb(bt_avrcp_equalizer_state_changed_cb callback, void *user_data);
3198
3199 /**
3200  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3201  * @brief  Unregisters a callback function that will be invoked when the equalizer state is changed. (e.g., by a TV remote control or other input devices).
3202  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3203  * @return   0 on success, otherwise a negative error value.
3204  * @retval #BT_ERROR_NONE  Successful
3205  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3206  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3207  *
3208  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3209  * @see bt_avrcp_target_initialize()
3210  * @see bt_avrcp_control_initialize()
3211  * @see bt_avrcp_set_equalizer_state_changed_cb()
3212  */
3213 int bt_avrcp_unset_equalizer_state_changed_cb(void);
3214
3215 /**
3216  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3217  * @brief  Registers a callback function that will be invoked when the repeat mode is changed. (e.g., by a TV remote control or other input devices).
3218  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3219  * @param[in] callback The callback function to register
3220  * @param[in] user_data The user data to be passed to the callback function
3221  * @return   0 on success, otherwise a negative error value.
3222  * @retval #BT_ERROR_NONE  Successful
3223  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3224  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3225  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3226  *
3227  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3228  * @see bt_avrcp_target_initialize()
3229  * @see bt_avrcp_control_initialize()
3230  * @see bt_avrcp_unset_repeat_mode_changed_cb()
3231  */
3232 int bt_avrcp_set_repeat_mode_changed_cb(bt_avrcp_repeat_mode_changed_cb callback, void *user_data);
3233
3234 /**
3235  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3236  * @brief  Unregisters a callback function that will be invoked when the repeat mode is changed. (e.g., by a TV remote control or other input devices).
3237  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3238  * @return   0 on success, otherwise a negative error value.
3239  * @retval #BT_ERROR_NONE  Successful
3240  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3241  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3242  *
3243  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3244  * @see bt_avrcp_target_initialize()
3245  * @see bt_avrcp_control_initialize()
3246  * @see bt_avrcp_set_repeat_mode_changed_cb()
3247  */
3248 int bt_avrcp_unset_repeat_mode_changed_cb(void);
3249
3250 /**
3251  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3252  * @brief  Registers a callback function that will be invoked when the shuffle mode is changed. (e.g., by a TV remote control or other input devices).
3253  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3254  * @param[in] callback The callback function to register
3255  * @param[in] user_data The user data to be passed to the callback function
3256  * @return   0 on success, otherwise a negative error value.
3257  * @retval #BT_ERROR_NONE  Successful
3258  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3259  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3260  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3261  *
3262  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3263  * @see bt_avrcp_target_initialize()
3264  * @see bt_avrcp_control_initialize()
3265  * @see bt_avrcp_unset_shuffle_mode_changed_cb()
3266  */
3267 int bt_avrcp_set_shuffle_mode_changed_cb(bt_avrcp_shuffle_mode_changed_cb callback, void *user_data);
3268
3269 /**
3270  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3271  * @brief  Unregisters a callback function that will be invoked when the shuffle mode is changed. (e.g., by a TV remote control or other input devices).
3272  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3273  * @return   0 on success, otherwise a negative error value.
3274  * @retval #BT_ERROR_NONE  Successful
3275  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3276  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3277  *
3278  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3279  * @see bt_avrcp_target_initialize()
3280  * @see bt_avrcp_control_initialize()
3281  * @see bt_avrcp_set_shuffle_mode_changed_cb()
3282  */
3283 int bt_avrcp_unset_shuffle_mode_changed_cb(void);
3284
3285 /**
3286  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3287  * @brief  Registers a callback function that will be invoked when the scan mode is changed. (e.g., by a TV remote control or other input devices).
3288  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3289  * @param[in] callback The callback function to register
3290  * @param[in] user_data The user data to be passed to the callback function
3291  * @return   0 on success, otherwise a negative error value.
3292  * @retval #BT_ERROR_NONE  Successful
3293  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3294  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3295  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3296  *
3297  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3298  * @see bt_avrcp_target_initialize()
3299  * @see bt_avrcp_control_initialize()
3300  * @see bt_avrcp_unset_scan_mode_changed_cb()
3301  */
3302 int bt_avrcp_set_scan_mode_changed_cb(bt_avrcp_scan_mode_changed_cb callback, void *user_data);
3303
3304 /**
3305  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3306  * @brief  Unregisters a callback function that will be invoked when the scan mode is changed. (e.g., by a TV remote control or other input devices).
3307  * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3308  * @return   0 on success, otherwise a negative error value.
3309  * @retval #BT_ERROR_NONE  Successful
3310  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3311  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3312  *
3313  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3314  * @see bt_avrcp_target_initialize()
3315  * @see bt_avrcp_control_initialize()
3316  * @see bt_avrcp_set_scan_mode_changed_cb()
3317  */
3318 int bt_avrcp_unset_scan_mode_changed_cb(void);
3319
3320 /**
3321  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3322  * @brief  Registers a callback function that will be invoked when the song position is changed. (e.g., by a TV remote control or other input devices).
3323  * @since_tizen 3.0
3324  * @param[in] callback The callback function to register
3325  * @param[in] user_data The user data to be passed to the callback function
3326  * @return   0 on success, otherwise a negative error value.
3327  * @retval #BT_ERROR_NONE  Successful
3328  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3329  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3330  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3331  *
3332  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3333  * @see bt_avrcp_target_initialize()
3334  * @see bt_avrcp_control_initialize()
3335  * @see bt_avrcp_unset_position_changed_cb()
3336  */
3337 int bt_avrcp_set_position_changed_cb(bt_avrcp_position_changed_cb callback, void *user_data);
3338
3339 /**
3340  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3341  * @brief  Unregisters a callback function that will be invoked when the song position is changed. (e.g., by a TV remote control or other input devices).
3342  * @since_tizen 3.0
3343  * @return   0 on success, otherwise a negative error value.
3344  * @retval #BT_ERROR_NONE  Successful
3345  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3346  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3347  *
3348  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3349  * @see bt_avrcp_target_initialize()
3350  * @see bt_avrcp_control_initialize()
3351  * @see bt_avrcp_set_position_changed_cb()
3352  */
3353 int bt_avrcp_unset_position_changed_cb(void);
3354
3355 /**
3356  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3357  * @brief  Registers a callback function that will be invoked when the Play status is changed. (e.g., by a TV remote control or other input devices).
3358  * @since_tizen 3.0
3359  * @param[in] callback The callback function to register
3360  * @param[in] user_data The user data to be passed to the callback function
3361  * @return   0 on success, otherwise a negative error value.
3362  * @retval #BT_ERROR_NONE  Successful
3363  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3364  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3365  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3366  *
3367  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3368  * @see bt_avrcp_target_initialize()
3369  * @see bt_avrcp_control_initialize()
3370  * @see bt_avrcp_unset_play_status_changed_cb()
3371  */
3372 int bt_avrcp_set_play_status_changed_cb(bt_avrcp_play_status_changed_cb callback, void *user_data);
3373
3374 /**
3375  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3376  * @brief  Unregisters a callback function that will be invoked when the Play status is changed. (e.g., by a TV remote control or other input devices).
3377  * @since_tizen 3.0
3378  * @return   0 on success, otherwise a negative error value.
3379  * @retval #BT_ERROR_NONE  Successful
3380  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3381  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3382  *
3383  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3384  * @see bt_avrcp_target_initialize()
3385  * @see bt_avrcp_control_initialize()
3386  * @see bt_avrcp_set_play_status_changed_cb()
3387  */
3388 int bt_avrcp_unset_play_status_changed_cb(void);
3389
3390 /**
3391  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3392  * @brief  Registers a callback function that will be invoked when the track metadata is changed. (e.g., by a TV remote control or other input devices).
3393  * @since_tizen 3.0
3394  * @param[in] callback The callback function to register
3395  * @param[in] user_data The user data to be passed to the callback function
3396  * @return   0 on success, otherwise a negative error value.
3397  * @retval #BT_ERROR_NONE  Successful
3398  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3399  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3400  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3401  *
3402  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3403  * @see bt_avrcp_target_initialize()
3404  * @see bt_avrcp_control_initialize()
3405  * @see bt_avrcp_unset_track_info_changed_cb()
3406  */
3407 int bt_avrcp_set_track_info_changed_cb(bt_avrcp_track_info_changed_cb callback, void *user_data);
3408
3409 /**
3410  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3411  * @brief  Unregisters a callback function that will be invoked when the track metadata is changed. (e.g., by a TV remote control or other input devices).
3412  * @since_tizen 3.0
3413  * @return   0 on success, otherwise a negative error value.
3414  * @retval #BT_ERROR_NONE  Successful
3415  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3416  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3417  *
3418  * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3419  * @see bt_avrcp_target_initialize()
3420  * @see bt_avrcp_control_initialize()
3421  * @see bt_avrcp_set_track_info_changed_cb()
3422  */
3423 int bt_avrcp_unset_track_info_changed_cb(void);
3424
3425 /**
3426  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3427  * @brief Initializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) controller service.
3428  * @since_tizen 3.0
3429  * @remarks This function must be called before any other AVRCP controller functions are called. \n
3430  * You must free all resources of the this service by calling bt_avrcp_control_deinitialize() \n
3431  * if Bluetooth AVRCP service is no longer needed.
3432  * @param[in] callback The callback function called when the connection state is changed
3433  * @param[in] user_data The user data to be passed to the callback function
3434  * @return 0 on success, otherwise a negative error value.
3435  * @retval #BT_ERROR_NONE  Successful
3436  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3437  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3438  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3439  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3440  * @pre The Bluetooth service must be initialized with bt_initialize().
3441  * @see bt_initialize()
3442  * @see bt_avrcp_control_deinitialize()
3443  */
3444 int bt_avrcp_control_initialize(bt_avrcp_control_connection_state_changed_cb callback, void *user_data);
3445
3446 /**
3447  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3448  * @brief Deinitializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) controller service.
3449  * @since_tizen 3.0
3450  * @return 0 on success, otherwise a negative error value.
3451  * @retval #BT_ERROR_NONE  Successful
3452  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3453  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3454  * @pre The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
3455  * @see bt_avrcp_control_initialize()
3456  */
3457 int bt_avrcp_control_deinitialize(void);
3458
3459 /**
3460  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3461  * @brief Connects the AVRCP (Audio/Video Remote Control Profile) target device.
3462  * @since_tizen 3.0
3463  * @privlevel public
3464  * @privilege %http://tizen.org/privilege/bluetooth
3465  * @param[in] remote_address  The remote address
3466  * @return 0 on success, otherwise a negative error value.
3467  * @retval #BT_ERROR_NONE  Successful
3468  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3469  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3470  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3471  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3472  * @pre The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
3473  * @see bt_avrcp_control_initialize()
3474  */
3475 int bt_avrcp_control_connect(const char *remote_address);
3476
3477 /**
3478  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3479  * @brief Disconnects from the AVRCP (Audio/Video Remote Control Profile) target device.
3480  * @since_tizen 3.0
3481  * @privlevel public
3482  * @privilege %http://tizen.org/privilege/bluetooth
3483  * @param[in] remote_address  The remote address
3484  * @return 0 on success, otherwise a negative error value.
3485  * @retval #BT_ERROR_NONE  Successful
3486  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3487  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3488  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3489  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3490  * @pre The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
3491  * @see bt_avrcp_control_initialize()
3492  * @see bt_avrcp_control_connect()
3493  */
3494 int bt_avrcp_control_disconnect(const char *remote_address);
3495
3496 /**
3497  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3498  * @brief Sends a command to the target device.
3499  * @since_tizen 3.0
3500  * @privlevel public
3501  * @privilege %http://tizen.org/privilege/bluetooth
3502  * @param[in] cmd The commands, one of: Play, Pause, Next, Rewind.
3503  * @return 0 on success, otherwise a negative error value.
3504  * @retval #BT_ERROR_NONE  Successful
3505  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3506  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3507  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3508  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3509  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3510  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3511  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3512  * @pre The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
3513  * @see bt_avrcp_control_initialize()
3514  * @see bt_avrcp_control_connect()
3515  */
3516 int bt_avrcp_control_send_player_command(bt_avrcp_player_command_e cmd);
3517
3518 /**
3519  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3520  * @brief  Sends the equalizer state change request to the remote device.
3521  * @since_tizen 3.0
3522  * @privlevel public
3523  * @privilege %http://tizen.org/privilege/bluetooth
3524  * @param[in] state The new equalizer state, one of: ON, OFF
3525  * @return  0 on success, otherwise a negative error value.
3526  * @retval #BT_ERROR_NONE  Successful
3527  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3528  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3529  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3530  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3531  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3532  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3533  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3534  *
3535  * @pre The remote device must be connected.
3536  * @see bt_avrcp_target_connection_state_changed_cb()
3537  * @see bt_avrcp_target_initialize()
3538  */
3539 int bt_avrcp_control_set_equalizer_state(bt_avrcp_equalizer_state_e state);
3540
3541 /**
3542  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3543  * @brief  Gets the the equalizer state of the remote device.
3544  * @since_tizen 3.0
3545  * @param[out] state The equalizer state, one of: ON, OFF
3546  * @return  0 on success, otherwise a negative error value.
3547  * @retval #BT_ERROR_NONE  Successful
3548  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3549  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3550  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3551  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3552  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3553  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3554  *
3555  * @pre The remote device must be connected.
3556  * @see bt_avrcp_target_connection_state_changed_cb()
3557  * @see bt_avrcp_target_initialize()
3558  */
3559 int bt_avrcp_control_get_equalizer_state(bt_avrcp_equalizer_state_e *state);
3560
3561 /**
3562  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3563  * @brief  Sends the repeat change request to the remote device.
3564  * @since_tizen 3.0
3565  * @privlevel public
3566  * @privilege %http://tizen.org/privilege/bluetooth
3567  * @param[in] mode The new repeat mode, one of: OFF, SINGLE, ALL
3568  * @return  0 on success, otherwise a negative error value.
3569  * @retval #BT_ERROR_NONE  Successful
3570  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3571  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3572  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3573  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3574  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3575  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3576  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3577  *
3578  * @pre The remote device must be connected.
3579  * @see bt_avrcp_target_connection_state_changed_cb()
3580  * @see bt_avrcp_target_initialize()
3581  */
3582 int bt_avrcp_control_set_repeat_mode(bt_avrcp_repeat_mode_e mode);
3583
3584 /**
3585  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3586  * @brief  Gets the repeat state of the remote device.
3587  * @since_tizen 3.0
3588  * @param[out] mode The repeat mode, one of: OFF, SINGLE, ALL
3589  * @return  0 on success, otherwise a negative error value.
3590  * @retval #BT_ERROR_NONE  Successful
3591  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3592  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3593  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3594  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3595  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3596  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3597  *
3598  * @pre The remote device must be connected.
3599  * @see bt_avrcp_target_connection_state_changed_cb()
3600  * @see bt_avrcp_target_initialize()
3601  */
3602 int bt_avrcp_control_get_repeat_mode(bt_avrcp_repeat_mode_e *mode);
3603
3604 /**
3605  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3606  * @brief  Sends the shuffle mode change request to the remote device.
3607  * @since_tizen 3.0
3608  * @privlevel public
3609  * @privilege %http://tizen.org/privilege/bluetooth
3610  * @param[in] mode The new shuffle mode, one of: OFF, GROUP, ALL
3611  * @return  0 on success, otherwise a negative error value.
3612  * @retval #BT_ERROR_NONE  Successful
3613  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3614  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3615  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3616  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3617  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3618  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3619  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3620  *
3621  * @pre The remote device must be connected.
3622  * @see bt_avrcp_target_connection_state_changed_cb()
3623  * @see bt_avrcp_target_initialize()
3624  */
3625 int bt_avrcp_control_set_shuffle_mode(bt_avrcp_shuffle_mode_e mode);
3626
3627 /**
3628  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3629  * @brief  Gets the shuffle mode of the remote device.
3630  * @since_tizen 3.0
3631  * @param[out] mode The shuffle mode, one of: OFF, GROUP, ALL
3632  * @return  0 on success, otherwise a negative error value.
3633  * @retval #BT_ERROR_NONE  Successful
3634  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3635  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3636  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3637  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3638  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3639  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3640  *
3641  * @pre The remote device must be connected.
3642  * @see bt_avrcp_target_connection_state_changed_cb()
3643  * @see bt_avrcp_target_initialize()
3644  */
3645 int bt_avrcp_control_get_shuffle_mode(bt_avrcp_shuffle_mode_e *mode);
3646
3647 /**
3648  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3649  * @brief  Sends the scan mode change request to the remote device.
3650  * @since_tizen 3.0
3651  * @privlevel public
3652  * @privilege %http://tizen.org/privilege/bluetooth
3653  * @param[in] mode The new scan mode, one of: OFF, GROUP, ALL
3654  * @return  0 on success, otherwise a negative error value.
3655  * @retval #BT_ERROR_NONE  Successful
3656  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3657  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3658  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3659  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3660  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3661  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3662  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3663  *
3664  * @pre The remote device must be connected.
3665  * @see bt_avrcp_target_connection_state_changed_cb()
3666  * @see bt_avrcp_target_initialize()
3667  */
3668 int bt_avrcp_control_set_scan_mode(bt_avrcp_scan_mode_e mode);
3669
3670 /**
3671  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3672  * @brief  Gets the scan mode of the remote device.
3673  * @since_tizen 3.0
3674  * @param[out] mode The scan mode, one of: OFF, GROUP, ALL
3675  * @return  0 on success, otherwise a negative error value.
3676  * @retval #BT_ERROR_NONE  Successful
3677  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3678  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3679  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3680  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3681  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3682  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3683  *
3684  * @pre The remote device must be connected.
3685  * @see bt_avrcp_target_connection_state_changed_cb()
3686  * @see bt_avrcp_target_initialize()
3687  */
3688 int bt_avrcp_control_get_scan_mode(bt_avrcp_scan_mode_e *mode);
3689
3690 /**
3691  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3692  * @brief  Gets the position of the song played by the remote device.
3693  * @since_tizen 3.0
3694  * @param[out] position The position, in milliseconds
3695  * @return  0 on success, otherwise a negative error value.
3696  * @retval #BT_ERROR_NONE  Successful
3697  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3698  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3699  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3700  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3701  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3702  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3703  *
3704  * @pre The remote device must be connected.
3705  * @see bt_avrcp_target_connection_state_changed_cb()
3706  * @see bt_avrcp_target_initialize()
3707  */
3708 int bt_avrcp_control_get_position(unsigned int *position);
3709
3710 /**
3711  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3712  * @brief  Gets the play status of the remote device.
3713  * @since_tizen 3.0
3714  * @param[out] status The play status, one of: PLAYING, STOPPED...
3715  * @return  0 on success, otherwise a negative error value.
3716  * @retval #BT_ERROR_NONE  Successful
3717  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3718  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3719  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3720  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3721  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3722  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3723  *
3724  * @pre The remote device must be connected.
3725  * @see bt_avrcp_target_connection_state_changed_cb()
3726  * @see bt_avrcp_target_initialize()
3727  */
3728 int bt_avrcp_control_get_play_status(bt_avrcp_player_state_e *status);
3729
3730 /**
3731  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3732  * @brief  Gets the metadata of the track played by the remote device.
3733  * @since_tizen 3.0
3734  * @remarks The @a track must be released using bt_avrcp_control_free_track_info().
3735  * @param[out] track The track metadata.
3736  * @return  0 on success, otherwise a negative error value.
3737  * @retval #BT_ERROR_NONE  Successful
3738  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3739  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3740  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3741  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3742  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3743  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3744  *
3745  * @pre The remote device must be connected.
3746  * @see bt_avrcp_target_connection_state_changed_cb()
3747  * @see bt_avrcp_target_initialize()
3748  */
3749 int bt_avrcp_control_get_track_info(bt_avrcp_metadata_attributes_info_s **track);
3750
3751 /**
3752  * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3753  * @brief  Frees the track metadata.
3754  * @since_tizen 3.0
3755  * @param[in] track The track metadata.
3756  * @return  0 on success, otherwise a negative error value.
3757  * @retval #BT_ERROR_NONE  Successful
3758  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3759  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3760  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3761  * @pre track should point to valid metadata address.
3762  * @see bt_avrcp_control_get_track_info()
3763  * @see bt_avrcp_target_initialize()
3764  */
3765 int bt_avrcp_control_free_track_info(bt_avrcp_metadata_attributes_info_s *track);
3766
3767 /**
3768  * @deprecated Deprecated since 5.0.
3769  * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3770  * @brief Registers an application that acts as the Sink role of HDP (Health Device Profile).
3771  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3772  * @privlevel public
3773  * @privilege %http://tizen.org/privilege/bluetooth
3774  * @remarks The @a app_id must be released with free() by you. \n
3775  *          Deprecated, because of no usecase and supported devices.
3776  * @param[in] data_type  The data type of MDEP. This value is defined in ISO/IEEE 11073-20601 spec.
3777  * For example, pulse oximeter is 0x1004 and blood pressure monitor is 0x1007.
3778  * @param[out] app_id  The ID of application
3779  * @return 0 on success, otherwise a negative error value.
3780  * @retval #BT_ERROR_NONE  Successful
3781  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3782  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3783  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
3784  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3785  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3786  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3787  *
3788  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
3789  * @see bt_hdp_unregister_sink_app()
3790  */
3791 int bt_hdp_register_sink_app(unsigned short data_type, char **app_id) TIZEN_DEPRECATED_API;
3792
3793 /**
3794  * @deprecated Deprecated since 5.0.
3795  * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3796  * @brief Unregisters the given application that acts as the Sink role of HDP (Health Device Profile).
3797  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3798  * @privlevel public
3799  * @privilege %http://tizen.org/privilege/bluetooth
3800  * @remarks Deprecated, because of no usecase and supported devices.
3801  * @param[in] app_id  The ID of application
3802  * @return 0 on success, otherwise a negative error value.
3803  * @retval #BT_ERROR_NONE  Successful
3804  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3805  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3806  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3807  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3808  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3809  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3810  *
3811  * @see bt_hdp_register_sink_app()
3812  */
3813 int bt_hdp_unregister_sink_app(const char *app_id) TIZEN_DEPRECATED_API;
3814
3815 /**
3816  * @deprecated Deprecated since 5.0.
3817  * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3818  * @brief Connects the remote device which acts as Source role, asynchronously.
3819  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3820  * @privlevel public
3821  * @privilege %http://tizen.org/privilege/bluetooth
3822  * @remarks Deprecated, because of no usecase and supported devices.
3823  * @param[in] remote_address  The remote address
3824  * @param[in] app_id  The ID of application
3825  * @return 0 on success, otherwise a negative error value.
3826  * @retval #BT_ERROR_NONE  Successful
3827  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3828  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3829  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3830  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
3831  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3832  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3833  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3834  *
3835  * @pre The Sink role of HDP must be registered with bt_hdp_register_sink_app().
3836  * @pre The local device must be bonded with the remote device by bt_device_create_bond().
3837  * @post bt_hdp_connected_cb() will be invoked.
3838  * @see bt_hdp_disconnect()
3839  * @see bt_hdp_set_connection_state_changed_cb()
3840  * @see bt_hdp_unset_connection_state_changed_cb()
3841  */
3842 int bt_hdp_connect_to_source(const char *remote_address, const char *app_id) TIZEN_DEPRECATED_API;
3843
3844 /**
3845  * @deprecated Deprecated since 5.0.
3846  * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3847  * @brief Disconnects the remote device, asynchronously.
3848  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3849  * @privlevel public
3850  * @privilege %http://tizen.org/privilege/bluetooth
3851  * @remarks Deprecated, because of no usecase and supported devices.
3852  * @param[in] remote_address  The remote address
3853  * @param[in] channel  The connected data channel
3854  * @return 0 on success, otherwise a negative error value.
3855  * @retval #BT_ERROR_NONE  Successful
3856  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3857  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3858  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3859  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
3860  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
3861  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3862  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3863  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3864  *
3865  * @pre The remote device must be connected.
3866  * @post bt_hdp_disconnected_cb() will be invoked.
3867  * @see bt_hdp_set_connection_state_changed_cb()
3868  * @see bt_hdp_unset_connection_state_changed_cb()
3869  */
3870 int bt_hdp_disconnect(const char *remote_address, unsigned int channel) TIZEN_DEPRECATED_API;
3871
3872 /**
3873  * @deprecated Deprecated since 5.0.
3874  * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3875  * @brief Sends the data to the remote device.
3876  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3877  * @privlevel public
3878  * @privilege %http://tizen.org/privilege/bluetooth
3879  * @remarks Deprecated, because of no usecase and supported devices.
3880  * @param[in] channel  The connected data channel
3881  * @param[in] data  The data to send
3882  * @param[in] size  The size of data to send (byte)
3883  * @return 0 on success, otherwise a negative error value.
3884  * @retval #BT_ERROR_NONE  Successful
3885  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3886  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3887  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
3888  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
3889  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
3890  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3891  *
3892  * @pre The remote device must be connected.
3893  * @see bt_hdp_data_received_cb()
3894  * @see bt_hdp_set_data_received_cb()
3895  * @see bt_hdp_unset_data_received_cb()
3896  */
3897 int bt_hdp_send_data(unsigned int channel, const char *data, unsigned int size) TIZEN_DEPRECATED_API;
3898
3899 /**
3900  * @deprecated Deprecated since 5.0.
3901  * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3902  * @brief  Registers a callback function that will be invoked when the connection state is changed.
3903  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3904  * @remarks Deprecated, because of no usecase and supported devices.
3905  * @param[in] connected_cb The callback function called when a connection is established
3906  * @param[in] disconnected_cb The callback function called when a connection is disconnected
3907  * @param[in] user_data The user data to be passed to the callback function
3908  * @return   0 on success, otherwise a negative error value.
3909  * @retval #BT_ERROR_NONE  Successful
3910  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3911  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3912  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3913  *
3914  * @pre The Bluetooth service must be initialized with bt_initialize().
3915  * @see bt_hdp_unset_connection_state_changed_cb()
3916  */
3917 int bt_hdp_set_connection_state_changed_cb(bt_hdp_connected_cb connected_cb, bt_hdp_disconnected_cb disconnected_cb, void *user_data) TIZEN_DEPRECATED_API;
3918
3919 /**
3920  * @deprecated Deprecated since 5.0.
3921  * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3922  * @brief  Unregisters a callback function that will be invoked when the connection state is changed.
3923  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3924  * @remarks Deprecated, because of no usecase and supported devices.
3925  * @return   0 on success, otherwise a negative error value.
3926  * @retval #BT_ERROR_NONE  Successful
3927  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3928  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3929  *
3930  * @pre The Bluetooth service must be initialized with bt_initialize().
3931  * @see bt_hdp_set_connection_state_changed_cb()
3932  */
3933 int bt_hdp_unset_connection_state_changed_cb(void) TIZEN_DEPRECATED_API;
3934
3935 /**
3936  * @deprecated Deprecated since 5.0.
3937  * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3938  * @brief  Registers a callback function that will be invoked when you receive the data.
3939  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3940  * @remarks Deprecated, because of no usecase and supported devices.
3941  * @param[in] callback The callback function to register
3942  * @param[in] user_data The user data to be passed to the callback function
3943  * @return   0 on success, otherwise a negative error value.
3944  * @retval #BT_ERROR_NONE  Successful
3945  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3946  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3947  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3948  *
3949  * @pre The Bluetooth service must be initialized with bt_initialize().
3950  * @see bt_hdp_unset_data_received_cb()
3951  */
3952 int bt_hdp_set_data_received_cb(bt_hdp_data_received_cb callback, void *user_data) TIZEN_DEPRECATED_API;
3953
3954 /**
3955  * @deprecated Deprecated since 5.0.
3956  * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3957  * @brief  Unregisters a callback function that will be invoked when you receive the data.
3958  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3959  * @remarks Deprecated, because of no usecase and supported devices.
3960  * @return   0 on success, otherwise a negative error value.
3961  * @retval #BT_ERROR_NONE  Successful
3962  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
3963  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3964  *
3965  * @pre The Bluetooth service must be initialized with bt_initialize().
3966  * @see bt_hdp_set_data_received_cb()
3967  */
3968 int bt_hdp_unset_data_received_cb(void) TIZEN_DEPRECATED_API;
3969
3970 /**
3971  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3972  * @brief  Gets the value of a characteristic or descriptor's GATT handle.
3973  * @since_tizen 2.3.1
3974  *
3975  * @remarks @a value must be released using free(). \n
3976  * When @a gatt_handle is associated with bt_gatt_client_h, bt_gatt_client_read_value() must be used prior to this function \n
3977  * in order to get the remote device's current value.
3978  *
3979  * @param[in] gatt_handle The handle of a characteristic or descriptor
3980  * @param[out] value The value of @a gatt_handle. It is a byte stream type.
3981  * @param[out] value_length The length of @a value
3982  * @return  0 on success, otherwise a negative error value
3983  * @retval #BT_ERROR_NONE  Successful
3984  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
3985  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
3986  */
3987 int bt_gatt_get_value(bt_gatt_h gatt_handle, char **value, int *value_length);
3988
3989 /**
3990  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3991  * @brief  Gets the value of a characteristic or descriptor's GATT handle as an integer type.
3992  * @since_tizen 2.3.1
3993  *
3994  * @remarks This function returns a locally saved value in @a gatt_handle. \n
3995  * When @a gatt_handle is associated with bt_gatt_client_h, bt_gatt_client_read_value() must be used prior to this function \n
3996  * in order to get the remote device's current value.
3997  *
3998  * @param[in] gatt_handle The handle of a characteristic or descriptor
3999  * @param[in] type The type of a saved value in @a gatt_handle
4000  * @param[in] offset The offset from where a value will be read from @a gatt_handle as an integer type
4001  * @param[out] value The integer type's value of @a gatt_handle
4002  * @return  0 on success, otherwise a negative error value
4003  * @retval #BT_ERROR_NONE  Successful
4004  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4005  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4006  */
4007 int bt_gatt_get_int_value(bt_gatt_h gatt_handle, bt_data_type_int_e type,
4008                         int offset, int *value);
4009
4010 /**
4011  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4012  * @brief  Gets the value of a characteristic or descriptor's GATT handle as a float type.
4013  * @since_tizen 2.3.1
4014  *
4015  * @remarks This function returns a locally saved value in @a gatt_handle. \n
4016  * When @a gatt_handle is associated with bt_gatt_client_h, bt_gatt_client_read_value() must be used prior to this function \n
4017  * in order to get the remote device's current value.
4018  *
4019  * @param[in] gatt_handle  The handle of a characteristic or descriptor
4020  * @param[in] type The type of a saved value in @a gatt_handle
4021  * @param[in] offset The offset from where a value will be read from @a gatt_handle as an integer type
4022  * @param[out] value The float type's value of @a gatt_handle
4023  * @return  0 on success, otherwise a negative error value
4024  * @retval #BT_ERROR_NONE  Successful
4025  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4026  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4027  */
4028 int bt_gatt_get_float_value(bt_gatt_h gatt_handle, bt_data_type_float_e type,
4029                         int offset, float *value);
4030
4031 /**
4032  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4033  * @brief  Updates the value of a characteristic or descriptor's GATT handle.
4034  * @since_tizen 2.3.1
4035  *
4036  * @remarks This function updates a value of @a gatt_handle locally. \n
4037  * When @a gatt_handle is associated with bt_gatt_client_h, bt_gatt_client_write_value() can be used after this function \n
4038  * in order to update the remote device's value. \n
4039  *
4040  * @param[in] gatt_handle The handle of a characteristic or descriptor
4041  * @param[in] value The value to be updated
4042  * @param[in] value_length The length of @a value
4043  * @return  0 on success, otherwise a negative error value
4044  * @retval #BT_ERROR_NONE  Successful
4045  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4046  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
4047  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4048  */
4049 int bt_gatt_set_value(bt_gatt_h gatt_handle, const char *value, int value_length);
4050
4051 /**
4052  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4053  * @brief  Updates the value of a characteristic or descriptor's GATT handle using a integer type's value.
4054  * @since_tizen 2.3.1
4055  *
4056  * @remarks This function updates a value of @a gatt_handle locally. \n
4057  * When @a gatt_handle is associated with bt_gatt_client_h, bt_gatt_client_write_value() can be used after this function \n
4058  * in order to update the remote device's value.
4059  *
4060  * @param[in] gatt_handle The handle of a characteristic or descriptor
4061  * @param[in] type @a value will be saved in @a gatt_handle as this type
4062  * @param[in] value The integer type's value to be updated
4063  * @param[in] offset The offset from where @a value will be saved in @a gatt_handle
4064  * @return  0 on success, otherwise a negative error value
4065  * @retval #BT_ERROR_NONE  Successful
4066  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4067  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
4068  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4069  */
4070 int bt_gatt_set_int_value(bt_gatt_h gatt_handle, bt_data_type_int_e type,
4071                         int value, int offset);
4072
4073 /**
4074  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4075  * @brief  Updates the value of a characteristic or descriptor's GATT handle using a float type's value.
4076  * @since_tizen 2.3.1
4077  *
4078  * @remarks This function updates a value of @a gatt_handle locally. \n
4079  * When @a gatt_handle is associated with bt_gatt_client_h, bt_gatt_client_write_value() can be used after this function \n
4080  * in order to update the remote device's value.
4081  *
4082  * @param[in] gatt_handle The handle of a characteristic or descriptor
4083  * @param[in] type @a mantissa and @a exponent will be saved in @a gatt_handle as this type
4084  * @param[in] mantissa The mantissa of float type's value to be updated
4085  * @param[in] exponent The exponent of float type's value to be updated
4086  * @param[in] offset The offset from where @a mantissa and @a exponent will be saved in @a gatt_handle
4087  * @return  0 on success, otherwise a negative error value
4088  * @retval #BT_ERROR_NONE  Successful
4089  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4090  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
4091  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4092  */
4093 int bt_gatt_set_float_value(bt_gatt_h gatt_handle, bt_data_type_float_e type,
4094                         int mantissa, int exponent, int offset);
4095
4096 /**
4097  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4098  * @brief  Gets the UUID of a service, characteristic or descriptor's GATT handle.
4099  * @since_tizen 2.3.1
4100  *
4101  * @remarks @a uuid must be released using free(). \n
4102  * 16-bit UUID or 128-bit UUID is supported. (e.g. 2A19, 00002A19-0000-1000-8000-00805F9B34FB).
4103  *
4104  * @param[in] gatt_handle The handle of a service, characteristic or descriptor
4105  * @param[out] uuid The string of the UUID of @a gatt_handle
4106  * @return  0 on success, otherwise a negative error value
4107  * @retval #BT_ERROR_NONE  Successful
4108  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4109  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4110  */
4111 int bt_gatt_get_uuid(bt_gatt_h gatt_handle, char **uuid);
4112
4113 /**
4114  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4115  * @brief  Gets the type of GATT handle.
4116  * @since_tizen 2.3.1
4117  *
4118  * @param[in] gatt_handle The GATT handle
4119  * @param[out] gatt_type The type of @a gatt_handle
4120  * @return  0 on success, otherwise a negative error value
4121  * @retval #BT_ERROR_NONE  Successful
4122  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4123  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4124  */
4125 int bt_gatt_get_type(bt_gatt_h gatt_handle, bt_gatt_type_e *gatt_type);
4126
4127 /**
4128  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4129  * @brief  Gets the GATT client handle which the specified service belongs to.
4130  * @since_tizen 2.3.1
4131  *
4132  * @remarks This function doesn't allocate new memory for GATT client handle. \n
4133  * The returned GATT client handle is the same one which was got from bt_gatt_client_create(). \n
4134  * So if it is destroyed by bt_gatt_client_destroy(), all related GATT handles are freed also.
4135  *
4136  * @param[in] service The service's GATT handle
4137  * @param[out] client The GATT client handle which @a service belongs to
4138  * @return  0 on success, otherwise a negative error value
4139  * @retval #BT_ERROR_NONE Successful
4140  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4141  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4142  *
4143  * @see bt_gatt_client_create()
4144  */
4145 int bt_gatt_service_get_client(bt_gatt_h service, bt_gatt_client_h *client);
4146
4147 /**
4148  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4149  * @brief  Gets a characteristic's GATT handle which has specific UUID.
4150  * @since_tizen 2.3.1
4151  *
4152  * @remarks The returned GATT handle must not be freed by application. \n
4153  * It will be freed when an associated client is destroyed by bt_gatt_client_destroy(). \n
4154  * If there are multiple characteristics which have same UUID, only the first matched one will be returned.
4155  *
4156  * @param[in] service The service's GATT handle
4157  * @param[in] uuid The characteristic's GATT handle which has this UUID will be returned if it exists
4158  * @param[out] characteristic The characteristic's GATT handle which has @a uuid if it exists
4159  * @return  0 on success, otherwise a negative error value
4160  * @retval #BT_ERROR_NONE Successful
4161  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4162  * @retval #BT_ERROR_NO_DATA  No data available
4163  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4164  */
4165 int bt_gatt_service_get_characteristic(bt_gatt_h service, const char *uuid,
4166                                         bt_gatt_h *characteristic);
4167
4168 /**
4169  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4170  * @brief  Invokes @a callback function on each characteristic that belongs to the specified service.
4171  * @since_tizen 2.3.1
4172  *
4173  * @param[in] service The service's GATT handle
4174  * @param[in] callback The function to be invoked on each characteristic
4175  * @param[in] user_data The user data to be passed to @a callback function
4176  * @return  0 on success, otherwise a negative error value
4177  * @retval #BT_ERROR_NONE Successful
4178  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4179  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4180  *
4181  * @see bt_gatt_foreach_cb()
4182  */
4183 int bt_gatt_service_foreach_characteristics(bt_gatt_h service,
4184                                         bt_gatt_foreach_cb callback, void *user_data);
4185
4186 /**
4187  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4188  * @brief  Gets an included service's GATT handle which has specific UUID.
4189  * @since_tizen 2.3.1
4190  *
4191  * @remarks The returned GATT handle must not be freed by application. \n
4192  * It will be freed when an associated client is destroyed by bt_gatt_client_destroy(). \n
4193  * If there are multiple included services which have same UUID, only the first matched one will be returned.
4194  *
4195  * @param[in] service The service's GATT handle
4196  * @param[in] uuid The included service's GATT handle which has this UUID will be returned if it exists
4197  * @param[out] included_service The included service's GATT handle which has @a uuid if it exists
4198  * @return  0 on success, otherwise a negative error value
4199  * @retval #BT_ERROR_NONE Successful
4200  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4201  * @retval #BT_ERROR_NO_DATA  No data available
4202  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4203  */
4204 int bt_gatt_service_get_included_service(bt_gatt_h service, const char *uuid,
4205                                                 bt_gatt_h *included_service);
4206
4207 /**
4208  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4209  * @brief  Invokes @a callback function on each included service that belongs to the specified service.
4210  * @since_tizen 2.3.1
4211  *
4212  * @param[in] service The service's GATT handle
4213  * @param[in] callback The function to be invoked on each included service
4214  * @param[in] user_data The user data to be passed to the callback function
4215  * @return  0 on success, otherwise a negative error value
4216  * @retval #BT_ERROR_NONE Successful
4217  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4218  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4219  *
4220  * @see bt_gatt_foreach_cb()
4221  */
4222 int bt_gatt_service_foreach_included_services(bt_gatt_h service,
4223                                         bt_gatt_foreach_cb callback, void *user_data);
4224
4225 /**
4226  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4227  * @brief  Gets the service's GATT handle which the specified characteristic belongs to.
4228  * @since_tizen 2.3.1
4229  *
4230  * @remarks The returned GATT handle must not be freed by application. \n
4231  * It will be freed when an associated client is destroyed by bt_gatt_client_destroy().
4232  *
4233  * @param[in] characteristic The characteristic's GATT handle
4234  * @param[out] service The service's GATT handle which @a characteristic belongs to
4235  * @return  0 on success, otherwise a negative error value
4236  * @retval #BT_ERROR_NONE Successful
4237  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4238  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4239  */
4240 int bt_gatt_characteristic_get_service(bt_gatt_h characteristic, bt_gatt_h *service);
4241
4242 /**
4243  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4244  * @brief  Gets the properties which a characteristic's GATT handle has.
4245  * @since_tizen 2.3.1
4246  *
4247  * @param[in] characteristic The characteristic's GATT handle
4248  * @param[out] properties The properties which a characteristic's GATT handle has
4249  * @return  0 on success, otherwise a negative error value
4250  * @retval #BT_ERROR_NONE Successful
4251  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4252  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4253  *
4254  * @see bt_gatt_property_e
4255  */
4256 int bt_gatt_characteristic_get_properties(bt_gatt_h characteristic, int *properties);
4257
4258 /**
4259  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4260  * @brief Gets the write type of the specified characteristic.
4261  * @since_tizen 2.3.1
4262  *
4263  * @param[in] characteristic The characteristic's GATT handle
4264  * @param[out] write_type The write type of the specified characteristic
4265  * @return  0 on success, otherwise a negative error value
4266  * @retval #BT_ERROR_NONE Successful
4267  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4268  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4269  *
4270  * @see bt_gatt_write_type_e
4271  */
4272 int bt_gatt_characteristic_get_write_type(bt_gatt_h characteristic,
4273                                         bt_gatt_write_type_e *write_type);
4274
4275 /**
4276  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4277  * @brief  Updates the write type of the specified characteristic.
4278  * @since_tizen 2.3.1
4279  *
4280  * @param[in] characteristic The characteristic's GATT handle
4281  * @param[in] write_type The write type to be updated
4282  * @return  0 on success, otherwise a negative error value
4283  * @retval #BT_ERROR_NONE Successful
4284  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4285  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4286  *
4287  * @see bt_gatt_client_write_value()
4288  * @see bt_gatt_write_type_e
4289  */
4290 int bt_gatt_characteristic_set_write_type(bt_gatt_h characteristic,
4291                                         bt_gatt_write_type_e write_type);
4292
4293 /**
4294  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4295  * @brief  Gets a descriptor's GATT handle which has specific UUID.
4296  * @since_tizen 2.3.1
4297  *
4298  * @remarks The returned GATT handle must not be freed by application. \n
4299  * It will be freed when an associated client is destroyed by bt_gatt_client_destroy(). \n
4300  * If there are multiple descriptors which have same UUID, only the first matched one will be returned.
4301  *
4302  * @param[in] characteristic The characteristic's GATT handle
4303  * @param[in] uuid The descriptor's GATT handle which has this UUID will be returned if it exists
4304  * @param[out] descriptor The descriptor's GATT handle which has @a uuid if it exists
4305  * @return  0 on success, otherwise a negative error value
4306  * @retval #BT_ERROR_NONE Successful
4307  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4308  * @retval #BT_ERROR_NO_DATA  No data available
4309  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4310  */
4311 int bt_gatt_characteristic_get_descriptor(bt_gatt_h characteristic, const char *uuid,
4312                                                 bt_gatt_h *descriptor);
4313
4314 /**
4315  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4316  * @brief  Invokes @a callback function on each descriptor that belongs to the specified characteristic.
4317  * @since_tizen 2.3.1
4318  *
4319  * @param[in] characteristic The characteristic's GATT handle
4320  * @param[in] callback The function to be invoked on each descriptor
4321  * @param[in] user_data The user data to be passed to @a callback function
4322  * @return  0 on success, otherwise a negative error value
4323  * @retval #BT_ERROR_NONE Successful
4324  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4325  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4326  *
4327  * @see bt_gatt_foreach_cb()
4328  */
4329 int bt_gatt_characteristic_foreach_descriptors(bt_gatt_h characteristic,
4330                                         bt_gatt_foreach_cb callback, void *user_data);
4331
4332 /**
4333  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4334  * @brief  Gets the characteristic's GATT handle which the specified descriptor belongs to.
4335  * @since_tizen 2.3.1
4336  *
4337  * @remarks The returned GATT handle must not be freed by application. \n
4338  * It will be freed when an associated client is destroyed by bt_gatt_client_destroy().
4339  *
4340  * @param[in] descriptor The descriptor's GATT handle
4341  * @param[out] characteristic The characteristic's GATT handle which @a descriptor belongs to
4342  * @return  0 on success, otherwise a negative error value
4343  * @retval #BT_ERROR_NONE Successful
4344  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4345  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4346  */
4347 int bt_gatt_descriptor_get_characteristic(bt_gatt_h descriptor, bt_gatt_h *characteristic);
4348
4349 /**
4350  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4351  * @brief  Creates the GATT client handle.
4352  * @since_tizen 2.3.1
4353  *
4354  * @remarks The GATT client handle must be freed by bt_gatt_client_destroy() after use.
4355  *
4356  * @param[in] remote_address The address of the remote device
4357  * @param[out] client The created GATT client's handle
4358  * @return  0 on success, otherwise a negative error value
4359  * @retval #BT_ERROR_NONE Successful
4360  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4361  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
4362  * @retval #BT_ERROR_ALREADY_DONE  Operation is already done
4363  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4364  *
4365  * @see bt_gatt_client_destroy()
4366  */
4367 int bt_gatt_client_create(const char *remote_address, bt_gatt_client_h *client);
4368
4369 /**
4370  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4371  * @brief  Destroys the GATT client's handle.
4372  * @since_tizen 2.3.1
4373  *
4374  * @remarks All related service, characteristic and descriptor's GATT handles are freed also.
4375  *
4376  * @param[in] client The GATT client's handle
4377  * @return  0 on success, otherwise a negative error value
4378  * @retval #BT_ERROR_NONE Successful
4379  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4380  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4381  *
4382  * @see bt_gatt_client_create()
4383  */
4384 int bt_gatt_client_destroy(bt_gatt_client_h client);
4385
4386 /**
4387  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4388  * @brief  Gets the address of remote device.
4389  * @since_tizen 2.3.1
4390  *
4391  * @param[in] client The created GATT client's handle
4392  * @param[out] remote_address The address of the remote device which is associated with @a client
4393  * @return  0 on success, otherwise a negative error value
4394  * @retval #BT_ERROR_NONE Successful
4395  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4396  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4397  *
4398  * @see bt_gatt_client_create()
4399  */
4400 int bt_gatt_client_get_remote_address(bt_gatt_client_h client,
4401                                         char **remote_address);
4402
4403 /**
4404  * @ingroup  CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4405  * @brief  Reads the value of a characteristic or descriptor from the remote device asynchronously.
4406  * @since_tizen 2.3.1
4407  * @privlevel public
4408  * @privilege %http://tizen.org/privilege/bluetooth
4409  *
4410  * @param[in] gatt_handle The GATT handle of a characteristic or descriptor
4411  * @param[in] callback When a read request is completed, this callback function will be called
4412  * @param[in] user_data The user data to be passed to @a callback function
4413  * @return  0 on success, otherwise a negative error value
4414  * @retval #BT_ERROR_NONE       Successful
4415  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4416  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4417  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
4418  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
4419  * @retval #BT_ERROR_NOW_IN_PROGRESS  Operation now in progress
4420  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
4421  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4422  *
4423  * @see bt_gatt_client_create()
4424  * @see bt_gatt_client_request_completed_cb()
4425  */
4426 int bt_gatt_client_read_value(bt_gatt_h gatt_handle,
4427                 bt_gatt_client_request_completed_cb callback, void *user_data);
4428
4429 /**
4430  * @ingroup  CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4431  * @brief  Writes the value of a characteristic or descriptor to the remote device asynchronously.
4432  * @since_tizen 2.3.1
4433  * @privlevel public
4434  * @privilege %http://tizen.org/privilege/bluetooth
4435  *
4436  * @param[in] gatt_handle The GATT handle of a characteristic or descriptor
4437  * @param[in] callback When a write request is completed, this callback function will be called
4438  * @param[in] user_data The user data to be passed to @a callback function
4439  * @return  0 on success, otherwise a negative error value
4440  * @retval #BT_ERROR_NONE       Successful
4441  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4442  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4443  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
4444  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
4445  * @retval #BT_ERROR_NOW_IN_PROGRESS  Operation now in progress
4446  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
4447  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4448  *
4449  * @see bt_gatt_client_create()
4450  * @see bt_gatt_characteristic_set_write_type()
4451  * @see bt_gatt_set_value()
4452  * @see bt_gatt_set_int_value()
4453  * @see bt_gatt_set_float_value()
4454  * @see bt_gatt_client_request_completed_cb()
4455  */
4456 int bt_gatt_client_write_value(bt_gatt_h gatt_handle,
4457                 bt_gatt_client_request_completed_cb callback, void *user_data);
4458
4459 /**
4460  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4461  * @brief Requests a change of the ATT MTU value.
4462  * @since_tizen 4.0
4463  * @privlevel public
4464  * @privilege %http://tizen.org/privilege/bluetooth
4465  *
4466  * @param[in] client The created GATT client's handle
4467  * @param[in] mtu The new MTU value
4468  *
4469  * @return 0 on success, otherwise a negative error value.
4470  * @retval #BT_ERROR_NONE  Successful
4471  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4472  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4473  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
4474  * @retval #BT_ERROR_OPERATION_FAILED   Operation failed
4475  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
4476  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4477  * @see bt_gatt_client_set_att_mtu_changed_cb()
4478  */
4479 int bt_gatt_client_request_att_mtu_change(bt_gatt_client_h client, unsigned int mtu);
4480
4481 /**
4482  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4483  * @brief Gets the ATT MTU value set for a connection.
4484  * @since_tizen 4.0
4485  *
4486  * @param[in] client The created GATT client's handle
4487  * @param[out] mtu The MTU value set for a connection
4488  *
4489  * @return 0 on success, otherwise a negative error value.
4490  * @retval #BT_ERROR_NONE  Successful
4491  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4492  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4493  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
4494  * @retval #BT_ERROR_OPERATION_FAILED   Operation failed
4495  * @retval #BT_ERROR_NOT_SUPPORTED      Not supported
4496  * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED  Remote device is not connected
4497  */
4498 int bt_gatt_client_get_att_mtu(bt_gatt_client_h client, unsigned int *mtu);
4499
4500 /**
4501  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4502  * @brief  Registers a callback function to be invoked when the ATT MTU is changed.
4503  * @since_tizen 4.0
4504  * @param[in] client The created GATT client's handle
4505  * @param[in] callback The callback function to register
4506  * @param[in] user_data The user data to be passed to the callback function
4507  * @return 0 on success, otherwise a negative error value.
4508  * @retval #BT_ERROR_NONE  Successful
4509  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4510  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4511  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4512  *
4513  * @pre The Bluetooth service must be initialized with bt_initialize().
4514  * @post bt_device_connection_state_changed_cb() will be invoked.
4515  * @see bt_initialize()
4516  * @see bt_gatt_client_request_att_mtu_change()
4517  * @see bt_gatt_client_unset_att_mtu_changed_cb()
4518  */
4519 int bt_gatt_client_set_att_mtu_changed_cb(bt_gatt_client_h client, bt_gatt_client_att_mtu_changed_cb callback, void *user_data);
4520
4521 /**
4522  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4523  * @brief Unregisters the callback function to be invoked when the ATT MTU is changed.
4524  * @since_tizen 4.0
4525  * @param[in] client The created GATT client's handle
4526  * @return 0 on success, otherwise a negative error value.
4527  * @retval #BT_ERROR_NONE  Successful
4528  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4529  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4530  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4531  *
4532  * @pre The Bluetooth service must be initialized with bt_initialize().
4533  * @see bt_initialize()
4534  * @see bt_gatt_client_request_att_mtu_change()
4535  * @see bt_gatt_client_set_att_mtu_changed_cb()
4536  */
4537 int bt_gatt_client_unset_att_mtu_changed_cb(bt_gatt_client_h client);
4538
4539 /**
4540  * @ingroup  CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4541  * @brief  Registers a callback function to be invoked when the characteristic value is changed on the remote device.
4542  * @since_tizen 2.3.1
4543  *
4544  * @param[in] characteristic The characteristic's GATT handle
4545  * @param[in] callback The callback to be invoked when the value is changed and it is informed
4546  * @param[in] user_data The user data to be passed to @a callback function
4547  * @return  0 on success, otherwise a negative error value
4548  * @retval #BT_ERROR_NONE       Successful
4549  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4550  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4551  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4552  *
4553  * @see bt_gatt_client_characteristic_value_changed_cb()
4554  * @see bt_gatt_client_unset_characteristic_value_changed_cb()
4555  */
4556 int bt_gatt_client_set_characteristic_value_changed_cb(bt_gatt_h characteristic,
4557                 bt_gatt_client_characteristic_value_changed_cb callback,
4558                 void *user_data);
4559
4560 /**
4561  * @ingroup  CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4562  * @brief  Unregisters a callback function to be invoked when the characteristic value is changed on the remote device.
4563  * @since_tizen 2.3.1
4564  *
4565  * @param[in] characteristic The characteristic's GATT handle, whose value change will not be informed
4566  * @return  0 on success, otherwise a negative error value
4567  * @retval #BT_ERROR_NONE       Successful
4568  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4569  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4570  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4571  *
4572  * @see bt_gatt_client_set_characteristic_value_changed_cb()
4573  */
4574 int bt_gatt_client_unset_characteristic_value_changed_cb(bt_gatt_h characteristic);
4575
4576 /**
4577  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4578  * @brief  Gets a service's GATT handle which has specific UUID.
4579  * @since_tizen 2.3.1
4580  *
4581  * @remarks The returned GATT handle must not be freed by application. \n
4582  * It will be freed when an associated client is destroyed by bt_gatt_client_destroy(). \n
4583  * If there are multiple services which have same UUID, only the first matched one will be returned.
4584  *
4585  * @param[in] client The GATT client's handle
4586  * @param[in] uuid The service's GATT handle which has this UUID will be returned if it exists
4587  * @param[out] service The service's GATT handle which has @a uuid if it exists
4588  * @return  0 on success, otherwise a negative error value
4589  * @retval #BT_ERROR_NONE Successful
4590  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4591  * @retval #BT_ERROR_NO_DATA  No data available
4592  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4593  */
4594 int bt_gatt_client_get_service(bt_gatt_client_h client, const char *uuid,
4595                                 bt_gatt_h *service);
4596
4597 /**
4598  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4599  * @brief  Invokes @a callback function on each service that belongs to the specified GATT client.
4600  * @since_tizen 2.3.1
4601  *
4602  * @param[in] client The GATT client's handle
4603  * @param[in] callback The function to be invoked on each service
4604  * @param[in] user_data The user data to be passed to @a callback function
4605  * @return  0 on success, otherwise a negative error value
4606  * @retval #BT_ERROR_NONE Successful
4607  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4608  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4609  *
4610  * @see bt_gatt_foreach_cb()
4611  */
4612 int bt_gatt_client_foreach_services(bt_gatt_client_h client,
4613                                     bt_gatt_foreach_cb callback, void *user_data);
4614
4615 /**
4616  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4617  * @brief  Registers a callback function to be invoked when service is changed from a remote device(GATT server).
4618  * @since_tizen 3.0
4619  *
4620  * @param[in] client The GATT client's handle
4621  * @param[in] callback The callback to be invoked
4622  * @param[in] user_data The user data to be passed to @a callback function
4623  * @return  0 on success, otherwise a negative error value
4624  * @retval #BT_ERROR_NONE Successful
4625  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4626  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4627  *
4628  * @see bt_gatt_client_unset_service_changed_cb()
4629  */
4630 int bt_gatt_client_set_service_changed_cb(bt_gatt_client_h client,
4631                 bt_gatt_client_service_changed_cb callback, void *user_data);
4632
4633 /**
4634  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4635  * @brief  Unregisters a callback function.
4636  * @since_tizen 3.0
4637  *
4638  * @param[in] client The GATT client's handle
4639  * @return  0 on success, otherwise a negative error value
4640  * @retval #BT_ERROR_NONE Successful
4641  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4642  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4643  *
4644  * @see bt_gatt_client_set_service_changed_cb()
4645  */
4646 int bt_gatt_client_unset_service_changed_cb(bt_gatt_client_h client);
4647
4648 /**
4649  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4650  * @brief Connects to a specific LE based service on a remote bluetooth device address, asynchronously.
4651  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
4652  * @privlevel public
4653  * @privilege %http://tizen.org/privilege/bluetooth
4654  *
4655  * @remarks A connection can be disconnected by bt_gatt_disconnect().
4656  *
4657  * @param[in] address The address of the remote Bluetooth device.
4658  * @param[in] auto_connect The flag of the auto connection.
4659  *
4660  * @return 0 on success, otherwise a negative error value.
4661  * @retval #BT_ERROR_NONE  Successful
4662  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4663  * @retval #BT_ERROR_NOT_ENABLED Not enabled
4664  * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4665  * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4666  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
4667  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4668  *
4669  * @pre The Bluetooth service must be initialized with bt_initialize().
4670  * @pre The remote device must support le connection.
4671  * @post This function invokes bt_gatt_connection_state_changed_cb().
4672  *
4673  * @see bt_initialize()
4674  * @see bt_gatt_disconnect()
4675  * @see bt_gatt_set_connection_state_changed_cb()
4676  * @see bt_gatt_unset_connection_state_changed_cb()
4677  * @see bt_gatt_connection_state_changed_cb()
4678  */
4679 int bt_gatt_connect(const char *address, bool auto_connect);
4680
4681 /**
4682  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4683  * @brief Disconnects to LE connection with the given remote Bluetooth device address, asynchronously or cancels a LE connection attempt currently in progress.
4684  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
4685  * @privlevel public
4686  * @privilege %http://tizen.org/privilege/bluetooth
4687  *
4688  * @param[in] address The address of the remote Bluetooth device
4689  *
4690  * @return 0 on success, otherwise a negative error value.
4691  * @retval #BT_ERROR_NONE  Successful
4692  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4693  * @retval #BT_ERROR_NOT_ENABLED Not enabled
4694  * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4695  * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4696  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
4697  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4698  *
4699  * @post This function invokes bt_gatt_connection_state_changed_cb().
4700  *
4701  * @see bt_initialize()
4702  * @see bt_gatt_connect()
4703  * @see bt_gatt_set_connection_state_changed_cb()
4704  * @see bt_gatt_unset_connection_state_changed_cb()
4705  * @see bt_gatt_connection_state_changed_cb()
4706  */
4707 int bt_gatt_disconnect(const char *address);
4708
4709 /**
4710  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4711  * @brief Registers a callback function that will be invoked when the connection state is changed.
4712  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
4713  *
4714  * @param[in] callback The callback function to register.
4715  * @param[in] user_data The user data to be passed  to the callback function.
4716  *
4717  * @return 0 on success, otherwise a negative error value.
4718  * @retval #BT_ERROR_NONE  Successful
4719  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4720  * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4721  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4722  *
4723  * @see bt_gatt_connect()
4724  * @see bt_gatt_disconnect()
4725  * @see bt_gatt_unset_connection_state_changed_cb()
4726  */
4727 int bt_gatt_set_connection_state_changed_cb(bt_gatt_connection_state_changed_cb callback, void *user_data);
4728
4729 /**
4730  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4731  * @brief Unregisters a callback function that will be invoked when the connection state is changed.
4732  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
4733  *
4734  * @return 0 on success, otherwise a negative error value.
4735  * @retval #BT_ERROR_NONE  Successful
4736  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4737  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4738  *
4739  * @see bt_gatt_connect()
4740  * @see bt_gatt_disconnect()
4741  * @see bt_gatt_connection_state_changed_cb()
4742  */
4743 int bt_gatt_unset_connection_state_changed_cb(void);
4744
4745 /**
4746  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4747  * @brief Destroys the GATT handle of service.
4748  * @since_tizen 3.0
4749  *
4750  * @param[in] gatt_handle The handle of service
4751  * @return  0 on success, otherwise a negative error value
4752  * @retval #BT_ERROR_NONE  Successful
4753  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4754  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4755  *
4756  * @see bt_gatt_service_create()
4757  */
4758 int bt_gatt_service_destroy(bt_gatt_h gatt_handle);
4759
4760 /**
4761  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4762  * @brief Destroys the GATT handle of characteristic.
4763  * @since_tizen 3.0
4764  *
4765  * @param[in] gatt_handle The handle of characteristic
4766  * @return  0 on success, otherwise a negative error value
4767  * @retval #BT_ERROR_NONE  Successful
4768  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4769  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4770  *
4771  * @see bt_gatt_characteristic_create()
4772  */
4773 int bt_gatt_characteristic_destroy(bt_gatt_h gatt_handle);
4774
4775 /**
4776  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4777  * @brief Destroys the GATT handle of descriptor.
4778  * @since_tizen 3.0
4779  *
4780  * @param[in] gatt_handle The handle of descriptor
4781  * @return  0 on success, otherwise a negative error value
4782  * @retval #BT_ERROR_NONE  Successful
4783  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4784  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4785  *
4786  * @see bt_gatt_descriptor_create()
4787  */
4788 int bt_gatt_descriptor_destroy(bt_gatt_h gatt_handle);
4789
4790 /**
4791  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4792  * @brief  Gets the permissions which a characteristic's GATT handle has.
4793  * @since_tizen 3.0
4794  *
4795  * @remarks The @a permissions can be one or more values of #bt_gatt_permission_e, combined with bitwise 'or'.
4796  *
4797  * @param[in] gatt_handle The handle of a characteristic
4798  * @param[out] permissions The permissions which a characteristic's GATT handle has
4799  * @return  0 on success, otherwise a negative error value
4800  * @retval #BT_ERROR_NONE  Successful
4801  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4802  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4803  *
4804  * @see bt_gatt_characteristic_create()
4805  * @see bt_gatt_permission_e
4806  */
4807 int bt_gatt_characteristic_get_permissions(bt_gatt_h gatt_handle, int *permissions);
4808
4809 /**
4810  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4811  * @brief  Gets the permissions which a descriptor's GATT handle has.
4812  * @since_tizen 3.0
4813  *
4814  * @remarks The @a permissions can be one or more values of #bt_gatt_permission_e, combined with bitwise 'or'.
4815  *
4816  * @param[in] gatt_handle The handle of a descriptor
4817  * @param[out] permissions The permissions which a descriptor's GATT handle has
4818  * @return  0 on success, otherwise a negative error value
4819  * @retval #BT_ERROR_NONE  Successful
4820  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4821  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4822  *
4823  * @see bt_gatt_descriptor_create()
4824  * @see bt_gatt_permission_e
4825  */
4826 int bt_gatt_descriptor_get_permissions(bt_gatt_h gatt_handle, int *permissions);
4827
4828 /**
4829  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4830  * @brief  Creates the GATT service.
4831  * @since_tizen 3.0
4832  *
4833  * @remarks The @a service should be destroyed by using bt_gatt_service_destroy().
4834  *
4835  * @param[in] uuid The UUID of the service
4836  * @param[in] type The type of the service
4837  * @param[out] service The GATT handle of the created service
4838  * @return  0 on success, otherwise a negative error value
4839  * @retval #BT_ERROR_NONE Successful
4840  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4841  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
4842  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4843  *
4844  * @see bt_gatt_service_destroy()
4845  */
4846 int bt_gatt_service_create(const char *uuid, bt_gatt_service_type_e type,
4847                            bt_gatt_h *service);
4848
4849 /**
4850  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4851  * @brief  Adds a characteristic to a specified service.
4852  * @since_tizen 3.0
4853  *
4854  * @param[in] service The service's GATT handle
4855  * @param[in] characteristic The characteristic's GATT handle to be added
4856  * @return  0 on success, otherwise a negative error value
4857  * @retval #BT_ERROR_NONE Successful
4858  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4859  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4860  *
4861  * @see bt_gatt_service_create()
4862  * @see bt_gatt_characteristic_create()
4863  */
4864 int bt_gatt_service_add_characteristic(bt_gatt_h service,
4865                                         bt_gatt_h characteristic);
4866
4867 /**
4868  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4869  * @brief  Adds a service to a specified service as included service.
4870  * @since_tizen 3.0
4871  *
4872  * @param[in] service The service's GATT handle
4873  * @param[in] included_service The service's GATT handle to be added as included service
4874  * @return  0 on success, otherwise a negative error value
4875  * @retval #BT_ERROR_NONE Successful
4876  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4877  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4878  *
4879  * @see bt_gatt_service_create()
4880  */
4881 int bt_gatt_service_add_included_service(bt_gatt_h service,
4882                                         bt_gatt_h included_service);
4883
4884 /**
4885  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4886  * @brief  Gets the GATT server handle to which the specified service belongs.
4887  * @since_tizen 3.0
4888  *
4889  * @remarks The returned Server handle must not be freed by application.
4890  *
4891  * @param[in] service The service's GATT handle
4892  * @param[out] server The GATT server handle to which @a service belongs
4893  * @return  0 on success, otherwise a negative error value
4894  * @retval #BT_ERROR_NONE Successful
4895  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4896  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4897  *
4898  * @see bt_gatt_server_create()
4899  * @see bt_gatt_service_create()
4900  * @see bt_gatt_server_register_service()
4901  */
4902 int bt_gatt_service_get_server(bt_gatt_h service, bt_gatt_server_h *server);
4903
4904 /**
4905  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4906  * @brief  Creates the GATT characteristic.
4907  * @since_tizen 3.0
4908  *
4909  * @remarks The @a permissions can be one or more values of #bt_gatt_permission_e, combined with bitwise 'or'. \n
4910  * @remarks The @a properties can be one or more values of #bt_gatt_property_e, combined with bitwise 'or'. \n
4911  * @remarks The @a characteristic should be destroyed by using bt_gatt_characteristic_destroy().
4912  *
4913  * @param[in] uuid The UUID of the characteristic
4914  * @param[in] permissions the permissions of the characteristic
4915  * @param[in] properties The properties of the characteristic
4916  * @param[in] value The value(byte stream) of the characteristic
4917  * @param[in] value_length The length of @a value
4918  * @param[out] characteristic The GATT handle of the created characteristic
4919  * @return  0 on success, otherwise a negative error value
4920  * @retval #BT_ERROR_NONE Successful
4921  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4922  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
4923  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4924  *
4925  * @see bt_gatt_characteristic_destroy()
4926  */
4927 int bt_gatt_characteristic_create(const char *uuid, int permissions,
4928                                 int properties, const char *value, int value_length,
4929                                 bt_gatt_h *characteristic);
4930
4931 /**
4932  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4933  * @brief  Adds a descriptor to a specified characteristic.
4934  * @since_tizen 3.0
4935  *
4936  * @param[in] characteristic The GATT handle of the characteristic
4937  * @param[in] descriptor The descriptor's GATT handle to be added
4938  * @return  0 on success, otherwise a negative error value
4939  * @retval #BT_ERROR_NONE Successful
4940  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4941  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4942  *
4943  * @see bt_gatt_characteristic_create()
4944  * @see bt_gatt_descriptor_create()
4945  */
4946 int bt_gatt_characteristic_add_descriptor(bt_gatt_h characteristic,
4947                                         bt_gatt_h descriptor);
4948
4949 /**
4950  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4951  * @brief  Creates the GATT characteristic descriptor.
4952  * @since_tizen 3.0
4953  *
4954  * @remarks The @a permissions can be one or more values of #bt_gatt_permission_e, combined with bitwise 'or'. \n
4955  * @remarks The @a descriptor should be destroyed by using bt_gatt_descriptor_destroy().
4956  *
4957  * @param[in] uuid The UUID of the descriptor
4958  * @param[in] permissions The permissions of the descriptor
4959  * @param[in] value The value(byte stream) associated with the descriptor
4960  * @param[in] value_length The length of @a value
4961  * @param[out] descriptor The GATT handle of the created characteristic descriptor
4962  * @return  0 on success, otherwise a negative error value
4963  * @retval #BT_ERROR_NONE Successful
4964  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
4965  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
4966  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4967  *
4968  * @see bt_gatt_descriptor_destroy()
4969  */
4970 int bt_gatt_descriptor_create(const char *uuid, int permissions,
4971                                 const char *value, int value_length,
4972                                 bt_gatt_h *descriptor);
4973
4974 /**
4975  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4976  * @brief Initializes the GATT Server.
4977  * @since_tizen 3.0
4978  *
4979  * @return  0 on success, otherwise a negative error value.
4980  * @retval #BT_ERROR_NONE  Successful
4981  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4982  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
4983  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
4984  *
4985  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
4986  * @see bt_gatt_server_deinitialize()
4987  */
4988 int bt_gatt_server_initialize(void);
4989
4990 /**
4991  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4992  * @brief DeInitializes the GATT server.
4993  * @since_tizen 3.0
4994  *
4995  * @return  0 on success, otherwise a negative error value.
4996  * @retval #BT_ERROR_NONE       Successful
4997  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
4998  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
4999  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5000  *
5001  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
5002  * @see bt_gatt_server_initialize()
5003  */
5004 int bt_gatt_server_deinitialize(void);
5005
5006 /**
5007  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5008  * @brief  Creates the GATT server's handle.
5009  * @since_tizen 3.0
5010  *
5011  * @remarks The @a server handle should be destroyed by using bt_gatt_server_destroy().
5012  *
5013  * @param[out] server The GATT server's handle
5014  * @return  0 on success, otherwise a negative error value
5015  * @retval #BT_ERROR_NONE Successful
5016  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5017  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
5018  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5019  *
5020  * @see bt_gatt_server_destroy()
5021  */
5022 int bt_gatt_server_create(bt_gatt_server_h *server);
5023
5024 /**
5025  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5026  * @brief  Destroys the GATT server's handle.
5027  * @since_tizen 3.0
5028  *
5029  * @remarks All registered services to GATT server are unregistered.
5030  *
5031  * @param[in] server The GATT server's handle
5032  * @return  0 on success, otherwise a negative error value
5033  * @retval #BT_ERROR_NONE Successful
5034  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5035  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5036  *
5037  * @see bt_gatt_server_create()
5038  */
5039 int bt_gatt_server_destroy(bt_gatt_server_h server);
5040
5041 /**
5042  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5043  * @brief  Registers a callback function to be invoked when a read request for a specified characteristic or descriptor is issued from a remote device(GATT client).
5044  * @since_tizen 3.0
5045  *
5046  * @param[in] gatt_handle The GATT handle of a characteristic or descriptor
5047  * @param[in] callback The callback to be invoked
5048  * @param[in] user_data The user data to be passed to @a callback function
5049  * @return  0 on success, otherwise a negative error value
5050  * @retval #BT_ERROR_NONE Successful
5051  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5052  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5053  *
5054  * @see bt_gatt_server_read_value_requested_cb()
5055  * @see bt_gatt_server_send_response()
5056  */
5057 int bt_gatt_server_set_read_value_requested_cb(bt_gatt_h gatt_handle,
5058                                 bt_gatt_server_read_value_requested_cb callback,
5059                                 void *user_data);
5060
5061 /**
5062  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5063  * @brief  Registers a callback function to be invoked when the remote device enables or disables the Notification/Indication for particular characteristics.
5064  * @since_tizen 3.0
5065  *
5066  * @param[in] gatt_handle The GATT handle of a characteristic
5067  * @param[in] callback The callback to be invoked
5068  * @param[in] user_data The user data to be passed to @a callback function
5069  * @return      0 on success, otherwise a negative error value
5070  * @retval #BT_ERROR_NONE Successful
5071  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5072  * @retval #BT_ERROR_NOT_SUPPORTED      Not supported
5073  *
5074  * @see bt_gatt_server_characteristic_notification_state_changed_cb()
5075  */
5076 int bt_gatt_server_set_characteristic_notification_state_change_cb(bt_gatt_h gatt_handle,
5077                                 bt_gatt_server_characteristic_notification_state_changed_cb callback,
5078                                 void *user_data);
5079
5080 /**
5081  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5082  * @brief  Registers a callback function to be invoked when a value of a characteristic or descriptor has been changed by a remote device(GATT client)'s request.
5083  * @since_tizen 3.0
5084  *
5085  * @param[in] gatt_handle The GATT handle of a characteristic or descriptor
5086  * @param[in] callback The callback to be invoked
5087  * @param[in] user_data The user data to be passed to @a callback function
5088  * @return  0 on success, otherwise a negative error value
5089  * @retval #BT_ERROR_NONE Successful
5090  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5091  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5092  *
5093  * @see bt_gatt_server_write_value_requested_cb()
5094  */
5095 int bt_gatt_server_set_write_value_requested_cb(bt_gatt_h gatt_handle,
5096                                 bt_gatt_server_write_value_requested_cb callback,
5097                                 void *user_data);
5098
5099 /**
5100  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5101  * @brief  Registers a specified service to the specified GATT server that the local device is hosting.
5102  * @since_tizen 3.0
5103  * @privlevel public
5104  * @privilege %http://tizen.org/privilege/bluetooth
5105  *
5106  * @param[in] server The GATT server that local device is hosting
5107  * @param[in] service The service, which needs to be registered in @a server
5108  * @return  0 on success, otherwise a negative error value
5109  * @retval #BT_ERROR_NONE Successful
5110  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5111  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
5112  * @retval #BT_ERROR_ALREADY_DONE Operation is already done
5113  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
5114  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5115  *
5116  * @see bt_gatt_server_create()
5117  * @see bt_gatt_service_create()
5118  * @see bt_gatt_server_start()
5119  * @see bt_gatt_server_unregister_service()
5120  */
5121 int bt_gatt_server_register_service(bt_gatt_server_h server, bt_gatt_h service);
5122
5123 /**
5124  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5125  * @brief  Unregisters a specified service from the specified GATT server that the local device is hosting.
5126  * @since_tizen 3.0
5127  * @privlevel public
5128  * @privilege %http://tizen.org/privilege/bluetooth
5129  *
5130  * @param[in] server The GATT server that local device is hosting
5131  * @param[in] service The service, which needs to be unregistered from @a server
5132  * @return  0 on success, otherwise a negative error value
5133  * @retval #BT_ERROR_NONE Successful
5134  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5135  * @retval #BT_ERROR_SERVICE_NOT_FOUND  Service not found
5136  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
5137  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5138  *
5139  * @see bt_gatt_server_register_service()
5140  */
5141 int bt_gatt_server_unregister_service(bt_gatt_server_h server, bt_gatt_h service);
5142
5143 /**
5144  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5145  * @brief  Unregisters all services from the specified GATT server that the local device is hosting.
5146  * @since_tizen 3.0
5147  * @privlevel public
5148  * @privilege %http://tizen.org/privilege/bluetooth
5149  *
5150  * @param[in] server The GATT server that local device is hosting
5151  * @return  0 on success, otherwise a negative error value
5152  * @retval #BT_ERROR_NONE Successful
5153  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5154  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
5155  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5156  *
5157  * @see bt_gatt_server_register_service()
5158  */
5159 int bt_gatt_server_unregister_all_services(bt_gatt_server_h server);
5160
5161 /**
5162  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5163  * @brief  Registers the application along with the GATT services of the application it is hosting.
5164  * @since_tizen 3.0
5165  * @privlevel public
5166  * @privilege %http://tizen.org/privilege/bluetooth
5167  *
5168  * @return  0 on success, otherwise a negative error value
5169  * @retval #BT_ERROR_NONE Successful
5170  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
5171  * @retval #BT_ERROR_ALREADY_DONE Operation is already done
5172  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
5173  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5174  *
5175  * @see bt_gatt_server_initialize()
5176  * @see bt_gatt_server_create()
5177  * @see bt_gatt_service_create()
5178  * @see bt_gatt_server_unregister_service()
5179  */
5180 int bt_gatt_server_start(void);
5181
5182 /**
5183  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5184  * @brief  Sends a response to the remote device as a result of a read/write request.
5185  * @since_tizen 3.0
5186  * @privlevel public
5187  * @privilege %http://tizen.org/privilege/bluetooth
5188  *
5189  * @remarks Until this function is called, a read/write request is not finished.
5190  *
5191  * @param[in] request_id The identification of a read/write request
5192  * @param[in] request_type The request type for read/write
5193  * @param[in] offset The offset from where a value is read
5194  * @param[in] resp_status The application error if any occurred or BT_ERROR_NONE for successful.
5195  * @param[in] value The value to be sent. It will be sent from @a offset. If it is NULL, a requested GATT handle's value will be sent from @a offset.
5196  * @param[in] value_length Value Length
5197  * @return  0 on success, otherwise a negative error value
5198  * @retval #BT_ERROR_NONE Successful
5199  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5200  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
5201  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5202  *
5203  * @see bt_gatt_server_read_value_requested_cb()
5204  */
5205 int bt_gatt_server_send_response(int request_id, bt_gatt_att_request_type_e request_type,
5206                         int offset, int resp_status, char *value, int value_length);
5207
5208 /**
5209  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5210  * @brief  Notifies value change of the characteristic to the remote devices which enable a Client Characteristic Configuration Descriptor.
5211  * @since_tizen 3.0
5212  *
5213  * @param[in] characteristic The characteristic which has a changed value
5214  * @param[in] callback The function to be invoked on each remote device when a sending operation is done
5215  * @param[in] device_address Remote device address to send notify or indicate and if set to NULL then notify/indicate all is enabled.
5216  * @param[in] user_data The user data to be passed to @a callback function
5217  * @return  0 on success, otherwise a negative error value
5218  * @retval #BT_ERROR_NONE Successful
5219  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5220  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5221  *
5222  * @see bt_gatt_server_notification_sent_cb()
5223  */
5224 int bt_gatt_server_notify_characteristic_changed_value(bt_gatt_h characteristic,
5225                                 bt_gatt_server_notification_sent_cb callback,
5226                                 const char *device_address, void *user_data);
5227
5228 /**
5229  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5230  * @brief  Gets a service's GATT handle which has specific UUID.
5231  * @since_tizen 3.0
5232  *
5233  * @remarks The returned GATT handle must not be freed by application. \n
5234  * It will be freed when an associated server is destroyed by bt_gatt_server_destroy(). \n
5235  * If there are multiple services which have same UUID, only the first matched one will be returned.
5236  *
5237  * @param[in] server The GATT server's handle
5238  * @param[in] uuid The service's GATT handle which has this UUID will be returned if it exists
5239  * @param[out] service The service's GATT handle which has @a uuid if it exists
5240  * @return  0 on success, otherwise a negative error value
5241  * @retval #BT_ERROR_NONE Successful
5242  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5243  * @retval #BT_ERROR_NO_DATA  No data available
5244  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5245  */
5246 int bt_gatt_server_get_service(bt_gatt_server_h server, const char *uuid,
5247                                 bt_gatt_h *service);
5248
5249 /**
5250  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5251  * @brief  Invokes @a callback function on each service that belongs to the specified GATT server.
5252  * @since_tizen 3.0
5253  *
5254  * @param[in] server The GATT server's handle
5255  * @param[in] callback The function to be invoked on each service
5256  * @param[in] user_data The user data to be passed to @a callback function
5257  * @return  0 on success, otherwise a negative error value
5258  * @retval #BT_ERROR_NONE Successful
5259  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5260  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5261  *
5262  * @see bt_gatt_foreach_cb()
5263  */
5264 int bt_gatt_server_foreach_services(bt_gatt_server_h server,
5265                 bt_gatt_foreach_cb callback, void *user_data);
5266
5267
5268 /**
5269  * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5270  * @brief Gets an ATT MTU value for a connection.
5271  * @since_tizen 5.5
5272  *
5273  * @param[in] remote_address The address of the remote Bluetooth device
5274  * @param[out] mtu The MTU value for a connection
5275  *
5276  * @return 0 on success, otherwise a negative error value.
5277  * @retval #BT_ERROR_NONE  Successful
5278  * @retval #BT_ERROR_NOT_SUPPORTED      Not supported
5279  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5280  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5281  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
5282  * @retval #BT_ERROR_OPERATION_FAILED   Operation failed
5283  */
5284 int bt_gatt_server_get_device_mtu(const char *remote_address, unsigned int *mtu);
5285
5286 /**
5287  * @WEARABLE_ONLY
5288  * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5289  * @brief Initializes the Bluetooth PBAP Client.
5290  * @details This initialization is necessary to call other PBAP client APIs.
5291  * @since_tizen 3.0
5292  *
5293  * @remarks This function must be called to initialize Bluetooth PBAP client. You must free all resources of the Bluetooth service \n
5294  * by calling bt_pbap_client_deinitialize() if Bluetooth PBAP Client is no longer needed.
5295  * @return 0 on success, otherwise a negative error value.
5296  * @retval #BT_ERROR_NONE  Successful
5297  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5298  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
5299  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
5300  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5301  *
5302  * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5303  *
5304  * @see  bt_pbap_client_deinitialize()
5305  * @see  bt_pbap_client_connect()
5306  * @see  bt_pbap_client_disconnect()
5307  * @see  bt_pbap_client_get_phone_book_size()
5308  * @see  bt_pbap_client_get_phone_book()
5309  * @see  bt_pbap_client_get_list()
5310  * @see  bt_pbap_client_pull_vcard()
5311  * @see  bt_pbap_client_search_phone_book()
5312  */
5313 int bt_pbap_client_initialize(void);
5314
5315 /**
5316  * @WEARABLE_ONLY
5317  * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5318  * @brief Deinitializes the Bluetooth PBAP Client.
5319  * @details This deinitialization must be done to free resources when the PBAP client is not longer needed.
5320  * @since_tizen 3.0
5321  *
5322  * @return 0 on success, otherwise a negative error value.
5323  * @retval #BT_ERROR_NONE  Successful
5324  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5325  * @retval #BT_ERROR_NOT_ENABLED  Not enabled
5326  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
5327  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5328  *
5329  * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5330  *      The PBAP client must be initialized with bt_pbap_client_initialize().
5331  * @see  bt_pbap_client_initialize()
5332  * @see  bt_pbap_client_connect()
5333  * @see  bt_pbap_client_disconnect()
5334  * @see  bt_pbap_client_get_phone_book_size()
5335  * @see  bt_pbap_client_get_phone_book()
5336  * @see  bt_pbap_client_get_list()
5337  * @see  bt_pbap_client_pull_vcard()
5338  * @see  bt_pbap_client_search_phone_book()
5339  */
5340 int bt_pbap_client_deinitialize(void);
5341
5342 /**
5343  * @WEARABLE_ONLY
5344  * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5345  * @brief  Registers a callback function that will be invoked when the connection state is changed.
5346  * @since_tizen 3.0
5347  * @param[in] callback The callback function to register
5348  * @param[in] user_data The user data to be passed to the callback function
5349  * @return   0 on success, otherwise a negative error value.
5350  * @retval #BT_ERROR_NONE  Successful
5351  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5352  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5353  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5354  *
5355  * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5356  * @see bt_pbap_client_initialize()
5357  */
5358 int bt_pbap_client_set_connection_state_changed_cb(bt_pbap_connection_state_changed_cb callback, void *user_data);
5359
5360 /**
5361  * @WEARABLE_ONLY
5362  * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5363  * @brief  Unregisters a callback function that will be invoked when the connection state is changed.
5364  * @since_tizen 3.0
5365  * @return   0 on success, otherwise a negative error value.
5366  * @retval #BT_ERROR_NONE  Successful
5367  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5368  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5369  *
5370  * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5371  * @see bt_pbap_client_initialize()
5372  */
5373 int bt_pbap_client_unset_connection_state_changed_cb(void);
5374
5375 /**
5376  * @WEARABLE_ONLY
5377  * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5378  * @brief Connects to PBAP server, asynchronously.
5379  * @since_tizen 3.0
5380  * @privlevel public
5381  * @privilege http://tizen.org/privilege/bluetooth
5382  *
5383  * @param[in] address The other device's address
5384  *
5385  * @return 0 on success, otherwise a negative error value.
5386  * @retval #BT_ERROR_NONE  Successful
5387  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5388  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5389  * @retval #BT_ERROR_NOT_ENABLED  Adapter is not enabled
5390  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
5391  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
5392  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5393  * @retval #BT_ERROR_NOW_IN_PROGRESS  Operation is in progress
5394  *
5395  * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5396  * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5397  * @pre The local device must be bonded with the remote device by bt_device_create_bond().
5398  * @post bt_pbap_connection_state_changed_cb() will be invoked.
5399  * @see bt_pbap_client_disconnect()
5400  * @see bt_pbap_client_set_connection_state_changed_cb()
5401  */
5402 int bt_pbap_client_connect(const char *address);
5403
5404 /**
5405  * @WEARABLE_ONLY
5406  * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5407  * @brief Disconnects from PBAP server, asynchronously.
5408  * @since_tizen 3.0
5409  * @privlevel public
5410  * @privilege http://tizen.org/privilege/bluetooth
5411  *
5412  * @param[in] address The other device's address
5413  *
5414  * @return 0 on success, otherwise a negative error value.
5415  * @retval #BT_ERROR_NONE  Successful
5416  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5417  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5418  * @retval #BT_ERROR_NOT_ENABLED  Adapter is not enabled
5419  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
5420  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
5421  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5422  * @retval #BT_ERROR_NOW_IN_PROGRESS  Operation is in progress
5423  *
5424  * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5425  * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5426  * @pre PBAP connection must be created with bt_pbap_client_connect().
5427  * @post bt_pbap_connection_state_changed_cb() will be invoked.
5428  * @see bt_pbap_client_connect()
5429  * @see bt_pbap_client_set_connection_state_changed_cb()
5430  */
5431 int bt_pbap_client_disconnect(const char *address);
5432
5433 /**
5434  * @WEARABLE_ONLY
5435  * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5436  * @brief Gets size of phone book from PBAP server, asynchronously.
5437  * @since_tizen 3.0
5438  * @privlevel public
5439  * @privilege http://tizen.org/privilege/bluetooth
5440  *
5441  * @param[in] address The other device's address
5442  * @param[in] source Source of the phone book (Phone/SIM)
5443  * @param[in] folder_type Type of folder
5444  * @param[in] callback The callback function called when PBAP phone book size is returned.
5445  * @param[in] user_data Data to be passed to the PBAP phone book size callback.
5446  *
5447  * @return 0 on success, otherwise a negative error value.
5448  * @retval #BT_ERROR_NONE  Successful
5449  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5450  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5451  * @retval #BT_ERROR_NOT_ENABLED  Adapter is not enabled
5452  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
5453  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
5454  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5455  *
5456  * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5457  * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5458  * @pre PBAP connection must be created with bt_pbap_client_connect().
5459  *
5460  * @see bt_pbap_client_connect()
5461  */
5462 int bt_pbap_client_get_phone_book_size(const char *address,
5463                                                 bt_pbap_address_book_source_e source,
5464                                                 bt_pbap_folder_type_e folder_type,
5465                                                 bt_pbap_phone_book_size_cb callback,
5466                                                 void *user_data);
5467
5468 /**
5469  * @WEARABLE_ONLY
5470  * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5471  * @brief Gets all contacts and call logs as vCard from PBAP server, asynchronously.
5472  * @details The received phone book file will be saved in the platform downloads folder.
5473  * @since_tizen 3.0
5474  * @privlevel public
5475  * @privilege http://tizen.org/privilege/bluetooth
5476  *                 http://tizen.org/privilege/mediastorage
5477  *
5478  * @param[in] address The other device's address
5479  * @param[in] source Source of phone book (Phone/SIM)
5480  * @param[in] folder_type Type of folder
5481  * @param[in] format The vCard format
5482  * @param[in] order Specifies which field shall be used to sort vCards.
5483  * @param[in] offset The number of vCards to be excluded, counting from the beginning
5484  * @param[in] max_list_count The maximum number of vCards to be fetched
5485  * @param[in] fields vCard fields to be fetched; one or more #bt_pbap_field_e values combined with bitwise 'or'
5486  * @param[in] callback The callback function called when PBAP phone book is Pulled.
5487  * @param[in] user_data Data to be passed to the PBAP phone book pulling callback.
5488  *
5489  * @return 0 on success, otherwise a negative error value.
5490  * @retval #BT_ERROR_NONE  Successful
5491  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5492  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5493  * @retval #BT_ERROR_NOT_ENABLED  Adapter is not enabled
5494  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
5495  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
5496  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5497  *
5498  * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5499  * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5500  * @pre PBAP connection must be created with bt_pbap_client_connect().
5501  *
5502  * @see bt_pbap_client_connect()
5503  */
5504 int bt_pbap_client_get_phone_book(const char *address,
5505                                                 bt_pbap_address_book_source_e source,
5506                                                 bt_pbap_folder_type_e folder_type,
5507                                                 bt_pbap_vcard_format_e format,
5508                                                 bt_pbap_sort_order_e order,
5509                                                 unsigned short offset,
5510                                                 unsigned short max_list_count,
5511                                                 unsigned int fields,
5512                                                 bt_pbap_phone_book_received_cb callback,
5513                                                 void *user_data);
5514
5515 /**
5516  * @WEARABLE_ONLY
5517  * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5518  * @brief Gets contact and call log information from the PBAP server, asynchronously.
5519  * @since_tizen 3.0
5520  * @privlevel public
5521  * @privilege http://tizen.org/privilege/bluetooth
5522  *
5523  * @param[in] address The other device's address
5524  * @param[in] source Source of phone book (Phone/SIM)
5525  * @param[in] folder_type Type of folder
5526  * @param[in] order Specifies which field shall be used to sort vCards.
5527  * @param[in] offset vCards to be excluded from beginning.
5528  * @param[in] max_list_count Maximum number of vCards to be fetched
5529  * @param[in] callback The callback function called when PBAP List is returned.
5530  * @param[in] user_data Data to be passed to the PBAP phone book pulling callback.
5531  *
5532  * @return 0 on success, otherwise a negative error value.
5533  * @retval #BT_ERROR_NONE  Successful
5534  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5535  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5536  * @retval #BT_ERROR_NOT_ENABLED  Adapter is not enabled
5537  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
5538  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
5539  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5540  *
5541  * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5542  * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5543  * @pre PBAP connection must be created with bt_pbap_client_connect().
5544  *
5545  * @see bt_pbap_client_connect()
5546  */
5547 int bt_pbap_client_get_list(const char *address,
5548                                         bt_pbap_address_book_source_e source,
5549                                         bt_pbap_folder_type_e folder_type,
5550                                         bt_pbap_sort_order_e order,
5551                                         unsigned short offset,
5552                                         unsigned short max_list_count,
5553                                         bt_pbap_list_vcards_cb callback,
5554                                         void *user_data);
5555
5556 /**
5557  * @WEARABLE_ONLY
5558  * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5559  * @brief Gets the selected contact using the index parameter as vCard from PBAP server, asynchronously.
5560  * @details The received phone book file will be saved in the platform downloads folder.
5561  *              The @a index value should be equal to the value of the @a index field in the #bt_pbap_vcard_info_s structure,
5562  *              which can be obtained with bt_pbap_client_get_list() or bt_pbap_client_search_phone_book().
5563  * @since_tizen 3.0
5564  * @privlevel public
5565  * @privilege http://tizen.org/privilege/bluetooth
5566  *                 http://tizen.org/privilege/mediastorage
5567  *
5568  * @param[in] address The other device's address
5569  * @param[in] source Source of phone book (Phone/SIM)
5570  * @param[in] folder_type Type of folder
5571  * @param[in] index The handle index of vCard to be fetched
5572  * @param[in] format Format of vCard
5573  * @param[in] fields vCard fields to be fetched; one or more #bt_pbap_field_e values combined with bitwise 'or'
5574  * @param[in] callback The callback function called when PBAP phone book is Pulled.
5575  * @param[in] user_data Data to be passed to the PBAP phone book Pulling callback.
5576  *
5577  * @return 0 on success, otherwise a negative error value.
5578  * @retval #BT_ERROR_NONE  Successful
5579  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5580  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5581  * @retval #BT_ERROR_NOT_ENABLED  Adapter is not enabled
5582  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
5583  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
5584  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5585  *
5586  * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5587  * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5588  * @pre PBAP connection must be created with bt_pbap_client_connect().
5589  * @pre The vCard information (#bt_pbap_vcard_info_s) must be obtained with bt_pbap_client_get_list() or bt_pbap_client_search_phone_book().
5590  * @see bt_pbap_client_connect()
5591  * @see bt_pbap_client_get_list()
5592  * @see bt_pbap_client_search_phone_book()
5593  */
5594 int bt_pbap_client_pull_vcard(const char *address,
5595                                         bt_pbap_address_book_source_e source,
5596                                         bt_pbap_folder_type_e folder_type,
5597                                         int index,
5598                                         bt_pbap_vcard_format_e format,
5599                                         unsigned int fields,
5600                                         bt_pbap_phone_book_received_cb callback,
5601                                         void *user_data);
5602
5603 /**
5604  * @WEARABLE_ONLY
5605  * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5606  * @brief Finds and fetches the contact and call log information from the PBAP server, asynchronously.
5607  * @since_tizen 3.0
5608  * @privlevel public
5609  * @privilege http://tizen.org/privilege/bluetooth
5610  *
5611  * @param[in] address The other device's address
5612  * @param[in] source Source of phone book (Phone/SIM)
5613  * @param[in] folder_type Type of folder
5614  * @param[in] search_attribute field to be search
5615  * @param[in] search_value pattern to be searched for
5616  * @param[in] order Specifies which field shall be used to sort vCards.
5617  * @param[in] offset vCards to be excluded from beginning.
5618  * @param[in] max_list_count Maximum number of vCards to be fetched
5619  * @param[in] callback The callback function called when PBAP List is returned.
5620  * @param[in] user_data Data to be passed to the PBAP phone book pulling callback.
5621  *
5622  * @return 0 on success, otherwise a negative error value.
5623  * @retval #BT_ERROR_NONE  Successful
5624  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5625  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5626  * @retval #BT_ERROR_NOT_ENABLED  Adapter is not enabled
5627  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
5628  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
5629  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5630  *
5631  * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5632  * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5633  * @pre PBAP connection must be created with bt_pbap_client_connect().
5634  *
5635  * @see bt_pbap_client_connect()
5636  */
5637 int bt_pbap_client_search_phone_book(const char *address,
5638                                         bt_pbap_address_book_source_e source,
5639                                         bt_pbap_folder_type_e folder_type,
5640                                         bt_pbap_search_field_e search_attribute,
5641                                         const char *search_value,
5642                                         bt_pbap_sort_order_e order,
5643                                         unsigned short offset,
5644                                         unsigned short max_list_count,
5645                                         bt_pbap_list_vcards_cb callback,
5646                                         void *user_data);
5647
5648 /**
5649  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5650  * @brief Creates a scan filter to find only LE advertisements which match specific requirements.
5651  * @details If the filter's attribute is not set, then the filter will accept
5652  *              all values of that attribute. If an attribute is set, the filter
5653  *              will accept only advertisements which match the set attribute.
5654  *
5655  *              For example, if device name is set with
5656  *              bt_adapter_le_scan_filter_set_device_name(), the filter will accept
5657  *              only advertisements from devices with the given name. If device name
5658  *              is not set, advertisements will be filtered without regard to device
5659  *              names.
5660  * @since_tizen 4.0
5661  *
5662  * @remarks The @a scan_filter should be destroyed with bt_adapter_le_scan_filter_destroy().
5663  *
5664  * @param[out] scan_filter The scan filter handle
5665  *
5666  * @return 0 on success, otherwise a negative error value.
5667  * @retval #BT_ERROR_NONE  Successful
5668  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5669  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5670  * @retval #BT_ERROR_OUT_OF_MEMORY  Out of memory
5671  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5672  *
5673  * @pre The Bluetooth service must be initialized with bt_initialize().
5674  *
5675  * @see bt_adapter_le_scan_filter_destroy()
5676  */
5677 int bt_adapter_le_scan_filter_create(bt_scan_filter_h *scan_filter);
5678
5679 /**
5680  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5681  * @brief Destroys a scan filter.
5682  * @since_tizen 4.0
5683  *
5684  * @param[in] scan_filter The scan filter handle
5685  *
5686  * @return 0 on success, otherwise a negative error value.
5687  * @retval #BT_ERROR_NONE  Successful
5688  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5689  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5690  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5691  *
5692  * @pre The Bluetooth service must be initialized with bt_initialize().
5693  *
5694  * @see bt_adapter_le_scan_filter_create()
5695  */
5696 int bt_adapter_le_scan_filter_destroy(bt_scan_filter_h scan_filter);
5697
5698 /**
5699  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5700  * @brief Sets the device address for the advertisements filter.
5701  * @since_tizen 4.0
5702  *
5703  * @param[in] scan_filter The scan filter handle
5704  * @param[in] address The device address by which advertisements will be filtered
5705  *
5706  * @return 0 on success, otherwise a negative error value.
5707  * @retval #BT_ERROR_NONE  Successful
5708  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5709  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5710  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5711  *
5712  * @pre The Bluetooth service must be initialized with bt_initialize().
5713  *
5714  */
5715 int bt_adapter_le_scan_filter_set_device_address(bt_scan_filter_h scan_filter, const char *address);
5716
5717 /**
5718  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5719  * @brief Sets the device name for the advertisements filter.
5720  * @details Any previously set value will be overwritten.
5721  * @since_tizen 4.0
5722  *
5723  * @param[in] scan_filter The scan filter handle
5724  * @param[in] name The device name by which advertisements will be filtered
5725  *
5726  * @return 0 on success, otherwise a negative error value.
5727  * @retval #BT_ERROR_NONE  Successful
5728  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5729  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5730  * @retval #BT_ERROR_NOT_SUPPORTED      Not supported
5731  *
5732  * @pre The Bluetooth service must be initialized with bt_initialize().
5733  *
5734  */
5735 int bt_adapter_le_scan_filter_set_device_name(bt_scan_filter_h scan_filter, const char *name);
5736
5737 /**
5738  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5739  * @brief Sets the service UUID for the advertisements filter.
5740  * @details Any previously set value will be overwritten.
5741  * @since_tizen 4.0
5742  *
5743  * @param[in] scan_filter The scan filter handle
5744  * @param[in] uuid The service UUID by which advertisements will be filtered
5745  *
5746  * @return 0 on success, otherwise a negative error value.
5747  * @retval #BT_ERROR_NONE  Successful
5748  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5749  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5750  * @retval #BT_ERROR_NOT_SUPPORTED      Not supported
5751  *
5752  * @pre The Bluetooth service must be initialized with bt_initialize().
5753  *
5754  */
5755 int bt_adapter_le_scan_filter_set_service_uuid(bt_scan_filter_h scan_filter, const char *uuid);
5756
5757 /**
5758  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5759  * @brief Sets the service UUID and the mask for the advertisements filter,
5760  *           to use for filtering by partial data.
5761  * @details Any previously set value will be overwritten. The mask works as follows:
5762  *             For each bit set to 1 in the mask, the corresponding bits in @a uuid
5763  *             and in the filtered data will have to be equal. If the mask bit is set to 0,
5764  *             the corresponding bits will be ignored.
5765  * @since_tizen 4.0
5766  *
5767  * @remarks The @a mask and the service @a uuid must have equal lengths.
5768  *
5769  * @param[in] scan_filter The scan filter handle
5770  * @param[in] uuid The service UUID by which advertisements will be filtered
5771  * @param[in] mask The mask to filter advertisements
5772  *
5773  * @return 0 on success, otherwise a negative error value.
5774  * @retval #BT_ERROR_NONE  Successful
5775  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5776  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5777  * @retval #BT_ERROR_NOT_SUPPORTED      Not supported
5778  *
5779  * @pre The Bluetooth service must be initialized with bt_initialize().
5780  *
5781  */
5782 int bt_adapter_le_scan_filter_set_service_uuid_with_mask(bt_scan_filter_h scan_filter,
5783                         const char *uuid, const char *mask);
5784
5785 /**
5786  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5787  * @brief Sets the service solicitation UUID for the advertisements filter.
5788  * @details Any previously set value will be overwritten.
5789  * @since_tizen 4.0
5790  *
5791  * @param[in] scan_filter The scan filter handle
5792  * @param[in] uuid The service solicitation UUID by which advertisements will be filtered
5793  *
5794  * @return 0 on success, otherwise a negative error value.
5795  * @retval #BT_ERROR_NONE  Successful
5796  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5797  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5798  * @retval #BT_ERROR_NOT_SUPPORTED      Not supported
5799  *
5800  * @pre The Bluetooth service must be initialized with bt_initialize().
5801  *
5802  */
5803 int bt_adapter_le_scan_filter_set_service_solicitation_uuid(bt_scan_filter_h scan_filter, const char *uuid);
5804
5805 /**
5806  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5807  * @brief Sets the service solicitation UUID and the mask for the advertisements filter,
5808  *           to use for filtering by partial data.
5809  * @details Any previously set value will be overwritten. The mask works as follows:
5810  *             For each bit set to 1 in the mask, the corresponding bits in @a uuid
5811  *             and in the filtered data will have to be equal. If the mask bit is set to 0,
5812  *             the corresponding bits will be ignored.
5813  * @since_tizen 4.0
5814  *
5815  * @remarks The @a mask and the service solicitation @a uuid must have equal lengths.
5816  *
5817  * @param[in] scan_filter The scan filter handle
5818  * @param[in] uuid The service solicitation UUID by which advertisements will be filtered
5819  * @param[in] mask The mask by which advertisements will be filtered
5820  *
5821  * @return 0 on success, otherwise a negative error value.
5822  * @retval #BT_ERROR_NONE  Successful
5823  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5824  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5825  * @retval #BT_ERROR_NOT_SUPPORTED      Not supported
5826  *
5827  * @pre The Bluetooth service must be initialized with bt_initialize().
5828  *
5829  */
5830 int bt_adapter_le_scan_filter_set_service_solicitation_uuid_with_mask(bt_scan_filter_h scan_filter,
5831                         const char *uuid, const char *mask);
5832
5833 /**
5834  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5835  * @brief Sets the service data for the advertisements filter.
5836  * @details Any previously set value will be overwritten.
5837  * @since_tizen 4.0
5838  *
5839  * @param[in] scan_filter The scan filter handle
5840  * @param[in] uuid The service UUID by which advertisements will be filtered
5841  * @param[in] data The service data by which advertisements will be filtered
5842  * @param[in] data_len The length of the service data
5843  *
5844  * @return 0 on success, otherwise a negative error value.
5845  * @retval #BT_ERROR_NONE  Successful
5846  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5847  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5848  * @retval #BT_ERROR_NOT_SUPPORTED      Not supported
5849  *
5850  * @pre The Bluetooth service must be initialized with bt_initialize().
5851  *
5852  */
5853 int bt_adapter_le_scan_filter_set_service_data(bt_scan_filter_h scan_filter,
5854                         const char *uuid, const char *data, unsigned int data_len);
5855
5856 /**
5857  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5858  * @brief Sets the service data and the mask for the advertisements filter,
5859  *           to use for filtering by partial data.
5860  * @details Any previously set value will be overwritten. The mask works as follows:
5861  *             For each bit set to 1 in the mask, the corresponding bits in @a data
5862  *             and in the filtered data will have to be equal. If the mask bit is set to 0,
5863  *             the corresponding bits will be ignored.
5864  * @since_tizen 4.0
5865  *
5866  * @remarks The @a mask and the service @a data must have equal lengths.
5867  *
5868  * @param[in] scan_filter The scan filter handle
5869  * @param[in] uuid The service UUID by which advertisements will be filtered
5870  * @param[in] data The service data by which advertisements will be filtered
5871  * @param[in] data_len The length of the service data
5872  * @param[in] mask The mask by which advertisements will be filtered
5873  * @param[in] mask_len The length of the mask
5874  *
5875  * @return 0 on success, otherwise a negative error value.
5876  * @retval #BT_ERROR_NONE  Successful
5877  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5878  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5879  * @retval #BT_ERROR_NOT_SUPPORTED      Not supported
5880  *
5881  * @pre The Bluetooth service must be initialized with bt_initialize().
5882  *
5883  */
5884 int bt_adapter_le_scan_filter_set_service_data_with_mask(bt_scan_filter_h scan_filter,
5885                         const char *uuid,
5886                         const char *data,
5887                         unsigned int data_len,
5888                         const char *mask,
5889                         unsigned int mask_len);
5890
5891 /**
5892  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5893  * @brief Sets the manufacturer data for the advertisements filter.
5894  * @details Any previously set value will be overwritten.
5895  * @since_tizen 4.0
5896  *
5897  * @param[in] scan_filter The scan filter handle
5898  * @param[in] manufacturer_id The manufacturer ID (0x0000 ~ 0xFFFF)
5899  * @param[in] data The manufacturer data (byte array)
5900  * @param[in] data_len The length of the manufacturer data
5901  *
5902  * @return 0 on success, otherwise a negative error value.
5903  * @retval #BT_ERROR_NONE  Successful
5904  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5905  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5906  * @retval #BT_ERROR_NOT_SUPPORTED      Not supported
5907  *
5908  * @pre The Bluetooth service must be initialized with bt_initialize().
5909  *
5910  */
5911 int bt_adapter_le_scan_filter_set_manufacturer_data(bt_scan_filter_h scan_filter,
5912                         int manufacturer_id,
5913                         const char *data,
5914                         unsigned int data_len);
5915
5916 /**
5917  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5918  * @brief Sets the manufacturer data and the mask for the advertisements filter,
5919  *           to use for filtering by partial data.
5920  * @details Any previously set value will be overwritten. The mask works as follows:
5921  *             For each bit set to 1 in the mask, the corresponding bits in @a data
5922  *             and in the filtered data will have to be equal. If the mask bit is set to 0,
5923  *             the corresponding bits will be ignored.
5924  * @since_tizen 4.0
5925  *
5926  * @remarks The @a mask and the manufacturer @a data must have equal lengths.
5927  *
5928  * @param[in] scan_filter The scan filter handle
5929  * @param[in] manufacturer_id The manufacturer ID (0x0000 ~ 0xFFFF)
5930  * @param[in] data The manufacturer data (byte array)
5931  * @param[in] data_len The length of the manufacturer data
5932  * @param[in] mask The mask by which advertisements will be filtered
5933  * @param[in] mask_len The length of the mask
5934  *
5935  * @return 0 on success, otherwise a negative error value.
5936  * @retval #BT_ERROR_NONE  Successful
5937  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5938  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5939  * @retval #BT_ERROR_NOT_SUPPORTED      Not supported
5940  *
5941  * @pre The Bluetooth service must be initialized with bt_initialize().
5942  *
5943  */
5944 int bt_adapter_le_scan_filter_set_manufacturer_data_with_mask(bt_scan_filter_h scan_filter,
5945                         int manufacturer_id,
5946                         const char *data,
5947                         unsigned int data_len,
5948                         const char *mask,
5949                         unsigned int mask_len);
5950
5951 /**
5952  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5953  * @brief Sets the scan filter type for the advertisements filter.
5954  * @details The filter type is used when searching only for iBeacon or proximity
5955  *              type's advertising data. If the type is not set, LE scanner will
5956  *              search devices as with regard to other filtered attributes.
5957  *              If the type is set, all other attributes set for the filter are ignored.
5958  * @since_tizen 4.0
5959  *
5960  * @param[in] scan_filter The scan filter handle
5961  * @param[in] mode The scan filter type
5962  *
5963  * @return 0 on success, otherwise a negative error value.
5964  * @retval #BT_ERROR_NONE  Successful
5965  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5966  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5967  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5968  *
5969  * @pre The Bluetooth service must be initialized with bt_initialize().
5970  *
5971  */
5972 int bt_adapter_le_scan_filter_set_type(bt_scan_filter_h scan_filter,
5973                          bt_adapter_le_scan_filter_type_e mode);
5974
5975 /**
5976  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5977  * @brief Registers a scan filter to use for scanning.
5978  * @details If the filter is registered, it cannot be changed.
5979  * @since_tizen 4.0
5980  * @privlevel public
5981  * @privilege %http://tizen.org/privilege/bluetooth
5982  *
5983  * @remarks Several scan filters can be registered. If an advertisement passes \n
5984  *                any of the registered scan filters, it will be included in the results.
5985  *
5986  * @param[in] scan_filter The scan filter handle
5987  *
5988  * @return 0 on success, otherwise a negative error value.
5989  * @retval #BT_ERROR_NONE  Successful
5990  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
5991  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
5992  * @retval #BT_ERROR_NOW_IN_PROGRESS  Scan is in progress
5993  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
5994  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
5995  *
5996  * @pre The Bluetooth service must be initialized with bt_initialize().
5997  *
5998  */
5999 int bt_adapter_le_scan_filter_register(bt_scan_filter_h scan_filter);
6000
6001 /**
6002  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
6003  * @brief Unregisters all registered scan filters.
6004  * @since_tizen 4.0
6005  * @privlevel public
6006  * @privilege %http://tizen.org/privilege/bluetooth
6007  *
6008  * @param[in] scan_filter The scan filter handle
6009  *
6010  * @return 0 on success, otherwise a negative error value.
6011  * @retval #BT_ERROR_NONE  Successful
6012  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
6013  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
6014  * @retval #BT_ERROR_NOW_IN_PROGRESS  Scan is in progress
6015  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
6016  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
6017  *
6018  * @pre The Bluetooth service must be initialized with bt_initialize().
6019  *
6020  */
6021 int bt_adapter_le_scan_filter_unregister(bt_scan_filter_h scan_filter);
6022
6023 /**
6024  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
6025  * @brief Unregisters all registered scan filters.
6026  * @since_tizen 4.0
6027  * @privlevel public
6028  * @privilege %http://tizen.org/privilege/bluetooth
6029  *
6030  * @return 0 on success, otherwise a negative error value.
6031  * @retval #BT_ERROR_NONE  Successful
6032  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
6033  * @retval #BT_ERROR_NOW_IN_PROGRESS  Scan is in progress
6034  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
6035  * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
6036  *
6037  * @pre The Bluetooth service must be initialized with bt_initialize().
6038  *
6039  */
6040 int bt_adapter_le_scan_filter_unregister_all(void);
6041
6042 /**
6043  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_50_MODULE
6044  * @brief Checks if LE 2M PHY feature is supported or not.
6045  * @since_tizen 5.0
6046  *
6047  * @remarks The LE 2M PHY feature was introduced in the BT 5.0 core specification.
6048  *
6049  * @param[out] is_supported The LE 2M PHY feature support: (@c true = supported , @c  false = not supported)
6050  *
6051  * @return 0 on success, otherwise a negative error value.
6052  * @retval #BT_ERROR_NONE  Successful
6053  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
6054  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
6055  * @retval #BT_ERROR_NOT_ENABLED  Adapter is not enabled
6056  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
6057  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
6058  *
6059  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
6060  */
6061 int bt_adapter_le_is_2m_phy_supported(bool *is_supported);
6062
6063 /**
6064  * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_50_MODULE
6065  * @brief Checks if LE CODED PHY feature is supported or not.
6066  * @since_tizen 5.0
6067  *
6068  * @remarks The LE CODED PHY feature was introduced in the BT 5.0 core specification.
6069  *
6070  * @param[out] is_supported The LE CODED PHY feature support: (@c true = supported , @c  false = not supported)
6071  *
6072  * @return 0 on success, otherwise a negative error value.
6073  * @retval #BT_ERROR_NONE  Successful
6074  * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
6075  * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
6076  * @retval #BT_ERROR_NOT_ENABLED  Adapter is not enabled
6077  * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
6078  * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
6079  *
6080  * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
6081  */
6082 int bt_adapter_le_is_coded_phy_supported(bool *is_supported);
6083
6084
6085
6086 #ifdef __cplusplus
6087 }
6088 #endif /* __cplusplus */
6089
6090 #endif /* __TIZEN_NETWORK_BLUETOOTH_H__ */