2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef __TIZEN_NETWORK_BLUETOOTH_H__
19 #define __TIZEN_NETWORK_BLUETOOTH_H__
24 #include <tizen_error.h>
26 #include "bluetooth_type.h"
31 #endif /* __cplusplus */
35 * @brief API to control the Bluetooth adapter and devices and communications.
36 * @ingroup CAPI_NETWORK_BLUETOOTH_MODULE
41 * @addtogroup CAPI_NETWORK_BLUETOOTH_MODULE
47 * @ingroup CAPI_NETWORK_BLUETOOTH_MODULE
48 * @brief Initializes the Bluetooth API.
51 * @remarks This function must be called before Bluetooth API starts. \n
52 * You must free all resources of the Bluetooth service by calling bt_deinitialize() if Bluetooth service is no longer needed.
54 * @return 0 on success, otherwise a negative error value.
55 * @retval #BT_ERROR_NONE Successful
56 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
58 * @see bt_deinitialize()
60 int bt_initialize(void);
64 * @ingroup CAPI_NETWORK_BLUETOOTH_MODULE
65 * @brief Releases all resources of the Bluetooth API.
68 * @remarks This function must be called if Bluetooth API is no longer needed.
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
75 * @pre Bluetooth API must be initialized with bt_initialize().
77 * @see bt_initialize()
79 int bt_deinitialize(void);
83 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
84 * @brief Enables the local Bluetooth adapter, asynchronously.
87 * @privilege %http://tizen.org/privilege/bluetooth.admin
89 * @details This function enables Bluetooth protocol stack and hardware.
91 * @return 0 on success, otherwise a negative error value.
92 * @retval #BT_ERROR_NONE Successful
93 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
94 * @retval #BT_ERROR_ALREADY_DONE Already enabled
95 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation now in progress
96 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
98 * @pre Bluetooth service must be initialized with bt_initialize().
99 * @pre The state of local Bluetooth must be #BT_ADAPTER_DISABLED
100 * @post This function invokes bt_adapter_state_changed_cb().
102 * @see bt_initialize()
103 * @see bt_adapter_get_state()
104 * @see bt_adapter_set_state_changed_cb()
105 * @see bt_adapter_unset_state_changed_cb()
106 * @see bt_adapter_state_changed_cb()
109 int bt_adapter_enable(void);
113 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
114 * @brief Disables the local Bluetooth adapter, asynchronously.
116 * @privlevel platform
117 * @privilege %http://tizen.org/privilege/bluetooth.admin
119 * @details This function disables Bluetooth protocol stack and hardware.
121 * @remarks You should disable Bluetooth adapter, which is helpful for saving power.
123 * @return 0 on success, otherwise a negative error value.
124 * @retval #BT_ERROR_NONE Successful
125 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
126 * @retval #BT_ERROR_NOT_ENABLED Not enabled
127 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation now in progress
128 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
130 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED
131 * @post This function invokes bt_adapter_state_changed_cb().
133 * @see bt_adapter_get_state()
134 * @see bt_adapter_state_changed_cb()
135 * @see bt_adapter_set_state_changed_cb()
136 * @see bt_adapter_unset_state_changed_cb ()
139 int bt_adapter_disable(void);
143 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
144 * @brief Recover the local Bluetooth adapter, asynchronously.
146 * @privlevel platform
147 * @privilege %http://tizen.org/privilege/bluetooth.admin
149 * @details This function does recovery logic, disables Bluetooth protocol stack and hardware, then enables after a few seconds.
151 * @return 0 on success, otherwise a negative error value.
152 * @retval #BT_ERROR_NONE Successful
153 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
154 * @retval #BT_ERROR_NOT_ENABLED Not enabled
155 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation now in progress
156 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
158 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED
159 * @post This function invokes bt_adapter_state_changed_cb().
161 * @see bt_adapter_get_state()
162 * @see bt_adapter_state_changed_cb()
163 * @see bt_adapter_set_state_changed_cb()
164 * @see bt_adapter_unset_state_changed_cb ()
167 int bt_adapter_recover(void);
171 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
172 * @brief Reset the local Bluetooth adapter, synchronously.
174 * @privlevel platform
175 * @privilege %http://tizen.org/privilege/bluetooth.admin
177 * @details This function resets Bluetooth protocol and values.
179 * @return 0 on success, otherwise a negative error value.
180 * @retval #BT_ERROR_NONE Successful
181 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
182 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
183 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
185 * @pre Bluetooth service must be initialized with bt_initialize().
186 * @post bt_adapter_state_changed_cb() will be invoked if The state of local Bluetooth was #BT_ADAPTER_ENABLED.
188 * @see bt_initialize()
189 * @see bt_adapter_get_state()
190 * @see bt_adapter_set_state_changed_cb()
191 * @see bt_adapter_unset_state_changed_cb()
192 * @see bt_adapter_state_changed_cb()
195 int bt_adapter_reset(void);
198 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
199 * @brief Gets the current state of local Bluetooth adapter.
202 * @param[out] adapter_state The current adapter state
204 * @return 0 on success, otherwise a negative error value.
205 * @retval #BT_ERROR_NONE Successful
206 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
207 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
209 * @pre Bluetooth service must be initialized with bt_initialize().
211 * @see bt_initialize()
213 int bt_adapter_get_state(bt_adapter_state_e *adapter_state);
216 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
217 * @brief Gets the address of local Bluetooth adapter.
220 * @remarks The @a local_address must be released with free() by you.
222 * @param[out] local_address The device address of local Bluetooth adapter
224 * @return 0 on success, otherwise a negative error value.
225 * @retval #BT_ERROR_NONE Successful
226 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
227 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
228 * @retval #BT_ERROR_NOT_ENABLED Not enabled
229 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
230 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
231 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
232 * @see bt_adapter_get_name()
234 int bt_adapter_get_address(char **local_address);
238 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
239 * @brief Gets the version of local Bluetooth adapter.
241 * @remarks The @a local_version must be released with free() by you.
243 * @param[out] local_version The version of local Bluetooth adapter
245 * @return 0 on success, otherwise a negative error value.
246 * @retval #BT_ERROR_NONE Successful
247 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
248 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
249 * @retval #BT_ERROR_NOT_ENABLED Not enabled
250 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
251 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
252 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
254 int bt_adapter_get_version(char **local_version);
258 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
259 * @brief Gets the information regarding local Bluetooth adapter.
261 * @remarks The @a all parameters must be released with free() by you.
263 * @param[out] chipset Chipset name of local Bluetooth adapter
264 * @param[out] firmware Firmware info. of local Bluetooth adapter
265 * @param[out] stack_version Bluetooth stack version
266 * @param[out] profiles The profile list of local Bluetooth adapter
268 * @return 0 on success, otherwise a negative error value.
269 * @retval #BT_ERROR_NONE Successful
270 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
271 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
272 * @retval #BT_ERROR_NOT_ENABLED Not enabled
273 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
274 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
275 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
277 int bt_adapter_get_local_info(char **chipset, char **firmware, char **stack_version, char **profiles);
280 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
281 * @brief Gets the name of local Bluetooth adapter.
284 * @details Use this function to get the friendly name associated with Bluetooth
285 * device, retrieved by the remote Bluetooth devices.
287 * @remarks The @a local_name must be released with free() by you.
289 * @param[out] local_name The local device name
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_OUT_OF_MEMORY Out of memory
297 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
299 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
301 * @see bt_adapter_set_name()
303 int bt_adapter_get_name(char **local_name);
306 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
307 * @brief Sets the name of local Bluetooth adapter.
310 * @privilege %http://tizen.org/privilege/bluetooth
312 * @param[in] local_name The name of the Bluetooth device. \n
313 * The maximum length is 248 characters.
315 * @return 0 on success, otherwise a negative error value.
316 * @retval #BT_ERROR_NONE Successful
317 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
318 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
319 * @retval #BT_ERROR_NOT_ENABLED Not enabled
320 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
321 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
323 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
324 * @post bt_adapter_name_changed_cb() will be invoked if this function returns #BT_ERROR_NONE.
326 * @see bt_adapter_get_name()
327 * @see bt_adapter_name_changed_cb()
328 * @see bt_adapter_set_name_changed_cb()
329 * @see bt_adapter_unset_name_changed_cb()
331 int bt_adapter_set_name(const char *local_name);
334 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
335 * @brief Gets the visibility mode of local Bluetooth adapter.
337 * @param[out] mode The visibility mode of the Bluetooth device
338 * @param[out] duration The duration until the visibility mode is changed to #BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE (in seconds).
339 * @a duration is valid only if @a mode is #BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE. This value can be NULL.
340 * @return 0 on success, otherwise a negative error value.
341 * @retval #BT_ERROR_NONE Successful
342 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
343 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
344 * @retval #BT_ERROR_NOT_ENABLED Not enabled
345 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
346 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
348 int bt_adapter_get_visibility(bt_adapter_visibility_mode_e *mode, int *duration);
352 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
353 * @brief Sets the visibility mode.
355 * @privlevel platform
356 * @privilege %http://tizen.org/privilege/bluetooth.admin
358 * @remarks #BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE will change to #BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE
359 * after the given @a duration goes.
361 * @param[in] discoverable_mode The Bluetooth visibility mode to set
362 * @param[in] duration The duration until the visibility mode is changed to #BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE (in seconds).
363 * @a duration is used only for #BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE mode.
365 * @return 0 on success, otherwise a negative error value.
366 * @retval #BT_ERROR_NONE Successful
367 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
368 * @retval #BT_ERROR_NOT_ENABLED Not enabled
369 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
370 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
371 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
373 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
374 * @post bt_adapter_visibility_mode_changed_cb() will be invoked if this function returns #BT_ERROR_NONE.
376 * @see bt_adapter_get_visibility()
377 * @see bt_adapter_visibility_mode_changed_cb()
378 * @see bt_adapter_set_visibility_mode_changed_cb()
379 * @see bt_adapter_unset_visibility_mode_changed_cb()
381 int bt_adapter_set_visibility(bt_adapter_visibility_mode_e discoverable_mode, int duration);
384 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
385 * @brief Starts the device discovery, asynchronously.
388 * @privilege %http://tizen.org/privilege/bluetooth
390 * @details If a device is discovered, bt_adapter_device_discovery_state_changed_cb() will be invoked
391 * with #BT_ADAPTER_DEVICE_DISCOVERY_FOUND, and then bt_adapter_device_discovery_state_changed_cb()
392 * will be called with #BT_ADAPTER_DEVICE_DISCOVERY_FINISHED in case of the completion or cancellation of the discovery.
394 * @remarks To connect to peer Bluetooth device, you need to know its Bluetooth address. \n
395 * The device discovery can be stopped by bt_adapter_stop_device_discovery().
397 * @return 0 on success, otherwise a negative error value.
398 * @retval #BT_ERROR_NONE Successful
399 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
400 * @retval #BT_ERROR_NOT_ENABLED Not enabled
401 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation is now in progress
402 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
403 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
405 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
406 * @post This function invokes bt_adapter_device_discovery_state_changed_cb().
408 * @see bt_adapter_is_discovering()
409 * @see bt_adapter_stop_device_discovery()
410 * @see bt_adapter_device_discovery_state_changed_cb()
411 * @see bt_adapter_set_device_discovery_state_changed_cb()
412 * @see bt_adapter_unset_device_discovery_state_changed_cb()
414 int bt_adapter_start_device_discovery(void);
417 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
418 * @brief Stops the device discovery, asynchronously.
421 * @privilege %http://tizen.org/privilege/bluetooth
422 * @remarks The device discovery process will take 10 ~ 20 seconds to get all the devices in vicinity.
424 * @return 0 on success, otherwise a negative error value.
425 * @retval #BT_ERROR_NONE Successful
426 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
427 * @retval #BT_ERROR_NOT_ENABLED Not enabled
428 * @retval #BT_ERROR_NOT_IN_PROGRESS Operation is not in progress
429 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
430 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
432 * @pre The device discovery must be in progress with bt_adapter_start_device_discovery().
433 * @post This function invokes bt_adapter_device_discovery_state_changed_cb().
435 * @see bt_adapter_is_discovering()
436 * @see bt_adapter_start_device_discovery()
437 * @see bt_adapter_set_device_discovery_state_changed_cb()
438 * @see bt_adapter_unset_device_discovery_state_changed_cb()
439 * @see bt_adapter_device_discovery_state_changed_cb()
441 int bt_adapter_stop_device_discovery(void);
444 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
445 * @brief Checks for the device discovery is in progress or not.
448 * @remarks If Bluetooth discovery is in progress, other operations are not allowed and
449 * you have to either stop the discovery operation, or wait for it to be finished,
450 * before performing other operations.
452 * @param[out] is_discovering The discovering status: (@c true = in progress , @c false = not in progress )
454 * @return 0 on success, otherwise a negative error value.
455 * @retval #BT_ERROR_NONE Successful
456 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
457 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
458 * @retval #BT_ERROR_NOT_ENABLED Not enabled
459 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
461 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
463 * @see bt_adapter_start_device_discovery()
464 * @see bt_adapter_stop_device_discovery()
466 int bt_adapter_is_discovering(bool *is_discovering);
469 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
470 * @brief Get the service mask from the uuid list.
473 * @param[in] uuids The UUID list of the device.
474 * @param[in] no_of_service The number of the UUID list count.
475 * @param[out] service_mask_list Service mask list converted from the given UUID list.
477 * @return 0 on success, otherwise a negative error value.
478 * @retval #BT_ERROR_NONE Successful
479 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
481 * @see bt_service_class_t
483 int bt_device_get_service_mask_from_uuid_list(char **uuids,
485 bt_service_class_t *service_mask_list);
488 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
489 * @brief Retrieves the device information of all bonded devices.
492 * @param [in] callback The callback function to invoke
493 * @param [in] user_data The user data passed from the foreach function
495 * @return 0 on success, otherwise a negative error value.
496 * @retval #BT_ERROR_NONE Successful
497 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
498 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
499 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
500 * @retval #BT_ERROR_NOT_ENABLED Not enabled
501 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
503 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
504 * @post This function invokes bt_adapter_bonded_device_cb().
506 * @see bt_adapter_bonded_device_cb()
508 int bt_adapter_foreach_bonded_device(bt_adapter_bonded_device_cb callback, void *user_data);
511 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
512 * @brief Gets the device information of a bonded device.
514 * @remarks The @a device_info must be released with bt_adapter_free_device_info() by you .
516 * @param [in] remote_address The address of remote device
517 * @param [out] device_info The bonded device information
519 * @return 0 on success, otherwise a negative error value.
520 * @retval #BT_ERROR_NONE Successful
521 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
522 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
523 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
524 * @retval #BT_ERROR_NOT_ENABLED Not enabled
525 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
526 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
528 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
529 * @post This function invokes bt_adapter_bonded_device_cb().
531 * @see bt_adapter_bonded_device_cb()
533 int bt_adapter_get_bonded_device_info(const char *remote_address, bt_device_info_s **device_info);
536 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
537 * @brief Frees device info.
540 * @param [in] device_info The bonded device information
542 * @return 0 on success, otherwise a negative error value.
543 * @retval #BT_ERROR_NONE Successful
544 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
546 * @see bt_adapter_get_bonded_device_info()
548 int bt_adapter_free_device_info(bt_device_info_s *device_info);
551 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
552 * @brief Checks whether the UUID of service is used or not
554 * @param[in] service_uuid The UUID of service
555 * @param[out] used Indicates whether the service is used or not
556 * @return true on success, otherwise false.
557 * @return 0 on success, otherwise a negative error value.
558 * @retval #BT_ERROR_NONE Successful
559 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
560 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
561 * @retval #BT_ERROR_NOT_ENABLED Not enabled
562 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
564 int bt_adapter_is_service_used(const char *service_uuid, bool *used);
567 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
568 * @brief Registers a callback function to be invoked when the Bluetooth adapter state changes.
571 * @param[in] callback The callback function to invoke
572 * @param[in] user_data The user data to be passed to the callback function
574 * @return 0 on success, otherwise a negative error value.
575 * @retval #BT_ERROR_NONE Successful
576 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
577 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
579 * @pre The Bluetooth service must be initialized with bt_initialize().
580 * @post bt_adapter_state_changed_cb() will be invoked.
582 * @see bt_initialize()
583 * @see bt_adapter_state_changed_cb()
584 * @see bt_adapter_set_state_changed_cb()
585 * @see bt_adapter_unset_state_changed_cb()
587 int bt_adapter_set_state_changed_cb(bt_adapter_state_changed_cb callback, void *user_data);
590 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
591 * @brief Unregisters the callback function.
594 * @return 0 on success, otherwise a negative error value.
595 * @retval #BT_ERROR_NONE Successful
596 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
598 * @pre The Bluetooth service must be initialized with bt_initialize().
600 * @see bt_initialize()
601 * @see bt_adapter_set_state_changed_cb()
603 int bt_adapter_unset_state_changed_cb(void);
606 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
607 * @brief Registers a callback function to be invoked when the name of Bluetooth adapter changes.
610 * @param[in] callback The callback function to invoke
611 * @param[in] user_data The user data to be passed to the callback function
613 * @return 0 on success, otherwise a negative error value.
614 * @retval #BT_ERROR_NONE Successful
615 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
616 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
618 * @pre The Bluetooth service must be initialized with bt_initialize().
619 * @post bt_adapter_name_changed_cb() will be invoked.
621 * @see bt_initialize()
622 * @see bt_adapter_name_changed_cb()
623 * @see bt_adapter_unset_name_changed_cb()
625 int bt_adapter_set_name_changed_cb(bt_adapter_name_changed_cb callback, void *user_data);
628 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
629 * @brief Unregisters the callback function.
632 * @return 0 on success, otherwise a negative error value.
633 * @retval #BT_ERROR_NONE Successful
634 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
636 * @pre The Bluetooth service must be initialized with bt_initialize().
638 * @see bt_initialize()
639 * @see bt_adapter_set_name_changed_cb()
641 int bt_adapter_unset_name_changed_cb(void);
644 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
645 * @brief Registers a callback function to be invoked when the visibility mode changes.
648 * @param[in] callback The callback function to register
649 * @param[in] user_data The user data to be passed to the callback function
651 * @return 0 on success, otherwise a negative error value.
652 * @retval #BT_ERROR_NONE Successful
653 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
654 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
656 * @pre The Bluetooth service must be initialized with bt_initialize().
657 * @post bt_adapter_visibility_mode_changed_cb() will be invoked.
659 * @see bt_initialize()
660 * @see bt_adapter_visibility_mode_changed_cb()
661 * @see bt_adapter_unset_visibility_mode_changed_cb()
663 int bt_adapter_set_visibility_mode_changed_cb(bt_adapter_visibility_mode_changed_cb callback, void *user_data);
666 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
667 * @brief Unregisters the callback function.
670 * @return 0 on success, otherwise a negative error value.
671 * @retval #BT_ERROR_NONE Successful
672 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
674 * @pre The Bluetooth service must be initialized with bt_initialize().
676 * @see bt_initialize()
677 * @see bt_adapter_set_visibility_mode_changed_cb()
679 int bt_adapter_unset_visibility_mode_changed_cb(void);
682 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
683 * @brief Registers a callback function to be invoked every second
685 * until the visibility mode is changed from #BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE
686 * to #BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE.
687 * @details When you set visibility mode as #BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE,
688 * @a callback will be called every second until visibility mode is changed to #BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE.
689 * @param[in] callback The callback function to register
690 * @param[in] user_data The user data to be passed to the callback function
691 * @return 0 on success, otherwise a negative error value.
692 * @retval #BT_ERROR_NONE Successful
693 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
694 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
695 * @pre The Bluetooth service must be initialized by bt_initialize().
696 * @post bt_adapter_visibility_duration_changed_cb() will be invoked.
697 * @see bt_initialize()
698 * @see bt_adapter_visibility_duration_changed_cb()
699 * @see bt_adapter_unset_visibility_duration_changed_cb()
701 int bt_adapter_set_visibility_duration_changed_cb(bt_adapter_visibility_duration_changed_cb callback, void *user_data);
704 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
705 * @brief Unregisters the callback function.
707 * @return 0 on success, otherwise a negative error value.
708 * @retval #BT_ERROR_NONE Successful
709 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
710 * @pre The Bluetooth service must be initialized with bt_initialize().
711 * @see bt_initialize()
712 * @see bt_adapter_set_visibility_duration_changed_cb()
714 int bt_adapter_unset_visibility_duration_changed_cb(void);
717 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
718 * @brief Registers a callback function to be invoked when the device discovery state changes.
721 * @param[in] callback The callback function to register
722 * @param[in] user_data The user data to be passed to the callback function
724 * @return 0 on success, otherwise a negative error value.
725 * @retval #BT_ERROR_NONE Successful
726 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
727 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
729 * @pre The Bluetooth service must be initialized with bt_initialize().
730 * @post bt_adapter_device_discovery_state_changed_cb() will be invoked.
732 * @see bt_initialize()
733 * @see bt_adapter_device_discovery_state_changed_cb()
734 * @see bt_adapter_set_device_discovery_state_changed_cb()
735 * @see bt_adapter_unset_device_discovery_state_changed_cb()
737 int bt_adapter_set_device_discovery_state_changed_cb(bt_adapter_device_discovery_state_changed_cb callback, void *user_data);
740 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
741 * @brief Unregisters the callback function.
744 * @return 0 on success, otherwise a negative error value.
745 * @retval #BT_ERROR_NONE Successful
746 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
748 * @pre The Bluetooth service must be initialized with bt_initialize().
750 * @see bt_initialize()
751 * @see bt_adapter_set_device_discovery_state_changed_cb()
753 int bt_adapter_unset_device_discovery_state_changed_cb(void);
756 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
757 * @brief Get the Hash and Randmoizer value, synchronously.
760 * @param[out] hash The hash value recieved from the controller
761 * @param[out] randomizer The hash value recieved from the controller
762 * @param[out] hash_len The length of the hash value
763 * @param[out] randomizer_len The length of the randomizer value
764 * @return 0 on success, otherwise a negative error value.
765 * @retval #BT_ERROR_NONE Successful
766 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
767 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
768 * @retval #BT_ERROR_NOT_ENABLED Not enabled
769 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
771 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
772 * @pre The Bluetooth service must be initialized with bt_initialize().
773 * @see bt_initialize()
775 int bt_adapter_get_local_oob_data(unsigned char **hash, unsigned char **randomizer,
776 int *hash_len, int *randomizer_len);
779 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
780 * @brief Sets the Hash and Randmoizer value, synchronously.
783 * @privilege %http://tizen.org/privilege/bluetooth
785 * @param[in] remote_address Remote device address
786 * @param[in] hash The hash value recieved from the controller
787 * @param[in] randomizer The hash value recieved from the controller
788 * @param[in] hash_len The length of the hash value. Allowed value is 16
789 * @param[in] randomizer_len The length of the randomizer value. Allowed value is 16
790 * @return 0 on success, otherwise a negative error value.
791 * @retval #BT_ERROR_NONE Successful
792 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
793 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
794 * @retval #BT_ERROR_NOT_ENABLED Not enabled
795 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
796 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
798 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
799 * @pre The Bluetooth service must be initialized with bt_initialize().
800 * @see bt_initialize()
802 int bt_adapter_set_remote_oob_data(const char *remote_address,
803 unsigned char *hash, unsigned char *randomizer,
804 int hash_len, int randomizer_len);
806 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
807 * @brief Deletes the Hash and Randomizer value, synchronously.
810 * @privilege %http://tizen.org/privilege/bluetooth
812 * @param[in] remote_address Remote device address
813 * @return 0 on success, otherwise a negative error value.
814 * @retval #BT_ERROR_NONE Successful
815 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
816 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
817 * @retval #BT_ERROR_NOT_ENABLED Not enabled
818 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
819 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
821 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
822 * @pre The Bluetooth service must be initialized with bt_initialize().
823 * @see bt_initialize()
825 int bt_adapter_remove_remote_oob_data(const char *remote_address);
829 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
830 * @brief Registers a callback function to be invoked when the connectable state changes.
833 * @param[in] callback The callback function to register
834 * @param[in] user_data The user data to be passed to the callback function
836 * @return 0 on success, otherwise a negative error value.
837 * @retval #BT_ERROR_NONE Successful
838 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
839 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
841 * @pre The Bluetooth service must be initialized with bt_initialize().
842 * @post bt_adapter_connectable_changed_cb() will be invoked.
844 * @see bt_initialize()
845 * @see bt_adapter_connectable_changed_cb()
846 * @see bt_adapter_unset_connectable_changed_cb()
848 int bt_adapter_set_connectable_changed_cb(bt_adapter_connectable_changed_cb callback, void *user_data);
852 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
853 * @brief Unregisters the callback function.
856 * @return 0 on success, otherwise a negative error value.
857 * @retval #BT_ERROR_NONE Successful
858 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
860 * @pre The Bluetooth service must be initialized with bt_initialize().
862 * @see bt_initialize()
863 * @see bt_adapter_set_connectable_changed_cb()
865 int bt_adapter_unset_connectable_changed_cb(void);
869 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
870 * @brief Gets the connectable state of local Bluetooth adapter.
873 * @remarks When connectable state is false, no device can connect to this device and visibility mode cannot be changed.
875 * @param[out] connectable The connectable state of local Bluetooth adapter
877 * @return 0 on success, otherwise a negative error value.
878 * @retval #BT_ERROR_NONE Successful
879 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
880 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
881 * @retval #BT_ERROR_NOT_ENABLED Not enabled
882 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
884 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
886 * @see bt_adapter_set_connectable()
888 int bt_adapter_get_connectable(bool *connectable);
892 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
893 * @brief Sets the connectable state of local Bluetooth adapter.
895 * @privlevel platform
896 * @privilege %http://tizen.org/privilege/bluetooth.admin
898 * @remarks When connectable state is false, no device can connect to this device and visibility mode cannot be changed.
900 * @param[in] connectable The connectable state to set
902 * @return 0 on success, otherwise a negative error value.
903 * @retval #BT_ERROR_NONE Successful
904 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
905 * @retval #BT_ERROR_NOT_ENABLED Not enabled
906 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
907 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
909 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
910 * @post bt_adapter_connectable_changed_cb() will be invoked if this function returns #BT_ERROR_NONE.
912 * @see bt_adapter_get_connectable()
913 * @see bt_adapter_connectable_changed_cb()
914 * @see bt_adapter_set_connectable_changed_cb()
915 * @see bt_adapter_unset_connectable_changed_cb()
917 int bt_adapter_set_connectable(bool connectable);
921 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
922 * @brief Enables the local Bluetooth le adapter, asynchronously.
924 * @privlevel platform
925 * @privilege %http://tizen.org/privilege/bluetooth.admin
927 * @details This function enables Bluetooth protocol stack and hardware.
929 * @return 0 on success, otherwise a negative error value.
930 * @retval #BT_ERROR_NONE Successful
931 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
932 * @retval #BT_ERROR_ALREADY_DONE Already enabled
933 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation now in progress
934 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
936 * @pre Bluetooth service must be initialized with bt_initialize().
937 * @post This function invokes bt_adapter_le_state_changed_cb().
939 * @see bt_initialize()
940 * @see bt_adapter_le_get_state()
941 * @see bt_adapter_le_set_state_changed_cb()
942 * @see bt_adapter_le_unset_state_changed_cb()
943 * @see bt_adapter_le_state_changed_cb()
946 int bt_adapter_le_enable(void);
950 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
951 * @brief Disables the local Bluetooth le adapter, asynchronously.
953 * @privlevel platform
954 * @privilege %http://tizen.org/privilege/bluetooth.admin
956 * @details This function disables Bluetooth le protocol stack and hardware.
960 * @return 0 on success, otherwise a negative error value.
961 * @retval #BT_ERROR_NONE Successful
962 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
963 * @retval #BT_ERROR_NOT_ENABLED Not enabled
964 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation now in progress
965 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
967 * @pre The state of local Bluetooth must be #BT_ADAPTER_LE_ENABLED
968 * @post This function invokes bt_adapter_le_state_changed_cb().
970 * @see bt_adapter_le_get_state()
971 * @see bt_adapter_le_state_changed_cb()
972 * @see bt_adapter_le_set_state_changed_cb()
973 * @see bt_adapter_le_unset_state_changed_cb ()
976 int bt_adapter_le_disable(void);
980 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
981 * @brief Gets the current state of local Bluetooth adapter.
984 * @param[out] adapter_le_state The current adapter le state
986 * @return 0 on success, otherwise a negative error value.
987 * @retval #BT_ERROR_NONE Successful
988 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
989 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
991 * @pre Bluetooth service must be initialized with bt_initialize().
993 * @see bt_initialize()
995 int bt_adapter_le_get_state(bt_adapter_le_state_e *adapter_le_state);
998 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
999 * @brief Starts the LE device discovery for a BT_ADAPTER_DEVICE_DISCOVERY_LE type.
1002 * @privilege %http://tizen.org/privilege/bluetooth
1004 * @details If a LE device is discovered, bt_adapter_le_device_discovery_state_changed_cb()
1005 * will be invoked with #BT_ADAPTER_LE_DEVICE_DISCOVERY_FOUND, and then bt_adapter_le_device_discovery_state_changed_cb()
1006 * will be called with #BT_ADAPTER_LE_DEVICE_DISCOVERY_FINISHED in case of the completion or cancellation of the discovery.
1008 * @remarks To connect to peer Bluetooth device, you need to know its Bluetooth address. \n
1009 * The device discovery can be stopped by bt_adapter_le_stop_device_discovery().
1011 * @return 0 on success, otherwise a negative error value.
1012 * @retval #BT_ERROR_NONE Successful
1013 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1014 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1015 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation is now in progress
1016 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1017 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1019 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1020 * or must be #BT_ADAPTER_LE_ENABLED.
1021 * @post This function invokes bt_adapter_le_device_discovery_state_changed_cb().
1023 * @see bt_adapter_le_is_discovering()
1024 * @see bt_adapter_le_device_discovery_state_changed_cb()
1025 * @see bt_adapter_le_set_device_discovery_state_changed_cb()
1026 * @see bt_adapter_le_unset_device_discovery_state_changed_cb()
1028 int bt_adapter_le_start_device_discovery(void);
1031 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1032 * @brief Stops the LE device discovery, asynchronously.
1035 * @privilege %http://tizen.org/privilege/bluetooth
1037 * @return 0 on success, otherwise a negative error value.
1038 * @retval #BT_ERROR_NONE Successful
1039 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1040 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1041 * @retval #BT_ERROR_NOT_IN_PROGRESS Operation is not in progress
1042 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1043 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1045 * @pre The device discovery must be in progress with bt_adapter_le_start_device_discovery().
1046 * @post This function invokes bt_adapter_le_device_discovery_state_changed_cb().
1048 * @see bt_adapter_le_is_discovering()
1049 * @see bt_adapter_le_start_device_discovery()
1050 * @see bt_adapter_le_set_device_discovery_state_changed_cb()
1051 * @see bt_adapter_le_unset_device_discovery_state_changed_cb()
1052 * @see bt_adapter_le_device_discovery_state_changed_cb()
1054 int bt_adapter_le_stop_device_discovery(void);
1057 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1058 * @brief Checks for the LE device discovery is in progress or not.
1061 * @remarks If Bluetooth LE discovery is in progress, other operations are not allowed and
1062 * you have to either stop the LE discovery operation, or wait for it to be finished,
1063 * before performing other operations.
1065 * @param[out] is_discovering The discovering status: (@c true = in progress , @c false = not in progress )
1067 * @return 0 on success, otherwise a negative error value.
1068 * @retval #BT_ERROR_NONE Successful
1069 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1070 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1071 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1072 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1074 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1075 * or must be #BT_ADAPTER_LE_ENABLED.
1077 * @see bt_adapter_le_start_device_discovery()
1078 * @see bt_adapter_le_stop_device_discovery()
1080 int bt_adapter_le_is_discovering(bool *is_discovering);
1083 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1084 * @brief Registers a callback function to be invoked when the LE device discovery state changes.
1087 * @param[in] callback The callback function to register
1088 * @param[in] user_data The user data to be passed to the callback function
1090 * @return 0 on success, otherwise a negative error value.
1091 * @retval #BT_ERROR_NONE Successful
1092 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1093 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1095 * @pre The Bluetooth service must be initialized with bt_initialize().
1096 * @post bt_adapter_le_device_discovery_state_changed_cb() will be invoked.
1098 * @see bt_initialize()
1099 * @see bt_adapter_le_device_discovery_state_changed_cb()
1100 * @see bt_adapter_le_unset_device_discovery_state_changed_cb()
1102 int bt_adapter_le_set_device_discovery_state_changed_cb(bt_adapter_le_device_discovery_state_changed_cb callback, void *user_data);
1105 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1106 * @brief Unregisters the callback function.
1109 * @return 0 on success, otherwise a negative error value.
1110 * @retval #BT_ERROR_NONE Successful
1111 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1113 * @pre The Bluetooth service must be initialized with bt_initialize().
1115 * @see bt_initialize()
1116 * @see bt_adapter_le_set_device_discovery_state_changed_cb()
1118 int bt_adapter_le_unset_device_discovery_state_changed_cb(void);
1122 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1123 * @brief Registers a callback function to be invoked when the Bluetooth adapter le state changes.
1126 * @param[in] callback The callback function to invoke
1127 * @param[in] user_data The user data to be passed to the callback function
1129 * @return 0 on success, otherwise a negative error value.
1130 * @retval #BT_ERROR_NONE Successful
1131 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1132 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1134 * @pre The Bluetooth service must be initialized with bt_initialize().
1135 * @post bt_adapter_le_state_changed_cb() will be invoked.
1137 * @see bt_initialize()
1138 * @see bt_adapter_le_state_changed_cb()
1139 * @see bt_adapter_le_unset_state_changed_cb()
1141 int bt_adapter_le_set_state_changed_cb(bt_adapter_le_state_changed_cb callback, void *user_data);
1145 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1146 * @brief Unregisters the callback function.
1149 * @return 0 on success, otherwise a negative error value.
1150 * @retval #BT_ERROR_NONE Successful
1151 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1153 * @pre The Bluetooth service must be initialized with bt_initialize().
1155 * @see bt_initialize()
1156 * @see bt_adapter_le_set_state_changed_cb()
1158 int bt_adapter_le_unset_state_changed_cb(void);
1162 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1163 * @brief add address to whitelist for accepting scanning request.
1165 * @privlevel platform
1166 * @privilege %http://tizen.org/privilege/bluetooth.admin
1168 * @remarks If the adress is in the whitelist then other LE devices are able to
1169 * search this device. Before calling this API, make sure that the adapter is
1170 * enabled. There is no callback event for this API.
1172 * @param[in] address The other device's address
1173 * @param[in] address_type The other device's address type
1175 * @return 0 on success, otherwise a negative error value.
1176 * @retval #BT_ERROR_NONE Successful
1177 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1178 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1179 * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
1180 * @retval #BT_ERROR_RESOURCE_BUSY Device or resource busy
1181 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1182 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1184 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1186 * @see bt_adapter_le_start_advertising()
1187 * @see bt_adapter_le_stop_advertising()
1189 int bt_adapter_le_add_white_list(const char *address, bt_device_address_type_e address_type);
1193 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1194 * @brief remove address from the whitelist for not accepting scanning request.
1196 * @privlevel platform
1197 * @privilege %http://tizen.org/privilege/bluetooth.admin
1199 * @remarks If the adress is in the whitelist then other LE devices are able to
1200 * search this device. Before calling this API, make sure that the adapter is
1201 * enabled. There is no callback event for this API.
1203 * @param[in] address The other device's address
1204 * @param[in] address_type The other device's address type
1206 * @return 0 on success, otherwise a negative error value.
1207 * @retval #BT_ERROR_NONE Successful
1208 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1209 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1210 * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
1211 * @retval #BT_ERROR_RESOURCE_BUSY Device or resource busy
1212 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1213 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1215 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1217 * @see bt_adapter_le_start_advertising()
1218 * @see bt_adapter_le_stop_advertising()
1220 int bt_adapter_le_remove_white_list(const char *address, bt_device_address_type_e address_type);
1224 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1225 * @brief clear address from the whitelist for not accepting scanning request.
1227 * @privlevel platform
1228 * @privilege %http://tizen.org/privilege/bluetooth.admin
1230 * @remarks If the adress is in the whitelist then other LE devices are able to
1231 * search this device. Before calling this API, make sure that the adapter is
1232 * enabled. There is no callback event for this API.
1234 * @return 0 on success, otherwise a negative error value.
1235 * @retval #BT_ERROR_NONE Successful
1236 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1237 * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
1238 * @retval #BT_ERROR_RESOURCE_BUSY Device or resource busy
1239 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1240 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1242 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1244 * @see bt_adapter_le_start_advertising()
1245 * @see bt_adapter_le_stop_advertising()
1247 int bt_adapter_le_clear_white_list(void);
1250 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1251 * @brief Create advertiser to advertise device's existence or respond to LE scanning reqeust.
1254 * @param[out] advertiser The handle of advertiser
1256 * @return 0 on success, otherwise a negative error value.
1257 * @retval #BT_ERROR_NONE Successful
1258 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1259 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1260 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
1262 * @pre The Bluetooth service must be initialized with bt_initialize().
1264 * @see bt_adapter_le_destroy_advertiser()
1266 int bt_adapter_le_create_advertiser(bt_advertiser_h *advertiser);
1269 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1270 * @brief Destroy advertiser.
1273 * @param[out] advertiser The handle of advertiser
1275 * @return 0 on success, otherwise a negative error value.
1276 * @retval #BT_ERROR_NONE Successful
1277 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1278 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1280 * @pre The Bluetooth service must be initialized with bt_initialize().
1282 * @see bt_adapter_le_create_advertiser()
1284 int bt_adapter_le_destroy_advertiser(bt_advertiser_h advertiser);
1287 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1288 * @brief Set the data to be advertised or responded to scan request from LE scanning device.
1289 * The maximum advertised or responded data size is 31 bytes
1290 * including data type and system wide data.
1293 * @param[in] advertiser The handle of advertiser
1294 * @param[in] pkt_type The packet type
1295 * @param[in] data_type The data type that is included in packet
1296 * @param[in] data The data to be advertised or be responded to scan request from LE scanning device
1297 * @param[in] data_size The size of data to be set.
1299 * @return 0 on success, otherwise a negative error value.
1300 * @retval #BT_ERROR_NONE Successful
1301 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1302 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1303 * @retval #BT_ERROR_QUOTA_EXCEEDED Quota exceeded
1304 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1306 * @pre The Bluetooth service must be initialized with bt_initialize().
1308 * @see bt_adapter_le_remove_advertising_data()
1309 * @see bt_adapter_le_clear_advertising_data()
1311 int bt_adapter_le_add_advertising_data(bt_advertiser_h advertiser,
1312 bt_adapter_le_packet_type_e pkt_type, bt_adapter_le_packet_data_type_e data_type,
1313 void *data, unsigned int data_size);
1316 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1317 * @brief Unset the data to be advertised or responded to scan request from LE scanning device.
1320 * @param[in] advertiser The handle of advertiser
1321 * @param[in] pkt_type The packet type
1322 * @param[in] data_type The data type to be removed from selected packet
1324 * @return 0 on success, otherwise a negative error value.
1325 * @retval #BT_ERROR_NONE Successful
1326 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1327 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1328 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1330 * @pre The Bluetooth service must be initialized with bt_initialize().
1332 * @see bt_adapter_le_add_advertising_data()
1333 * @see bt_adapter_le_clear_advertising_data()
1335 int bt_adapter_le_remove_advertising_data(bt_advertiser_h advertiser,
1336 bt_adapter_le_packet_type_e pkt_type, bt_adapter_le_packet_data_type_e data_type);
1339 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1340 * @brief Clear all data to be advertised or responded to scan request from LE scanning device.
1343 * @param[in] advertiser The handle of advertiser
1344 * @param[in] pkt_type The packet type to be cleared
1346 * @return 0 on success, otherwise a negative error value.
1347 * @retval #BT_ERROR_NONE Successful
1348 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1349 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1351 * @pre The Bluetooth service must be initialized with bt_initialize().
1353 * @see bt_adapter_le_add_advertising_data()
1354 * @see bt_adapter_le_remove_advertising_data()
1356 int bt_adapter_le_clear_advertising_data(bt_advertiser_h advertiser, bt_adapter_le_packet_type_e pkt_type);
1359 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1360 * @brief Start advertising with passed advertiser and advertising parameters.
1363 * @privilege %http://tizen.org/privilege/bluetooth
1365 * @details Once Bluetooth advertising is started, nearby Bluetooth LE(Low Energy) supported
1366 * devices can know this device's existence. And one of them can make a connection reqeust,
1369 * @param[in] advertiser The handle of advertiser
1370 * @param[in] adv_params The parameters of advertising \n
1371 * If NULL is passed, default values which are defined in driver / controller are used.
1372 * @param[in] cb The callback to report the result of this function
1373 * @param[in] user_data The user data to be passed when callback is called
1375 * @return 0 on success, otherwise a negative error value.
1376 * @retval #BT_ERROR_NONE Successful
1377 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1378 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1379 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1380 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation is now in progress
1381 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1382 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1384 * @pre The Bluetooth service must be initialized with bt_initialize().
1385 * @post This function invokes bt_adapter_le_advertising_state_changed_cb().
1387 * @see bt_adapter_le_stop_advertising()
1388 * @see bt_adapter_le_advertising_state_changed_cb()
1390 int bt_adapter_le_start_advertising(bt_advertiser_h advertiser, bt_adapter_le_advertising_params_s *adv_params,
1391 bt_adapter_le_advertising_state_changed_cb cb, void *user_data);
1393 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1394 * @brief Stops the advertising.
1397 * @privilege %http://tizen.org/privilege/bluetooth
1399 * @param[in] advertiser The handle of advertiser
1401 * @return 0 on success, otherwise a negative error value.
1402 * @retval #BT_ERROR_NONE Successful
1403 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1404 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1405 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1406 * @retval #BT_ERROR_NOT_IN_PROGRESS Operation is not in progress
1407 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1408 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1410 * @pre The advertising must be going on with bt_adapter_le_start_advertising().
1411 * @post This function invokes bt_adapter_le_advertising_state_changed_cb().
1413 * @see bt_adapter_le_start_advertising()
1414 * @see bt_adapter_le_advertising_state_changed_cb()
1416 int bt_adapter_le_stop_advertising(bt_advertiser_h advertiser);
1420 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
1421 * @brief Sets the Privacy feature state of local Bluetooth adapter.
1423 * @privlevel platform
1424 * @privilege %http://tizen.org/privilege/bluetooth.admin
1426 * @param[in] enable_privacy The privacy feature to set/unset.
1428 * @return 0 on success, otherwise a negative error value.
1429 * @retval #BT_ERROR_NONE Successful
1430 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1431 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1432 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1433 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1434 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1436 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1437 * @pre The state of local Bluetooth must be #BT_ADAPTER_LE_ENABLED.
1440 int bt_adapter_le_enable_privacy(bool enable_privacy);
1443 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1444 * @brief Creates a bond with a remote Bluetooth device, asynchronously.
1447 * @privilege %http://tizen.org/privilege/bluetooth
1449 * @remarks A bond can be destroyed by bt_device_destroy_bond().\n
1450 * The bonding request can be cancelled by bt_device_cancel_bonding().
1452 * @param[in] remote_address The address of the remote Bluetooth device with which the bond should be created
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_RESOURCE_BUSY Device or resource busy
1460 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1461 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1463 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1464 * @pre The remote device must be discoverable with bt_adapter_start_device_discovery().
1465 * @post This function invokes bt_device_bond_created_cb().
1467 * @see bt_adapter_start_device_discovery()
1468 * @see bt_device_bond_created_cb()
1469 * @see bt_device_cancel_bonding()
1470 * @see bt_device_destroy_bond()
1471 * @see bt_device_set_bond_created_cb()
1472 * @see bt_device_unset_bond_created_cb()
1474 int bt_device_create_bond(const char *remote_address);
1478 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1479 * @brief Creates a bond with a remote Bluetooth device, asynchronously.
1481 * @privlevel platform
1482 * @privilege %http://tizen.org/privilege/bluetooth.admin
1484 * @remarks A bond can be destroyed by bt_device_destroy_bond().\n
1485 * The bonding request can be cancelled by bt_device_cancel_bonding().
1487 * @param[in] remote_address The address of the remote Bluetooth device with which the bond should be created
1488 * @param[in] conn_type The connection type(LE or BREDR) to create bond with remote device
1490 * @return 0 on success, otherwise a negative error value.
1491 * @retval #BT_ERROR_NONE Successful
1492 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1493 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1494 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1495 * @retval #BT_ERROR_RESOURCE_BUSY Device or resource busy
1496 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1497 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1499 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1500 * @pre The remote device must be discoverable with bt_adapter_start_device_discovery().
1501 * @post This function invokes bt_device_bond_created_cb().
1503 * @see bt_adapter_start_device_discovery()
1504 * @see bt_device_create_bond()
1505 * @see bt_device_bond_created_cb()
1506 * @see bt_device_cancel_bonding()
1507 * @see bt_device_destroy_bond()
1508 * @see bt_device_set_bond_created_cb()
1509 * @see bt_device_unset_bond_created_cb()
1511 int bt_device_create_bond_by_type(const char *remote_address,
1512 bt_device_connection_link_type_e conn_type);
1515 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1516 * @brief Cancels the bonding process.
1519 * @privilege %http://tizen.org/privilege/bluetooth
1521 * @remarks Use this function when the remote Bluetooth device is not responding to the
1522 * bond request or you wish to cancel the bonding request.
1524 * @return 0 on success, otherwise a negative error value.
1525 * @retval #BT_ERROR_NONE Successful
1526 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1527 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1528 * @retval #BT_ERROR_NOT_IN_PROGRESS Operation not in progress
1529 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1531 * @pre The creating a bond must be in progress by bt_device_create_bond().
1533 * @see bt_device_create_bond()
1534 * @see bt_device_bond_created_cb()
1535 * @see bt_device_set_bond_created_cb()
1536 * @see bt_device_unset_bond_created_cb()
1538 int bt_device_cancel_bonding(void);
1541 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1542 * @brief Destroys the bond, asynchronously.
1545 * @privilege %http://tizen.org/privilege/bluetooth
1547 * @param[in] remote_address The address of the remote Bluetooth device to remove bonding
1549 * @return 0 on success, otherwise a negative error value.
1550 * @retval #BT_ERROR_NONE Successful
1551 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1552 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1553 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1554 * @retval #BT_ERROR_RESOURCE_BUSY Device or resource busy
1555 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
1556 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1557 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1559 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1560 * @pre The bond with the remote device must be created with bt_device_create_bond().
1561 * @post This function invokes bt_device_bond_destroyed_cb().
1563 * @see bt_device_create_bond()
1564 * @see bt_device_bond_destroyed_cb()
1565 * @see bt_device_set_bond_destroyed_cb()
1566 * @see bt_device_unset_bond_destroyed_cb()
1568 int bt_device_destroy_bond(const char *remote_address);
1571 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1572 * @brief Sets an alias for the bonded device.
1575 * @privilege %http://tizen.org/privilege/bluetooth
1577 * @param[in] remote_address The address of the remote Bluetooth device
1578 * @param[in] alias The alias of the remote Bluetooth device
1580 * @return 0 on success, otherwise a negative error value.
1581 * @retval #BT_ERROR_NONE Successful
1582 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1583 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1584 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1585 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
1586 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1587 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1589 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1590 * @pre The bond with the remote device must be created with bt_device_create_bond().
1592 * @see bt_device_create_bond()
1594 int bt_device_set_alias(const char *remote_address, const char *alias);
1597 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1598 * @brief Sets the authorization of a bonded device, asynchronously.
1601 * @privilege %http://tizen.org/privilege/bluetooth
1603 * @remarks Once a device is authorized, you don't need to receive a confirmation.
1605 * @param[in] remote_address The address of the remote Bluetooth device to authorize
1606 * @param[in] authorization_state The Bluetooth authorization state
1608 * @return 0 on success, otherwise a negative error value.
1609 * @retval #BT_ERROR_NONE Successful
1610 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1611 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1612 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1613 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
1614 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1615 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1617 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1618 * @pre The bond with the remote device must be created with bt_device_create_bond().
1619 * @post bt_device_authorization_changed_cb() will be invoked.
1621 * @see bt_device_create_bond()
1622 * @see bt_device_authorization_changed_cb()
1623 * @see bt_device_set_authorization_changed_cb()
1624 * @see bt_device_unset_authorization_changed_cb()
1626 int bt_device_set_authorization(const char *remote_address, bt_device_authorization_e authorization_state);
1629 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1630 * @brief Starts the search for services supported by the specified device, asynchronously.
1633 * @privilege %http://tizen.org/privilege/bluetooth
1635 * @remarks If creating a bond succeeds, which means bt_device_bond_created_cb() is called with result #BT_ERROR_NONE,
1636 * then you don't need to run this function.\n
1637 * The service search takes a couple of seconds to complete normally. \n
1638 * The service search can be canceled by bt_device_cancel_service_search().
1640 * @param[in] remote_address The address of the remote Bluetooth device whose services need to be checked
1642 * @return 0 on success, otherwise a negative error value.
1643 * @retval #BT_ERROR_NONE Successful
1644 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1645 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1646 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1647 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
1648 * @retval #BT_ERROR_SERVICE_SEARCH_FAILED Service search failed
1649 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1651 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1652 * @pre The remote device must be discoverable with bt_adapter_start_device_discovery().
1653 * @pre The bond with the remote device must be created with bt_device_create_bond().
1654 * @post This function invokes bt_device_service_searched_cb().
1656 * @see bt_adapter_start_device_discovery()
1657 * @see bt_device_create_bond()
1658 * @see bt_device_bond_created_cb()
1659 * @see bt_device_service_searched_cb()
1660 * @see bt_device_cancel_service_search()
1661 * @see bt_device_set_service_searched_cb()
1662 * @see bt_device_unset_service_searched_cb()
1664 int bt_device_start_service_search(const char *remote_address);
1668 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1669 * @brief Cancels service search process.
1671 * @privlevel platform
1672 * @privilege %http://tizen.org/privilege/bluetooth.admin
1674 * @return 0 on success, otherwise a negative error value.
1675 * @retval #BT_ERROR_NONE Successful
1676 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1677 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1678 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
1679 * @retval #BT_ERROR_NOT_IN_PROGRESS Operation not in progress
1680 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1681 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1683 * @pre The service search must be in progress by bt_device_start_service_search().
1685 * @see bt_device_start_service_search()
1686 * @see bt_device_service_searched_cb()
1687 * @see bt_device_set_service_searched_cb()
1688 * @see bt_device_unset_service_searched_cb()
1690 int bt_device_cancel_service_search(void);
1693 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1694 * @brief Gets the connected profiles.
1696 * @param[in] remote_address The address of the remote device
1697 * @param[in] callback The callback function to invoke
1698 * @param[in] user_data The user data to be passed to the callback function
1699 * @return 0 on success, otherwise a negative error value.
1700 * @retval #BT_ERROR_NONE Successful
1701 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1702 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1703 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1704 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1705 * @post bt_device_connected_profile() will be invoked.
1706 * @see bt_device_connected_profile()
1708 int bt_device_foreach_connected_profiles(const char *remote_address, bt_device_connected_profile callback, void *user_data);
1711 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1712 * @brief Gets the profile connected status.
1714 * @param[in] remote_address The address of the remote device
1715 * @param[in] bt_profile wish to know bt_profile
1716 * @param[out] connected_status the connected status
1717 * @return 0 on success, otherwise a negative error value.
1718 * @retval #BT_ERROR_NONE Successful
1719 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1720 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1721 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1722 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
1723 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1724 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1726 int bt_device_is_profile_connected(const char *remote_address, bt_profile_e bt_profile,
1727 bool *connected_status);
1730 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1731 * @brief Registers a callback function to be invoked when the bond creates.
1733 * @param[in] callback The callback function to register
1734 * @param[in] user_data The user data to be passed to the callback function
1735 * @return 0 on success, otherwise a negative error value.
1736 * @retval #BT_ERROR_NONE Successful
1737 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1738 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1739 * @pre The Bluetooth service must be initialized with bt_initialize().
1740 * @post bt_device_bond_created_cb() will be invoked.
1741 * @see bt_initialize()
1742 * @see bt_device_bond_created_cb()
1743 * @see bt_device_unset_bond_created_cb()
1745 int bt_device_set_bond_created_cb(bt_device_bond_created_cb callback, void *user_data);
1748 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1749 * @brief Unregisters the callback function.
1751 * @return 0 on success, otherwise a negative error value.
1752 * @retval #BT_ERROR_NONE Successful
1753 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1754 * @pre The Bluetooth service must be initialized with bt_initialize().
1755 * @see bt_initialize()
1756 * @see bt_device_set_bond_created_cb()
1758 int bt_device_unset_bond_created_cb(void);
1761 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1762 * @brief Registers a callback function to be invoked when the bond destroys.
1764 * @param[in] callback The callback function to register
1765 * @param[in] user_data The user data to be passed to the callback function
1766 * @return 0 on success, otherwise a negative error value.
1767 * @retval #BT_ERROR_NONE Successful
1768 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1769 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1770 * @pre The Bluetooth service must be initialized with bt_initialize().
1771 * @post bt_device_bond_destroyed_cb() will be invoked.
1772 * @see bt_initialize()
1773 * @see bt_device_bond_destroyed_cb()
1774 * @see bt_device_unset_bond_destroyed_cb()
1776 int bt_device_set_bond_destroyed_cb(bt_device_bond_destroyed_cb callback, void *user_data);
1779 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1780 * @brief Unregisters the callback function.
1782 * @return 0 on success, otherwise a negative error value.
1783 * @retval #BT_ERROR_NONE Successful
1784 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1785 * @pre The Bluetooth service must be initialized with bt_initialize().
1786 * @see bt_initialize()
1787 * @see bt_device_set_bond_destroyed_cb()
1789 int bt_device_unset_bond_destroyed_cb(void);
1792 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1793 * @brief Registers a callback function to be invoked when the authorization of device changes.
1795 * @param[in] callback The callback function to register
1796 * @param[in] user_data The user data to be passed to the callback function
1797 * @return 0 on success, otherwise a negative error value.
1798 * @retval #BT_ERROR_NONE Successful
1799 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1800 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1801 * @pre The Bluetooth service must be initialized with bt_initialize().
1802 * @post bt_device_authorization_changed_cb() will be invoked.
1803 * @see bt_initialize()
1804 * @see bt_device_authorization_changed_cb()
1805 * @see bt_device_set_authorization_changed_cb()
1806 * @see bt_device_unset_authorization_changed_cb()
1808 int bt_device_set_authorization_changed_cb(bt_device_authorization_changed_cb callback, void *user_data);
1811 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1812 * @brief Unregisters the callback function.
1814 * @return 0 on success, otherwise a negative error value.
1815 * @retval #BT_ERROR_NONE Successful
1816 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1817 * @pre The Bluetooth service must be initialized with bt_initialize().
1818 * @see bt_initialize()
1819 * @see bt_device_set_authorization_changed_cb()
1821 int bt_device_unset_authorization_changed_cb(void);
1824 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1825 * @brief Registers a callback function to be invoked when the process of service search finishes.
1827 * @param[in] callback The callback function to register
1828 * @param[in] user_data The user data to be passed to the callback function
1829 * @return 0 on success, otherwise a negative error value.
1830 * @retval #BT_ERROR_NONE Successful
1831 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1832 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1833 * @pre The Bluetooth service must be initialized with bt_initialize().
1834 * @post bt_device_service_searched_cb() will be invoked.
1835 * @see bt_initialize()
1836 * @see bt_device_service_searched_cb()
1837 * @see bt_device_unset_service_searched_cb()
1839 int bt_device_set_service_searched_cb(bt_device_service_searched_cb callback, void *user_data);
1842 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1843 * @brief Unregisters the callback function.
1845 * @return 0 on success, otherwise a negative error value.
1846 * @retval #BT_ERROR_NONE Successful
1847 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1848 * @pre The Bluetooth service must be initialized with bt_initialize().
1849 * @see bt_initialize()
1850 * @see bt_device_set_service_searched_cb()
1852 int bt_device_unset_service_searched_cb(void);
1855 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1856 * @brief Registers a callback function to be invoked when the connection state is changed.
1858 * @param[in] callback The callback function to register
1859 * @param[in] user_data The user data to be passed to the callback function
1860 * @return 0 on success, otherwise a negative error value.
1861 * @retval #BT_ERROR_NONE Successful
1862 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1863 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1864 * @pre The Bluetooth service must be initialized with bt_initialize().
1865 * @post bt_device_connection_state_changed_cb() will be invoked.
1866 * @see bt_initialize()
1867 * @see bt_device_connection_state_changed_cb()
1868 * @see bt_device_unset_connection_state_changed_cb()
1870 int bt_device_set_connection_state_changed_cb(bt_device_connection_state_changed_cb callback, void *user_data);
1873 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1874 * @brief Unregisters the callback function to be invoked when the connection state is changed.
1876 * @return 0 on success, otherwise a negative error value.
1877 * @retval #BT_ERROR_NONE Successful
1878 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1879 * @pre The Bluetooth service must be initialized with bt_initialize().
1880 * @see bt_initialize()
1881 * @see bt_device_set_connection_state_changed_cb()
1883 int bt_device_unset_connection_state_changed_cb(void);
1886 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
1887 * @brief Registers a rfcomm server socket with a specific UUID.
1890 * @privilege %http://tizen.org/privilege/bluetooth
1892 * @remarks A socket can be destroyed by bt_socket_destroy_rfcomm().
1894 * @param[in] service_uuid The UUID of service to provide
1895 * @param[out] socket_fd The file descriptor of socket to listen
1896 * @return 0 on success, otherwise a negative error value.
1898 * @retval #BT_ERROR_NONE Successful
1899 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1900 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1901 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1902 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1903 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1905 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1907 * @see bt_socket_listen_and_accept_rfcomm()
1908 * @see bt_socket_destroy_rfcomm()
1910 int bt_socket_create_rfcomm(const char *service_uuid, int *socket_fd);
1913 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
1914 * @brief Removes the rfcomm server socket which was created using bt_socket_create_rfcomm().
1917 * @privilege %http://tizen.org/privilege/bluetooth
1918 * @remarks If callback function bt_socket_connection_state_changed_cb() is set and the remote Bluetooth device is connected,
1919 * then bt_socket_connection_state_changed_cb() will be called when this function is finished successfully.
1921 * @param[in] socket_fd The file descriptor of socket (which was created using bt_socket_create_rfcomm()) to destroy
1922 * @return 0 on success, otherwise a negative error value.
1923 * @retval #BT_ERROR_NONE Successful
1924 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1925 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1926 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1927 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1928 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1930 * @pre The socket must be created with bt_socket_create_rfcomm().
1931 * @post If callback function bt_socket_connection_state_changed_cb() is set and the remote Bluetooth device is connected,
1932 * then bt_socket_connection_state_changed_cb() will be called.
1933 * @see bt_socket_create_rfcomm()
1934 * @see bt_socket_connection_state_changed_cb()
1935 * @see bt_socket_set_connection_state_changed_cb()
1936 * @see bt_socket_unset_connection_state_changed_cb()
1938 int bt_socket_destroy_rfcomm(int socket_fd);
1941 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
1942 * @brief Starts listening on passed rfcomm socket and accepts connection requests.
1945 * @privilege %http://tizen.org/privilege/bluetooth
1946 * @details Pop-up is shown automatically when a RFCOMM connection is requested.
1947 * bt_socket_connection_state_changed_cb() will be called with
1948 * #BT_SOCKET_CONNECTED if you click "yes" and connection is finished successfully.
1949 * @param[in] socket_fd The file descriptor of socket on which start to listen
1950 * @param[in] max_pending_connections The maximum number of pending connections
1951 * @return 0 on success, otherwise a negative error value.
1952 * @retval #BT_ERROR_NONE Successful
1953 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1954 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1955 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1956 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1957 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1959 * @pre The socket must be created with bt_socket_create_rfcomm().
1960 * @post If callback function bt_socket_connection_state_changed_cb() is set,
1961 * then bt_socket_connection_state_changed_cb() will be called when the remote Bluetooth device is connected.
1962 * @see bt_socket_create_rfcomm()
1963 * @see bt_socket_connection_state_changed_cb()
1964 * @see bt_socket_set_connection_state_changed_cb()
1965 * @see bt_socket_unset_connection_state_changed_cb()
1967 int bt_socket_listen_and_accept_rfcomm(int socket_fd, int max_pending_connections);
1971 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
1972 * @brief Starts listening on passed rfcomm socket.
1974 * @privlevel platform
1975 * @privilege %http://tizen.org/privilege/bluetooth.admin
1976 * @details bt_socket_connection_requested_cb() will be called when a RFCOMM connection is requested.
1978 * @param[in] socket_fd The file descriptor socket on which start to listen
1979 * @param[in] max_pending_connections The number of pending connections
1981 * @return 0 on success, otherwise a negative error value.
1982 * @retval #BT_ERROR_NONE Successful
1983 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1984 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1985 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1986 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1987 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1989 * @pre The socket must be created with bt_socket_create_rfcomm().
1990 * @post This function invokes bt_socket_connection_state_changed_cb().
1992 * @see bt_socket_create_rfcomm()
1993 * @see bt_socket_set_connection_requested_cb()
1994 * @see bt_socket_unset_connection_requested_cb()
1995 * @see bt_socket_connection_requested_cb()
1997 int bt_socket_listen(int socket_fd, int max_pending_connections);
2001 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2002 * @brief Accepts a connection request.
2004 * @privlevel platform
2005 * @privilege %http://tizen.org/privilege/bluetooth.admin
2006 * @param[in] requested_socket_fd The file descriptor of socket on which a connection is requested
2007 * @return 0 on success, otherwise a negative error value.
2008 * @retval #BT_ERROR_NONE Successful
2009 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2010 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2011 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2012 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2013 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2015 * @pre The connection is requested by bt_socket_connection_requested_cb().
2016 * @see bt_socket_create_rfcomm()
2017 * @see bt_socket_connection_requested_cb()
2018 * @see bt_socket_listen()
2019 * @see bt_socket_reject()
2021 int bt_socket_accept(int requested_socket_fd);
2025 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2026 * @brief Rejects a connection request.
2028 * @privlevel platform
2029 * @privilege %http://tizen.org/privilege/bluetooth.admin
2030 * @param[in] socket_fd The file descriptor of socket on which a connection is requested
2031 * @return 0 on success, otherwise a negative error value.
2032 * @retval #BT_ERROR_NONE Successful
2033 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2034 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2035 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2036 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2037 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2039 * @pre The connection is requested by bt_socket_connection_requested_cb().
2040 * @see bt_socket_create_rfcomm()
2041 * @see bt_socket_connection_requested_cb()
2042 * @see bt_socket_listen()
2043 * @see bt_socket_accept()
2045 int bt_socket_reject(int socket_fd);
2048 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2049 * @brief Connects to a specific RFCOMM based service on a remote Bluetooth device UUID, asynchronously.
2052 * @privilege %http://tizen.org/privilege/bluetooth
2054 * @remarks A connection can be disconnected by bt_socket_disconnect_rfcomm().
2056 * @param[in] remote_address The address of the remote Bluetooth device
2057 * @param[in] service_uuid The UUID of service provided by the remote Bluetooth device
2059 * @return 0 on success, otherwise a negative error value.
2060 * @retval #BT_ERROR_NONE Successful
2061 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2062 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2063 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2064 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
2065 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2066 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2068 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
2069 * @pre The remote device must be discoverable with bt_adapter_start_device_discovery().
2070 * @pre The bond with the remote device must be created with bt_device_create_bond().
2071 * @post This function invokes bt_socket_connection_state_changed_cb().
2073 * @see bt_device_create_bond()
2074 * @see bt_adapter_start_device_discovery()
2075 * @see bt_device_start_service_search()
2076 * @see bt_socket_disconnect_rfcomm()
2077 * @see bt_socket_connection_state_changed_cb()
2078 * @see bt_socket_set_connection_state_changed_cb()
2079 * @see bt_socket_unset_connection_state_changed_cb()
2081 int bt_socket_connect_rfcomm(const char *remote_address, const char *service_uuid);
2084 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2085 * @brief Disconnects the RFCOMM connection with the given file descriptor of conneted socket.
2088 * @privilege %http://tizen.org/privilege/bluetooth
2089 * @param[in] socket_fd The file descriptor of socket to close which was received using bt_socket_connection_state_changed_cb().
2090 * @return 0 on success, otherwise a negative error value.
2091 * @retval #BT_ERROR_NONE Successful
2092 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2093 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2094 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2095 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2097 * @pre The connection must be established.
2099 * @see bt_socket_connection_state_changed_cb()
2100 * @see bt_socket_set_connection_state_changed_cb()
2101 * @see bt_socket_unset_connection_state_changed_cb()
2103 int bt_socket_disconnect_rfcomm(int socket_fd);
2106 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2107 * @brief Sends data to the connected device.
2110 * @privilege %http://tizen.org/privilege/bluetooth
2111 * @remark The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
2113 * @param[in] socket_fd The file descriptor of connected socket which was received using bt_socket_connection_state_changed_cb()
2114 * @param[in] data The data to be sent
2115 * @param[in] length The length of data to be sent
2117 * @return the number of bytes written (zero indicates nothing was written).
2118 * @retval On error, -1 is returned, and errno is set appropriately. See write 2 man page.
2119 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2120 * @exception BT_ERROR_NOT_INITIALIZED Not initialized
2121 * @exception BT_ERROR_PERMISSION_DENIED Permission denied
2122 * @exception BT_ERROR_AGAIN Resource temporarily unavailable
2124 * @pre The connection must be established.
2126 * @see bt_socket_connection_state_changed_cb()
2127 * @see bt_socket_set_connection_state_changed_cb()
2128 * @see bt_socket_unset_connection_state_changed_cb()
2130 int bt_socket_send_data(int socket_fd, const char *data, int length);
2133 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2134 * @brief Register a callback function that will be invoked when you receive data.
2136 * @param[in] callback The callback function to register
2137 * @param[in] user_data The user data to be passed to the callback function
2138 * @return 0 on success, otherwise a negative error value.
2139 * @retval #BT_ERROR_NONE Successful
2140 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2141 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2142 * @pre The Bluetooth service must be initialized with bt_initialize().
2143 * @post bt_socket_data_received_cb() will be invoked.
2144 * @see bt_initialize()
2145 * @see bt_socket_data_received_cb()
2146 * @see bt_socket_set_data_received_cb()
2147 * @see bt_socket_unset_data_received_cb()
2149 int bt_socket_set_data_received_cb(bt_socket_data_received_cb callback, void *user_data);
2152 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2153 * @brief Unregisters the callback function.
2155 * @return 0 on success, otherwise a negative error value.
2156 * @retval #BT_ERROR_NONE Successful
2157 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2158 * @pre The Bluetooth service must be initialized with bt_initialize().
2159 * @see bt_initialize()
2160 * @see bt_socket_data_received_cb()
2161 * @see bt_socket_set_data_received_cb()
2163 int bt_socket_unset_data_received_cb(void);
2166 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2167 * @brief Register a callback function that will be invoked when a RFCOMM connection is requested.
2169 * @param[in] callback The callback function to register
2170 * @param[in] user_data The user data to be passed to the callback function
2171 * @return 0 on success, otherwise a negative error value.
2172 * @retval #BT_ERROR_NONE Successful
2173 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2174 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2175 * @pre The Bluetooth service must be initialized with bt_initialize().
2176 * @post If you listen a socket by bt_socket_listen(), bt_socket_connection_requested_cb() will be invoked.
2177 * @see bt_initialize()
2178 * @see bt_socket_unset_connection_requested_cb()
2180 int bt_socket_set_connection_requested_cb(bt_socket_connection_requested_cb callback, void *user_data);
2183 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2184 * @brief Unregisters the callback function.
2186 * @return 0 on success, otherwise a negative error value.
2187 * @retval #BT_ERROR_NONE Successful
2188 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2189 * @pre The Bluetooth service must be initialized with bt_initialize().
2190 * @see bt_initialize()
2191 * @see bt_socket_set_connection_requested_cb()
2192 * @see bt_socket_connection_requested_cb()
2194 int bt_socket_unset_connection_requested_cb(void);
2197 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2198 * @brief Register a callback function that will be invoked when the connection state changes.
2200 * @param[in] callback The callback function to register
2201 * @param[in] user_data The user data to be passed to the callback function
2202 * @return 0 on success, otherwise a negative error value.
2203 * @retval #BT_ERROR_NONE Successful
2204 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2205 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2206 * @pre The Bluetooth service must be initialized with bt_initialize().
2207 * @post bt_socket_connection_state_changed_cb() will be invoked.
2208 * @see bt_initialize()
2209 * @see bt_socket_connection_state_changed_cb()
2210 * @see bt_socket_unset_connection_state_changed_cb()
2212 int bt_socket_set_connection_state_changed_cb(bt_socket_connection_state_changed_cb callback, void *user_data);
2215 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2216 * @brief Unregisters 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 * @pre The Bluetooth service must be initialized with bt_initialize().
2222 * @see bt_initialize()
2223 * @see bt_socket_connection_state_changed_cb()
2224 * @see bt_socket_set_connection_state_changed_cb()
2226 int bt_socket_unset_connection_state_changed_cb(void);
2230 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2231 * @brief Initializes the Bluetooth OPP server requested by bt_opp_server_push_requested_cb().
2233 * @details The popup appears when an OPP connection is requested from a remote device.
2234 * If you accept the request, then connection will be established and bt_opp_server_push_requested_cb() will be called.
2235 * At that time, you can call either bt_opp_server_accept() or bt_opp_server_reject().
2236 * @remarks This function must be called to start Bluetooth OPP server. You must free all resources of the Bluetooth service
2237 * by calling bt_opp_server_deinitialize() if Bluetooth OPP service is no longer needed.
2238 * @param[in] destination The destination path
2239 * @param[in] push_requested_cb The callback called when a push is requested
2240 * @param[in] user_data The user data to be passed to the callback function
2241 * @return 0 on success, otherwise a negative error value.
2242 * @retval #BT_ERROR_NONE Successful
2243 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2244 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2245 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2246 * @retval #BT_ERROR_RESOURCE_BUSY Device or resource busy
2247 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2248 * @see bt_opp_server_push_requested_cb()
2249 * @see bt_opp_server_deinitialize()
2250 * @see bt_opp_server_accept()
2251 * @see bt_opp_server_reject()
2253 int bt_opp_server_initialize(const char *destination, bt_opp_server_push_requested_cb push_requested_cb, void *user_data);
2256 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2257 * @brief Initializes the Bluetooth OPP server requested by bt_opp_server_connection_requested_cb().
2259 * @details No popup appears when an OPP connection is requested from a remote device.
2260 * Instead, @a connection_requested_cb() will be called.
2261 * At that time, you can call either bt_opp_server_accept() or bt_opp_server_reject().
2262 * @remarks This function must be called to start Bluetooth OPP server. \n
2263 * You must free all resources of the Bluetooth service by calling bt_opp_server_deinitialize() if Bluetooth OPP service is no longer needed.
2264 * @param[in] destination The destination path
2265 * @param[in] connection_requested_cb The callback called when an OPP connection is requested
2266 * @param[in] user_data The user data to be passed to the callback function
2267 * @return 0 on success, otherwise a negative error value.
2268 * @retval #BT_ERROR_NONE Successful
2269 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2270 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2271 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2272 * @retval #BT_ERROR_RESOURCE_BUSY Device or resource busy
2273 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2274 * @see bt_opp_server_connection_requested_cb()
2275 * @see bt_opp_server_deinitialize()
2276 * @see bt_opp_server_accept_connection()
2277 * @see bt_opp_server_reject_connection()
2279 int bt_opp_server_initialize_by_connection_request(const char *destination, bt_opp_server_connection_requested_cb connection_requested_cb, void *user_data);
2282 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2283 * @brief Denitializes the Bluetooth OPP server.
2285 * @return 0 on success, otherwise a negative error value.
2286 * @retval #BT_ERROR_NONE Successful
2287 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2288 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2289 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2290 * @see bt_opp_server_initialize()
2291 * @see bt_opp_server_deinitialize()
2293 int bt_opp_server_deinitialize(void);
2296 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2297 * @brief Accepts the push request from the remote device.
2300 * @privilege %http://tizen.org/privilege/bluetooth
2301 * @remarks If you initialize OPP server by bt_opp_server_initialize_by_connection_request(), then name is ignored.
2302 * You can cancel the pushes by bt_opp_server_cancel_transfer() with transfer_id.
2303 * @param[in] progress_cb The callback called when a file is being transfered
2304 * @param[in] finished_cb The callback called when a transfer is finished
2305 * @param[in] name The name to store. This can be NULL if you initialize OPP server by bt_opp_server_initialize_by_connection_request().
2306 * @param[in] user_data The user data to be passed to the callback function
2307 * @param[out] transfer_id The ID of transfer
2308 * @return 0 on success, otherwise a negative error value.
2309 * @retval #BT_ERROR_NONE Successful
2310 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2311 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2312 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2313 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2314 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation now in progress
2315 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2316 * @see bt_opp_server_reject()
2318 int bt_opp_server_accept(bt_opp_server_transfer_progress_cb progress_cb, bt_opp_server_transfer_finished_cb finished_cb, const char *name,
2319 void *user_data, int *transfer_id);
2322 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2323 * @brief Rejects the push request from the remote device.
2326 * @privilege %http://tizen.org/privilege/bluetooth
2327 * @return 0 on success, otherwise a negative error value.
2328 * @retval #BT_ERROR_NONE Successful
2329 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2330 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2331 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2332 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2333 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2334 * @see bt_opp_server_accept()
2336 int bt_opp_server_reject(void);
2339 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2340 * @brief Cancels the transfer.
2343 * @privilege %http://tizen.org/privilege/bluetooth
2344 * @param[in] transfer_id The ID of transfer
2345 * @return 0 on success, otherwise a negative error value.
2346 * @retval #BT_ERROR_NONE Successful
2347 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2348 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2349 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2350 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2351 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2352 * @see bt_opp_server_accept_connection()
2353 * @see bt_opp_server_accept()
2355 int bt_opp_server_cancel_transfer(int transfer_id);
2358 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2359 * @brief Sets the destination path of file to be pushed.
2362 * @privilege %http://tizen.org/privilege/bluetooth
2363 * @param[in] destination The destination path of file to be pushed
2364 * @return 0 on success, otherwise a negative error value.
2365 * @retval #BT_ERROR_NONE Successful
2366 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2367 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2368 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2369 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2370 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2371 * @see bt_opp_server_initialize()
2373 int bt_opp_server_set_destination(const char *destination);
2376 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2377 * @brief Initializes the Bluetooth OPP client.
2379 * @remarks This function must be called before Bluetooth OPP client starts. \n
2380 * You must free all resources of the Bluetooth service by calling bt_opp_client_deinitialize()
2381 * if Bluetooth OPP service is no longer needed.
2382 * @return 0 on success, otherwise a negative error value.
2383 * @retval #BT_ERROR_NONE Successful
2384 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2385 * @retval #BT_ERROR_RESOURCE_BUSY Device or resource busy
2386 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2387 * @see bt_opp_client_deinitialize()
2389 int bt_opp_client_initialize(void);
2392 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2393 * @brief Denitializes the Bluetooth OPP client.
2395 * @return 0 on success, otherwise a negative error value.
2396 * @retval #BT_ERROR_NONE Successful
2397 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2398 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2399 * @see bt_opp_client_initialize()
2401 int bt_opp_client_deinitialize(void);
2404 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2405 * @brief Adds file to be pushed.
2407 * @param[in] file The path of file to be pushed
2408 * @return 0 on success, otherwise a negative error value.
2409 * @retval #BT_ERROR_NONE Successful
2410 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2411 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2412 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2413 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2414 * @see bt_opp_client_clear_files()
2415 * @see bt_opp_client_push_files()
2417 int bt_opp_client_add_file(const char *file);
2420 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2421 * @brief Adds file to be pushed.
2423 * @return 0 on success, otherwise a negative error value.
2424 * @retval #BT_ERROR_NONE Successful
2425 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2426 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2427 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2428 * @see bt_opp_client_add_file()
2429 * @see bt_opp_client_push_files()
2431 int bt_opp_client_clear_files(void);
2434 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2435 * @brief Pushes the file to the remote device, asynchronously.
2438 * @privilege %http://tizen.org/privilege/bluetooth
2439 * @details At first, bt_opp_client_push_responded_cb() will be called when OPP server responds to the push request.
2440 * After connection is established, bt_opp_client_push_progress_cb() will be called repeatedly until a file is tranfered completely.
2441 * If you send several files, then bt_opp_client_push_progress_cb() with another file will be called repeatedly until the file is tranfered completely.
2442 * bt_opp_client_push_finished_cb() will be called when the push request is finished.
2443 * @param[in] remote_address The remote address
2444 * @param[in] responded_cb The callback called when OPP server responds to the push request
2445 * @param[in] progress_cb The callback called when each file is being transfered
2446 * @param[in] finished_cb The callback called when the push request is finished
2447 * @param[in] user_data The user data to be passed to the callback function
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_INVALID_PARAMETER Invalid parameter
2453 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2454 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation now in progress
2455 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2456 * @see bt_opp_client_initialize()
2457 * @see bt_opp_client_cancel_push
2459 int bt_opp_client_push_files(const char *remote_address, bt_opp_client_push_responded_cb responded_cb,
2460 bt_opp_client_push_progress_cb progress_cb, bt_opp_client_push_finished_cb finished_cb, void *user_data);
2463 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2464 * @brief Cancels the push request in progress, asynchronously.
2467 * @privilege %http://tizen.org/privilege/bluetooth
2468 * @return 0 on success, otherwise a negative error value.
2469 * @retval #BT_ERROR_NONE Successful
2470 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2471 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2472 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2473 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2474 * @pre bt_opp_client_push_files() must be called.
2475 * @post bt_opp_client_push_finished_cb() will be invoked with result #BT_ERROR_CANCELLED,
2476 * which is a parameter of bt_opp_client_push_files().
2477 * @see bt_opp_client_initialize()
2478 * @see bt_opp_client_push_files()
2480 int bt_opp_client_cancel_push(void);
2483 * @ingroup CAPI_NETWORK_BLUETOOTH_HID_MODULE
2484 * @brief Initializes the Bluetooth HID(Human Interface Device) Host.
2486 * @remarks This function must be called before Bluetooth HID Host starts. \n
2487 * You must free all resources of the Bluetooth service by calling bt_hid_host_deinitialize()
2488 * if Bluetooth HID Host service is no longer needed.
2489 * @param[in] connection_cb The callback called when the connection state is changed
2490 * @param[in] user_data The user data to be passed to the callback function
2491 * @return 0 on success, otherwise a negative error value.
2492 * @retval #BT_ERROR_NONE Successful
2493 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2494 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2495 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2496 * @pre The Bluetooth service must be initialized with bt_initialize().
2497 * @see bt_initialize()
2498 * @see bt_hid_host_deinitialize()
2500 int bt_hid_host_initialize(bt_hid_host_connection_state_changed_cb connection_cb, void *user_data);
2503 * @ingroup CAPI_NETWORK_BLUETOOTH_HID_MODULE
2504 * @brief Deinitializes the Bluetooth HID(Human Interface Device) Host.
2506 * @return 0 on success, otherwise a negative error value.
2507 * @retval #BT_ERROR_NONE Successful
2508 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2509 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2510 * @pre The Bluetooth HID service must be initialized with bt_hid_host_initialize().
2511 * @see bt_hid_host_initialize()
2513 int bt_hid_host_deinitialize(void);
2516 * @ingroup CAPI_NETWORK_BLUETOOTH_HID_MODULE
2517 * @brief Connects the remote device with the HID(Human Interface Device) service, asynchronously.
2520 * @privilege %http://tizen.org/privilege/bluetooth
2521 * @param[in] remote_address The remote address
2522 * @return 0 on success, otherwise a negative error value.
2523 * @retval #BT_ERROR_NONE Successful
2524 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2525 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2526 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2527 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device is not bonded
2528 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2529 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2530 * @pre The local device must be bonded with the remote device by bt_device_create_bond().
2531 * @pre The Bluetooth HID service must be initialized with bt_hid_host_initialize().
2532 * @post bt_hid_host_connection_state_changed_cb() will be invoked.
2533 * @see bt_hid_host_disconnect()
2534 * @see bt_hid_host_connection_state_changed_cb()
2536 int bt_hid_host_connect(const char *remote_address);
2539 * @ingroup CAPI_NETWORK_BLUETOOTH_HID_MODULE
2540 * @brief Disconnects the remote device with the HID(Human Interface Device) service, asynchronously.
2543 * @privilege %http://tizen.org/privilege/bluetooth
2544 * @param[in] remote_address The remote address
2545 * @return 0 on success, otherwise a negative error value.
2546 * @retval #BT_ERROR_NONE Successful
2547 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2548 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2549 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2550 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
2551 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2552 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2553 * @pre The remote device must be connected by bt_hid_host_connect().
2554 * @post bt_hid_host_connection_state_changed_cb() will be invoked.
2555 * @see bt_hid_host_connect()
2556 * @see bt_hid_host_connection_state_changed_cb()
2558 int bt_hid_host_disconnect(const char *remote_address);
2561 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2562 * @brief Initializes the Bluetooth profiles related with audio.
2564 * @remarks This function must be called before Bluetooth profiles related with audio starts. \n
2565 * You must free all resources of the this service by calling bt_audio_deinitialize()
2566 * if Bluetooth profiles related with audio service is no longer needed.
2567 * @return 0 on success, otherwise a negative error value.
2568 * @retval #BT_ERROR_NONE Successful
2569 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2570 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2571 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2572 * @pre The Bluetooth service must be initialized with bt_initialize().
2573 * @see bt_initialize()
2574 * @see bt_audio_deinitialize()
2576 int bt_audio_initialize(void);
2579 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2580 * @brief Deinitializes the Bluetooth profiles related with audio.
2582 * @return 0 on success, otherwise a negative error value.
2583 * @retval #BT_ERROR_NONE Successful
2584 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2585 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2586 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2587 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2588 * @see bt_audio_initialize()
2590 int bt_audio_deinitialize(void);
2593 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2594 * @brief Connects the remote device with the given audio profile, asynchronously.
2597 * @privilege %http://tizen.org/privilege/bluetooth
2598 * @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
2599 * when #BT_AUDIO_PROFILE_TYPE_HSP_HFP is connected and #BT_AUDIO_PROFILE_TYPE_A2DP is connected.
2600 * @param[in] remote_address The remote address
2601 * @param[in] type The type of audio profile
2602 * @return 0 on success, otherwise a negative error value.
2603 * @retval #BT_ERROR_NONE Successful
2604 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2605 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2606 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2607 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device is not bonded
2608 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2609 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2610 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2611 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2612 * @pre The local device must be bonded with the remote device by bt_device_create_bond().
2613 * @post bt_audio_connection_state_changed_cb() will be invoked.
2614 * @see bt_audio_disconnect()
2615 * @see bt_audio_connection_state_changed_cb()
2617 int bt_audio_connect(const char *remote_address, bt_audio_profile_type_e type);
2620 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2621 * @brief Disconnects the remote device with the given audio profile, asynchronously.
2624 * @privilege %http://tizen.org/privilege/bluetooth
2625 * @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
2626 * when #BT_AUDIO_PROFILE_TYPE_HSP_HFP is disconnected and #BT_AUDIO_PROFILE_TYPE_A2DP is disconnected.
2627 * @param[in] remote_address The remote address
2628 * @param[in] type The type of audio profile
2629 * @return 0 on success, otherwise a negative error value.
2630 * @retval #BT_ERROR_NONE Successful
2631 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2632 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2633 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2634 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2635 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2636 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2637 * @pre The remote device must be connected by bt_audio_connect().
2638 * @post bt_audio_connection_state_changed_cb() will be invoked.
2639 * @see bt_audio_connect()
2640 * @see bt_audio_connection_state_changed_cb()
2642 int bt_audio_disconnect(const char *remote_address, bt_audio_profile_type_e type);
2645 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2646 * @brief Registers a callback function that will be invoked when the connection state is changed.
2648 * @param[in] callback The callback function to register
2649 * @param[in] user_data The user data to be passed to the callback function
2650 * @return 0 on success, otherwise a negative error value.
2651 * @retval #BT_ERROR_NONE Successful
2652 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2653 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2654 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2655 * @see bt_audio_initialize()
2656 * @see bt_audio_connection_state_changed_cb()
2657 * @see bt_panu_unset_connection_state_changed_cb()
2659 int bt_audio_set_connection_state_changed_cb(bt_audio_connection_state_changed_cb callback, void *user_data);
2662 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2663 * @brief Unregisters a callback function that will be invoked when the connection state is changed.
2665 * @return 0 on success, otherwise a negative error value.
2666 * @retval #BT_ERROR_NONE Successful
2667 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2668 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2669 * @see bt_audio_initialize()
2670 * @see bt_audio_connection_state_changed_cb()
2671 * @see bt_audio_set_connection_state_changed_cb()
2673 int bt_audio_unset_connection_state_changed_cb(void);
2677 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2678 * @brief Opens a SCO(Synchronous Connection Oriented link) to connected remote device, asynchronously.
2680 * @privlevel platform
2681 * @privilege %http://tizen.org/privilege/bluetooth.admin
2682 * @return 0 on success, otherwise a negative error value.
2683 * @retval #BT_ERROR_NONE Successful
2684 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2685 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2686 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device is not bonded
2687 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
2688 * @retval #BT_ERROR_ALREADY_DONE Operation is already done
2689 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2690 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2691 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2692 * @pre The Bluetooth audio device must be connected with bt_audio_connect().
2693 * @post bt_ag_sco_state_changed_cb() will be invoked.
2694 * @see bt_ag_close_sco()
2695 * @see bt_ag_sco_state_changed_cb()
2696 * @see bt_audio_connect()
2698 int bt_ag_open_sco(void);
2702 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2703 * @brief Closes an opened SCO(Synchronous Connection Oriented link), asynchronously.
2705 * @privlevel platform
2706 * @privilege %http://tizen.org/privilege/bluetooth.admin
2707 * @return 0 on success, otherwise a negative error value.
2708 * @retval #BT_ERROR_NONE Successful
2709 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2710 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2711 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device is not bonded
2712 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
2713 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2714 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2715 * @pre The SCO must be opened with bt_ag_open_sco().
2716 * @post bt_ag_sco_state_changed_cb() will be invoked.
2717 * @see bt_ag_open_sco()
2718 * @see bt_ag_sco_state_changed_cb()
2720 int bt_ag_close_sco(void);
2724 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2725 * @brief Checks whether an opened SCO(Synchronous Connection Oriented link) exists or not.
2727 * @param[out] opened The SCO status: (@c true = opened, @c false = not opened)
2728 * @return 0 on success, otherwise a negative error value.
2729 * @retval #BT_ERROR_NONE Successful
2730 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2731 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2732 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2733 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2734 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2735 * @see bt_ag_open_sco()
2736 * @see bt_ag_close_sco()
2738 int bt_ag_is_sco_opened(bool *opened);
2742 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2743 * @brief Registers a callback function that will be invoked when the SCO(Synchronous Connection Oriented link) state is changed.
2745 * @param[in] callback The callback function to register
2746 * @param[in] user_data The user data to be passed to the callback function
2747 * @return 0 on success, otherwise a negative error value.
2748 * @retval #BT_ERROR_NONE Successful
2749 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2750 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2751 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2752 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2753 * @see bt_audio_initialize()
2754 * @see bt_ag_sco_state_changed_cb()
2755 * @see bt_ag_unset_sco_state_changed_cb()
2757 int bt_ag_set_sco_state_changed_cb(bt_ag_sco_state_changed_cb callback, void *user_data);
2761 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2762 * @brief Unregisters a callback function that will be invoked when the SCO(Synchronous Connection Oriented link) state is changed.
2764 * @return 0 on success, otherwise a negative error value.
2765 * @retval #BT_ERROR_NONE Successful
2766 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2767 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2768 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2769 * @see bt_audio_initialize()
2770 * @see bt_ag_sco_state_changed_cb()
2771 * @see bt_ag_set_sco_state_changed_cb()
2773 int bt_ag_unset_sco_state_changed_cb(void);
2777 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2778 * @brief Notifies the call event to the remote bluetooth device.
2780 * @privlevel platform
2781 * @privilege %http://tizen.org/privilege/bluetooth.admin
2782 * @remarks Before notifying #BT_AG_CALL_EVENT_ANSWERED or #BT_AG_CALL_EVENT_DIALING, you should open SCO(Synchronous Connection Oriented link)
2783 * if Bluetooth Hands-Free need SCO connection.
2784 * @param[in] event The call event
2785 * @param[in] call_id The call ID
2786 * @param[in] phone_number The phone number. You must set this value in case of #BT_AG_CALL_EVENT_DIALING and #BT_AG_CALL_EVENT_INCOMING.
2787 * In other cases, this value can be NULL.
2788 * @return 0 on success, otherwise a negative error value.
2789 * @retval #BT_ERROR_NONE Successful
2790 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2791 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2792 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2793 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device is not bonded
2794 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
2795 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2796 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2797 * @pre The Bluetooth audio device must be connected with bt_audio_connect().
2798 * @see bt_audio_connect()
2800 int bt_ag_notify_call_event(bt_ag_call_event_e event, unsigned int call_id, const char *phone_number);
2804 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2805 * @brief Notifies the call list to the remote bluetooth device.
2807 * @privlevel platform
2808 * @privilege %http://tizen.org/privilege/bluetooth.admin
2809 * @param[in] list The call list
2810 * @return 0 on success, otherwise a negative error value.
2811 * @retval #BT_ERROR_NONE Successful
2812 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2813 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2814 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2815 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device is not bonded
2816 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
2817 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2818 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2819 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2820 * @pre The Bluetooth audio device must be connected with bt_audio_connect().
2821 * @see bt_audio_connect()
2823 int bt_ag_notify_call_list(bt_call_list_h list);
2827 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2828 * @brief Notifies the state of voice recognition.
2830 * @privlevel platform
2831 * @privilege %http://tizen.org/privilege/bluetooth.admin
2832 * @param[in] state The state of voice recognition: (@c true = enabled, @c false = disabled)
2833 * @return 0 on success, otherwise a negative error value.
2834 * @retval #BT_ERROR_NONE Successful
2835 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2836 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2837 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2838 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device is not bonded
2839 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
2840 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2841 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2842 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2843 * @pre The Bluetooth audio device must be connected with bt_audio_connect().
2844 * @see bt_audio_connect()
2846 int bt_ag_notify_voice_recognition_state(bool state);
2850 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2851 * @brief Registers a callback function that will be invoked when a call handling event happened from Hands-Free.
2853 * @param[in] callback The callback function to register
2854 * @param[in] user_data The user data to be passed to the callback function
2855 * @return 0 on success, otherwise a negative error value.
2856 * @retval #BT_ERROR_NONE Successful
2857 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2858 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2859 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2860 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2861 * @see bt_audio_initialize()
2862 * @see bt_ag_call_handling_event_cb()
2863 * @see bt_ag_unset_call_handling_event_cb()
2865 int bt_ag_set_call_handling_event_cb(bt_ag_call_handling_event_cb callback, void *user_data);
2869 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2870 * @brief Unregisters a callback function that will be invoked when a call handling event happened from Hands-Free.
2872 * @return 0 on success, otherwise a negative error value.
2873 * @retval #BT_ERROR_NONE Successful
2874 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2875 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2876 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2877 * @see bt_audio_initialize()
2878 * @see bt_ag_call_handling_event_cb()
2879 * @see bt_ag_set_call_handling_event_cb()
2881 int bt_ag_unset_call_handling_event_cb(void);
2885 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2886 * @brief Registers a callback function that will be invoked when a multi call handling event happened from Hands-Free.
2888 * @param[in] callback The callback function to register
2889 * @param[in] user_data The user data to be passed to the callback function
2890 * @return 0 on success, otherwise a negative error value.
2891 * @retval #BT_ERROR_NONE Successful
2892 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2893 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2894 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2895 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2896 * @see bt_audio_initialize()
2897 * @see bt_ag_multi_call_handling_event_cb()
2898 * @see bt_ag_unset_multi_call_handling_event_cb()
2900 int bt_ag_set_multi_call_handling_event_cb(bt_ag_multi_call_handling_event_cb callback, void *user_data);
2904 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2905 * @brief Unregisters a callback function that will be invoked when a multi call handling event happened from Hands-Free.
2907 * @return 0 on success, otherwise a negative error value.
2908 * @retval #BT_ERROR_NONE Successful
2909 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2910 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2911 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2912 * @see bt_audio_initialize()
2913 * @see bt_ag_multi_call_handling_event_cb()
2914 * @see bt_ag_set_multi_call_handling_event_cb()
2916 int bt_ag_unset_multi_call_handling_event_cb(void);
2920 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2921 * @brief Registers a callback function that will be invoked when a DTMF(Dual Tone Multi Frequency) is transmitted from Hands-Free.
2923 * @param[in] callback The callback function to register
2924 * @param[in] user_data The user data to be passed to the callback function
2925 * @return 0 on success, otherwise a negative error value.
2926 * @retval #BT_ERROR_NONE Successful
2927 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2928 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2929 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2930 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2931 * @see bt_audio_initialize()
2932 * @see bt_ag_dtmf_transmitted_cb()
2933 * @see bt_ag_unset_dtmf_transmitted_cb()
2935 int bt_ag_set_dtmf_transmitted_cb(bt_ag_dtmf_transmitted_cb callback, void *user_data);
2939 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2940 * @brief Unregisters a callback function that will be invoked when a DTMF(Dual Tone Multi Frequency) is transmitted from Hands-Free.
2942 * @return 0 on success, otherwise a negative error value.
2943 * @retval #BT_ERROR_NONE Successful
2944 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2945 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2946 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2947 * @see bt_audio_initialize()
2948 * @see bt_ag_dtmf_transmitted_cb()
2949 * @see bt_ag_set_dtmf_transmitted_cb()
2951 int bt_ag_unset_dtmf_transmitted_cb(void);
2955 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2956 * @brief Notifies the speaker gain to the remote device.
2958 * @privlevel platform
2959 * @privilege %http://tizen.org/privilege/bluetooth.admin
2960 * @details This function sends a signal to the remote device. This signal has the gain value.
2961 * @a gain is represented on a scale from 0 to 15. This value is absolute value relating to a particular volume level.
2962 * When the speaker gain of remote device is changed to the requested gain, bt_audio_speaker_gain_changed_cb() will be called.
2963 * @param[in] gain The gain of speaker (0 ~ 15)
2964 * @return 0 on success, otherwise a negative error value.
2965 * @retval #BT_ERROR_NONE Successful
2966 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2967 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2968 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2969 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2970 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
2971 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2972 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2973 * @pre The remote device is connected by bt_audio_connect() with #BT_AUDIO_PROFILE_TYPE_HSP_HFP service.
2974 * @see bt_ag_get_speaker_gain()
2975 * @see bt_ag_set_speaker_gain_changed_cb()
2976 * @see bt_ag_unset_speaker_gain_changed_cb()
2978 int bt_ag_notify_speaker_gain(int gain);
2982 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
2983 * @brief Gets the current speaker gain of the remote device.
2985 * @details This function gets the value of speaker gain of the remote device.
2986 * @a gain is represented on a scale from 0 to 15. This value is absolute value relating to a particular volume level.
2987 * @param[out] gain The gain of speaker (0 ~ 15)
2988 * @return 0 on success, otherwise a negative error value.
2989 * @retval #BT_ERROR_NONE Successful
2990 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2991 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2992 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2993 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
2994 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2995 * @pre The remote device is connected by bt_audio_connect() with #BT_AUDIO_PROFILE_TYPE_HSP_HFP service.
2996 * @see bt_ag_notify_speaker_gain()
2997 * @see bt_ag_set_speaker_gain_changed_cb()
2998 * @see bt_ag_unset_speaker_gain_changed_cb()
3000 int bt_ag_get_speaker_gain(int *gain);
3004 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
3005 * @brief Checks whether the remoted device enables NREC(Noise Reduction and Echo Canceling) or not.
3007 * @param[out] enabled The NREC status: (@c true = enabled, @c false = not enabled)
3008 * @return 0 on success, otherwise a negative error value.
3009 * @retval #BT_ERROR_NONE Successful
3010 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3011 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3012 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3013 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3014 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3015 * @pre The remote device is connected by bt_audio_connect() with #BT_AUDIO_PROFILE_TYPE_HSP_HFP service.
3016 * @see bt_audio_connect()
3018 int bt_ag_is_nrec_enabled(bool *enabled);
3022 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
3023 * @brief Registers a callback function that will be invoked when the speaker gain of the remote device is changed.
3025 * @details This function let you know the change of the speaker gain of the remote device.
3026 * @a gain is represented on a scale from 0 to 15. This value is absolute value relating to a particular volume level.
3027 * @param[in] callback The callback function to register
3028 * @param[in] user_data The user data to be passed to the callback function
3029 * @return 0 on success, otherwise a negative error value.
3030 * @retval #BT_ERROR_NONE Successful
3031 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3032 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3033 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3034 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
3035 * @see bt_audio_initialize()
3036 * @see bt_ag_unset_speaker_gain_changed_cb()
3038 int bt_ag_set_speaker_gain_changed_cb(bt_ag_speaker_gain_changed_cb callback, void *user_data);
3042 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
3043 * @brief Unregisters a callback function that will be invoked when the speaker gain of the remote device is changed.
3045 * @return 0 on success, otherwise a negative error value.
3046 * @retval #BT_ERROR_NONE Successful
3047 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3048 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3049 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3050 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
3051 * @see bt_audio_initialize()
3052 * @see bt_ag_set_speaker_gain_changed_cb()
3054 int bt_ag_unset_speaker_gain_changed_cb(void);
3058 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
3059 * @brief Registers a callback function that will be invoked when the microphone gain of the remote device is changed.
3061 * @param[in] callback The callback function to register
3062 * @param[in] user_data The user data to be passed to the callback function
3063 * @return 0 on success, otherwise a negative error value.
3064 * @retval #BT_ERROR_NONE Successful
3065 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3066 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3067 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3068 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
3069 * @see bt_audio_initialize()
3070 * @see bt_ag_unset_microphone_gain_changed_cb()
3072 int bt_ag_set_microphone_gain_changed_cb(bt_ag_microphone_gain_changed_cb callback, void *user_data);
3076 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE
3077 * @brief Unregisters a callback function that will be invoked when the microphone gain of the remote device is changed.
3079 * @return 0 on success, otherwise a negative error value.
3080 * @retval #BT_ERROR_NONE Successful
3081 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3082 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3083 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3084 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
3085 * @see bt_audio_initialize()
3086 * @see bt_ag_set_microphone_gain_changed_cb()
3088 int bt_ag_unset_microphone_gain_changed_cb(void);
3092 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_CALL_MODULE
3093 * @brief Creates a handle of call list.
3095 * @param[out] list The handle of call list
3096 * @return 0 on success, otherwise a negative error value.
3097 * @retval #BT_ERROR_NONE Successful
3098 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3099 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
3100 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3101 * @see bt_call_list_destroy()
3103 int bt_call_list_create(bt_call_list_h *list);
3107 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_CALL_MODULE
3108 * @brief Destroys the handle of call list.
3110 * @param[in] list The handle of call list
3111 * @return 0 on success, otherwise a negative error value.
3112 * @retval #BT_ERROR_NONE Successful
3113 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3114 * @see bt_call_list_create()
3116 int bt_call_list_destroy(bt_call_list_h list);
3120 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_CALL_MODULE
3121 * @brief Resets the handle of call list.
3123 * @param[in] list The handle of call list
3124 * @return 0 on success, otherwise a negative error value.
3125 * @retval #BT_ERROR_NONE Successful
3126 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3127 * @see bt_call_list_create()
3129 int bt_call_list_reset(bt_call_list_h list);
3133 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_CALL_MODULE
3134 * @brief Adds a call to the handle of call list.
3136 * @param[in] list The handle of call list
3137 * @param[in] call_id The call ID
3138 * @param[in] state The state of audio gate call
3139 * @param[in] phone_number The phone number. You must set this value in case of #BT_AG_CALL_EVENT_DIALING and #BT_AG_CALL_EVENT_INCOMING.
3140 * @return 0 on success, otherwise a negative error value.
3141 * @retval #BT_ERROR_NONE Successful
3142 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3143 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
3144 * @see bt_call_list_create()
3146 int bt_call_list_add(bt_call_list_h list, unsigned int call_id, bt_ag_call_state_e state, const char *phone_number);
3150 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3151 * @brief Initializes the Bluetooth AVRCP(Audio/Video Remote Control Profile) service.
3153 * @remarks This function must be called before Bluetooth AVRCP service. \n
3154 * You must free all resources of the this service by calling bt_avrcp_target_deinitialize()
3155 * if Bluetooth AVRCP service is no longer needed.
3156 * @param[in] callback The callback function called when the connection state is changed
3157 * @param[in] user_data The user data to be passed to the callback function
3158 * @return 0 on success, otherwise a negative error value.
3159 * @retval #BT_ERROR_NONE Successful
3160 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3161 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3162 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3163 * @pre The Bluetooth service must be initialized with bt_initialize().
3164 * @see bt_initialize()
3165 * @see bt_avrcp_target_deinitialize()
3167 int bt_avrcp_target_initialize(bt_avrcp_target_connection_state_changed_cb callback, void *user_data);
3171 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3172 * @brief Deinitializes the Bluetooth AVRCP(Audio/Video Remote Control Profile) service.
3174 * @return 0 on success, otherwise a negative error value.
3175 * @retval #BT_ERROR_NONE Successful
3176 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3177 * @pre The Bluetooth audio service must be initialized with bt_avrcp_target_initialize().
3178 * @see bt_avrcp_target_initialize()
3180 int bt_avrcp_target_deinitialize(void);
3184 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3185 * @brief Notifies the equalize state to the remote device.
3187 * @privlevel platform
3188 * @privilege %http://tizen.org/privilege/bluetooth.admin
3189 * @param[in] state The state of equalizer
3190 * @return 0 on success, otherwise a negative error value.
3191 * @retval #BT_ERROR_NONE Successful
3192 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3193 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3194 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3195 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3196 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3197 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3198 * @pre The remote device must be connected.
3199 * @see bt_avrcp_target_connection_state_changed_cb()
3200 * @see bt_avrcp_target_initialize()
3202 int bt_avrcp_target_notify_equalizer_state(bt_avrcp_equalizer_state_e state);
3206 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3207 * @brief Notifies the repeat mode to the remote device.
3209 * @privlevel platform
3210 * @privilege %http://tizen.org/privilege/bluetooth.admin
3211 * @param[in] mode The repeat mode
3212 * @return 0 on success, otherwise a negative error value.
3213 * @retval #BT_ERROR_NONE Successful
3214 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3215 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3216 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3217 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3218 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3219 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3220 * @pre The remote device must be connected.
3221 * @see bt_avrcp_target_connection_state_changed_cb()
3222 * @see bt_avrcp_target_initialize()
3224 int bt_avrcp_target_notify_repeat_mode(bt_avrcp_repeat_mode_e mode);
3228 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3229 * @brief Notifies the shuffle mode to the remote device.
3231 * @privlevel platform
3232 * @privilege %http://tizen.org/privilege/bluetooth.admin
3233 * @param[in] mode The repeat mode
3234 * @return 0 on success, otherwise a negative error value.
3235 * @retval #BT_ERROR_NONE Successful
3236 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3237 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3238 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3239 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3240 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3241 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3242 * @pre The remote device must be connected.
3243 * @see bt_avrcp_target_connection_state_changed_cb()
3244 * @see bt_avrcp_target_initialize()
3246 int bt_avrcp_target_notify_shuffle_mode(bt_avrcp_shuffle_mode_e mode);
3250 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3251 * @brief Notifies the scan mode to the remote device.
3253 * @privlevel platform
3254 * @privilege %http://tizen.org/privilege/bluetooth.admin
3255 * @param[in] mode The scan mode
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_ENABLED Not enabled
3261 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3262 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3263 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3264 * @pre The remote device must be connected.
3265 * @see bt_avrcp_target_connection_state_changed_cb()
3266 * @see bt_avrcp_target_initialize()
3268 int bt_avrcp_target_notify_scan_mode(bt_avrcp_scan_mode_e mode);
3272 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3273 * @brief Notifies the player state to the remote device.
3275 * @privlevel platform
3276 * @privilege %http://tizen.org/privilege/bluetooth.admin
3277 * @param[in] state The player state
3278 * @return 0 on success, otherwise a negative error value.
3279 * @retval #BT_ERROR_NONE Successful
3280 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3281 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3282 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3283 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3284 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3285 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3286 * @pre The remote device must be connected.
3287 * @see bt_avrcp_target_connection_state_changed_cb()
3288 * @see bt_avrcp_target_initialize()
3290 int bt_avrcp_target_notify_player_state(bt_avrcp_player_state_e state);
3294 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3295 * @brief Notifies the current position of song to the remote device.
3297 * @privlevel platform
3298 * @privilege %http://tizen.org/privilege/bluetooth.admin
3299 * @param[in] position The current position in milliseconds
3300 * @return 0 on success, otherwise a negative error value.
3301 * @retval #BT_ERROR_NONE Successful
3302 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3303 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3304 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3305 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3306 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3307 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3308 * @pre The remote device must be connected.
3309 * @see bt_avrcp_target_connection_state_changed_cb()
3310 * @see bt_avrcp_target_initialize()
3312 int bt_avrcp_target_notify_position(unsigned int position);
3316 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3317 * @brief Notifies the track to the remote device.
3319 * @privlevel platform
3320 * @privilege %http://tizen.org/privilege/bluetooth.admin
3321 * @param[in] title The title of track
3322 * @param[in] artist The artist of track
3323 * @param[in] album The album of track
3324 * @param[in] genre The genre of track
3325 * @param[in] track_num The track number
3326 * @param[in] total_tracks The number of all tracks
3327 * @param[in] duration The duration of track in milliseconds
3328 * @return 0 on success, otherwise a negative error value.
3329 * @retval #BT_ERROR_NONE Successful
3330 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3331 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3332 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3333 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3334 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3335 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3336 * @pre The remote device must be connected.
3337 * @see bt_avrcp_target_connection_state_changed_cb()
3338 * @see bt_avrcp_target_initialize()
3340 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);
3344 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3345 * @brief Registers a callback function that will be invoked when the equalizer state is changed by the remote control device.
3347 * @param[in] callback The callback function to register
3348 * @param[in] user_data The user data to be passed to the callback function
3349 * @return 0 on success, otherwise a negative error value.
3350 * @retval #BT_ERROR_NONE Successful
3351 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3352 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3353 * @pre The Bluetooth service must be initialized by bt_initialize().
3354 * @see bt_initialize()
3355 * @see bt_avrcp_unset_equalizer_state_changed_cb()
3357 int bt_avrcp_set_equalizer_state_changed_cb(bt_avrcp_equalizer_state_changed_cb callback, void *user_data);
3361 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3362 * @brief Unregisters a callback function that will be invoked when the equalizer state is changed by the remote control device.
3364 * @return 0 on success, otherwise a negative error value.
3365 * @retval #BT_ERROR_NONE Successful
3366 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3367 * @pre The Bluetooth service must be initialized by bt_initialize().
3368 * @see bt_initialize()
3369 * @see bt_avrcp_set_equalizer_state_changed_cb()
3371 int bt_avrcp_unset_equalizer_state_changed_cb(void);
3375 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3376 * @brief Registers a callback function that will be invoked when the repeat mode is changed by the remote control device.
3378 * @param[in] callback The callback function to register
3379 * @param[in] user_data The user data to be passed to the callback function
3380 * @return 0 on success, otherwise a negative error value.
3381 * @retval #BT_ERROR_NONE Successful
3382 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3383 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3384 * @pre The Bluetooth service must be initialized by bt_initialize().
3385 * @see bt_initialize()
3386 * @see bt_avrcp_unset_repeat_mode_changed_cb()
3388 int bt_avrcp_set_repeat_mode_changed_cb(bt_avrcp_repeat_mode_changed_cb callback, void *user_data);
3392 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3393 * @brief Unregisters a callback function that will be invoked when the repeat mode is changed by the remote control device.
3395 * @return 0 on success, otherwise a negative error value.
3396 * @retval #BT_ERROR_NONE Successful
3397 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3398 * @pre The Bluetooth service must be initialized by bt_initialize().
3399 * @see bt_initialize()
3400 * @see bt_avrcp_set_repeat_mode_changed_cb()
3402 int bt_avrcp_unset_repeat_mode_changed_cb(void);
3406 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3407 * @brief Registers a callback function that will be invoked when the shuffle mode is changed by the remote control device.
3409 * @param[in] callback The callback function to register
3410 * @param[in] user_data The user data to be passed to the callback function
3411 * @return 0 on success, otherwise a negative error value.
3412 * @retval #BT_ERROR_NONE Successful
3413 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3414 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3415 * @pre The Bluetooth service must be initialized by bt_initialize().
3416 * @see bt_initialize()
3417 * @see bt_avrcp_unset_shuffle_mode_changed_cb()
3419 int bt_avrcp_set_shuffle_mode_changed_cb(bt_avrcp_shuffle_mode_changed_cb callback, void *user_data);
3423 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3424 * @brief Unregisters a callback function that will be invoked when the shuffle mode is changed by the remote control device.
3426 * @return 0 on success, otherwise a negative error value.
3427 * @retval #BT_ERROR_NONE Successful
3428 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3429 * @pre The Bluetooth service must be initialized by bt_initialize().
3430 * @see bt_initialize()
3431 * @see bt_avrcp_set_shuffle_mode_changed_cb()
3433 int bt_avrcp_unset_shuffle_mode_changed_cb(void);
3437 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3438 * @brief Registers a callback function that will be invoked when the scan mode is changed by the remote control device.
3440 * @param[in] callback The callback function to register
3441 * @param[in] user_data The user data to be passed to the callback function
3442 * @return 0 on success, otherwise a negative error value.
3443 * @retval #BT_ERROR_NONE Successful
3444 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3445 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3446 * @pre The Bluetooth service must be initialized by bt_initialize().
3447 * @see bt_initialize()
3448 * @see bt_avrcp_unset_scan_mode_changed_cb()
3450 int bt_avrcp_set_scan_mode_changed_cb(bt_avrcp_scan_mode_changed_cb callback, void *user_data);
3454 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3455 * @brief Unregisters a callback function that will be invoked when the scan mode is changed by the remote control device.
3457 * @return 0 on success, otherwise a negative error value.
3458 * @retval #BT_ERROR_NONE Successful
3459 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3460 * @pre The Bluetooth service must be initialized by bt_initialize().
3461 * @see bt_initialize()
3462 * @see bt_avrcp_set_scan_mode_changed_cb()
3464 int bt_avrcp_unset_scan_mode_changed_cb(void);
3467 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3468 * @brief Registers an application that acts as the @a Sink role of HDP(Health Device Profile).
3471 * @privilege %http://tizen.org/privilege/bluetooth
3472 * @remarks The @a app_id must be released with free() by you.
3473 * @param[in] data_type The data type of MDEP. This value is defined in ISO/IEEE 11073-20601 spec.
3474 * For example, pulse oximeter is 0x1004 and blood pressure monitor is 0x1007.
3475 * @param[out] app_id The ID of application
3476 * @return 0 on success, otherwise a negative error value.
3477 * @retval #BT_ERROR_NONE Successful
3478 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3479 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
3480 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3481 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3482 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
3483 * @see bt_hdp_deactivate_sink()
3485 int bt_hdp_register_sink_app(unsigned short data_type, char **app_id);
3488 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3489 * @brief Unregisters the given application that acts as the @a Sink role of HDP(Health Device Profile).
3492 * @privilege %http://tizen.org/privilege/bluetooth
3493 * @param[in] app_id The ID of application
3494 * @return 0 on success, otherwise a negative error value.
3495 * @retval #BT_ERROR_NONE Successful
3496 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3497 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3498 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3499 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3500 * @see bt_hdp_register_sink_app()
3502 int bt_hdp_unregister_sink_app(const char *app_id);
3505 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3506 * @brief Connects the remote device which acts as @a Source role, asynchronously.
3509 * @privilege %http://tizen.org/privilege/bluetooth
3510 * @param[in] remote_address The remote address
3511 * @param[in] app_id The ID of application
3512 * @return 0 on success, otherwise a negative error value.
3513 * @retval #BT_ERROR_NONE Successful
3514 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3515 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3516 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3517 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device is not bonded
3518 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
3519 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3520 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3521 * @pre The Sink role of HDP must be registered with bt_hdp_register_sink_app().
3522 * @pre The local device must be bonded with the remote device by bt_device_create_bond().
3523 * @post bt_hdp_connected_cb() will be invoked.
3524 * @see bt_hdp_disconnect()
3525 * @see bt_hdp_set_connection_state_changed_cb()
3526 * @see bt_hdp_unset_connection_state_changed_cb()
3528 int bt_hdp_connect_to_source(const char *remote_address, const char *app_id);
3531 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3532 * @brief Disconnects the remote device, asynchronously.
3535 * @privilege %http://tizen.org/privilege/bluetooth
3536 * @param[in] remote_address The remote address
3537 * @param[in] channel The connected data channel
3538 * @return 0 on success, otherwise a negative error value.
3539 * @retval #BT_ERROR_NONE Successful
3540 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3541 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3542 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3543 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3544 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
3545 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3546 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3547 * @pre The remote device must be connected.
3548 * @post bt_hdp_disconnected_cb() will be invoked.
3549 * @see bt_hdp_set_connection_state_changed_cb()
3550 * @see bt_hdp_unset_connection_state_changed_cb()
3552 int bt_hdp_disconnect(const char *remote_address, unsigned int channel);
3555 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3556 * @brief Sends the data to the remote device.
3559 * @privilege %http://tizen.org/privilege/bluetooth
3560 * @param[in] channel The connected data channel
3561 * @param[in] data The data to send
3562 * @param[in] size The size of data to send (byte)
3563 * @return 0 on success, otherwise a negative error value.
3564 * @retval #BT_ERROR_NONE Successful
3565 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3566 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3567 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3568 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3569 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3570 * @pre The remote device must be connected.
3571 * @see bt_hdp_data_received_cb()
3572 * @see bt_hdp_set_data_received_cb()
3573 * @see bt_hdp_unset_data_received_cb()
3575 int bt_hdp_send_data(unsigned int channel, const char *data, unsigned int size);
3578 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3579 * @brief Registers a callback function that will be invoked when the connection state is changed.
3581 * @param[in] connected_cb The callback function called when a connection is established
3582 * @param[in] disconnected_cb The callback function called when a connection is disconnected
3583 * @param[in] user_data The user data to be passed to the callback function
3584 * @return 0 on success, otherwise a negative error value.
3585 * @retval #BT_ERROR_NONE Successful
3586 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3587 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3588 * @pre The Bluetooth service must be initialized with bt_initialize().
3589 * @see bt_hdp_unset_connection_state_changed_cb()
3591 int bt_hdp_set_connection_state_changed_cb(bt_hdp_connected_cb connected_cb, bt_hdp_disconnected_cb disconnected_cb, void *user_data);
3594 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3595 * @brief Unregisters a callback function that will be invoked when the connection state is changed.
3597 * @return 0 on success, otherwise a negative error value.
3598 * @retval #BT_ERROR_NONE Successful
3599 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3600 * @pre The Bluetooth service must be initialized with bt_initialize().
3601 * @see bt_hdp_set_connection_state_changed_cb()
3603 int bt_hdp_unset_connection_state_changed_cb(void);
3606 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3607 * @brief Registers a callback function that will be invoked when you receive the data.
3609 * @param[in] callback The callback function to register
3610 * @param[in] user_data The user data to be passed to the callback function
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 * @pre The Bluetooth service must be initialized with bt_initialize().
3616 * @see bt_hdp_unset_data_received_cb()
3618 int bt_hdp_set_data_received_cb(bt_hdp_data_received_cb callback, void *user_data);
3621 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3622 * @brief Unregisters a callback function that will be invoked when you receive the data.
3624 * @return 0 on success, otherwise a negative error value.
3625 * @retval #BT_ERROR_NONE Successful
3626 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3627 * @pre The Bluetooth service must be initialized with bt_initialize().
3628 * @see bt_hdp_set_data_received_cb()
3630 int bt_hdp_unset_data_received_cb(void);
3633 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3634 * @brief Gets the primary services of GATT(Generic Attribute Profile).
3637 * @privilege %http://tizen.org/privilege/bluetooth
3638 * @param[in] remote_address The address of the remote device
3639 * @param[in] callback The callback function to invoke
3640 * @param[in] user_data The user data to be passed to the callback function
3641 * @return 0 on success, otherwise a negative error value.
3642 * @retval #BT_ERROR_NONE Successful
3643 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3644 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3645 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3646 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3647 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3648 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
3649 * @post @a callback will be called if there are primary services.
3650 * @see bt_gatt_primary_service_cb()
3652 int bt_gatt_foreach_primary_services(const char *remote_address, bt_gatt_primary_service_cb callback, void *user_data);
3655 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3656 * @brief Discovers the characteristics in service, asynchronously.
3659 * @privilege %http://tizen.org/privilege/bluetooth
3660 * @param[in] service The attribute handle of service
3661 * @param[in] callback The result callback
3662 * @param[in] user_data The user data to be passed to the callback function
3663 * @return 0 on success, otherwise a negative error value.
3664 * @retval #BT_ERROR_NONE Successful
3665 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3666 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3667 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3668 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3669 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
3670 * @post @a callback will be called.
3671 * @see bt_gatt_characteristics_discovered_cb()
3673 int bt_gatt_discover_characteristics(bt_gatt_attribute_h service, bt_gatt_characteristics_discovered_cb callback, void *user_data);
3676 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3677 * @brief Gets the UUID of service.
3680 * @privilege %http://tizen.org/privilege/bluetooth
3681 * @remarks @a uuid must be released with free() by you.
3682 * @param[in] service The attribute handle of service
3683 * @param[out] uuid The UUID of service
3684 * @return 0 on success, otherwise a negative error value.
3685 * @retval #BT_ERROR_NONE Successful
3686 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3687 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3688 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3689 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
3690 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3691 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
3693 int bt_gatt_get_service_uuid(bt_gatt_attribute_h service, char **uuid);
3696 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3697 * @brief Gets the included services in service.
3700 * @privilege %http://tizen.org/privilege/bluetooth
3701 * @param[in] service The attribute handle of service
3702 * @param[in] callback The callback function to invoke
3703 * @param[in] user_data The user data to be passed to the callback function
3704 * @return 0 on success, otherwise a negative error value.
3705 * @retval #BT_ERROR_NONE Successful
3706 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3707 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3708 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3709 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3710 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3711 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
3712 * @post @a callback will be called if there are included services.
3713 * @see bt_gatt_included_service_cb()
3715 int bt_gatt_foreach_included_services(bt_gatt_attribute_h service, bt_gatt_included_service_cb callback, void *user_data);
3718 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3719 * @brief Registers a callback function that will be invoked when a characteristic value is changed.
3721 * @param[in] callback The callback function to register
3722 * @param[in] user_data The user data to be passed to the callback function
3723 * @return 0 on success, otherwise a negative error value.
3724 * @retval #BT_ERROR_NONE Successful
3725 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3726 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3727 * @pre The Bluetooth service must be initialized with bt_initialize().
3728 * @see bt_gatt_unset_characteristic_changed_cb()
3730 int bt_gatt_set_characteristic_changed_cb(bt_gatt_characteristic_changed_cb callback, void *user_data);
3733 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3734 * @brief Unregisters a callback function that will be invoked when a characteristic is changed.
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 * @pre The Bluetooth service must be initialized with bt_initialize().
3740 * @see bt_gatt_set_characteristic_changed_cb()
3742 int bt_gatt_unset_characteristic_changed_cb(void);
3745 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3746 * @brief Watches all the characteristic value changes of the service
3749 * @privilege %http://tizen.org/privilege/bluetooth
3750 * @param[in] service The attribute handle of service
3751 * @return 0 on success, otherwise a negative error value.
3752 * @retval #BT_ERROR_NONE Successful
3753 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3754 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3755 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3756 * @pre The Bluetooth service must be initialized with bt_initialize().
3757 * @see bt_gatt_unset_characteristic_changed_cb()
3759 int bt_gatt_watch_characteristic_changes(bt_gatt_attribute_h service);
3762 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3763 * @brief Remove watching of all the characteristic value changes of the service
3766 * @privilege %http://tizen.org/privilege/bluetooth
3767 * @param[in] service The attribute handle of service
3768 * @return 0 on success, otherwise a negative error value.
3769 * @retval #BT_ERROR_NONE Successful
3770 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3771 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3772 * @pre The Bluetooth service must be initialized with bt_initialize().
3773 * @see bt_gatt_set_characteristic_changed_cb()
3775 int bt_gatt_unwatch_characteristic_changes(bt_gatt_attribute_h service);
3779 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3780 * @brief Gets the characteristic declaration.
3783 * @privilege %http://tizen.org/privilege/bluetooth
3784 * @remarks @a uuid and @a value must be released with free() by you.
3785 * @param[in] characteristic The attribute handle of characteristic
3786 * @param[out] uuid The UUID of service
3787 * @param[out] value The value of characteristic (byte array)
3788 * @param[out] value_length The length of value
3789 * @return 0 on success, otherwise a negative error value.
3790 * @retval #BT_ERROR_NONE Successful
3791 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3792 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3793 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3794 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
3795 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3796 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
3797 * @see bt_gatt_set_characteristic_value()
3799 int bt_gatt_get_characteristic_declaration(bt_gatt_attribute_h characteristic, char **uuid, unsigned char **value, int *value_length);
3802 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3803 * @brief Sets the value of characteristic.
3806 * @privilege %http://tizen.org/privilege/bluetooth
3807 * @param[in] characteristic The attribute handle of characteristic
3808 * @param[in] value The value of characteristic (byte array)
3809 * @param[in] value_length The length of value
3810 * @return 0 on success, otherwise a negative error value.
3811 * @retval #BT_ERROR_NONE Successful
3812 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3813 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3814 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3815 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3816 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
3817 * @see bt_gatt_get_characteristic_declaration()
3819 int bt_gatt_set_characteristic_value(bt_gatt_attribute_h characteristic, const unsigned char *value, int value_length);
3822 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3823 * @brief Sets the value of characteristic request.
3826 * @privilege %http://tizen.org/privilege/bluetooth
3827 * @param[in] characteristic The attribute handle of characteristic
3828 * @param[in] value The value of characteristic (byte array)
3829 * @param[in] value_length The length of value
3830 * @param[in] callback The result callback
3831 * @return 0 on success, otherwise a negative error value.
3832 * @retval #BT_ERROR_NONE Successful
3833 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3834 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3835 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3836 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3837 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
3838 * @see bt_gatt_get_characteristic_declaration()
3840 int bt_gatt_set_characteristic_value_request(bt_gatt_attribute_h characteristic, const unsigned char *value,
3841 int value_length, bt_gatt_characteristic_write_cb callback);
3844 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3845 * @brief Clones the attribute handle.
3847 * @remarks @a clone must be released with bt_gatt_destroy_attribute_handle().
3848 * @param[out] clone The cloned attribute handle
3849 * @param[in] origin The origin attribute handle
3850 * @return 0 on success, otherwise negative error value.
3851 * @retval #BT_ERROR_NONE Successful
3852 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3853 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
3854 * @see bt_gatt_destroy_attribute_handle()
3856 int bt_gatt_clone_attribute_handle(bt_gatt_attribute_h* clone, bt_gatt_attribute_h origin);
3859 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3860 * @brief Destroys the attribute handle.
3862 * @param[in] handle The attribute handle
3863 * @return 0 on success, otherwise negative error value.
3864 * @retval #BT_ERROR_NONE Successful
3865 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3866 * @see bt_gatt_clone_attribute_handle()
3868 int bt_gatt_destroy_attribute_handle(bt_gatt_attribute_h handle);
3871 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3872 * @brief Reads the value of characteristic from remote device
3875 * @privilege %http://tizen.org/privilege/bluetooth
3876 * @param[in] char_handle The attribute handle of characteristic
3877 * @param[in] callback The result callback
3878 * @return 0 on success, otherwise a negative error value.
3879 * @retval #BT_ERROR_NONE Successful
3880 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3881 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3882 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3883 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3884 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
3885 * @see bt_gatt_get_characteristic_declaration()
3887 int bt_gatt_read_characteristic_value(bt_gatt_attribute_h char_handle,
3888 bt_gatt_characteristic_read_cb callback);
3891 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3892 * @brief Discovers the characteristic descriptors of a characteristic within its definition, asynchronously.
3895 * @privilege %http://tizen.org/privilege/bluetooth
3896 * @param[in] characteristic_handle The attribute handle of characteristic
3897 * @param[in] callback The result callback
3898 * @param[in] user_data The user data to be passed to the callback function
3899 * @return 0 on success, otherwise a negative error value.
3900 * @retval #BT_ERROR_NONE Successful
3901 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3902 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3903 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3904 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3905 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
3906 * @post @a callback will be called.
3907 * @see bt_gatt_characteristic_descriptor_discovered_cb()
3909 int bt_gatt_discover_characteristic_descriptor(bt_gatt_attribute_h characteristic_handle,
3910 bt_gatt_characteristic_descriptor_discovered_cb callback,
3913 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3914 * @brief Sets the value of characteristic descriptor request.
3917 * @privilege %http://tizen.org/privilege/bluetooth
3918 * @param[in] characteristic The attribute handle of characteristic
3919 * @param[in] value The value of characteristic (byte array), desc handle, desc value
3920 * @param[in] value_length The length of value
3921 * @param[in] callback The result callback
3922 * @return 0 on success, otherwise a negative error value.
3923 * @retval #BT_ERROR_NONE Successful
3924 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3925 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3926 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3927 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3928 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
3929 * @see bt_gatt_get_characteristic_declaration()
3931 int bt_gatt_set_characteristic_desc_value_request(bt_gatt_attribute_h characteristic,
3932 const unsigned char *value, int value_length,
3933 bt_gatt_characteristic_write_cb callback);
3936 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3937 * @brief Connect to a specific LE based service on a remote bluetooth dievice address, asynchronously.
3940 * @privilege %http://tizen.org/privilege/bluetooth
3942 * @remarks A connection can be disconnected by bt_gatt_disconnect().
3944 * @param[in] address The address of the remote Bluetooth device.
3945 * @param[in] auto_connect The flag of the auto connection.
3947 * @return 0 on success, otherwise a negative error value.
3948 * @retval #BT_ERROR_NONE Successful
3949 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3950 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3951 * @retval #BT_ERROR_INVALID_PARAMETER Invalid paramater
3952 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3953 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3955 * @pre The Bluetooth service must be initialized with bt_initialize().
3956 * @pre The remote device must support le connection.
3957 * @post This function invokes bt_gatt_connection_state_changed_cb().
3959 * @see bt_initialize()
3960 * @see bt_gatt_disconnect()
3961 * @see bt_gatt_set_connection_state_changed_cb()
3962 * @see bt_gatt_unset_connection_state_changed_cb()
3963 * @see bt_gatt_connection_state_changed_cb()
3965 int bt_gatt_connect(const char *address, bool auto_connect);
3968 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3969 * @brief Disconnect to LE connection with the given remote Bluetooth dievice address, asynchronously.
3972 * @privilege %http://tizen.org/privilege/bluetooth
3974 * @param[in] address The address of the remote Bluetooth device
3976 * @return 0 on success, otherwise a negative error value.
3977 * @retval #BT_ERROR_NONE Successful
3978 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3979 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3980 * @retval #BT_ERROR_INVALID_PARAMETER Invalid paramater
3981 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3982 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3984 * @pre The connection must be established.
3985 * @post This function invokes bt_gatt_connection_state_changed_cb().
3987 * @see bt_initialize()
3988 * @see bt_gatt_connect()
3989 * @see bt_gatt_set_connection_state_changed_cb()
3990 * @see bt_gatt_unset_connection_state_changed_cb()
3991 * @see bt_gatt_connection_state_changed_cb()
3993 int bt_gatt_disconnect(const char *address);
3996 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3997 * @brief Registers a callback function that will be invoked when the connection state is changed.
4000 * @param[in] callback The callback function to register.
4001 * @param[in] user_data The user data to be passed to the callback function.
4003 * @retval #BT_ERROR_NONE Successful
4004 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4005 * @retval #BT_ERROR_INVALID_PARAMETER Invalid paramater
4007 * @see bt_gatt_connect()
4008 * @see bt_gatt_disconnect()
4009 * @see bt_gatt_unset_connection_state_changed_cb()
4011 int bt_gatt_set_connection_state_changed_cb(bt_gatt_connection_state_changed_cb callback, void *user_data);
4014 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4015 * @brief Unregisters a callback function that will be invoked when the connection state is changed.
4018 * @retval #BT_ERROR_NONE Successful
4019 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4021 * @see bt_gatt_connect()
4022 * @see bt_gatt_disconnect()
4023 * @see bt_gatt_connection_state_changed_cb()
4025 int bt_gatt_unset_connection_state_changed_cb(void);
4029 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4030 * @brief Initializes the Gatt Service.
4032 * @privlevel platform
4033 * @privilege http://tizen.org/privilege/bluetooth.admin
4035 * @return 0 on success, otherwise a negative error value.
4036 * @retval #BT_ERROR_NONE Successful
4037 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4038 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4039 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4040 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4042 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
4043 * @see bt_adapter_enable()
4045 int _bt_gatt_init_service(void);
4050 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4051 * @brief DeInitializes the Gatt Service.
4053 * @privlevel platform
4054 * @privilege http://tizen.org/privilege/bluetooth.admin
4056 * @return 0 on success, otherwise a negative error value.
4057 * @retval #BT_ERROR_NONE Successful
4058 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4059 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4060 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4061 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4063 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
4064 * @see bt_adapter_enable()
4065 * @see _bt_gatt_init_service(void)
4067 int _bt_gatt_deinit_service(void);
4072 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4073 * @brief Adds Gatt Service to the service interface.
4075 * @privlevel platform
4076 * @privilege http://tizen.org/privilege/bluetooth.admin
4078 * @param[in] svc_uuid Gatt service uuid.
4079 * @param[out] svc_path Object path of the GATT service.
4080 * @remarks svc_path must be released with free() by you.
4082 * @return 0 on success, otherwise a negative error value.
4083 * @retval #BT_ERROR_NONE Successful
4084 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4085 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4086 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4087 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4089 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
4090 * @see bt_adapter_enable()
4092 int bt_gatt_add_service(const char *svc_uuid,
4097 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4098 * @brief Deletes a Gatt Service from the Gatt Server Database.
4100 * @privlevel platform
4101 * @privilege http://tizen.org/privilege/bluetooth.admin
4103 * @param[in] svc_path Service path of the gatt service to remove.
4104 * @return 0 on success, otherwise a negative error value.
4105 * @retval #BT_ERROR_NONE Successful
4106 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4107 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4108 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4109 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4111 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
4112 * @see bt_adapter_enable()
4114 int bt_gatt_remove_service(const char *svc_path);
4118 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4119 * @brief Adds Gatt characteristic to the Characteristics interface.
4121 * @privlevel platform
4122 * @privilege http://tizen.org/privilege/bluetooth.admin
4124 * @param[in] char_uuid Gatt characteristic uuid.
4125 * @param[in] char_value Gatt characteristic value.
4126 * @param[in] value_length Caracteristic value length.
4127 * @param[in] char_flags Characteristic flags.
4128 * @param[in] flags_length Caracteristic flags length.
4129 * @param[in] svc_path service path to which this characteristic belongs to.
4130 * @param[out] char_path characteristic path registered on the interface.
4131 * @remarks char_path must be released with free() by you.
4133 * @return 0 on success, otherwise a negative error value.
4134 * @retval #BT_ERROR_NONE Successful
4135 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4136 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4137 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4138 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4140 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
4141 * @see bt_adapter_enable()
4143 int bt_gatt_add_characteristic(const char *char_uuid,
4144 const char *char_value, int value_length,
4145 const char *char_flags[], int flags_length,
4146 const char *svc_path, char **char_path);
4150 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4151 * @brief Adds Gatt descriptor to the descriptor interface.
4153 * @privlevel platform
4154 * @privilege http://tizen.org/privilege/bluetooth.admin
4156 * @param[in] desc_uuid Gatt descriptor uuid.
4157 * @param[in] desc_value Gatt descriptor value.
4158 * @param[in] desc_length Gatt descriptor value.
4159 * @param[in] permissions Permissions for the descriptor.
4160 * @param[in] char_path Characteristic path to which this descriptor should belong to.
4161 * @return 0 on success, otherwise a negative error value.
4162 * @retval #BT_ERROR_NONE Successful
4163 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4164 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4165 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4166 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4168 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
4169 * @see bt_adapter_enable()
4171 int bt_gatt_add_descriptor(const char *desc_uuid,
4172 const char *desc_value, int value_length,
4173 const char *permissions, const char *char_path,
4178 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4179 * @brief Registers the given service path (including characteristics and descriptor) with the Bluez.
4181 * @privlevel platform
4182 * @privilege http://tizen.org/privilege/bluetooth.admin
4184 * @param[in] svc_path Gatt service path obtained from the add_service.
4185 * @return 0 on success, otherwise a negative error value.
4186 * @retval #BT_ERROR_NONE Successful
4187 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4188 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4189 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4190 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4192 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
4193 * @pre bt_gatt_add_service, bt_gatt_add_characteristic and bt_gatt_add_descriptor
4194 * must be called before calling bt_gatt_register_service
4196 * @see bt_adapter_enable()
4197 * @see bt_gatt_add_service()
4198 * @see bt_gatt_add_characteristic()
4199 * @see bt_gatt_add_descriptor()
4201 int bt_gatt_register_service(const char *svc_path,
4202 bt_gatt_remote_characteristic_write_cb callback,
4207 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4208 * @brief Updates the existing characteristic value.
4210 * @privlevel platform
4211 * @privilege http://tizen.org/privilege/bluetooth.admin
4213 * @param[in] char_path characteristic path registered on the interface.
4214 * @param[in] char_value Gatt characteristic value.
4215 * @param[in] value_length Characteristic value length.
4216 * @param[in] address Remote device address, for which
4217 * Notification/Indication need to be sent.
4219 * @return 0 on success, otherwise a negative error value.
4220 * @retval #BT_ERROR_NONE Successful
4221 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4222 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4223 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4224 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4226 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
4227 * @see bt_adapter_enable()
4229 int bt_gatt_update_characteristic(const char *char_path,
4230 const char *char_value, int value_length,
4231 const char *address);
4234 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4235 * @brief Delete Gatt Services from the Gatt Server Database.
4237 * @privlevel platform
4238 * @privilege http://tizen.org/privilege/bluetooth.admin
4240 * @return 0 on success, otherwise a negative error value.
4241 * @retval #BT_ERROR_NONE Successful
4242 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4243 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4244 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4245 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4247 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
4248 * @post @a callback will be called.
4249 * @see bt_adapter_enable()
4251 int bt_gatt_delete_services(void);
4255 * @ingroup CAPI_NETWORK_BLUETOOTH_PAN_NAP_MODULE
4256 * @brief Activates the NAP(Network Access Point).
4258 * @privlevel platform
4259 * @privilege %http://tizen.org/privilege/bluetooth.admin
4260 * @return 0 on success, otherwise a negative error value.
4261 * @retval #BT_ERROR_NONE Successful
4262 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4263 * @retval #BT_ERROR_NOT_ENABLED Not enabled
4264 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4265 * @retval #BT_ERROR_ALREADY_DONE Operation is already done
4266 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4267 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED
4268 * @see bt_nap_deactivate()
4270 int bt_nap_activate(void);
4274 * @ingroup CAPI_NETWORK_BLUETOOTH_PAN_NAP_MODULE
4275 * @brief Deactivates the NAP(Network Access Point).
4277 * @privlevel platform
4278 * @privilege %http://tizen.org/privilege/bluetooth.admin
4279 * @return 0 on success, otherwise a negative error value.
4280 * @retval #BT_ERROR_NONE Successful
4281 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4282 * @retval #BT_ERROR_NOT_ENABLED Not enabled
4283 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4284 * @retval #BT_ERROR_ALREADY_DONE Operation is already done
4285 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4286 * @pre The Bluetooth NAP service must be activated with bt_nap_activate().
4287 * @see bt_nap_activate()
4289 int bt_nap_deactivate(void);
4293 * @ingroup CAPI_NETWORK_BLUETOOTH_PAN_NAP_MODULE
4294 * @brief Disconnects the all PANUs(Personal Area Networking User) which are connected to you.
4296 * @privlevel platform
4297 * @privilege %http://tizen.org/privilege/bluetooth.admin
4298 * @return 0 on success, otherwise a negative error value.
4299 * @retval #BT_ERROR_NONE Successful
4300 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4301 * @retval #BT_ERROR_NOT_ENABLED Not enabled
4302 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4303 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4304 * @pre The Bluetooth NAP service must be activated with bt_nap_activate().
4305 * @see bt_nap_activate()
4307 int bt_nap_disconnect_all(void);
4311 * @ingroup CAPI_NETWORK_BLUETOOTH_PAN_NAP_MODULE
4312 * @brief Disconnects the specified PANU(Personal Area Networking User) which is connected to you.
4314 * @privlevel platform
4315 * @privilege %http://tizen.org/privilege/bluetooth.admin
4316 * @param[in] remote_address The remote address
4317 * @return 0 on success, otherwise a negative error value.
4318 * @retval #BT_ERROR_NONE Successful
4319 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4320 * @retval #BT_ERROR_NOT_ENABLED Not enabled
4321 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4322 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4323 * @pre The Bluetooth NAP service must be activated with bt_nap_activate().
4324 * @see bt_nap_activate()
4326 int bt_nap_disconnect(const char *remote_address);
4330 * @ingroup CAPI_NETWORK_BLUETOOTH_PAN_NAP_MODULE
4331 * @brief Registers a callback function that will be invoked when the connection state changes.
4333 * @param[in] callback The callback function to register
4334 * @param[in] user_data The user data to be passed to the callback function
4335 * @return 0 on success, otherwise a negative error value.
4336 * @retval #BT_ERROR_NONE Successful
4337 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4338 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4339 * @pre The Bluetooth service must be initialized with bt_initialize().
4340 * @post bt_nap_connection_state_changed_cb() will be invoked.
4341 * @see bt_initialize()
4342 * @see bt_nap_connection_state_changed_cb()
4343 * @see bt_nap_unset_connection_state_changed_cb()
4345 int bt_nap_set_connection_state_changed_cb(bt_nap_connection_state_changed_cb callback, void *user_data);
4349 * @ingroup CAPI_NETWORK_BLUETOOTH_PAN_NAP_MODULE
4350 * @brief Unregisters a callback function that will be invoked when the connection state changes.
4352 * @return 0 on success, otherwise a negative error value.
4353 * @retval #BT_ERROR_NONE Successful
4354 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4355 * @pre The Bluetooth service must be initialized with bt_initialize().
4356 * @post bt_nap_connection_state_changed_cb() will be invoked.
4357 * @see bt_initialize()
4358 * @see bt_nap_connection_state_changed_cb()
4359 * @see bt_nap_set_connection_state_changed_cb()
4361 int bt_nap_unset_connection_state_changed_cb(void);
4365 * @ingroup CAPI_NETWORK_BLUETOOTH_PAN_PANU_MODULE
4366 * @brief Registers a callback function that will be invoked when the connection state changes.
4368 * @param[in] callback The callback function to register
4369 * @param[in] user_data The user data to be passed to the callback function
4370 * @return 0 on success, otherwise a negative error value.
4371 * @retval #BT_ERROR_NONE Successful
4372 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4373 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4374 * @pre The Bluetooth service must be initialized with bt_initialize().
4375 * @post bt_nap_connection_state_changed_cb() will be invoked.
4376 * @see bt_initialize()
4377 * @see bt_panu_connection_state_changed_cb()
4378 * @see bt_panu_unset_connection_state_changed_cb()
4380 int bt_panu_set_connection_state_changed_cb(bt_panu_connection_state_changed_cb callback, void *user_data);
4384 * @ingroup CAPI_NETWORK_BLUETOOTH_PAN_PANU_MODULE
4385 * @brief Unregisters a callback function that will be invoked when the connection state changes.
4387 * @return 0 on success, otherwise a negative error value.
4388 * @retval #BT_ERROR_NONE Successful
4389 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4390 * @pre The Bluetooth service must be initialized with bt_initialize().
4391 * @post bt_nap_connection_state_changed_cb() will be invoked.
4392 * @see bt_initialize()
4393 * @see bt_panu_connection_state_changed_cb()
4394 * @see bt_panu_set_connection_state_changed_cb()
4396 int bt_panu_unset_connection_state_changed_cb(void);
4400 * @ingroup CAPI_NETWORK_BLUETOOTH_PAN_PANU_MODULE
4401 * @brief Connects the remote device with the PAN(Personal Area Networking) service, asynchronously.
4403 * @privlevel platform
4404 * @privilege %http://tizen.org/privilege/bluetooth.admin
4405 * @param[in] remote_address The remote address
4406 * @param[in] type The type of PAN service
4407 * @return 0 on success, otherwise a negative error value.
4408 * @retval #BT_ERROR_NONE Successful
4409 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4410 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4411 * @retval #BT_ERROR_NOT_ENABLED Not enabled
4412 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device is not bonded
4413 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
4414 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4415 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4416 * @pre The local device must be bonded with the remote device by bt_device_create_bond().
4417 * @post bt_panu_connection_state_changed_cb() will be invoked.
4418 * @see bt_panu_disconnect()
4419 * @see bt_panu_connection_state_changed_cb()
4421 int bt_panu_connect(const char *remote_address, bt_panu_service_type_e type);
4425 * @ingroup CAPI_NETWORK_BLUETOOTH_PAN_PANU_MODULE
4426 * @brief Disconnects the remote device with the PAN(Personal Area Networking) service, asynchronously.
4428 * @privlevel platform
4429 * @privilege %http://tizen.org/privilege/bluetooth.admin
4430 * @param[in] remote_address The remote address
4431 * @return 0 on success, otherwise a negative error value.
4432 * @retval #BT_ERROR_NONE Successful
4433 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4434 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4435 * @retval #BT_ERROR_NOT_ENABLED Not enabled
4436 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
4437 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
4438 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4439 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4440 * @pre The remote device must be connected by bt_panu_connect().
4441 * @post bt_panu_connection_state_changed_cb() will be invoked.
4442 * @see bt_panu_connect()
4443 * @see bt_panu_connection_state_changed_cb()
4445 int bt_panu_disconnect(const char *remote_address);
4449 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
4450 * @brief update LE connection.
4452 * @privlevel platform
4453 * @privilege %http://tizen.org/privilege/bluetooth.admin
4454 * @return 0 on success, otherwise a negative error value.
4455 * @retval #BT_ERROR_NONE Successful
4456 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4457 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4458 * @pre The Bluetooth service must be initialized by bt_initialize().
4459 * @pre The remote device must be connected with bt_gatt_connect().
4461 int bt_device_le_conn_update(const char *device_address,
4462 const bt_le_conn_update_s *parameters);
4472 #endif /* __cplusplus */
4474 #endif // __TIZEN_NETWORK_BLUETOOTH_H__