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>
27 #include <bluetooth_type.h>
29 #ifndef TIZEN_DEPRECATED_API
30 #define TIZEN_DEPRECATED_API __attribute__((__visibility__("default"), deprecated))
36 #endif /* __cplusplus */
40 * @brief API to control the Bluetooth adapter and devices and communications.
41 * @ingroup CAPI_NETWORK_BLUETOOTH_MODULE
46 * @ingroup CAPI_NETWORK_BLUETOOTH_MODULE
47 * @brief Initializes the Bluetooth API.
48 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
50 * @remarks This function must be called before Bluetooth API starts. \n
51 * You must free all resources of the Bluetooth service by calling bt_deinitialize() if Bluetooth service is no longer needed.
53 * @return 0 on success, otherwise a negative error value.
54 * @retval #BT_ERROR_NONE Successful
55 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
56 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
58 * @see bt_deinitialize()
60 int bt_initialize(void);
64 * @ingroup CAPI_NETWORK_BLUETOOTH_MODULE
65 * @brief Releases all resources of the Bluetooth API.
66 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
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
74 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
76 * @pre Bluetooth API must be initialized with bt_initialize().
78 * @see bt_initialize()
80 int bt_deinitialize(void);
83 * @ingroup CAPI_NETWORK_BLUETOOTH_MODULE
84 * @brief Gets the specification name for the given UUID.
87 * @remarks The @a name must be released using free().
89 * @param[in] uuid The UUID
90 * @param[out] name The specification name defined at www.bluetooth.com
91 * @return 0 on success, otherwise a negative error value.
92 * @retval #BT_ERROR_NONE Successful
93 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
94 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
96 * @see bt_gatt_get_uuid()
98 int bt_get_uuid_name(const char *uuid, char **name);
101 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
102 * @brief Gets the current state of local Bluetooth adapter.
103 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
105 * @param[out] adapter_state The current adapter state
107 * @return 0 on success, otherwise a negative error value.
108 * @retval #BT_ERROR_NONE Successful
109 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
110 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
111 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
113 * @pre Bluetooth service must be initialized with bt_initialize().
115 * @see bt_initialize()
117 int bt_adapter_get_state(bt_adapter_state_e *adapter_state);
120 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
121 * @brief Gets the address of local Bluetooth adapter.
122 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
124 * @remarks The @a local_address must be released with free() by you.
126 * @param[out] local_address The device address of local Bluetooth adapter
128 * @return 0 on success, otherwise a negative error value.
129 * @retval #BT_ERROR_NONE Successful
130 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
131 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
132 * @retval #BT_ERROR_NOT_ENABLED Not enabled
133 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
134 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
135 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
137 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
138 * @see bt_adapter_get_name()
140 int bt_adapter_get_address(char **local_address);
143 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
144 * @brief Gets the name of local Bluetooth adapter.
146 * @details Use this function to get the friendly name associated with Bluetooth \n
147 * device, retrieved by the remote Bluetooth devices.
149 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
151 * @remarks The @a local_name must be released with free() by you.
153 * @param[out] local_name The local device name
155 * @return 0 on success, otherwise a negative error value.
156 * @retval #BT_ERROR_NONE Successful
157 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
158 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
159 * @retval #BT_ERROR_NOT_ENABLED Not enabled
160 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
161 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
162 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
164 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
166 * @see bt_adapter_set_name()
168 int bt_adapter_get_name(char **local_name);
171 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
172 * @brief Sets the name of local Bluetooth adapter.
173 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
175 * @privilege %http://tizen.org/privilege/bluetooth
177 * @param[in] local_name The name of the Bluetooth device. \n
178 * The maximum length is 248 characters.
180 * @return 0 on success, otherwise a negative error value.
181 * @retval #BT_ERROR_NONE Successful
182 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
183 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
184 * @retval #BT_ERROR_NOT_ENABLED Not enabled
185 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
186 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
187 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
189 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
190 * @post bt_adapter_name_changed_cb() will be invoked if this function returns #BT_ERROR_NONE.
192 * @see bt_adapter_get_name()
193 * @see bt_adapter_name_changed_cb()
194 * @see bt_adapter_set_name_changed_cb()
195 * @see bt_adapter_unset_name_changed_cb()
197 int bt_adapter_set_name(const char *local_name);
200 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
201 * @brief Gets the visibility mode of local Bluetooth adapter.
202 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
203 * @param[out] mode The visibility mode of the Bluetooth device
204 * @param[out] duration The duration until the visibility mode is changed to #BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE (in seconds).
205 * @a duration is valid only if @a mode is #BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE. This value can be NULL.
206 * @return 0 on success, otherwise a negative error value.
207 * @retval #BT_ERROR_NONE Successful
208 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
209 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
210 * @retval #BT_ERROR_NOT_ENABLED Not enabled
211 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
212 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
214 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
216 int bt_adapter_get_visibility(bt_adapter_visibility_mode_e *mode, int *duration);
219 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
220 * @brief Starts the device discovery, asynchronously.
222 * @details If a device is discovered, bt_adapter_device_discovery_state_changed_cb() will be invoked \n
223 * with #BT_ADAPTER_DEVICE_DISCOVERY_FOUND, and then bt_adapter_device_discovery_state_changed_cb() \n
224 * will be called with #BT_ADAPTER_DEVICE_DISCOVERY_FINISHED in case of the completion or cancellation of the discovery.
226 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
228 * @privilege %http://tizen.org/privilege/bluetooth
229 * @remarks To connect to peer Bluetooth device, you need to know its Bluetooth address. \n
230 * The device discovery can be stopped by bt_adapter_stop_device_discovery().
232 * @return 0 on success, otherwise a negative error value.
233 * @retval #BT_ERROR_NONE Successful
234 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
235 * @retval #BT_ERROR_NOT_ENABLED Not enabled
236 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation is now in progress
237 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
238 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
239 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
241 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
242 * @post This function invokes bt_adapter_device_discovery_state_changed_cb().
244 * @see bt_adapter_is_discovering()
245 * @see bt_adapter_stop_device_discovery()
246 * @see bt_adapter_device_discovery_state_changed_cb()
247 * @see bt_adapter_set_device_discovery_state_changed_cb()
248 * @see bt_adapter_unset_device_discovery_state_changed_cb()
250 int bt_adapter_start_device_discovery(void);
253 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
254 * @brief Stops the device discovery, asynchronously.
255 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
257 * @privilege %http://tizen.org/privilege/bluetooth
258 * @remarks The device discovery process will take 10 ~ 20 seconds to get all the devices in vicinity.
260 * @return 0 on success, otherwise a negative error value.
261 * @retval #BT_ERROR_NONE Successful
262 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
263 * @retval #BT_ERROR_NOT_ENABLED Not enabled
264 * @retval #BT_ERROR_NOT_IN_PROGRESS Operation is not in progress
265 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
266 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
267 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
269 * @pre The device discovery must be in progress with bt_adapter_start_device_discovery().
270 * @post This function invokes bt_adapter_device_discovery_state_changed_cb().
272 * @see bt_adapter_is_discovering()
273 * @see bt_adapter_start_device_discovery()
274 * @see bt_adapter_set_device_discovery_state_changed_cb()
275 * @see bt_adapter_unset_device_discovery_state_changed_cb()
276 * @see bt_adapter_device_discovery_state_changed_cb()
278 int bt_adapter_stop_device_discovery(void);
281 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
282 * @brief Checks for the device discovery is in progress or not.
283 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
285 * @remarks If Bluetooth discovery is in progress, other operations are not allowed and \n
286 * you have to either stop the discovery operation, or wait for it to be finished, \n
287 * before performing other operations.
289 * @param[out] is_discovering The discovering status: (@c true = in progress , @c false = not in progress )
291 * @return 0 on success, otherwise a negative error value.
292 * @retval #BT_ERROR_NONE Successful
293 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
294 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
295 * @retval #BT_ERROR_NOT_ENABLED Not enabled
296 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
297 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
299 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
301 * @see bt_adapter_start_device_discovery()
302 * @see bt_adapter_stop_device_discovery()
304 int bt_adapter_is_discovering(bool *is_discovering);
307 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
308 * @brief Gets the service mask from the UUID list.
309 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
311 * @param[in] uuids The UUID list of the device.
312 * @param[in] no_of_service The number of the UUID list count.
313 * @param[out] service_mask_list Service mask list converted from the given UUID list.
315 * @return 0 on success, otherwise a negative error value.
316 * @retval #BT_ERROR_NONE Successful
317 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
318 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
320 * @see bt_service_class_t
322 int bt_device_get_service_mask_from_uuid_list(char **uuids,
324 bt_service_class_t *service_mask_list);
327 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
328 * @brief Retrieves the device information of all bonded devices.
329 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
331 * @param[in] callback The callback function to invoke
332 * @param[in] user_data The user data passed from the foreach function
334 * @return 0 on success, otherwise a negative error value.
335 * @retval #BT_ERROR_NONE Successful
336 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
337 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
338 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
339 * @retval #BT_ERROR_NOT_ENABLED Not enabled
340 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
341 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
343 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
344 * @post This function invokes bt_adapter_bonded_device_cb().
346 * @see bt_adapter_bonded_device_cb()
348 int bt_adapter_foreach_bonded_device(bt_adapter_bonded_device_cb callback, void *user_data);
351 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
352 * @brief Gets the device information of a bonded device.
353 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
354 * @remarks The @a device_info must be released with bt_adapter_free_device_info() by you .
356 * @param[in] remote_address The address of remote device
357 * @param[out] device_info The bonded device information
359 * @return 0 on success, otherwise a negative error value.
360 * @retval #BT_ERROR_NONE Successful
361 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
362 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
363 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
364 * @retval #BT_ERROR_NOT_ENABLED Not enabled
365 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
366 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
367 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
369 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
370 * @post This function invokes bt_adapter_bonded_device_cb().
372 * @see bt_adapter_bonded_device_cb()
374 int bt_adapter_get_bonded_device_info(const char *remote_address, bt_device_info_s **device_info);
377 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
378 * @brief Frees device info.
379 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
381 * @param[in] device_info The bonded device information
383 * @return 0 on success, otherwise a negative error value.
384 * @retval #BT_ERROR_NONE Successful
385 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
386 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
388 * @see bt_adapter_get_bonded_device_info()
390 int bt_adapter_free_device_info(bt_device_info_s *device_info);
393 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
394 * @brief Checks whether the UUID of service is used or not.
395 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
396 * @param[in] service_uuid The UUID of service
397 * @param[out] used Indicates whether the service is used or not
398 * @return true on success, otherwise false.
399 * @return 0 on success, otherwise a negative error value.
400 * @retval #BT_ERROR_NONE Successful
401 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
402 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
403 * @retval #BT_ERROR_NOT_ENABLED Not enabled
404 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
405 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
407 int bt_adapter_is_service_used(const char *service_uuid, bool *used);
410 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
411 * @brief Registers a callback function to be invoked when the Bluetooth adapter state changes.
412 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
414 * @param[in] callback The callback function to invoke
415 * @param[in] user_data The user data to be passed to the callback function
417 * @return 0 on success, otherwise a negative error value.
418 * @retval #BT_ERROR_NONE Successful
419 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
420 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
421 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
423 * @pre The Bluetooth service must be initialized with bt_initialize().
424 * @post bt_adapter_state_changed_cb() will be invoked.
426 * @see bt_initialize()
427 * @see bt_adapter_state_changed_cb()
428 * @see bt_adapter_unset_state_changed_cb()
430 int bt_adapter_set_state_changed_cb(bt_adapter_state_changed_cb callback, void *user_data);
433 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
434 * @brief Unregisters the callback function.
435 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
437 * @return 0 on success, otherwise a negative error value.
438 * @retval #BT_ERROR_NONE Successful
439 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
440 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
442 * @pre The Bluetooth service must be initialized with bt_initialize().
444 * @see bt_initialize()
445 * @see bt_adapter_set_state_changed_cb()
447 int bt_adapter_unset_state_changed_cb(void);
450 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
451 * @brief Registers a callback function to be invoked when the name of Bluetooth adapter changes.
452 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
454 * @param[in] callback The callback function to invoke
455 * @param[in] user_data The user data to be passed to the callback function
457 * @return 0 on success, otherwise a negative error value.
458 * @retval #BT_ERROR_NONE Successful
459 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
460 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
461 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
463 * @pre The Bluetooth service must be initialized with bt_initialize().
464 * @post bt_adapter_name_changed_cb() will be invoked.
466 * @see bt_initialize()
467 * @see bt_adapter_name_changed_cb()
468 * @see bt_adapter_unset_name_changed_cb()
470 int bt_adapter_set_name_changed_cb(bt_adapter_name_changed_cb callback, void *user_data);
473 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
474 * @brief Unregisters the callback function.
475 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
477 * @return 0 on success, otherwise a negative error value.
478 * @retval #BT_ERROR_NONE Successful
479 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
480 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
482 * @pre The Bluetooth service must be initialized with bt_initialize().
484 * @see bt_initialize()
485 * @see bt_adapter_set_name_changed_cb()
487 int bt_adapter_unset_name_changed_cb(void);
490 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
491 * @brief Registers a callback function to be invoked when the visibility mode changes.
492 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
494 * @param[in] callback The callback function to register
495 * @param[in] user_data The user data to be passed to the callback function
497 * @return 0 on success, otherwise a negative error value.
498 * @retval #BT_ERROR_NONE Successful
499 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
500 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
501 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
503 * @pre The Bluetooth service must be initialized with bt_initialize().
504 * @post bt_adapter_visibility_mode_changed_cb() will be invoked.
506 * @see bt_initialize()
507 * @see bt_adapter_visibility_mode_changed_cb()
508 * @see bt_adapter_unset_visibility_mode_changed_cb()
510 int bt_adapter_set_visibility_mode_changed_cb(bt_adapter_visibility_mode_changed_cb callback, void *user_data);
513 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
514 * @brief Unregisters the callback function.
515 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
517 * @return 0 on success, otherwise a negative error value.
518 * @retval #BT_ERROR_NONE Successful
519 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
520 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
522 * @pre The Bluetooth service must be initialized with bt_initialize().
524 * @see bt_initialize()
525 * @see bt_adapter_set_visibility_mode_changed_cb()
527 int bt_adapter_unset_visibility_mode_changed_cb(void);
530 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
531 * @brief Registers a callback function to be invoked every second.
533 * @details When you set visibility mode as #BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE, \n
534 * @a callback will be called every second until visibility mode is changed to #BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE.
536 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
537 * until the visibility mode is changed from #BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE
538 * to #BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE.
539 * @param[in] callback The callback function to register
540 * @param[in] user_data The user data to be passed to the callback function
541 * @return 0 on success, otherwise a negative error value.
542 * @retval #BT_ERROR_NONE Successful
543 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
544 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
545 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
547 * @pre The Bluetooth service must be initialized by bt_initialize().
548 * @post bt_adapter_visibility_duration_changed_cb() will be invoked.
549 * @see bt_initialize()
550 * @see bt_adapter_visibility_duration_changed_cb()
551 * @see bt_adapter_unset_visibility_duration_changed_cb()
553 int bt_adapter_set_visibility_duration_changed_cb(bt_adapter_visibility_duration_changed_cb callback, void *user_data);
556 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
557 * @brief Unregisters the callback function.
558 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
559 * @return 0 on success, otherwise a negative error value.
560 * @retval #BT_ERROR_NONE Successful
561 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
562 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
564 * @pre The Bluetooth service must be initialized with bt_initialize().
565 * @see bt_initialize()
566 * @see bt_adapter_set_visibility_duration_changed_cb()
568 int bt_adapter_unset_visibility_duration_changed_cb(void);
571 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
572 * @brief Registers a callback function to be invoked when the device discovery state changes.
573 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
575 * @param[in] callback The callback function to register
576 * @param[in] user_data The user data to be passed to the callback function
578 * @return 0 on success, otherwise a negative error value.
579 * @retval #BT_ERROR_NONE Successful
580 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
581 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
582 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
584 * @pre The Bluetooth service must be initialized with bt_initialize().
585 * @post bt_adapter_device_discovery_state_changed_cb() will be invoked.
587 * @see bt_initialize()
588 * @see bt_adapter_device_discovery_state_changed_cb()
589 * @see bt_adapter_unset_device_discovery_state_changed_cb()
591 int bt_adapter_set_device_discovery_state_changed_cb(bt_adapter_device_discovery_state_changed_cb callback, void *user_data);
594 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
595 * @brief Unregisters the callback function.
596 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
598 * @return 0 on success, otherwise a negative error value.
599 * @retval #BT_ERROR_NONE Successful
600 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
601 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
603 * @pre The Bluetooth service must be initialized with bt_initialize().
605 * @see bt_initialize()
606 * @see bt_adapter_set_device_discovery_state_changed_cb()
608 int bt_adapter_unset_device_discovery_state_changed_cb(void);
611 * @ingroup CAPI_NETWORK_BLUETOOTH_OOB_MODULE
612 * @brief Gets the Hash and Randomizer value, synchronously.
613 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
615 * @privilege %http://tizen.org/privilege/bluetooth
616 * @remarks %http://tizen.org/privilege/bluetooth (public level privilege) is required to use this API since 5.5.
618 * @param[out] hash The hash value received from the controller
619 * @param[out] randomizer The hash value received from the controller
620 * @param[out] hash_len The length of the hash value
621 * @param[out] randomizer_len The length of the randomizer value
622 * @return 0 on success, otherwise a negative error value.
623 * @retval #BT_ERROR_NONE Successful
624 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
625 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
626 * @retval #BT_ERROR_NOT_ENABLED Not enabled
627 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
628 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
630 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
631 * @pre The Bluetooth service must be initialized with bt_initialize().
632 * @see bt_initialize()
634 int bt_adapter_get_local_oob_data(unsigned char **hash, unsigned char **randomizer,
635 int *hash_len, int *randomizer_len);
638 * @ingroup CAPI_NETWORK_BLUETOOTH_OOB_MODULE
639 * @brief Sets the Hash and Randomizer value, synchronously.
640 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
642 * @privilege %http://tizen.org/privilege/bluetooth
644 * @param[in] remote_address Remote device address
645 * @param[in] hash The hash value received from the controller
646 * @param[in] randomizer The hash value received from the controller
647 * @param[in] hash_len The length of the hash value. Allowed value is 16
648 * @param[in] randomizer_len The length of the randomizer value. Allowed value is 16
649 * @return 0 on success, otherwise a negative error value.
650 * @retval #BT_ERROR_NONE Successful
651 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
652 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
653 * @retval #BT_ERROR_NOT_ENABLED Not enabled
654 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
655 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
656 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
658 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
659 * @pre The Bluetooth service must be initialized with bt_initialize().
660 * @see bt_initialize()
662 int bt_adapter_set_remote_oob_data(const char *remote_address,
663 unsigned char *hash, unsigned char *randomizer,
664 int hash_len, int randomizer_len);
667 * @ingroup CAPI_NETWORK_BLUETOOTH_OOB_MODULE
668 * @brief Gets the Hash and Randomizer value, synchronously.
671 * @privilege %http://tizen.org/privilege/bluetooth
673 * @remarks %http://tizen.org/privilege/bluetooth (public level privilege) is required to use this API since 5.5.
674 * @remarks The @a hash192, randomizer192, hash256 and randomizer256 must be released using free().
676 * @param[out] hash192 The hash value derived from the P-192 public key
677 * @param[out] randomizer192 The randomizer value associated with the P-192 public key
678 * @param[out] hash192_len The length of @a hash192
679 * @param[out] randomizer192_len The length of @a randomizer192
680 * @param[out] hash256 The hash value derived from the P-256 public key
681 * @param[out] randomizer256 The randomizer value associated with the P-256 public key
682 * @param[out] hash256_len The length of @a hash256
683 * @param[out] randomizer256_len The length of @a randomizer256
684 * @return 0 on success, otherwise a negative error value.
685 * @retval #BT_ERROR_NONE Successful
686 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
687 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
688 * @retval #BT_ERROR_NOT_ENABLED Not enabled
689 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
690 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
692 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
693 * @pre The Bluetooth service must be initialized with bt_initialize().
694 * @see bt_initialize()
696 int bt_adapter_get_local_oob_ext_data(unsigned char **hash192, unsigned char **randomizer192,
697 int *hash192_len, int *randomizer192_len,
698 unsigned char **hash256, unsigned char **randomizer256,
699 int *hash256_len, int *randomizer256_len);
702 * @ingroup CAPI_NETWORK_BLUETOOTH_OOB_MODULE
703 * @brief Sets the Hash and Randomizer value, synchronously.
706 * @privilege %http://tizen.org/privilege/bluetooth
708 * @param[in] remote_address Remote device address
709 * @param[in] hash192 The P-192 hash value received via OOB from remote device
710 * @param[in] randomizer192 The P-192 randomizer value received via OOB from remote device
711 * @param[in] hash192_len The length of @a hash192
712 * @param[in] randomizer192_len The length of @a randomizer192
713 * @param[in] hash256 The P-256 hash value received via OOB from remote device
714 * @param[in] randomizer256 The P-256 randomizer value received via OOB from remote device
715 * @param[in] hash256_len The length of @a hash256
716 * @param[in] randomizer256_len The length of @a randomizer256
717 * @return 0 on success, otherwise a negative error value.
718 * @retval #BT_ERROR_NONE Successful
719 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
720 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
721 * @retval #BT_ERROR_NOT_ENABLED Not enabled
722 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
723 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
724 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
726 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
727 * @pre The Bluetooth service must be initialized with bt_initialize().
728 * @see bt_initialize()
730 int bt_adapter_set_remote_oob_ext_data(const char *remote_address,
731 const unsigned char *hash192, const unsigned char *randomizer192,
732 int hash192_len, int randomizer192_len,
733 const unsigned char *hash256, const unsigned char *randomizer256,
734 int hash256_len, int randomizer256_len);
737 * @ingroup CAPI_NETWORK_BLUETOOTH_OOB_MODULE
738 * @brief Deletes the Hash and Randomizer value, synchronously.
739 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
741 * @privilege %http://tizen.org/privilege/bluetooth
743 * @param[in] remote_address Remote device address
744 * @return 0 on success, otherwise a negative error value.
745 * @retval #BT_ERROR_NONE Successful
746 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
747 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
748 * @retval #BT_ERROR_NOT_ENABLED Not enabled
749 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
750 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
751 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
753 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
754 * @pre The Bluetooth service must be initialized with bt_initialize().
755 * @see bt_initialize()
757 int bt_adapter_remove_remote_oob_data(const char *remote_address);
760 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
761 * @brief Checks for the LE device discovery is in progress or not.
762 * @since_tizen @if MOBILE 2.3 @else 6.0 @endif
764 * @remarks If Bluetooth LE scan is in progress, other operations are not allowed and \n
765 * you have to either stop the LE scan operation, or wait for it to be finished, \n
766 * before performing other operations.
768 * @param[out] is_discovering The discovering status: (@c true = in progress , @c false = not in progress )
770 * @return 0 on success, otherwise a negative error value.
771 * @retval #BT_ERROR_NONE Successful
772 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
773 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
774 * @retval #BT_ERROR_NOT_ENABLED Not enabled
775 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
776 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
778 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
780 int bt_adapter_le_is_discovering(bool *is_discovering);
783 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
784 * @brief Starts the LE scan to find LE advertisement.
786 * @details If a LE advertisement is found, bt_adapter_le_scan_result_cb() will be invoked.
790 * @privilege %http://tizen.org/privilege/bluetooth
791 * @param[in] cb The callback to report the result of this function
792 * @param[in] user_data The user data to be passed when callback is called
794 * @return 0 on success, otherwise a negative error value.
795 * @retval #BT_ERROR_NONE Successful
796 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
797 * @retval #BT_ERROR_NOT_ENABLED Not enabled
798 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation is now in progress
799 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
800 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
801 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
803 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
804 * @post This function invokes bt_adapter_le_scan_result_cb().
806 * @see bt_adapter_le_scan_result_cb()
808 int bt_adapter_le_start_scan(bt_adapter_le_scan_result_cb cb, void *user_data);
811 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
812 * @brief Stops the LE scan.
815 * @privilege %http://tizen.org/privilege/bluetooth
817 * @return 0 on success, otherwise a negative error value.
818 * @retval #BT_ERROR_NONE Successful
819 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
820 * @retval #BT_ERROR_NOT_ENABLED Not enabled
821 * @retval #BT_ERROR_NOT_IN_PROGRESS Operation is not in progress
822 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
823 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
824 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
826 * @pre The LE scan must be in progress with bt_adapter_le_start_scan().
828 * @see bt_adapter_le_start_scan()
830 int bt_adapter_le_stop_scan(void);
833 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
834 * @brief Gets the service UUID list from the scan result information.
837 * @remarks The @a uuids must be iterated as count and each pointed data must be released with free().
838 * Then @a uuids must be released with free(). \n
839 * 16-bit service UUID or 128-bit service UUID is supported. (e.g. 180F, 0000180F-0000-1000-8000-00805F9B34FB)
841 * @param[in] info The scan result information
842 * @param[in] pkt_type The packet type
843 * @param[out] uuids The list of string of the service UUID
844 * @param[out] count The count of the service UUIDs
846 * @return 0 on success, otherwise a negative error value.
847 * @retval #BT_ERROR_NONE Successful
848 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
849 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
850 * @retval #BT_ERROR_NO_DATA No data available
851 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
853 * @pre The Bluetooth service must be initialized with bt_initialize().
855 * @see bt_adapter_le_scan_result_cb()
857 int bt_adapter_le_get_scan_result_service_uuids(const bt_adapter_le_device_scan_result_info_s *info,
858 bt_adapter_le_packet_type_e pkt_type, char ***uuids, int *count);
861 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
862 * @brief Gets the device name from the scan result information.
865 * @remarks The @a name must be released with free() by you.
867 * @param[in] info The scan result information
868 * @param[in] pkt_type The packet type
869 * @param[out] name The device name
871 * @return 0 on success, otherwise a negative error value.
872 * @retval #BT_ERROR_NONE Successful
873 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
874 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
875 * @retval #BT_ERROR_NO_DATA No data available
876 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
878 * @pre The Bluetooth service must be initialized with bt_initialize().
880 * @see bt_adapter_le_scan_result_cb()
882 int bt_adapter_le_get_scan_result_device_name(const bt_adapter_le_device_scan_result_info_s *info,
883 bt_adapter_le_packet_type_e pkt_type, char **name);
886 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
887 * @brief Gets the transmission power level from the scan result information.
890 * @param[in] info The scan result information
891 * @param[in] pkt_type The packet type
892 * @param[out] power_level The transmission power level in dBm
894 * @return 0 on success, otherwise a negative error value.
895 * @retval #BT_ERROR_NONE Successful
896 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
897 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
898 * @retval #BT_ERROR_NO_DATA No data available
899 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
901 * @pre The Bluetooth service must be initialized with bt_initialize().
903 * @see bt_adapter_le_scan_result_cb()
905 int bt_adapter_le_get_scan_result_tx_power_level(const bt_adapter_le_device_scan_result_info_s *info,
906 bt_adapter_le_packet_type_e pkt_type, int *power_level);
909 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
910 * @brief Gets the service solicitation UUID list from the scan result information.
913 * @remarks The @a uuids must be iterated as count and each pointed data must be released with free().
914 * Then @a uuids must be released with free(). \n
915 * 16-bit service solicitation UUID or 128-bit service solicitation UUID is supported.
916 * (e.g. 180F, 0000180F-0000-1000-8000-00805F9B34FB)
918 * @param[in] info The scan result information
919 * @param[in] pkt_type The packet type
920 * @param[out] uuids The list of string of the service solicitation UUID
921 * @param[out] count The count of the service UUIDs
923 * @return 0 on success, otherwise a negative error value.
924 * @retval #BT_ERROR_NONE Successful
925 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
926 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
927 * @retval #BT_ERROR_NO_DATA No data available
928 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
930 * @pre The Bluetooth service must be initialized with bt_initialize().
932 * @see bt_adapter_le_scan_result_cb()
934 int bt_adapter_le_get_scan_result_service_solicitation_uuids(const bt_adapter_le_device_scan_result_info_s *info,
935 bt_adapter_le_packet_type_e pkt_type, char ***uuids, int *count);
938 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
939 * @brief Gets the service data list from the scan result information.
942 * @remarks The @a data_list must be released with bt_adapter_le_free_service_data_list() by you .
944 * @param[in] info The scan result information
945 * @param[in] pkt_type The packet type
946 * @param[out] data_list The list of the service data
947 * @param[out] count The count of the service data list
949 * @return 0 on success, otherwise a negative error value.
950 * @retval #BT_ERROR_NONE Successful
951 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
952 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
953 * @retval #BT_ERROR_NO_DATA No data available
954 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
956 * @pre The Bluetooth service must be initialized with bt_initialize().
958 * @see bt_adapter_le_scan_result_cb()
960 int bt_adapter_le_get_scan_result_service_data_list(const bt_adapter_le_device_scan_result_info_s *info,
961 bt_adapter_le_packet_type_e pkt_type, bt_adapter_le_service_data_s **data_list, int *count);
964 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
965 * @brief Frees service data list.
968 * @param[in] data_list The list of the service data
969 * @param[in] count The count of the service data list
971 * @return 0 on success, otherwise a negative error value.
972 * @retval #BT_ERROR_NONE Successful
973 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
974 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
976 * @see bt_adapter_le_get_scan_result_service_data_list()
978 int bt_adapter_le_free_service_data_list(bt_adapter_le_service_data_s *data_list, int count);
981 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
982 * @brief Gets the appearance from the scan result information.
985 * @param[in] info The scan result information
986 * @param[in] pkt_type The packet type
987 * @param[out] appearance The appearance
989 * @return 0 on success, otherwise a negative error value.
990 * @retval #BT_ERROR_NONE Successful
991 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
992 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
993 * @retval #BT_ERROR_NO_DATA No data available
994 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
996 * @pre The Bluetooth service must be initialized with bt_initialize().
998 * @see bt_adapter_le_scan_result_cb()
1000 int bt_adapter_le_get_scan_result_appearance(const bt_adapter_le_device_scan_result_info_s *info,
1001 bt_adapter_le_packet_type_e pkt_type, int *appearance);
1004 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1005 * @brief Gets the manufacturer data from the scan result information.
1006 * @since_tizen 2.3.1
1008 * @remarks The @a manufacturer_data must be released with free() by you.
1010 * @param[in] info The scan result information
1011 * @param[in] pkt_type The packet type
1012 * @param[out] manufacturer_id The manufacturer ID
1013 * @param[out] manufacturer_data The manufacturer data (byte array)
1014 * @param[out] manufacturer_data_len The length of manufacturer data
1016 * @return 0 on success, otherwise a negative error value.
1017 * @retval #BT_ERROR_NONE Successful
1018 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1019 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1020 * @retval #BT_ERROR_NO_DATA No data available
1021 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1023 * @pre The Bluetooth service must be initialized with bt_initialize().
1025 * @see bt_adapter_le_scan_result_cb()
1027 int bt_adapter_le_get_scan_result_manufacturer_data(const bt_adapter_le_device_scan_result_info_s *info,
1028 bt_adapter_le_packet_type_e pkt_type, int *manufacturer_id, char **manufacturer_data, int *manufacturer_data_len);
1031 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1032 * @brief Gets iBeacon format's data from the scan result information.
1035 * @remarks The @a ibeacon_info must be released with bt_adapter_le_free_ibeacon_report().
1037 * @param[in] info The scan result information
1038 * @param[in] pkt_type The packet type
1039 * @param[out] ibeacon_info The iBeacon format's scan result data
1041 * @return 0 on success, otherwise a negative error value.
1042 * @retval #BT_ERROR_NONE Successful
1043 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1044 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1045 * @retval #BT_ERROR_NO_DATA No data available
1046 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1048 * @pre The Bluetooth service must be initialized with bt_initialize().
1050 * @see bt_adapter_le_scan_result_cb()
1052 int bt_adapter_le_get_scan_result_ibeacon_report(const bt_adapter_le_device_scan_result_info_s *info,
1053 bt_adapter_le_packet_type_e pkt_type,
1054 bt_adapter_le_ibeacon_scan_result_info_s **ibeacon_info);
1057 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1058 * @brief Frees iBeacon information.
1061 * @param[in] ibeacon_info The iBeacon format's scan result data
1063 * @return 0 on success, otherwise a negative error value.
1064 * @retval #BT_ERROR_NONE Successful
1065 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1066 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1068 * @see bt_adapter_le_get_scan_result_service_data_list()
1070 int bt_adapter_le_free_ibeacon_report(bt_adapter_le_ibeacon_scan_result_info_s *ibeacon_info);
1073 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1074 * @brief Creates advertiser to advertise device's existence or respond to LE scanning request.
1075 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1077 * @param[out] advertiser The handle of advertiser
1079 * @return 0 on success, otherwise a negative error value.
1080 * @retval #BT_ERROR_NONE Successful
1081 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1082 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1083 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
1084 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1086 * @pre The Bluetooth service must be initialized with bt_initialize().
1088 * @see bt_adapter_le_destroy_advertiser()
1090 int bt_adapter_le_create_advertiser(bt_advertiser_h *advertiser);
1093 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1094 * @brief Destroys advertiser.
1095 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1097 * @param[out] advertiser The handle of advertiser
1099 * @return 0 on success, otherwise a negative error value.
1100 * @retval #BT_ERROR_NONE Successful
1101 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1102 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1103 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1105 * @pre The Bluetooth service must be initialized with bt_initialize().
1107 * @see bt_adapter_le_create_advertiser()
1109 int bt_adapter_le_destroy_advertiser(bt_advertiser_h advertiser);
1112 * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE
1113 * @brief Initializes the Bluetooth IPSP (Internet Protocol Support Profile) service.
1115 * @param[in] callback The callback called when the initialization is finished
1116 * @param[in] user_data The user data to be passed to the callback function
1117 * @return 0 on success, otherwise a negative error value.
1118 * @retval #BT_ERROR_NONE Successful
1119 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1120 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1121 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1122 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1124 * @pre The Bluetooth service must be initialized with bt_initialize().
1125 * @see bt_initialize()
1127 int bt_ipsp_initialize(bt_ipsp_init_state_changed_cb callback, void *user_data);
1130 * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE
1131 * @brief Deinitializes the Bluetooth IPSP (Internet Protocol Support Profile) service.
1133 * @return 0 on success, otherwise a negative error value.
1134 * @retval #BT_ERROR_NONE Successful
1135 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1136 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1137 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1139 * @pre The Bluetooth service must be initialized with bt_initialize().
1140 * @see bt_initialize()
1142 int bt_ipsp_deinitialize(void);
1145 * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE
1146 * @brief Connects to a remote device's IPSP service over LE, asynchronously.
1149 * @privilege %http://tizen.org/privilege/bluetooth
1150 * @param[in] remote_address The remote address
1151 * @return 0 on success, otherwise a negative error value.
1152 * @retval #BT_ERROR_NONE Successful
1153 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1154 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1155 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1156 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1157 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1158 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1160 * @post bt_ipsp_set_connection_state_changed_cb() will be invoked.
1161 * @see bt_ipsp_set_connection_state_changed_cb()
1163 int bt_ipsp_connect(const char *remote_address);
1166 * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE
1167 * @brief Disconnects from a remote device's IPSP service, asynchronously.
1170 * @privilege %http://tizen.org/privilege/bluetooth
1171 * @param[in] remote_address The remote address
1172 * @return 0 on success, otherwise a negative error value.
1173 * @retval #BT_ERROR_NONE Successful
1174 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1175 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1176 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1177 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
1178 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1179 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1180 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1182 * @pre The remote device must be connected by bt_ipsp_connect().
1183 * @post bt_ipsp_set_connection_state_changed_cb() will be invoked.
1184 * @see bt_ipsp_connect()
1185 * @see bt_ipsp_set_connection_state_changed_cb()
1187 int bt_ipsp_disconnect(const char *remote_address);
1190 * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE
1191 * @brief Registers a callback function that will be invoked when the connection state changes.
1193 * @param[in] callback The callback function to register
1194 * @param[in] user_data The user data to be passed to the callback function
1195 * @return 0 on success, otherwise a negative error value.
1196 * @retval #BT_ERROR_NONE Successful
1197 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1198 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1199 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1201 * @pre The Bluetooth service must be initialized with bt_initialize().
1202 * @see bt_initialize()
1204 int bt_ipsp_set_connection_state_changed_cb(bt_ipsp_connection_state_changed_cb callback,
1208 * @ingroup CAPI_NETWORK_BLUETOOTH_IPSP_MODULE
1209 * @brief Unregisters the callback function called when the connection state changes.
1211 * @return 0 on success, otherwise a negative error value.
1212 * @retval #BT_ERROR_NONE Successful
1213 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1214 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1216 * @pre The Bluetooth service must be initialized with bt_initialize().
1217 * @see bt_initialize()
1219 int bt_ipsp_unset_connection_state_changed_cb(void);
1222 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1223 * @brief Adds a service UUID to advertise or scan response data.
1224 * The maximum advertised or responded data size is 31 bytes
1225 * including data type and system wide data.
1226 * @since_tizen 2.3.1
1228 * @remarks 16-bit UUID or 128-bit UUID is supported.
1229 * (e.g. 180F, 0000180F-0000-1000-8000-00805F9B34FB).
1230 * 16-bit UUID is advertised as 16-bit UUID.
1231 * 128-bit UUID made from base UUID(00000000-0000-1000-8000-00805F9B34FB)
1232 * is converted to the 16-bit equivalent form and advertised as such.
1233 * (e.g. 0000180F-0000-1000-8000-00805F9B34FB is converted to 180F 16-bit form).
1234 * Any other 128-bit UUID is advertised as 128-bit UUID.
1236 * @param[in] advertiser The handle of advertiser
1237 * @param[in] pkt_type The packet type
1238 * @param[in] uuid The string of the service UUID.
1240 * @return 0 on success, otherwise a negative error value.
1241 * @retval #BT_ERROR_NONE Successful
1242 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1243 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1244 * @retval #BT_ERROR_QUOTA_EXCEEDED Quota exceeded
1245 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1246 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1248 * @pre The Bluetooth service must be initialized with bt_initialize().
1250 * @see bt_adapter_le_clear_advertising_data()
1252 int bt_adapter_le_add_advertising_service_uuid(bt_advertiser_h advertiser,
1253 bt_adapter_le_packet_type_e pkt_type, const char *uuid);
1256 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1257 * @brief Adds a service solicitation UUID to advertise or scan response data.
1258 * The maximum advertised or responded data size is 31 bytes
1259 * including data type and system wide data.
1260 * @since_tizen 2.3.1
1262 * @remarks 16-bit service solicitation UUID or 128-bit service solicitation UUID is supported.
1263 * (e.g. 180F, 0000180F-0000-1000-8000-00805F9B34FB).
1264 * 16-bit UUID is advertised as 16-bit UUID.
1265 * 128-bit UUID made from base UUID(00000000-0000-1000-8000-00805F9B34FB)
1266 * is converted to the 16-bit equivalent form and advertised as such.
1267 * (e.g. 0000180F-0000-1000-8000-00805F9B34FB is converted to 180F 16-bit form).
1268 * Any other 128-bit UUID is advertised as 128-bit UUID.
1270 * @param[in] advertiser The handle of advertiser
1271 * @param[in] pkt_type The packet type
1272 * @param[in] uuid The string of the service solicitation UUID.
1274 * @return 0 on success, otherwise a negative error value.
1275 * @retval #BT_ERROR_NONE Successful
1276 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1277 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1278 * @retval #BT_ERROR_QUOTA_EXCEEDED Quota exceeded
1279 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1280 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1282 * @pre The Bluetooth service must be initialized with bt_initialize().
1284 * @see bt_adapter_le_clear_advertising_data()
1286 int bt_adapter_le_add_advertising_service_solicitation_uuid(bt_advertiser_h advertiser,
1287 bt_adapter_le_packet_type_e pkt_type, const char *uuid);
1290 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1291 * @brief Adds service data to advertise or scan response data.
1292 * The maximum advertised or responded data size is 31 bytes
1293 * including data type and system wide data.
1294 * @since_tizen 2.3.1
1296 * @remarks 16-bit UUID is supported. (e.g. 180F).
1298 * @param[in] advertiser The handle of advertiser
1299 * @param[in] pkt_type The packet type
1300 * @param[in] uuid 16-bit UUID of the service
1301 * @param[in] service_data The service data
1302 * @param[in] service_data_len The data length of service data
1304 * @return 0 on success, otherwise a negative error value.
1305 * @retval #BT_ERROR_NONE Successful
1306 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1307 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1308 * @retval #BT_ERROR_QUOTA_EXCEEDED Quota exceeded
1309 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1310 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1312 * @pre The Bluetooth service must be initialized with bt_initialize().
1314 * @see bt_adapter_le_clear_advertising_data()
1316 int bt_adapter_le_add_advertising_service_data(bt_advertiser_h advertiser,
1317 bt_adapter_le_packet_type_e pkt_type, const char *uuid,
1318 const char *service_data, int service_data_len);
1321 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1322 * @brief Sets the external appearance of this device to advertise or scan response data.
1323 * Please refer to the adopted Bluetooth specification for the the appearance.
1324 * @since_tizen 2.3.1
1326 * @param[in] advertiser The handle of advertiser
1327 * @param[in] pkt_type The packet type
1328 * @param[in] appearance The external appearance of device
1330 * @return 0 on success, otherwise a negative error value.
1331 * @retval #BT_ERROR_NONE Successful
1332 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1333 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1334 * @retval #BT_ERROR_QUOTA_EXCEEDED Quota exceeded
1335 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1336 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1338 * @pre The Bluetooth service must be initialized with bt_initialize().
1340 * @see bt_adapter_le_clear_advertising_data()
1342 int bt_adapter_le_set_advertising_appearance(bt_advertiser_h advertiser,
1343 bt_adapter_le_packet_type_e pkt_type, int appearance);
1346 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1347 * @brief Adds manufacturer specific data to advertise or scan response data.
1348 * Please refer to the Bluetooth Assigned Numbers provided by the Bluetooth SIG for a list of existing company identifiers.
1349 * The maximum advertised or responded data size is 31 bytes
1350 * including data type and system wide data.
1351 * @since_tizen 2.3.1
1354 * @param[in] advertiser The handle of advertiser
1355 * @param[in] pkt_type The packet type
1356 * @param[in] manufacturer_id Manufacturer identifier
1357 * @param[in] manufacturer_data The manufacturer specific data
1358 * @param[in] manufacturer_data_len The data length of manufacturer data
1360 * @return 0 on success, otherwise a negative error value.
1361 * @retval #BT_ERROR_NONE Successful
1362 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1363 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1364 * @retval #BT_ERROR_QUOTA_EXCEEDED Quota exceeded
1365 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1366 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1368 * @pre The Bluetooth service must be initialized with bt_initialize().
1370 * @see bt_adapter_le_clear_advertising_data()
1372 int bt_adapter_le_add_advertising_manufacturer_data(bt_advertiser_h advertiser,
1373 bt_adapter_le_packet_type_e pkt_type, int manufacturer_id, const char *manufacturer_data, int manufacturer_data_len);
1376 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1377 * @brief Sets whether the device name should be included in advertise or scan response data.
1378 * The maximum advertised or responded data size is 31 bytes
1379 * including data type and system wide data.
1380 * @since_tizen 2.3.1
1382 * @param[in] advertiser The handle of advertiser
1383 * @param[in] pkt_type The packet type
1384 * @param[in] include_name Whether the device name should be included
1386 * @return 0 on success, otherwise a negative error value.
1387 * @retval #BT_ERROR_NONE Successful
1388 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1389 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1390 * @retval #BT_ERROR_QUOTA_EXCEEDED Quota exceeded
1391 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1392 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1394 * @pre The Bluetooth service must be initialized with bt_initialize().
1396 * @see bt_adapter_le_clear_advertising_data()
1398 int bt_adapter_le_set_advertising_device_name(bt_advertiser_h advertiser,
1399 bt_adapter_le_packet_type_e pkt_type, bool include_name);
1402 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1403 * @brief Sets whether the transmission power level should be included in advertise or scan response data.
1404 * The maximum advertised or responded data size is 31 bytes
1405 * including data type and system wide data.
1406 * @since_tizen 2.3.1
1408 * @param[in] advertiser The handle of advertiser
1409 * @param[in] pkt_type The packet type
1410 * @param[in] include_tx_power Whether the transmission power level should be included
1412 * @return 0 on success, otherwise a negative error value.
1413 * @retval #BT_ERROR_NONE Successful
1414 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1415 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1416 * @retval #BT_ERROR_QUOTA_EXCEEDED Quota exceeded
1417 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1418 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1420 * @pre The Bluetooth service must be initialized with bt_initialize().
1422 * @see bt_adapter_le_clear_advertising_data()
1424 int bt_adapter_le_set_advertising_tx_power_level(bt_advertiser_h advertiser,
1425 bt_adapter_le_packet_type_e pkt_type, bool include_tx_power);
1428 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1429 * @brief Clears all data to be advertised or responded to scan request from LE scanning device.
1430 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1432 * @param[in] advertiser The handle of advertiser
1433 * @param[in] pkt_type The packet type to be cleared
1435 * @return 0 on success, otherwise a negative error value.
1436 * @retval #BT_ERROR_NONE Successful
1437 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1438 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1439 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1441 * @pre The Bluetooth service must be initialized with bt_initialize().
1443 int bt_adapter_le_clear_advertising_data(bt_advertiser_h advertiser, bt_adapter_le_packet_type_e pkt_type);
1446 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1447 * @brief Stops the advertising.
1448 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1450 * @privilege %http://tizen.org/privilege/bluetooth
1452 * @param[in] advertiser The handle of advertiser
1454 * @return 0 on success, otherwise a negative error value.
1455 * @retval #BT_ERROR_NONE Successful
1456 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1457 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1458 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1459 * @retval #BT_ERROR_NOT_IN_PROGRESS Operation is not in progress
1460 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1461 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1462 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1464 * @pre The advertising must be going on with bt_adapter_le_start_advertising_new().
1465 * @post This function invokes bt_adapter_le_advertising_state_changed_cb().
1467 * @see bt_adapter_le_start_advertising_new()
1468 * @see bt_adapter_le_advertising_state_changed_cb()
1470 int bt_adapter_le_stop_advertising(bt_advertiser_h advertiser);
1473 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1474 * @brief Starts advertising with passed advertiser and advertising parameters.
1476 * @details Once Bluetooth advertising is started, nearby Bluetooth LE (Low Energy) supported \n
1477 * devices can know this device's existence. And one of them can make a connection request, \n
1480 * @since_tizen 2.3.1
1482 * @privilege %http://tizen.org/privilege/bluetooth
1483 * @param[in] advertiser The handle of advertiser
1484 * @param[in] cb The callback to report the result of this function
1485 * @param[in] user_data The user data to be passed when callback is called
1487 * @return 0 on success, otherwise a negative error value.
1488 * @retval #BT_ERROR_NONE Successful
1489 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1490 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1491 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1492 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation is now in progress
1493 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1494 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1495 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1497 * @pre The Bluetooth service must be initialized with bt_initialize().
1498 * @post This function invokes bt_adapter_le_advertising_state_changed_cb().
1500 * @see bt_adapter_le_stop_advertising()
1501 * @see bt_adapter_le_advertising_state_changed_cb()
1503 int bt_adapter_le_start_advertising_new(bt_advertiser_h advertiser, bt_adapter_le_advertising_state_changed_cb cb, void *user_data);
1506 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1507 * @brief Sets advertising mode to control the advertising power and latency.
1508 * @since_tizen 2.3.1
1510 * @privilege %http://tizen.org/privilege/bluetooth
1512 * @param[in] advertiser The handle of advertiser
1513 * @param[in] mode The mode of advertising
1515 * @return 0 on success, otherwise a negative error value.
1516 * @retval #BT_ERROR_NONE Successful
1517 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1518 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1519 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1520 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation is now in progress
1521 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1522 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1524 * @pre The Bluetooth service must be initialized with bt_initialize().
1526 * @see bt_adapter_le_start_advertising_new()
1528 int bt_adapter_le_set_advertising_mode(bt_advertiser_h advertiser, bt_adapter_le_advertising_mode_e mode);
1531 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1532 * @brief Sets whether the advertising type should be connectable or non-connectable.
1533 * @since_tizen 2.3.1
1535 * @privilege %http://tizen.org/privilege/bluetooth
1537 * @param[in] advertiser The handle of advertiser
1538 * @param[in] connectable The type of advertising
1540 * @return 0 on success, otherwise a negative error value.
1541 * @retval #BT_ERROR_NONE Successful
1542 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1543 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1544 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1545 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation is now in progress
1546 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1547 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1549 * @pre The Bluetooth service must be initialized with bt_initialize().
1551 * @see bt_adapter_le_start_advertising_new()
1553 int bt_adapter_le_set_advertising_connectable(bt_advertiser_h advertiser, bool connectable);
1556 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
1557 * @brief Sets Bluetooth LE scan mode.
1560 * @privilege %http://tizen.org/privilege/bluetooth
1561 * @param[in] scan_mode The scan mode
1563 * @return 0 on success, otherwise a negative error value.
1564 * @retval #BT_ERROR_NONE Successful
1565 * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
1566 * @retval #BT_ERROR_INVALID_PARAMETER Parameter is invalid
1567 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1568 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1569 * @pre The state of local bluetooth must be #BT_ADAPTER_ENABLED.
1570 * @pre The bluetooth service must be initialized with bt_initialize().
1571 * @see bt_initialize()
1573 int bt_adapter_le_set_scan_mode(bt_adapter_le_scan_mode_e scan_mode);
1576 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1577 * @brief Creates a bond with a remote Bluetooth device, asynchronously.
1578 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1580 * @privilege %http://tizen.org/privilege/bluetooth
1582 * @remarks A bond can be destroyed by bt_device_destroy_bond().\n
1583 * The bonding request can be cancelled by bt_device_cancel_bonding().
1585 * @param[in] remote_address The address of the remote Bluetooth device with which the bond should be created
1587 * @return 0 on success, otherwise a negative error value.
1588 * @retval #BT_ERROR_NONE Successful
1589 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1590 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1591 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1592 * @retval #BT_ERROR_RESOURCE_BUSY Device or resource busy
1593 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1594 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1595 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1597 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1598 * @pre The remote device must be discoverable with bt_adapter_start_device_discovery().
1599 * @post This function invokes bt_device_bond_created_cb().
1601 * @see bt_adapter_start_device_discovery()
1602 * @see bt_device_bond_created_cb()
1603 * @see bt_device_cancel_bonding()
1604 * @see bt_device_destroy_bond()
1605 * @see bt_device_set_bond_created_cb()
1606 * @see bt_device_unset_bond_created_cb()
1608 int bt_device_create_bond(const char *remote_address);
1611 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1612 * @brief Cancels the bonding process.
1613 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1615 * @privilege %http://tizen.org/privilege/bluetooth
1617 * @remarks Use this function when the remote Bluetooth device is not responding to the \n
1618 * bond request or you wish to cancel the bonding request.
1620 * @return 0 on success, otherwise a negative error value.
1621 * @retval #BT_ERROR_NONE Successful
1622 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1623 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1624 * @retval #BT_ERROR_NOT_IN_PROGRESS Operation not in progress
1625 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1626 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1628 * @pre The creating a bond must be in progress by bt_device_create_bond().
1630 * @see bt_device_create_bond()
1631 * @see bt_device_bond_created_cb()
1632 * @see bt_device_set_bond_created_cb()
1633 * @see bt_device_unset_bond_created_cb()
1635 int bt_device_cancel_bonding(void);
1638 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1639 * @brief Destroys the bond, asynchronously.
1640 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1642 * @privilege %http://tizen.org/privilege/bluetooth
1644 * @param[in] remote_address The address of the remote Bluetooth device to remove bonding
1646 * @return 0 on success, otherwise a negative error value.
1647 * @retval #BT_ERROR_NONE Successful
1648 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1649 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1650 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1651 * @retval #BT_ERROR_RESOURCE_BUSY Device or resource busy
1652 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
1653 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1654 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1655 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1657 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1658 * @pre The bond with the remote device must be created with bt_device_create_bond().
1659 * @post This function invokes bt_device_bond_destroyed_cb().
1661 * @see bt_device_create_bond()
1662 * @see bt_device_bond_destroyed_cb()
1663 * @see bt_device_set_bond_destroyed_cb()
1664 * @see bt_device_unset_bond_destroyed_cb()
1666 int bt_device_destroy_bond(const char *remote_address);
1669 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1670 * @brief Sets an alias for the bonded device.
1671 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1673 * @privilege %http://tizen.org/privilege/bluetooth
1675 * @param[in] remote_address The address of the remote Bluetooth device
1676 * @param[in] alias The alias of the remote Bluetooth device
1678 * @return 0 on success, otherwise a negative error value.
1679 * @retval #BT_ERROR_NONE Successful
1680 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1681 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1682 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1683 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
1684 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1685 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1686 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1688 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1689 * @pre The bond with the remote device must be created with bt_device_create_bond().
1691 * @see bt_device_create_bond()
1693 int bt_device_set_alias(const char *remote_address, const char *alias);
1696 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1697 * @brief Sets the authorization of a bonded device, asynchronously.
1698 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1700 * @privilege %http://tizen.org/privilege/bluetooth
1702 * @remarks Once a device is authorized, you don't need to receive a confirmation.
1704 * @param[in] remote_address The address of the remote Bluetooth device to authorize
1705 * @param[in] authorization_state The Bluetooth authorization state
1707 * @return 0 on success, otherwise a negative error value.
1708 * @retval #BT_ERROR_NONE Successful
1709 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1710 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1711 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1712 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
1713 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1714 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1715 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1717 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1718 * @pre The bond with the remote device must be created with bt_device_create_bond().
1719 * @post bt_device_authorization_changed_cb() will be invoked.
1721 * @see bt_device_create_bond()
1722 * @see bt_device_authorization_changed_cb()
1723 * @see bt_device_set_authorization_changed_cb()
1724 * @see bt_device_unset_authorization_changed_cb()
1726 int bt_device_set_authorization(const char *remote_address, bt_device_authorization_e authorization_state);
1729 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1730 * @brief Starts the search for services supported by the specified device, asynchronously.
1731 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1733 * @privilege %http://tizen.org/privilege/bluetooth
1735 * @remarks If creating a bond succeeds, which means bt_device_bond_created_cb() is called with result #BT_ERROR_NONE, \n
1736 * then you don't need to run this function.\n
1737 * The service search takes a couple of seconds to complete normally.
1739 * @param[in] remote_address The address of the remote Bluetooth device whose services need to be checked
1741 * @return 0 on success, otherwise a negative error value.
1742 * @retval #BT_ERROR_NONE Successful
1743 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1744 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1745 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1746 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
1747 * @retval #BT_ERROR_SERVICE_SEARCH_FAILED Service search failed
1748 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1749 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1751 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1752 * @pre The remote device must be discoverable with bt_adapter_start_device_discovery().
1753 * @pre The bond with the remote device must be created with bt_device_create_bond().
1754 * @post This function invokes bt_device_service_searched_cb().
1756 * @see bt_adapter_start_device_discovery()
1757 * @see bt_device_create_bond()
1758 * @see bt_device_bond_created_cb()
1759 * @see bt_device_service_searched_cb()
1760 * @see bt_device_set_service_searched_cb()
1761 * @see bt_device_unset_service_searched_cb()
1763 int bt_device_start_service_search(const char *remote_address);
1766 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1767 * @brief Gets the connected profiles.
1768 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1769 * @param[in] remote_address The address of the remote device
1770 * @param[in] callback The callback function to invoke
1771 * @param[in] user_data The user data to be passed to the callback function
1772 * @return 0 on success, otherwise a negative error value.
1773 * @retval #BT_ERROR_NONE Successful
1774 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1775 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1776 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1777 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1779 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1780 * @post bt_device_connected_profile() will be invoked.
1781 * @see bt_device_connected_profile()
1783 int bt_device_foreach_connected_profiles(const char *remote_address, bt_device_connected_profile callback, void *user_data);
1786 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1787 * @brief Gets the profile connected status.
1788 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1789 * @param[in] remote_address The address of the remote device
1790 * @param[in] bt_profile wish to know bt_profile
1791 * @param[out] connected_status the connected status
1792 * @return 0 on success, otherwise a negative error value.
1793 * @retval #BT_ERROR_NONE Successful
1794 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1795 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1796 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1797 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_BONDED Remote device not bonded
1798 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1799 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1801 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
1803 int bt_device_is_profile_connected(const char *remote_address, bt_profile_e bt_profile,
1804 bool *connected_status);
1807 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1808 * @brief Updates a LE connection mode.
1811 * @privilege %http://tizen.org/privilege/bluetooth
1813 * @param[in] remote_address The address of the remote Bluetooth device
1814 * @param[in] mode The LE connection mode
1816 * @return 0 on success, otherwise a negative error value.
1817 * @retval #BT_ERROR_NONE Successful
1818 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1819 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1820 * @retval #BT_ERROR_NOT_ENABLED Not enabled
1821 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
1822 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
1823 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1825 int bt_device_update_le_connection_mode(const char *remote_address, bt_device_le_connection_mode_e mode);
1828 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1829 * @brief Registers a callback function to be invoked when the bond creates.
1830 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1831 * @param[in] callback The callback function to register
1832 * @param[in] user_data The user data to be passed to the callback function
1833 * @return 0 on success, otherwise a negative error value.
1834 * @retval #BT_ERROR_NONE Successful
1835 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1836 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1837 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1839 * @pre The Bluetooth service must be initialized with bt_initialize().
1840 * @post bt_device_bond_created_cb() will be invoked.
1841 * @see bt_initialize()
1842 * @see bt_device_bond_created_cb()
1843 * @see bt_device_unset_bond_created_cb()
1845 int bt_device_set_bond_created_cb(bt_device_bond_created_cb callback, void *user_data);
1848 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1849 * @brief Unregisters the callback function.
1850 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1851 * @return 0 on success, otherwise a negative error value.
1852 * @retval #BT_ERROR_NONE Successful
1853 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1854 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1856 * @pre The Bluetooth service must be initialized with bt_initialize().
1857 * @see bt_initialize()
1858 * @see bt_device_set_bond_created_cb()
1860 int bt_device_unset_bond_created_cb(void);
1863 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1864 * @brief Registers a callback function to be invoked when the bond destroys.
1865 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1866 * @param[in] callback The callback function to register
1867 * @param[in] user_data The user data to be passed to the callback function
1868 * @return 0 on success, otherwise a negative error value.
1869 * @retval #BT_ERROR_NONE Successful
1870 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1871 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1872 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1874 * @pre The Bluetooth service must be initialized with bt_initialize().
1875 * @post bt_device_bond_destroyed_cb() will be invoked.
1876 * @see bt_initialize()
1877 * @see bt_device_bond_destroyed_cb()
1878 * @see bt_device_unset_bond_destroyed_cb()
1880 int bt_device_set_bond_destroyed_cb(bt_device_bond_destroyed_cb callback, void *user_data);
1883 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1884 * @brief Unregisters the callback function.
1885 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1886 * @return 0 on success, otherwise a negative error value.
1887 * @retval #BT_ERROR_NONE Successful
1888 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1889 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1891 * @pre The Bluetooth service must be initialized with bt_initialize().
1892 * @see bt_initialize()
1893 * @see bt_device_set_bond_destroyed_cb()
1895 int bt_device_unset_bond_destroyed_cb(void);
1898 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1899 * @brief Registers a callback function to be invoked when the authorization of device changes.
1900 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1901 * @param[in] callback The callback function to register
1902 * @param[in] user_data The user data to be passed to the callback function
1903 * @return 0 on success, otherwise a negative error value.
1904 * @retval #BT_ERROR_NONE Successful
1905 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1906 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1907 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1909 * @pre The Bluetooth service must be initialized with bt_initialize().
1910 * @post bt_device_authorization_changed_cb() will be invoked.
1911 * @see bt_initialize()
1912 * @see bt_device_authorization_changed_cb()
1913 * @see bt_device_unset_authorization_changed_cb()
1915 int bt_device_set_authorization_changed_cb(bt_device_authorization_changed_cb callback, void *user_data);
1918 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1919 * @brief Unregisters the callback function.
1920 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1921 * @return 0 on success, otherwise a negative error value.
1922 * @retval #BT_ERROR_NONE Successful
1923 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1924 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1926 * @pre The Bluetooth service must be initialized with bt_initialize().
1927 * @see bt_initialize()
1928 * @see bt_device_set_authorization_changed_cb()
1930 int bt_device_unset_authorization_changed_cb(void);
1933 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1934 * @brief Registers a callback function to be invoked when the process of service search finishes.
1935 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1936 * @param[in] callback The callback function to register
1937 * @param[in] user_data The user data to be passed to the callback function
1938 * @return 0 on success, otherwise a negative error value.
1939 * @retval #BT_ERROR_NONE Successful
1940 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1941 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1942 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1944 * @pre The Bluetooth service must be initialized with bt_initialize().
1945 * @post bt_device_service_searched_cb() will be invoked.
1946 * @see bt_initialize()
1947 * @see bt_device_service_searched_cb()
1948 * @see bt_device_unset_service_searched_cb()
1950 int bt_device_set_service_searched_cb(bt_device_service_searched_cb callback, void *user_data);
1953 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1954 * @brief Unregisters the callback function.
1955 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1956 * @return 0 on success, otherwise a negative error value.
1957 * @retval #BT_ERROR_NONE Successful
1958 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1959 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1961 * @pre The Bluetooth service must be initialized with bt_initialize().
1962 * @see bt_initialize()
1963 * @see bt_device_set_service_searched_cb()
1965 int bt_device_unset_service_searched_cb(void);
1968 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1969 * @brief Registers a callback function to be invoked when the connection state is changed.
1970 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1971 * @param[in] callback The callback function to register
1972 * @param[in] user_data The user data to be passed to the callback function
1973 * @return 0 on success, otherwise a negative error value.
1974 * @retval #BT_ERROR_NONE Successful
1975 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1976 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
1977 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1979 * @pre The Bluetooth service must be initialized with bt_initialize().
1980 * @post bt_device_connection_state_changed_cb() will be invoked.
1981 * @see bt_initialize()
1982 * @see bt_device_connection_state_changed_cb()
1983 * @see bt_device_unset_connection_state_changed_cb()
1985 int bt_device_set_connection_state_changed_cb(bt_device_connection_state_changed_cb callback, void *user_data);
1988 * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
1989 * @brief Unregisters the callback function to be invoked when the connection state is changed.
1990 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
1991 * @return 0 on success, otherwise a negative error value.
1992 * @retval #BT_ERROR_NONE Successful
1993 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
1994 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
1996 * @pre The Bluetooth service must be initialized with bt_initialize().
1997 * @see bt_initialize()
1998 * @see bt_device_set_connection_state_changed_cb()
2000 int bt_device_unset_connection_state_changed_cb(void);
2003 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2004 * @brief Registers a RFCOMM server socket with a specific UUID.
2005 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2007 * @privilege %http://tizen.org/privilege/bluetooth
2009 * @remarks A socket can be destroyed by bt_socket_destroy_rfcomm().
2011 * @param[in] service_uuid The 128-bit UUID of service to provide
2012 * @param[out] socket_fd The file descriptor of socket to listen
2013 * @return 0 on success, otherwise a negative error value.
2015 * @retval #BT_ERROR_NONE Successful
2016 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2017 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2018 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2019 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2020 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2021 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2023 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
2025 * @see bt_socket_listen_and_accept_rfcomm()
2026 * @see bt_socket_destroy_rfcomm()
2028 int bt_socket_create_rfcomm(const char *service_uuid, int *socket_fd);
2031 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2032 * @brief Removes the RFCOMM server socket which was created using bt_socket_create_rfcomm().
2033 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2035 * @privilege %http://tizen.org/privilege/bluetooth
2036 * @remarks If callback function bt_socket_connection_state_changed_cb() is set and the remote Bluetooth device is connected, \n
2037 * then bt_socket_connection_state_changed_cb() will be called when this function is finished successfully.
2039 * @param[in] socket_fd The file descriptor of socket (which was created using bt_socket_create_rfcomm()) to destroy
2040 * @return 0 on success, otherwise a negative error value.
2041 * @retval #BT_ERROR_NONE Successful
2042 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2043 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2044 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2045 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2046 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2047 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2049 * @pre The socket must be created with bt_socket_create_rfcomm().
2050 * @post If callback function bt_socket_connection_state_changed_cb() is set and the remote Bluetooth device is connected,
2051 * then bt_socket_connection_state_changed_cb() will be called.
2052 * @see bt_socket_create_rfcomm()
2053 * @see bt_socket_connection_state_changed_cb()
2054 * @see bt_socket_set_connection_state_changed_cb()
2055 * @see bt_socket_unset_connection_state_changed_cb()
2057 int bt_socket_destroy_rfcomm(int socket_fd);
2060 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2061 * @brief Starts listening on passed RFCOMM socket and accepts connection requests.
2062 * @details Pop-up is shown automatically when a RFCOMM connection is requested. \n
2063 * bt_socket_connection_state_changed_cb() will be called with \n
2064 * #BT_SOCKET_CONNECTED if you click "yes" and connection is finished successfully.
2065 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2067 * @privilege %http://tizen.org/privilege/bluetooth
2068 * @param[in] socket_fd The file descriptor of socket on which start to listen
2069 * @param[in] max_pending_connections The maximum number of pending connections
2070 * @return 0 on success, otherwise a negative error value.
2071 * @retval #BT_ERROR_NONE Successful
2072 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2073 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2074 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2075 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2076 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2077 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2079 * @pre The socket must be created with bt_socket_create_rfcomm().
2080 * @post If callback function bt_socket_connection_state_changed_cb() is set,
2081 * then bt_socket_connection_state_changed_cb() will be called when the remote Bluetooth device is connected.
2082 * @see bt_socket_create_rfcomm()
2083 * @see bt_socket_connection_state_changed_cb()
2084 * @see bt_socket_set_connection_state_changed_cb()
2085 * @see bt_socket_unset_connection_state_changed_cb()
2087 int bt_socket_listen_and_accept_rfcomm(int socket_fd, int max_pending_connections);
2090 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2091 * @brief Connects to a specific RFCOMM based service on a remote Bluetooth device UUID, asynchronously.
2092 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2094 * @privilege %http://tizen.org/privilege/bluetooth
2096 * @remarks A connection can be disconnected by bt_socket_disconnect_rfcomm().
2098 * @param[in] remote_address The address of the remote Bluetooth device
2099 * @param[in] service_uuid The UUID of service provided by the remote Bluetooth device
2101 * @return 0 on success, otherwise a negative error value.
2102 * @retval #BT_ERROR_NONE Successful
2103 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2104 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2105 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2106 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2107 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2108 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2110 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
2111 * @pre The remote device must be discoverable with bt_adapter_start_device_discovery().
2112 * @pre The bond with the remote device must be created with bt_device_create_bond().
2113 * @post This function invokes bt_socket_connection_state_changed_cb().
2115 * @see bt_device_create_bond()
2116 * @see bt_adapter_start_device_discovery()
2117 * @see bt_device_start_service_search()
2118 * @see bt_socket_disconnect_rfcomm()
2119 * @see bt_socket_connection_state_changed_cb()
2120 * @see bt_socket_set_connection_state_changed_cb()
2121 * @see bt_socket_unset_connection_state_changed_cb()
2123 int bt_socket_connect_rfcomm(const char *remote_address, const char *service_uuid);
2126 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2127 * @brief Disconnects the RFCOMM connection with the given file descriptor of connected socket.
2128 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2130 * @privilege %http://tizen.org/privilege/bluetooth
2131 * @param[in] socket_fd The file descriptor of socket to close which was received using bt_socket_connection_state_changed_cb().
2132 * @return 0 on success, otherwise a negative error value.
2133 * @retval #BT_ERROR_NONE Successful
2134 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2135 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2136 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2137 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2138 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2140 * @pre The connection must be established.
2142 * @see bt_socket_connection_state_changed_cb()
2143 * @see bt_socket_set_connection_state_changed_cb()
2144 * @see bt_socket_unset_connection_state_changed_cb()
2146 int bt_socket_disconnect_rfcomm(int socket_fd);
2149 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2150 * @brief Sends data to the connected device.
2151 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2153 * @privilege %http://tizen.org/privilege/bluetooth
2154 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
2156 * @param[in] socket_fd The file descriptor of connected socket which was received using bt_socket_connection_state_changed_cb()
2157 * @param[in] data The data to be sent
2158 * @param[in] length The length of data to be sent
2160 * @return the number of bytes written (zero indicates nothing was written).
2161 * @retval On error, -1 is returned, and errno is set appropriately. See write 2 man page.
2162 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2163 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2164 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2165 * @exception BT_ERROR_PERMISSION_DENIED Permission denied
2166 * @exception BT_ERROR_AGAIN Resource temporarily unavailable
2168 * @pre The connection must be established.
2170 * @see bt_socket_connection_state_changed_cb()
2171 * @see bt_socket_set_connection_state_changed_cb()
2172 * @see bt_socket_unset_connection_state_changed_cb()
2174 int bt_socket_send_data(int socket_fd, const char *data, int length);
2177 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2178 * @brief Registers a callback function that will be invoked when you receive data.
2179 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2180 * @param[in] callback The callback function to register
2181 * @param[in] user_data The user data to be passed to the callback function
2182 * @return 0 on success, otherwise a negative error value.
2183 * @retval #BT_ERROR_NONE Successful
2184 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2185 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2186 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2188 * @pre The Bluetooth service must be initialized with bt_initialize().
2189 * @post bt_socket_data_received_cb() will be invoked.
2190 * @see bt_initialize()
2191 * @see bt_socket_data_received_cb()
2192 * @see bt_socket_unset_data_received_cb()
2194 int bt_socket_set_data_received_cb(bt_socket_data_received_cb callback, void *user_data);
2197 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2198 * @brief Unregisters the callback function.
2199 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2200 * @return 0 on success, otherwise a negative error value.
2201 * @retval #BT_ERROR_NONE Successful
2202 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2203 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2205 * @pre The Bluetooth service must be initialized with bt_initialize().
2206 * @see bt_initialize()
2207 * @see bt_socket_data_received_cb()
2208 * @see bt_socket_set_data_received_cb()
2210 int bt_socket_unset_data_received_cb(void);
2213 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2214 * @brief Registers a callback function that will be invoked when a RFCOMM connection is requested.
2215 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2216 * @param[in] callback The callback function to register
2217 * @param[in] user_data The user data to be passed to the callback function
2218 * @return 0 on success, otherwise a negative error value.
2219 * @retval #BT_ERROR_NONE Successful
2220 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2221 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2222 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2224 * @pre The Bluetooth service must be initialized with bt_initialize().
2225 * @post bt_socket_connection_requested_cb() will be invoked.
2226 * @see bt_initialize()
2227 * @see bt_socket_unset_connection_requested_cb()
2229 int bt_socket_set_connection_requested_cb(bt_socket_connection_requested_cb callback, void *user_data);
2232 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2233 * @brief Unregisters the callback function.
2234 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2235 * @return 0 on success, otherwise a negative error value.
2236 * @retval #BT_ERROR_NONE Successful
2237 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2238 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2240 * @pre The Bluetooth service must be initialized with bt_initialize().
2241 * @see bt_initialize()
2242 * @see bt_socket_set_connection_requested_cb()
2243 * @see bt_socket_connection_requested_cb()
2245 int bt_socket_unset_connection_requested_cb(void);
2248 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2249 * @brief Registers a callback function that will be invoked when the connection state changes.
2250 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2251 * @param[in] callback The callback function to register
2252 * @param[in] user_data The user data to be passed to the callback function
2253 * @return 0 on success, otherwise a negative error value.
2254 * @retval #BT_ERROR_NONE Successful
2255 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2256 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2257 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2259 * @pre The Bluetooth service must be initialized with bt_initialize().
2260 * @post bt_socket_connection_state_changed_cb() will be invoked.
2261 * @see bt_initialize()
2262 * @see bt_socket_connection_state_changed_cb()
2263 * @see bt_socket_unset_connection_state_changed_cb()
2265 int bt_socket_set_connection_state_changed_cb(bt_socket_connection_state_changed_cb callback, void *user_data);
2268 * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
2269 * @brief Unregisters the callback function.
2270 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2271 * @return 0 on success, otherwise a negative error value.
2272 * @retval #BT_ERROR_NONE Successful
2273 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2274 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2276 * @pre The Bluetooth service must be initialized with bt_initialize().
2277 * @see bt_initialize()
2278 * @see bt_socket_connection_state_changed_cb()
2279 * @see bt_socket_set_connection_state_changed_cb()
2281 int bt_socket_unset_connection_state_changed_cb(void);
2284 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2285 * @brief Initializes the Bluetooth OPP server requested by bt_opp_server_connection_requested_cb().
2286 * @details No popup appears when an OPP connection is requested from a remote device. \n
2287 * Instead, @a connection_requested_cb() will be called. \n
2288 * At that time, you can call either bt_opp_server_accept() or bt_opp_server_reject().
2289 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2290 * @remarks This function must be called to start Bluetooth OPP server. \n
2291 * You must free all resources of the Bluetooth service by calling bt_opp_server_deinitialize() if Bluetooth OPP service is no longer needed.
2292 * @param[in] destination The destination path
2293 * @param[in] connection_requested_cb The callback called when an OPP connection is requested
2294 * @param[in] user_data The user data to be passed to the callback function
2295 * @return 0 on success, otherwise a negative error value.
2296 * @retval #BT_ERROR_NONE Successful
2297 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2298 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2299 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2300 * @retval #BT_ERROR_RESOURCE_BUSY Device or resource busy
2301 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2302 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2304 * @see bt_opp_server_connection_requested_cb()
2305 * @see bt_opp_server_deinitialize()
2306 * @see bt_opp_server_accept()
2307 * @see bt_opp_server_reject()
2309 int bt_opp_server_initialize_by_connection_request(const char *destination, bt_opp_server_connection_requested_cb connection_requested_cb, void *user_data);
2312 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2313 * @brief Deinitializes the Bluetooth OPP server.
2314 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2315 * @return 0 on success, otherwise a negative error value.
2316 * @retval #BT_ERROR_NONE Successful
2317 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2318 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2319 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2320 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2322 * @see bt_opp_server_initialize_by_connection_request()
2324 int bt_opp_server_deinitialize(void);
2327 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2328 * @brief Accepts the push request from the remote device.
2329 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2331 * @privilege %http://tizen.org/privilege/bluetooth
2332 * @remarks If you initialize OPP server by bt_opp_server_initialize_by_connection_request(), then name is ignored.
2333 * You can cancel the pushes by bt_opp_server_cancel_transfer() with transfer_id.
2334 * @param[in] progress_cb The callback called when a file is being transferred
2335 * @param[in] finished_cb The callback called when a transfer is finished
2336 * @param[in] name The name to store. This can be NULL if you initialize OPP server by bt_opp_server_initialize_by_connection_request().
2337 * @param[in] user_data The user data to be passed to the callback function
2338 * @param[out] transfer_id The ID of transfer
2339 * @return 0 on success, otherwise a negative error value.
2340 * @retval #BT_ERROR_NONE Successful
2341 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2342 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2343 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2344 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2345 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation now in progress
2346 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2347 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2349 * @see bt_opp_server_reject()
2351 int bt_opp_server_accept(bt_opp_server_transfer_progress_cb progress_cb,
2352 bt_opp_server_transfer_finished_cb finished_cb, const char *name,
2353 void *user_data, int *transfer_id);
2356 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2357 * @brief Rejects the push request from the remote device.
2358 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2360 * @privilege %http://tizen.org/privilege/bluetooth
2361 * @return 0 on success, otherwise a negative error value.
2362 * @retval #BT_ERROR_NONE Successful
2363 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2364 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2365 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2366 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2367 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2369 * @see bt_opp_server_accept()
2371 int bt_opp_server_reject(void);
2374 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2375 * @brief Cancels the transfer.
2376 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2378 * @privilege %http://tizen.org/privilege/bluetooth
2379 * @param[in] transfer_id The ID of transfer
2380 * @return 0 on success, otherwise a negative error value.
2381 * @retval #BT_ERROR_NONE Successful
2382 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2383 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2384 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2385 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2386 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2387 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2389 * @see bt_opp_server_accept()
2391 int bt_opp_server_cancel_transfer(int transfer_id);
2394 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_SERVER_MODULE
2395 * @brief Sets the destination path of file to be pushed.
2396 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2398 * @privilege %http://tizen.org/privilege/bluetooth
2399 * @param[in] destination The destination path of file to be pushed
2400 * @return 0 on success, otherwise a negative error value.
2401 * @retval #BT_ERROR_NONE Successful
2402 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2403 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2404 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2405 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2406 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2407 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2409 int bt_opp_server_set_destination(const char *destination);
2412 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2413 * @brief Initializes the Bluetooth OPP client.
2414 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2415 * @remarks This function must be called before Bluetooth OPP client starts. \n
2416 * You must free all resources of the Bluetooth service by calling bt_opp_client_deinitialize() \n
2417 * if Bluetooth OPP service is no longer needed.
2418 * @return 0 on success, otherwise a negative error value.
2419 * @retval #BT_ERROR_NONE Successful
2420 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2421 * @retval #BT_ERROR_RESOURCE_BUSY Device or resource busy
2422 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2423 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2425 * @see bt_opp_client_deinitialize()
2427 int bt_opp_client_initialize(void);
2430 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2431 * @brief Deinitializes the Bluetooth OPP client.
2432 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2433 * @return 0 on success, otherwise a negative error value.
2434 * @retval #BT_ERROR_NONE Successful
2435 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2436 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2437 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2439 * @see bt_opp_client_initialize()
2441 int bt_opp_client_deinitialize(void);
2444 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2445 * @brief Adds file to be pushed.
2446 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2447 * @param[in] file The path of file to be pushed
2448 * @return 0 on success, otherwise a negative error value.
2449 * @retval #BT_ERROR_NONE Successful
2450 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2451 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2452 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2453 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2454 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2456 * @see bt_opp_client_clear_files()
2457 * @see bt_opp_client_push_files()
2459 int bt_opp_client_add_file(const char *file);
2462 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2463 * @brief Adds file to be pushed.
2464 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2465 * @return 0 on success, otherwise a negative error value.
2466 * @retval #BT_ERROR_NONE Successful
2467 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2468 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2469 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2470 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2472 * @see bt_opp_client_add_file()
2473 * @see bt_opp_client_push_files()
2475 int bt_opp_client_clear_files(void);
2478 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2479 * @brief Pushes the file to the remote device, asynchronously.
2481 * @details At first, bt_opp_client_push_responded_cb() will be called when OPP server responds to the push request. \n
2482 * After connection is established, bt_opp_client_push_progress_cb() will be called repeatedly until a file is transferred completely. \n
2483 * If you send several files, then bt_opp_client_push_progress_cb() with another file will be called repeatedly until the file is transferred completely. \n
2484 * bt_opp_client_push_finished_cb() will be called when the push request is finished.
2486 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2488 * @privilege %http://tizen.org/privilege/bluetooth
2489 * @param[in] remote_address The remote address
2490 * @param[in] responded_cb The callback called when OPP server responds to the push request
2491 * @param[in] progress_cb The callback called when each file is being transferred
2492 * @param[in] finished_cb The callback called when the push request is finished
2493 * @param[in] user_data The user data to be passed to the callback function
2494 * @return 0 on success, otherwise a negative error value.
2495 * @retval #BT_ERROR_NONE Successful
2496 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2497 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2498 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2499 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2500 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation now in progress
2501 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2502 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2504 * @see bt_opp_client_initialize()
2505 * @see bt_opp_client_cancel_push()
2507 int bt_opp_client_push_files(const char *remote_address,
2508 bt_opp_client_push_responded_cb responded_cb,
2509 bt_opp_client_push_progress_cb progress_cb,
2510 bt_opp_client_push_finished_cb finished_cb,
2514 * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_CLIENT_MODULE
2515 * @brief Cancels the push request in progress, asynchronously.
2516 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2518 * @privilege %http://tizen.org/privilege/bluetooth
2519 * @return 0 on success, otherwise a negative error value.
2520 * @retval #BT_ERROR_NONE Successful
2521 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2522 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2523 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2524 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2525 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2527 * @pre bt_opp_client_push_files() must be called.
2528 * @post bt_opp_client_push_finished_cb() will be invoked with result #BT_ERROR_CANCELLED,
2529 * which is a parameter of bt_opp_client_push_files().
2530 * @see bt_opp_client_initialize()
2531 * @see bt_opp_client_push_files()
2533 int bt_opp_client_cancel_push(void);
2537 * @addtogroup CAPI_NETWORK_BLUETOOTH_HID_HOST_MODULE
2539 * @addtogroup CAPI_NETWORK_BLUETOOTH_HID_MODULE
2545 * @brief Initializes the Bluetooth HID (Human Interface Device) Host.
2546 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2547 * @remarks This function must be called before Bluetooth HID Host starts. \n
2548 * You must free all resources of the Bluetooth service by calling bt_hid_host_deinitialize() \n
2549 * if Bluetooth HID Host service is no longer needed.
2550 * @param[in] connection_cb The callback called when the connection state is changed
2551 * @param[in] user_data The user data to be passed to the callback function
2552 * @return 0 on success, otherwise a negative error value.
2553 * @retval #BT_ERROR_NONE Successful
2554 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2555 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2556 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2557 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2559 * @pre The Bluetooth service must be initialized with bt_initialize().
2560 * @see bt_initialize()
2561 * @see bt_hid_host_deinitialize()
2563 int bt_hid_host_initialize(bt_hid_host_connection_state_changed_cb connection_cb, void *user_data);
2566 * @brief Deinitializes the Bluetooth HID (Human Interface Device) Host.
2567 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2568 * @return 0 on success, otherwise a negative error value.
2569 * @retval #BT_ERROR_NONE Successful
2570 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2571 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2572 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2574 * @pre The Bluetooth HID service must be initialized with bt_hid_host_initialize().
2575 * @see bt_hid_host_initialize()
2577 int bt_hid_host_deinitialize(void);
2580 * @brief Connects the remote device with the HID (Human Interface Device) service, asynchronously.
2581 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2583 * @privilege %http://tizen.org/privilege/bluetooth
2584 * @param[in] remote_address The remote address
2585 * @return 0 on success, otherwise a negative error value.
2586 * @retval #BT_ERROR_NONE Successful
2587 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2588 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2589 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2590 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2591 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2592 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2594 * @pre The local device must be bonded with the remote device by bt_device_create_bond().
2595 * @pre The Bluetooth HID service must be initialized with bt_hid_host_initialize().
2596 * @post bt_hid_host_connection_state_changed_cb() will be invoked.
2597 * @see bt_hid_host_disconnect()
2598 * @see bt_hid_host_connection_state_changed_cb()
2600 int bt_hid_host_connect(const char *remote_address);
2603 * @brief Disconnects the remote device with the HID (Human Interface Device) service, asynchronously.
2604 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2606 * @privilege %http://tizen.org/privilege/bluetooth
2607 * @param[in] remote_address The remote address
2608 * @return 0 on success, otherwise a negative error value.
2609 * @retval #BT_ERROR_NONE Successful
2610 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2611 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2612 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2613 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
2614 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2615 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2616 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2618 * @pre The remote device must be connected by bt_hid_host_connect().
2619 * @post bt_hid_host_connection_state_changed_cb() will be invoked.
2620 * @see bt_hid_host_connect()
2621 * @see bt_hid_host_connection_state_changed_cb()
2623 int bt_hid_host_disconnect(const char *remote_address);
2631 * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2632 * @brief Activates the Bluetooth HID Device role.
2633 * @since_tizen @if WEARABLE 3.0 @endif
2635 * @privilege %http://tizen.org/privilege/bluetooth
2637 * @remarks This function must be called to register HID UUID. \n
2638 * Only then a remote device is able to identify this one as a HID device.
2640 * @param[in] callback The callback called when the connection state is changed
2641 * @param[in] user_data The user data to be passed to the callback function
2642 * @return 0 on success, otherwise a negative error value.
2643 * @retval #BT_ERROR_NONE Successful
2644 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2645 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2646 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2647 * @retval #BT_ERROR_NOW_IN_PROGRESS Already activated
2648 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2649 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2650 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2652 * @pre The Bluetooth service must be initialized with bt_initialize().
2653 * @see bt_initialize()
2654 * @see bt_hid_device_deactivate()
2656 int bt_hid_device_activate(bt_hid_device_connection_state_changed_cb callback, void *user_data);
2660 * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2661 * @brief Deactivates the Bluetooth HID Device role.
2662 * @since_tizen @if WEARABLE 3.0 @endif
2664 * @privilege %http://tizen.org/privilege/bluetooth
2666 * @remarks This function must be called to deregister the HID UUID.
2668 * @return 0 on success, otherwise a negative error value.
2669 * @retval #BT_ERROR_NONE Successful
2670 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2671 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2672 * @retval #BT_ERROR_NOT_IN_PROGRESS Not activated
2673 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2674 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2675 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2677 * @pre The Bluetooth service must be initialized with bt_initialize().
2678 * @see bt_initialize()
2679 * @see bt_hid_device_activate()
2681 int bt_hid_device_deactivate(void);
2685 * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2686 * @brief Initiates the HID device connection with the Device role, asynchronously.
2687 * @since_tizen @if WEARABLE 3.0 @endif
2689 * @privilege %http://tizen.org/privilege/bluetooth
2691 * @remarks This function must be called to Initiate the HID device role connection.
2693 * @param[in] remote_address The remote device's address.
2695 * @return 0 on success, otherwise a negative error value.
2696 * @retval #BT_ERROR_NONE Successful
2697 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2698 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2699 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2700 * @retval #BT_ERROR_NOT_IN_PROGRESS Not activated
2701 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2702 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2703 * @retval #BT_ERROR_ALREADY_DONE Already connected
2704 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2706 * @pre The Bluetooth service must be initialized with bt_initialize().
2707 * @pre The local device must be bonded with the remote device by bt_device_create_bond().
2708 * @see bt_initialize()
2709 * @see bt_hid_device_activate()
2711 int bt_hid_device_connect(const char *remote_address);
2715 * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2716 * @brief Disconnects from the HID Host device, asynchronously.
2717 * @since_tizen @if WEARABLE 3.0 @endif
2719 * @privilege %http://tizen.org/privilege/bluetooth
2721 * @param[in] remote_address The remote device's address.
2722 * @return 0 on success, otherwise a negative error value.
2723 * @retval #BT_ERROR_NONE Successful
2724 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2725 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2726 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2727 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
2728 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2729 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2730 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2732 * @pre The Bluetooth service must be initialized with bt_initialize().
2733 * @see bt_initialize()
2734 * @see bt_hid_device_connection_state_changed_cb()
2736 int bt_hid_device_disconnect(const char *remote_address);
2740 * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2741 * @brief Sends the mouse event data to the remote device.
2742 * @since_tizen @if WEARABLE 3.0 @endif
2744 * @privilege %http://tizen.org/privilege/bluetooth
2746 * @param[in] remote_address The remote device's address.
2747 * @param[in] mouse_data The mouse data to be passed to the remote device.
2749 * @return the number of bytes written (zero indicates nothing was written).
2750 * @retval On error, -1 is returned, and errno is set appropriately. See write 2 man page.
2751 * @retval #BT_ERROR_NONE Successful
2752 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2753 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2754 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2755 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2756 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2758 * @pre The HID connection must be established.
2759 * @see bt_hid_device_connection_state_changed_cb()
2761 int bt_hid_device_send_mouse_event(const char *remote_address,
2762 const bt_hid_mouse_data_s *mouse_data);
2766 * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2767 * @brief Sends the keyboard event data to the remote device.
2768 * @since_tizen @if WEARABLE 3.0 @endif
2770 * @privilege %http://tizen.org/privilege/bluetooth
2772 * @param[in] remote_address The remote device's address.
2773 * @param[in] key_data The key data to be passed to the remote device
2775 * @return the number of bytes written (zero indicates nothing was written).
2776 * @retval On error, -1 is returned, and errno is set appropriately. See write 2 man page.
2777 * @retval #BT_ERROR_NONE Successful
2778 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2779 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2780 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2781 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2782 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2784 * @pre The HID connection must be established.
2785 * @see bt_hid_device_connection_state_changed_cb()
2787 int bt_hid_device_send_key_event(const char *remote_address,
2788 const bt_hid_key_data_s *key_data);
2792 * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2793 * @brief Sets the callback called when the device receives data from the HID Host.
2794 * @since_tizen @if WEARABLE 3.0 @endif
2796 * @param[in] callback The callback function to be set when data is received.
2797 * @param[in] user_data The user data to be passed to the callback.
2798 * @return 0 on success, otherwise a negative error value.
2799 * @retval #BT_ERROR_NONE Successful
2800 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2801 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2802 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2804 * @see bt_hid_device_connection_state_changed_cb()
2806 int bt_hid_device_set_data_received_cb(bt_hid_device_data_received_cb callback, void *user_data);
2810 * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2811 * @brief Unsets the data received callback.
2812 * @since_tizen @if WEARABLE 3.0 @endif
2814 * @return 0 on success, otherwise a negative error value.
2815 * @retval #BT_ERROR_NONE Successful
2816 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2817 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2819 * @see bt_hid_device_connection_state_changed_cb()
2821 int bt_hid_device_unset_data_received_cb(void);
2825 * @ingroup CAPI_NETWORK_BLUETOOTH_HID_DEVICE_MODULE
2826 * @brief Responds to reports from the HID Host.
2827 * @since_tizen @if WEARABLE 3.0 @endif
2829 * @privilege %http://tizen.org/privilege/bluetooth
2831 * @param[in] remote_address The remote device's address.
2832 * @param[in] header_type The response header type
2833 * @param[in] param_type The response parameter type
2834 * @param[in] data The response data
2835 * @param[in] data_len The length of the response data
2837 * @return the number of bytes written (zero indicates nothing was written).
2838 * @retval On error, -1 is returned, and errno is set appropriately. See write 2 man page.
2839 * @retval #BT_ERROR_NONE Successful
2840 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2841 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2842 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2843 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2844 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2845 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2847 * @pre The HID connection must be established.
2848 * @see bt_hid_device_connection_state_changed_cb()
2850 int bt_hid_device_reply_to_report(const char *remote_address,
2851 bt_hid_header_type_e header_type,
2852 bt_hid_param_type_e param_type,
2853 const char *data, unsigned int data_len);
2856 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2857 * @brief Initializes the Bluetooth profiles related with audio.
2858 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2859 * @remarks This function must be called before Bluetooth profiles related with audio starts. \n
2860 * You must free all resources of the this service by calling bt_audio_deinitialize() \n
2861 * if Bluetooth profiles related with audio service is no longer needed.
2862 * @return 0 on success, otherwise a negative error value.
2863 * @retval #BT_ERROR_NONE Successful
2864 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2865 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2866 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2868 * @pre The Bluetooth service must be initialized with bt_initialize().
2869 * @see bt_initialize()
2870 * @see bt_audio_deinitialize()
2872 int bt_audio_initialize(void);
2875 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2876 * @brief Deinitializes the Bluetooth profiles related with audio.
2877 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2878 * @return 0 on success, otherwise a negative error value.
2879 * @retval #BT_ERROR_NONE Successful
2880 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2881 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2882 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2884 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2885 * @see bt_audio_initialize()
2887 int bt_audio_deinitialize(void);
2890 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2891 * @brief Connects the remote device with the given audio profile, asynchronously.
2892 * @details If you input type as #BT_AUDIO_PROFILE_TYPE_ALL and connection request succeeds, then bt_audio_connection_state_changed_cb() will be called twice \n
2893 * when #BT_AUDIO_PROFILE_TYPE_HSP_HFP is connected and #BT_AUDIO_PROFILE_TYPE_A2DP is connected.
2895 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2897 * @privilege %http://tizen.org/privilege/bluetooth
2898 * @param[in] remote_address The remote address
2899 * @param[in] type The type of audio profile
2900 * @return 0 on success, otherwise a negative error value.
2901 * @retval #BT_ERROR_NONE Successful
2902 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2903 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2904 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2905 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2906 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2907 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2909 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2910 * @pre The local device must be bonded with the remote device by bt_device_create_bond().
2911 * @post bt_audio_connection_state_changed_cb() will be invoked.
2912 * @see bt_audio_disconnect()
2913 * @see bt_audio_connection_state_changed_cb()
2915 int bt_audio_connect(const char *remote_address, bt_audio_profile_type_e type);
2918 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2919 * @brief Disconnects the remote device with the given audio profile, asynchronously.
2920 * @details If you input type as #BT_AUDIO_PROFILE_TYPE_ALL and disconnection request succeeds, then bt_audio_connection_state_changed_cb() will be called twice \n
2921 * when #BT_AUDIO_PROFILE_TYPE_HSP_HFP is disconnected and #BT_AUDIO_PROFILE_TYPE_A2DP is disconnected.
2922 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2924 * @privilege %http://tizen.org/privilege/bluetooth
2925 * @param[in] remote_address The remote address
2926 * @param[in] type The type of audio profile
2927 * @return 0 on success, otherwise a negative error value.
2928 * @retval #BT_ERROR_NONE Successful
2929 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2930 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2931 * @retval #BT_ERROR_NOT_ENABLED Not enabled
2932 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2933 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
2934 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2936 * @pre The remote device must be connected by bt_audio_connect().
2937 * @post bt_audio_connection_state_changed_cb() will be invoked.
2938 * @see bt_audio_connect()
2939 * @see bt_audio_connection_state_changed_cb()
2941 int bt_audio_disconnect(const char *remote_address, bt_audio_profile_type_e type);
2944 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2945 * @brief Registers a callback function that will be invoked when the connection state is changed.
2946 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2947 * @param[in] callback The callback function to register
2948 * @param[in] user_data The user data to be passed to the callback function
2949 * @return 0 on success, otherwise a negative error value.
2950 * @retval #BT_ERROR_NONE Successful
2951 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2952 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2953 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2955 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2956 * @see bt_audio_initialize()
2957 * @see bt_audio_connection_state_changed_cb()
2959 int bt_audio_set_connection_state_changed_cb(bt_audio_connection_state_changed_cb callback, void *user_data);
2962 * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_MODULE
2963 * @brief Unregisters a callback function that will be invoked when the connection state is changed.
2964 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
2965 * @return 0 on success, otherwise a negative error value.
2966 * @retval #BT_ERROR_NONE Successful
2967 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2968 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2970 * @pre The Bluetooth audio service must be initialized with bt_audio_initialize().
2971 * @see bt_audio_initialize()
2972 * @see bt_audio_connection_state_changed_cb()
2973 * @see bt_audio_set_connection_state_changed_cb()
2975 int bt_audio_unset_connection_state_changed_cb(void);
2978 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
2979 * @brief Initializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) target service.
2980 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
2981 * @remarks This function must be called before any other AVRCP target functions are called. \n
2982 * You must free all resources of the this service by calling bt_avrcp_target_deinitialize() \n
2983 * if Bluetooth AVRCP service is no longer needed.
2984 * @param[in] callback The callback function called when the connection state is changed
2985 * @param[in] user_data The user data to be passed to the callback function
2986 * @return 0 on success, otherwise a negative error value.
2987 * @retval #BT_ERROR_NONE Successful
2988 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
2989 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
2990 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
2991 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
2993 * @pre The Bluetooth service must be initialized with bt_initialize().
2994 * @see bt_initialize()
2995 * @see bt_avrcp_target_deinitialize()
2997 int bt_avrcp_target_initialize(bt_avrcp_target_connection_state_changed_cb callback, void *user_data);
3000 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3001 * @brief Deinitializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) target service.
3002 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3003 * @return 0 on success, otherwise a negative error value.
3004 * @retval #BT_ERROR_NONE Successful
3005 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3006 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3008 * @pre The Bluetooth audio service must be initialized with bt_avrcp_target_initialize().
3009 * @see bt_avrcp_target_initialize()
3011 int bt_avrcp_target_deinitialize(void);
3014 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3015 * @brief Notifies the equalizer state to the remote device.
3016 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3018 * @privilege %http://tizen.org/privilege/bluetooth
3019 * @param[in] state The state of equalizer
3020 * @return 0 on success, otherwise a negative error value.
3021 * @retval #BT_ERROR_NONE Successful
3022 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3023 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3024 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3025 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3026 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3027 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3028 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3030 * @pre The remote device must be connected.
3031 * @see bt_avrcp_target_connection_state_changed_cb()
3032 * @see bt_avrcp_target_initialize()
3034 int bt_avrcp_target_notify_equalizer_state(bt_avrcp_equalizer_state_e state);
3037 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3038 * @brief Notifies the repeat mode to the remote device.
3039 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3041 * @privilege %http://tizen.org/privilege/bluetooth
3042 * @param[in] mode The repeat mode
3043 * @return 0 on success, otherwise a negative error value.
3044 * @retval #BT_ERROR_NONE Successful
3045 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3046 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3047 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3048 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3049 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3050 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3051 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3053 * @pre The remote device must be connected.
3054 * @see bt_avrcp_target_connection_state_changed_cb()
3055 * @see bt_avrcp_target_initialize()
3057 int bt_avrcp_target_notify_repeat_mode(bt_avrcp_repeat_mode_e mode);
3060 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3061 * @brief Notifies the shuffle mode to the remote device.
3062 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3064 * @privilege %http://tizen.org/privilege/bluetooth
3065 * @param[in] mode The repeat mode
3066 * @return 0 on success, otherwise a negative error value.
3067 * @retval #BT_ERROR_NONE Successful
3068 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3069 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3070 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3071 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3072 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3073 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3074 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3076 * @pre The remote device must be connected.
3077 * @see bt_avrcp_target_connection_state_changed_cb()
3078 * @see bt_avrcp_target_initialize()
3080 int bt_avrcp_target_notify_shuffle_mode(bt_avrcp_shuffle_mode_e mode);
3083 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3084 * @brief Notifies the scan mode to the remote device.
3085 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3087 * @privilege %http://tizen.org/privilege/bluetooth
3088 * @param[in] mode The scan mode
3089 * @return 0 on success, otherwise a negative error value.
3090 * @retval #BT_ERROR_NONE Successful
3091 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3092 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3093 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3094 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3095 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3096 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3097 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3099 * @pre The remote device must be connected.
3100 * @see bt_avrcp_target_connection_state_changed_cb()
3101 * @see bt_avrcp_target_initialize()
3103 int bt_avrcp_target_notify_scan_mode(bt_avrcp_scan_mode_e mode);
3106 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3107 * @brief Notifies the player state to the remote device.
3108 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3110 * @privilege %http://tizen.org/privilege/bluetooth
3111 * @param[in] state The player state
3112 * @return 0 on success, otherwise a negative error value.
3113 * @retval #BT_ERROR_NONE Successful
3114 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3115 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3116 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3117 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3118 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3119 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3120 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3122 * @pre The remote device must be connected.
3123 * @see bt_avrcp_target_connection_state_changed_cb()
3124 * @see bt_avrcp_target_initialize()
3126 int bt_avrcp_target_notify_player_state(bt_avrcp_player_state_e state);
3129 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3130 * @brief Notifies the current position of song to the remote device.
3131 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3133 * @privilege %http://tizen.org/privilege/bluetooth
3134 * @param[in] position The current position in milliseconds
3135 * @return 0 on success, otherwise a negative error value.
3136 * @retval #BT_ERROR_NONE Successful
3137 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3138 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3139 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3140 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3141 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3142 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3143 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3145 * @pre The remote device must be connected.
3146 * @see bt_avrcp_target_connection_state_changed_cb()
3147 * @see bt_avrcp_target_initialize()
3149 int bt_avrcp_target_notify_position(unsigned int position);
3152 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_TARGET_MODULE
3153 * @brief Notifies the track to the remote device.
3154 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3156 * @privilege %http://tizen.org/privilege/bluetooth
3157 * @param[in] title The title of track
3158 * @param[in] artist The artist of track
3159 * @param[in] album The album of track
3160 * @param[in] genre The genre of track
3161 * @param[in] track_num The track number
3162 * @param[in] total_tracks The number of all tracks
3163 * @param[in] duration The duration of track in milliseconds
3164 * @return 0 on success, otherwise a negative error value.
3165 * @retval #BT_ERROR_NONE Successful
3166 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3167 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3168 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3169 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3170 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3171 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3172 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3174 * @pre The remote device must be connected.
3175 * @see bt_avrcp_target_connection_state_changed_cb()
3176 * @see bt_avrcp_target_initialize()
3178 int bt_avrcp_target_notify_track(const char *title, const char *artist, const char *album, const char *genre, unsigned int track_num, unsigned int total_tracks, unsigned int duration);
3181 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3182 * @brief Registers a callback function that will be invoked when the equalizer state is changed. (e.g., by a TV remote control or other input devices).
3183 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3184 * @param[in] callback The callback function to register
3185 * @param[in] user_data The user data to be passed to the callback function
3186 * @return 0 on success, otherwise a negative error value.
3187 * @retval #BT_ERROR_NONE Successful
3188 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3189 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3190 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3192 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3193 * @see bt_avrcp_target_initialize()
3194 * @see bt_avrcp_control_initialize()
3195 * @see bt_avrcp_unset_equalizer_state_changed_cb()
3197 int bt_avrcp_set_equalizer_state_changed_cb(bt_avrcp_equalizer_state_changed_cb callback, void *user_data);
3200 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3201 * @brief Unregisters a callback function that will be invoked when the equalizer state is changed. (e.g., by a TV remote control or other input devices).
3202 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3203 * @return 0 on success, otherwise a negative error value.
3204 * @retval #BT_ERROR_NONE Successful
3205 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3206 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3208 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3209 * @see bt_avrcp_target_initialize()
3210 * @see bt_avrcp_control_initialize()
3211 * @see bt_avrcp_set_equalizer_state_changed_cb()
3213 int bt_avrcp_unset_equalizer_state_changed_cb(void);
3216 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3217 * @brief Registers a callback function that will be invoked when the repeat mode is changed. (e.g., by a TV remote control or other input devices).
3218 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3219 * @param[in] callback The callback function to register
3220 * @param[in] user_data The user data to be passed to the callback function
3221 * @return 0 on success, otherwise a negative error value.
3222 * @retval #BT_ERROR_NONE Successful
3223 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3224 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3225 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3227 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3228 * @see bt_avrcp_target_initialize()
3229 * @see bt_avrcp_control_initialize()
3230 * @see bt_avrcp_unset_repeat_mode_changed_cb()
3232 int bt_avrcp_set_repeat_mode_changed_cb(bt_avrcp_repeat_mode_changed_cb callback, void *user_data);
3235 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3236 * @brief Unregisters a callback function that will be invoked when the repeat mode is changed. (e.g., by a TV remote control or other input devices).
3237 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3238 * @return 0 on success, otherwise a negative error value.
3239 * @retval #BT_ERROR_NONE Successful
3240 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3241 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3243 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3244 * @see bt_avrcp_target_initialize()
3245 * @see bt_avrcp_control_initialize()
3246 * @see bt_avrcp_set_repeat_mode_changed_cb()
3248 int bt_avrcp_unset_repeat_mode_changed_cb(void);
3251 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3252 * @brief Registers a callback function that will be invoked when the shuffle mode is changed. (e.g., by a TV remote control or other input devices).
3253 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3254 * @param[in] callback The callback function to register
3255 * @param[in] user_data The user data to be passed to the callback function
3256 * @return 0 on success, otherwise a negative error value.
3257 * @retval #BT_ERROR_NONE Successful
3258 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3259 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3260 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3262 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3263 * @see bt_avrcp_target_initialize()
3264 * @see bt_avrcp_control_initialize()
3265 * @see bt_avrcp_unset_shuffle_mode_changed_cb()
3267 int bt_avrcp_set_shuffle_mode_changed_cb(bt_avrcp_shuffle_mode_changed_cb callback, void *user_data);
3270 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3271 * @brief Unregisters a callback function that will be invoked when the shuffle mode is changed. (e.g., by a TV remote control or other input devices).
3272 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3273 * @return 0 on success, otherwise a negative error value.
3274 * @retval #BT_ERROR_NONE Successful
3275 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3276 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3278 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3279 * @see bt_avrcp_target_initialize()
3280 * @see bt_avrcp_control_initialize()
3281 * @see bt_avrcp_set_shuffle_mode_changed_cb()
3283 int bt_avrcp_unset_shuffle_mode_changed_cb(void);
3286 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3287 * @brief Registers a callback function that will be invoked when the scan mode is changed. (e.g., by a TV remote control or other input devices).
3288 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3289 * @param[in] callback The callback function to register
3290 * @param[in] user_data The user data to be passed to the callback function
3291 * @return 0 on success, otherwise a negative error value.
3292 * @retval #BT_ERROR_NONE Successful
3293 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3294 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3295 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3297 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3298 * @see bt_avrcp_target_initialize()
3299 * @see bt_avrcp_control_initialize()
3300 * @see bt_avrcp_unset_scan_mode_changed_cb()
3302 int bt_avrcp_set_scan_mode_changed_cb(bt_avrcp_scan_mode_changed_cb callback, void *user_data);
3305 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3306 * @brief Unregisters a callback function that will be invoked when the scan mode is changed. (e.g., by a TV remote control or other input devices).
3307 * @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
3308 * @return 0 on success, otherwise a negative error value.
3309 * @retval #BT_ERROR_NONE Successful
3310 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3311 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3313 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3314 * @see bt_avrcp_target_initialize()
3315 * @see bt_avrcp_control_initialize()
3316 * @see bt_avrcp_set_scan_mode_changed_cb()
3318 int bt_avrcp_unset_scan_mode_changed_cb(void);
3321 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3322 * @brief Registers a callback function that will be invoked when the song position is changed. (e.g., by a TV remote control or other input devices).
3324 * @param[in] callback The callback function to register
3325 * @param[in] user_data The user data to be passed to the callback function
3326 * @return 0 on success, otherwise a negative error value.
3327 * @retval #BT_ERROR_NONE Successful
3328 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3329 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3330 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3332 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3333 * @see bt_avrcp_target_initialize()
3334 * @see bt_avrcp_control_initialize()
3335 * @see bt_avrcp_unset_position_changed_cb()
3337 int bt_avrcp_set_position_changed_cb(bt_avrcp_position_changed_cb callback, void *user_data);
3340 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3341 * @brief Unregisters a callback function that will be invoked when the song position is changed. (e.g., by a TV remote control or other input devices).
3343 * @return 0 on success, otherwise a negative error value.
3344 * @retval #BT_ERROR_NONE Successful
3345 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3346 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3348 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3349 * @see bt_avrcp_target_initialize()
3350 * @see bt_avrcp_control_initialize()
3351 * @see bt_avrcp_set_position_changed_cb()
3353 int bt_avrcp_unset_position_changed_cb(void);
3356 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3357 * @brief Registers a callback function that will be invoked when the Play status is changed. (e.g., by a TV remote control or other input devices).
3359 * @param[in] callback The callback function to register
3360 * @param[in] user_data The user data to be passed to the callback function
3361 * @return 0 on success, otherwise a negative error value.
3362 * @retval #BT_ERROR_NONE Successful
3363 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3364 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3365 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3367 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3368 * @see bt_avrcp_target_initialize()
3369 * @see bt_avrcp_control_initialize()
3370 * @see bt_avrcp_unset_play_status_changed_cb()
3372 int bt_avrcp_set_play_status_changed_cb(bt_avrcp_play_status_changed_cb callback, void *user_data);
3375 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3376 * @brief Unregisters a callback function that will be invoked when the Play status is changed. (e.g., by a TV remote control or other input devices).
3378 * @return 0 on success, otherwise a negative error value.
3379 * @retval #BT_ERROR_NONE Successful
3380 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3381 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3383 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3384 * @see bt_avrcp_target_initialize()
3385 * @see bt_avrcp_control_initialize()
3386 * @see bt_avrcp_set_play_status_changed_cb()
3388 int bt_avrcp_unset_play_status_changed_cb(void);
3391 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3392 * @brief Registers a callback function that will be invoked when the track metadata is changed. (e.g., by a TV remote control or other input devices).
3394 * @param[in] callback The callback function to register
3395 * @param[in] user_data The user data to be passed to the callback function
3396 * @return 0 on success, otherwise a negative error value.
3397 * @retval #BT_ERROR_NONE Successful
3398 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3399 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3400 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3402 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3403 * @see bt_avrcp_target_initialize()
3404 * @see bt_avrcp_control_initialize()
3405 * @see bt_avrcp_unset_track_info_changed_cb()
3407 int bt_avrcp_set_track_info_changed_cb(bt_avrcp_track_info_changed_cb callback, void *user_data);
3410 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_MODULE
3411 * @brief Unregisters a callback function that will be invoked when the track metadata is changed. (e.g., by a TV remote control or other input devices).
3413 * @return 0 on success, otherwise a negative error value.
3414 * @retval #BT_ERROR_NONE Successful
3415 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3416 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3418 * @pre The AVRCP service must be initialized with bt_avrcp_target_initialize() or bt_avrcp_control_initialize().
3419 * @see bt_avrcp_target_initialize()
3420 * @see bt_avrcp_control_initialize()
3421 * @see bt_avrcp_set_track_info_changed_cb()
3423 int bt_avrcp_unset_track_info_changed_cb(void);
3426 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3427 * @brief Initializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) controller service.
3429 * @remarks This function must be called before any other AVRCP controller functions are called. \n
3430 * You must free all resources of the this service by calling bt_avrcp_control_deinitialize() \n
3431 * if Bluetooth AVRCP service is no longer needed.
3432 * @param[in] callback The callback function called when the connection state is changed
3433 * @param[in] user_data The user data to be passed to the callback function
3434 * @return 0 on success, otherwise a negative error value.
3435 * @retval #BT_ERROR_NONE Successful
3436 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3437 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3438 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3439 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3440 * @pre The Bluetooth service must be initialized with bt_initialize().
3441 * @see bt_initialize()
3442 * @see bt_avrcp_control_deinitialize()
3444 int bt_avrcp_control_initialize(bt_avrcp_control_connection_state_changed_cb callback, void *user_data);
3447 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3448 * @brief Deinitializes the Bluetooth AVRCP (Audio/Video Remote Control Profile) controller service.
3450 * @return 0 on success, otherwise a negative error value.
3451 * @retval #BT_ERROR_NONE Successful
3452 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3453 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3454 * @pre The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
3455 * @see bt_avrcp_control_initialize()
3457 int bt_avrcp_control_deinitialize(void);
3460 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3461 * @brief Connects the AVRCP (Audio/Video Remote Control Profile) target device.
3464 * @privilege %http://tizen.org/privilege/bluetooth
3465 * @param[in] remote_address The remote address
3466 * @return 0 on success, otherwise a negative error value.
3467 * @retval #BT_ERROR_NONE Successful
3468 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3469 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3470 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3471 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3472 * @pre The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
3473 * @see bt_avrcp_control_initialize()
3475 int bt_avrcp_control_connect(const char *remote_address);
3478 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3479 * @brief Disconnects from the AVRCP (Audio/Video Remote Control Profile) target device.
3482 * @privilege %http://tizen.org/privilege/bluetooth
3483 * @param[in] remote_address The remote address
3484 * @return 0 on success, otherwise a negative error value.
3485 * @retval #BT_ERROR_NONE Successful
3486 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3487 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3488 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3489 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3490 * @pre The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
3491 * @see bt_avrcp_control_initialize()
3492 * @see bt_avrcp_control_connect()
3494 int bt_avrcp_control_disconnect(const char *remote_address);
3497 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3498 * @brief Sends a command to the target device.
3501 * @privilege %http://tizen.org/privilege/bluetooth
3502 * @param[in] cmd The commands, one of: Play, Pause, Next, Rewind.
3503 * @return 0 on success, otherwise a negative error value.
3504 * @retval #BT_ERROR_NONE Successful
3505 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3506 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3507 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3508 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3509 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3510 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3511 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3512 * @pre The Bluetooth audio service must be initialized with bt_avrcp_control_initialize().
3513 * @see bt_avrcp_control_initialize()
3514 * @see bt_avrcp_control_connect()
3516 int bt_avrcp_control_send_player_command(bt_avrcp_player_command_e cmd);
3519 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3520 * @brief Sends the equalizer state change request to the remote device.
3523 * @privilege %http://tizen.org/privilege/bluetooth
3524 * @param[in] state The new equalizer state, one of: ON, OFF
3525 * @return 0 on success, otherwise a negative error value.
3526 * @retval #BT_ERROR_NONE Successful
3527 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3528 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3529 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3530 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3531 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3532 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3533 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3535 * @pre The remote device must be connected.
3536 * @see bt_avrcp_target_connection_state_changed_cb()
3537 * @see bt_avrcp_target_initialize()
3539 int bt_avrcp_control_set_equalizer_state(bt_avrcp_equalizer_state_e state);
3542 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3543 * @brief Gets the the equalizer state of the remote device.
3545 * @param[out] state The equalizer state, one of: ON, OFF
3546 * @return 0 on success, otherwise a negative error value.
3547 * @retval #BT_ERROR_NONE Successful
3548 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3549 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3550 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3551 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3552 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3553 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3555 * @pre The remote device must be connected.
3556 * @see bt_avrcp_target_connection_state_changed_cb()
3557 * @see bt_avrcp_target_initialize()
3559 int bt_avrcp_control_get_equalizer_state(bt_avrcp_equalizer_state_e *state);
3562 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3563 * @brief Sends the repeat change request to the remote device.
3566 * @privilege %http://tizen.org/privilege/bluetooth
3567 * @param[in] mode The new repeat mode, one of: OFF, SINGLE, ALL
3568 * @return 0 on success, otherwise a negative error value.
3569 * @retval #BT_ERROR_NONE Successful
3570 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3571 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3572 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3573 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3574 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3575 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3576 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3578 * @pre The remote device must be connected.
3579 * @see bt_avrcp_target_connection_state_changed_cb()
3580 * @see bt_avrcp_target_initialize()
3582 int bt_avrcp_control_set_repeat_mode(bt_avrcp_repeat_mode_e mode);
3585 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3586 * @brief Gets the repeat state of the remote device.
3588 * @param[out] mode The repeat mode, one of: OFF, SINGLE, ALL
3589 * @return 0 on success, otherwise a negative error value.
3590 * @retval #BT_ERROR_NONE Successful
3591 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3592 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3593 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3594 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3595 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3596 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3598 * @pre The remote device must be connected.
3599 * @see bt_avrcp_target_connection_state_changed_cb()
3600 * @see bt_avrcp_target_initialize()
3602 int bt_avrcp_control_get_repeat_mode(bt_avrcp_repeat_mode_e *mode);
3605 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3606 * @brief Sends the shuffle mode change request to the remote device.
3609 * @privilege %http://tizen.org/privilege/bluetooth
3610 * @param[in] mode The new shuffle mode, one of: OFF, GROUP, ALL
3611 * @return 0 on success, otherwise a negative error value.
3612 * @retval #BT_ERROR_NONE Successful
3613 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3614 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3615 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3616 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3617 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3618 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3619 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3621 * @pre The remote device must be connected.
3622 * @see bt_avrcp_target_connection_state_changed_cb()
3623 * @see bt_avrcp_target_initialize()
3625 int bt_avrcp_control_set_shuffle_mode(bt_avrcp_shuffle_mode_e mode);
3628 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3629 * @brief Gets the shuffle mode of the remote device.
3631 * @param[out] mode The shuffle mode, one of: OFF, GROUP, ALL
3632 * @return 0 on success, otherwise a negative error value.
3633 * @retval #BT_ERROR_NONE Successful
3634 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3635 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3636 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3637 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3638 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3639 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3641 * @pre The remote device must be connected.
3642 * @see bt_avrcp_target_connection_state_changed_cb()
3643 * @see bt_avrcp_target_initialize()
3645 int bt_avrcp_control_get_shuffle_mode(bt_avrcp_shuffle_mode_e *mode);
3648 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3649 * @brief Sends the scan mode change request to the remote device.
3652 * @privilege %http://tizen.org/privilege/bluetooth
3653 * @param[in] mode The new scan mode, one of: OFF, GROUP, ALL
3654 * @return 0 on success, otherwise a negative error value.
3655 * @retval #BT_ERROR_NONE Successful
3656 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3657 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3658 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3659 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3660 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3661 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3662 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3664 * @pre The remote device must be connected.
3665 * @see bt_avrcp_target_connection_state_changed_cb()
3666 * @see bt_avrcp_target_initialize()
3668 int bt_avrcp_control_set_scan_mode(bt_avrcp_scan_mode_e mode);
3671 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3672 * @brief Gets the scan mode of the remote device.
3674 * @param[out] mode The scan mode, one of: OFF, GROUP, ALL
3675 * @return 0 on success, otherwise a negative error value.
3676 * @retval #BT_ERROR_NONE Successful
3677 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3678 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3679 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3680 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3681 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3682 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3684 * @pre The remote device must be connected.
3685 * @see bt_avrcp_target_connection_state_changed_cb()
3686 * @see bt_avrcp_target_initialize()
3688 int bt_avrcp_control_get_scan_mode(bt_avrcp_scan_mode_e *mode);
3691 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3692 * @brief Gets the position of the song played by the remote device.
3694 * @param[out] position The position, in milliseconds
3695 * @return 0 on success, otherwise a negative error value.
3696 * @retval #BT_ERROR_NONE Successful
3697 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3698 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3699 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3700 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3701 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3702 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3704 * @pre The remote device must be connected.
3705 * @see bt_avrcp_target_connection_state_changed_cb()
3706 * @see bt_avrcp_target_initialize()
3708 int bt_avrcp_control_get_position(unsigned int *position);
3711 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3712 * @brief Gets the play status of the remote device.
3714 * @param[out] status The play status, one of: PLAYING, STOPPED...
3715 * @return 0 on success, otherwise a negative error value.
3716 * @retval #BT_ERROR_NONE Successful
3717 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3718 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3719 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3720 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3721 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3722 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3724 * @pre The remote device must be connected.
3725 * @see bt_avrcp_target_connection_state_changed_cb()
3726 * @see bt_avrcp_target_initialize()
3728 int bt_avrcp_control_get_play_status(bt_avrcp_player_state_e *status);
3731 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3732 * @brief Gets the metadata of the track played by the remote device.
3734 * @remarks The @a track must be released using bt_avrcp_control_free_track_info().
3735 * @param[out] track The track metadata.
3736 * @return 0 on success, otherwise a negative error value.
3737 * @retval #BT_ERROR_NONE Successful
3738 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3739 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3740 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3741 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3742 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3743 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3745 * @pre The remote device must be connected.
3746 * @see bt_avrcp_target_connection_state_changed_cb()
3747 * @see bt_avrcp_target_initialize()
3749 int bt_avrcp_control_get_track_info(bt_avrcp_metadata_attributes_info_s **track);
3752 * @ingroup CAPI_NETWORK_BLUETOOTH_AVRCP_CONTROL_MODULE
3753 * @brief Frees the track metadata.
3755 * @param[in] track The track metadata.
3756 * @return 0 on success, otherwise a negative error value.
3757 * @retval #BT_ERROR_NONE Successful
3758 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3759 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3760 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3761 * @pre track should point to valid metadata address.
3762 * @see bt_avrcp_control_get_track_info()
3763 * @see bt_avrcp_target_initialize()
3765 int bt_avrcp_control_free_track_info(bt_avrcp_metadata_attributes_info_s *track);
3768 * @deprecated Deprecated since 5.0.
3769 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3770 * @brief Registers an application that acts as the Sink role of HDP (Health Device Profile).
3771 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3773 * @privilege %http://tizen.org/privilege/bluetooth
3774 * @remarks The @a app_id must be released with free() by you. \n
3775 * Deprecated, because of no usecase and supported devices.
3776 * @param[in] data_type The data type of MDEP. This value is defined in ISO/IEEE 11073-20601 spec.
3777 * For example, pulse oximeter is 0x1004 and blood pressure monitor is 0x1007.
3778 * @param[out] app_id The ID of application
3779 * @return 0 on success, otherwise a negative error value.
3780 * @retval #BT_ERROR_NONE Successful
3781 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3782 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3783 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
3784 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3785 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3786 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3788 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
3789 * @see bt_hdp_unregister_sink_app()
3791 int bt_hdp_register_sink_app(unsigned short data_type, char **app_id) TIZEN_DEPRECATED_API;
3794 * @deprecated Deprecated since 5.0.
3795 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3796 * @brief Unregisters the given application that acts as the Sink role of HDP (Health Device Profile).
3797 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3799 * @privilege %http://tizen.org/privilege/bluetooth
3800 * @remarks Deprecated, because of no usecase and supported devices.
3801 * @param[in] app_id The ID of application
3802 * @return 0 on success, otherwise a negative error value.
3803 * @retval #BT_ERROR_NONE Successful
3804 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3805 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3806 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3807 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3808 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3809 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3811 * @see bt_hdp_register_sink_app()
3813 int bt_hdp_unregister_sink_app(const char *app_id) TIZEN_DEPRECATED_API;
3816 * @deprecated Deprecated since 5.0.
3817 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3818 * @brief Connects the remote device which acts as Source role, asynchronously.
3819 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3821 * @privilege %http://tizen.org/privilege/bluetooth
3822 * @remarks Deprecated, because of no usecase and supported devices.
3823 * @param[in] remote_address The remote address
3824 * @param[in] app_id The ID of application
3825 * @return 0 on success, otherwise a negative error value.
3826 * @retval #BT_ERROR_NONE Successful
3827 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3828 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3829 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3830 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
3831 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3832 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3833 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3835 * @pre The Sink role of HDP must be registered with bt_hdp_register_sink_app().
3836 * @pre The local device must be bonded with the remote device by bt_device_create_bond().
3837 * @post bt_hdp_connected_cb() will be invoked.
3838 * @see bt_hdp_disconnect()
3839 * @see bt_hdp_set_connection_state_changed_cb()
3840 * @see bt_hdp_unset_connection_state_changed_cb()
3842 int bt_hdp_connect_to_source(const char *remote_address, const char *app_id) TIZEN_DEPRECATED_API;
3845 * @deprecated Deprecated since 5.0.
3846 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3847 * @brief Disconnects the remote device, asynchronously.
3848 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3850 * @privilege %http://tizen.org/privilege/bluetooth
3851 * @remarks Deprecated, because of no usecase and supported devices.
3852 * @param[in] remote_address The remote address
3853 * @param[in] channel The connected data channel
3854 * @return 0 on success, otherwise a negative error value.
3855 * @retval #BT_ERROR_NONE Successful
3856 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3857 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3858 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3859 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
3860 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
3861 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3862 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3863 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3865 * @pre The remote device must be connected.
3866 * @post bt_hdp_disconnected_cb() will be invoked.
3867 * @see bt_hdp_set_connection_state_changed_cb()
3868 * @see bt_hdp_unset_connection_state_changed_cb()
3870 int bt_hdp_disconnect(const char *remote_address, unsigned int channel) TIZEN_DEPRECATED_API;
3873 * @deprecated Deprecated since 5.0.
3874 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3875 * @brief Sends the data to the remote device.
3876 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3878 * @privilege %http://tizen.org/privilege/bluetooth
3879 * @remarks Deprecated, because of no usecase and supported devices.
3880 * @param[in] channel The connected data channel
3881 * @param[in] data The data to send
3882 * @param[in] size The size of data to send (byte)
3883 * @return 0 on success, otherwise a negative error value.
3884 * @retval #BT_ERROR_NONE Successful
3885 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3886 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3887 * @retval #BT_ERROR_NOT_ENABLED Not enabled
3888 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
3889 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
3890 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3892 * @pre The remote device must be connected.
3893 * @see bt_hdp_data_received_cb()
3894 * @see bt_hdp_set_data_received_cb()
3895 * @see bt_hdp_unset_data_received_cb()
3897 int bt_hdp_send_data(unsigned int channel, const char *data, unsigned int size) TIZEN_DEPRECATED_API;
3900 * @deprecated Deprecated since 5.0.
3901 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3902 * @brief Registers a callback function that will be invoked when the connection state is changed.
3903 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3904 * @remarks Deprecated, because of no usecase and supported devices.
3905 * @param[in] connected_cb The callback function called when a connection is established
3906 * @param[in] disconnected_cb The callback function called when a connection is disconnected
3907 * @param[in] user_data The user data to be passed to the callback function
3908 * @return 0 on success, otherwise a negative error value.
3909 * @retval #BT_ERROR_NONE Successful
3910 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3911 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3912 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3914 * @pre The Bluetooth service must be initialized with bt_initialize().
3915 * @see bt_hdp_unset_connection_state_changed_cb()
3917 int bt_hdp_set_connection_state_changed_cb(bt_hdp_connected_cb connected_cb, bt_hdp_disconnected_cb disconnected_cb, void *user_data) TIZEN_DEPRECATED_API;
3920 * @deprecated Deprecated since 5.0.
3921 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3922 * @brief Unregisters a callback function that will be invoked when the connection state is changed.
3923 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3924 * @remarks Deprecated, because of no usecase and supported devices.
3925 * @return 0 on success, otherwise a negative error value.
3926 * @retval #BT_ERROR_NONE Successful
3927 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3928 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3930 * @pre The Bluetooth service must be initialized with bt_initialize().
3931 * @see bt_hdp_set_connection_state_changed_cb()
3933 int bt_hdp_unset_connection_state_changed_cb(void) TIZEN_DEPRECATED_API;
3936 * @deprecated Deprecated since 5.0.
3937 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3938 * @brief Registers a callback function that will be invoked when you receive the data.
3939 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3940 * @remarks Deprecated, because of no usecase and supported devices.
3941 * @param[in] callback The callback function to register
3942 * @param[in] user_data The user data to be passed to the callback function
3943 * @return 0 on success, otherwise a negative error value.
3944 * @retval #BT_ERROR_NONE Successful
3945 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3946 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3947 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3949 * @pre The Bluetooth service must be initialized with bt_initialize().
3950 * @see bt_hdp_unset_data_received_cb()
3952 int bt_hdp_set_data_received_cb(bt_hdp_data_received_cb callback, void *user_data) TIZEN_DEPRECATED_API;
3955 * @deprecated Deprecated since 5.0.
3956 * @ingroup CAPI_NETWORK_BLUETOOTH_HDP_MODULE
3957 * @brief Unregisters a callback function that will be invoked when you receive the data.
3958 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
3959 * @remarks Deprecated, because of no usecase and supported devices.
3960 * @return 0 on success, otherwise a negative error value.
3961 * @retval #BT_ERROR_NONE Successful
3962 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
3963 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3965 * @pre The Bluetooth service must be initialized with bt_initialize().
3966 * @see bt_hdp_set_data_received_cb()
3968 int bt_hdp_unset_data_received_cb(void) TIZEN_DEPRECATED_API;
3971 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3972 * @brief Gets the value of a characteristic or descriptor's GATT handle.
3973 * @since_tizen 2.3.1
3975 * @remarks @a value must be released using free(). \n
3976 * When @a gatt_handle is associated with bt_gatt_client_h, bt_gatt_client_read_value() must be used prior to this function \n
3977 * in order to get the remote device's current value.
3979 * @param[in] gatt_handle The handle of a characteristic or descriptor
3980 * @param[out] value The value of @a gatt_handle. It is a byte stream type.
3981 * @param[out] value_length The length of @a value
3982 * @return 0 on success, otherwise a negative error value
3983 * @retval #BT_ERROR_NONE Successful
3984 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
3985 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
3987 int bt_gatt_get_value(bt_gatt_h gatt_handle, char **value, int *value_length);
3990 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
3991 * @brief Gets the value of a characteristic or descriptor's GATT handle as an integer type.
3992 * @since_tizen 2.3.1
3994 * @remarks This function returns a locally saved value in @a gatt_handle. \n
3995 * When @a gatt_handle is associated with bt_gatt_client_h, bt_gatt_client_read_value() must be used prior to this function \n
3996 * in order to get the remote device's current value.
3998 * @param[in] gatt_handle The handle of a characteristic or descriptor
3999 * @param[in] type The type of a saved value in @a gatt_handle
4000 * @param[in] offset The offset from where a value will be read from @a gatt_handle as an integer type
4001 * @param[out] value The integer type's value of @a gatt_handle
4002 * @return 0 on success, otherwise a negative error value
4003 * @retval #BT_ERROR_NONE Successful
4004 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4005 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4007 int bt_gatt_get_int_value(bt_gatt_h gatt_handle, bt_data_type_int_e type,
4008 int offset, int *value);
4011 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4012 * @brief Gets the value of a characteristic or descriptor's GATT handle as a float type.
4013 * @since_tizen 2.3.1
4015 * @remarks This function returns a locally saved value in @a gatt_handle. \n
4016 * When @a gatt_handle is associated with bt_gatt_client_h, bt_gatt_client_read_value() must be used prior to this function \n
4017 * in order to get the remote device's current value.
4019 * @param[in] gatt_handle The handle of a characteristic or descriptor
4020 * @param[in] type The type of a saved value in @a gatt_handle
4021 * @param[in] offset The offset from where a value will be read from @a gatt_handle as an integer type
4022 * @param[out] value The float type's value of @a gatt_handle
4023 * @return 0 on success, otherwise a negative error value
4024 * @retval #BT_ERROR_NONE Successful
4025 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4026 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4028 int bt_gatt_get_float_value(bt_gatt_h gatt_handle, bt_data_type_float_e type,
4029 int offset, float *value);
4032 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4033 * @brief Updates the value of a characteristic or descriptor's GATT handle.
4034 * @since_tizen 2.3.1
4036 * @remarks This function updates a value of @a gatt_handle locally. \n
4037 * When @a gatt_handle is associated with bt_gatt_client_h, bt_gatt_client_write_value() can be used after this function \n
4038 * in order to update the remote device's value. \n
4040 * @param[in] gatt_handle The handle of a characteristic or descriptor
4041 * @param[in] value The value to be updated
4042 * @param[in] value_length The length of @a value
4043 * @return 0 on success, otherwise a negative error value
4044 * @retval #BT_ERROR_NONE Successful
4045 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4046 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4047 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4049 int bt_gatt_set_value(bt_gatt_h gatt_handle, const char *value, int value_length);
4052 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4053 * @brief Updates the value of a characteristic or descriptor's GATT handle using a integer type's value.
4054 * @since_tizen 2.3.1
4056 * @remarks This function updates a value of @a gatt_handle locally. \n
4057 * When @a gatt_handle is associated with bt_gatt_client_h, bt_gatt_client_write_value() can be used after this function \n
4058 * in order to update the remote device's value.
4060 * @param[in] gatt_handle The handle of a characteristic or descriptor
4061 * @param[in] type @a value will be saved in @a gatt_handle as this type
4062 * @param[in] value The integer type's value to be updated
4063 * @param[in] offset The offset from where @a value will be saved in @a gatt_handle
4064 * @return 0 on success, otherwise a negative error value
4065 * @retval #BT_ERROR_NONE Successful
4066 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4067 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4068 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4070 int bt_gatt_set_int_value(bt_gatt_h gatt_handle, bt_data_type_int_e type,
4071 int value, int offset);
4074 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4075 * @brief Updates the value of a characteristic or descriptor's GATT handle using a float type's value.
4076 * @since_tizen 2.3.1
4078 * @remarks This function updates a value of @a gatt_handle locally. \n
4079 * When @a gatt_handle is associated with bt_gatt_client_h, bt_gatt_client_write_value() can be used after this function \n
4080 * in order to update the remote device's value.
4082 * @param[in] gatt_handle The handle of a characteristic or descriptor
4083 * @param[in] type @a mantissa and @a exponent will be saved in @a gatt_handle as this type
4084 * @param[in] mantissa The mantissa of float type's value to be updated
4085 * @param[in] exponent The exponent of float type's value to be updated
4086 * @param[in] offset The offset from where @a mantissa and @a exponent will be saved in @a gatt_handle
4087 * @return 0 on success, otherwise a negative error value
4088 * @retval #BT_ERROR_NONE Successful
4089 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4090 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4091 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4093 int bt_gatt_set_float_value(bt_gatt_h gatt_handle, bt_data_type_float_e type,
4094 int mantissa, int exponent, int offset);
4097 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4098 * @brief Gets the UUID of a service, characteristic or descriptor's GATT handle.
4099 * @since_tizen 2.3.1
4101 * @remarks @a uuid must be released using free(). \n
4102 * 16-bit UUID or 128-bit UUID is supported. (e.g. 2A19, 00002A19-0000-1000-8000-00805F9B34FB).
4104 * @param[in] gatt_handle The handle of a service, characteristic or descriptor
4105 * @param[out] uuid The string of the UUID of @a gatt_handle
4106 * @return 0 on success, otherwise a negative error value
4107 * @retval #BT_ERROR_NONE Successful
4108 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4109 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4111 int bt_gatt_get_uuid(bt_gatt_h gatt_handle, char **uuid);
4114 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4115 * @brief Gets the type of GATT handle.
4116 * @since_tizen 2.3.1
4118 * @param[in] gatt_handle The GATT handle
4119 * @param[out] gatt_type The type of @a gatt_handle
4120 * @return 0 on success, otherwise a negative error value
4121 * @retval #BT_ERROR_NONE Successful
4122 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4123 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4125 int bt_gatt_get_type(bt_gatt_h gatt_handle, bt_gatt_type_e *gatt_type);
4128 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4129 * @brief Gets the GATT client handle which the specified service belongs to.
4130 * @since_tizen 2.3.1
4132 * @remarks This function doesn't allocate new memory for GATT client handle. \n
4133 * The returned GATT client handle is the same one which was got from bt_gatt_client_create(). \n
4134 * So if it is destroyed by bt_gatt_client_destroy(), all related GATT handles are freed also.
4136 * @param[in] service The service's GATT handle
4137 * @param[out] client The GATT client handle which @a service belongs to
4138 * @return 0 on success, otherwise a negative error value
4139 * @retval #BT_ERROR_NONE Successful
4140 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4141 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4143 * @see bt_gatt_client_create()
4145 int bt_gatt_service_get_client(bt_gatt_h service, bt_gatt_client_h *client);
4148 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4149 * @brief Gets a characteristic's GATT handle which has specific UUID.
4150 * @since_tizen 2.3.1
4152 * @remarks The returned GATT handle must not be freed by application. \n
4153 * It will be freed when an associated client is destroyed by bt_gatt_client_destroy(). \n
4154 * If there are multiple characteristics which have same UUID, only the first matched one will be returned.
4156 * @param[in] service The service's GATT handle
4157 * @param[in] uuid The characteristic's GATT handle which has this UUID will be returned if it exists
4158 * @param[out] characteristic The characteristic's GATT handle which has @a uuid if it exists
4159 * @return 0 on success, otherwise a negative error value
4160 * @retval #BT_ERROR_NONE Successful
4161 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4162 * @retval #BT_ERROR_NO_DATA No data available
4163 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4165 int bt_gatt_service_get_characteristic(bt_gatt_h service, const char *uuid,
4166 bt_gatt_h *characteristic);
4169 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4170 * @brief Invokes @a callback function on each characteristic that belongs to the specified service.
4171 * @since_tizen 2.3.1
4173 * @param[in] service The service's GATT handle
4174 * @param[in] callback The function to be invoked on each characteristic
4175 * @param[in] user_data The user data to be passed to @a callback function
4176 * @return 0 on success, otherwise a negative error value
4177 * @retval #BT_ERROR_NONE Successful
4178 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4179 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4181 * @see bt_gatt_foreach_cb()
4183 int bt_gatt_service_foreach_characteristics(bt_gatt_h service,
4184 bt_gatt_foreach_cb callback, void *user_data);
4187 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4188 * @brief Gets an included service's GATT handle which has specific UUID.
4189 * @since_tizen 2.3.1
4191 * @remarks The returned GATT handle must not be freed by application. \n
4192 * It will be freed when an associated client is destroyed by bt_gatt_client_destroy(). \n
4193 * If there are multiple included services which have same UUID, only the first matched one will be returned.
4195 * @param[in] service The service's GATT handle
4196 * @param[in] uuid The included service's GATT handle which has this UUID will be returned if it exists
4197 * @param[out] included_service The included service's GATT handle which has @a uuid if it exists
4198 * @return 0 on success, otherwise a negative error value
4199 * @retval #BT_ERROR_NONE Successful
4200 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4201 * @retval #BT_ERROR_NO_DATA No data available
4202 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4204 int bt_gatt_service_get_included_service(bt_gatt_h service, const char *uuid,
4205 bt_gatt_h *included_service);
4208 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4209 * @brief Invokes @a callback function on each included service that belongs to the specified service.
4210 * @since_tizen 2.3.1
4212 * @param[in] service The service's GATT handle
4213 * @param[in] callback The function to be invoked on each included service
4214 * @param[in] user_data The user data to be passed to the callback function
4215 * @return 0 on success, otherwise a negative error value
4216 * @retval #BT_ERROR_NONE Successful
4217 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4218 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4220 * @see bt_gatt_foreach_cb()
4222 int bt_gatt_service_foreach_included_services(bt_gatt_h service,
4223 bt_gatt_foreach_cb callback, void *user_data);
4226 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4227 * @brief Gets the service's GATT handle which the specified characteristic belongs to.
4228 * @since_tizen 2.3.1
4230 * @remarks The returned GATT handle must not be freed by application. \n
4231 * It will be freed when an associated client is destroyed by bt_gatt_client_destroy().
4233 * @param[in] characteristic The characteristic's GATT handle
4234 * @param[out] service The service's GATT handle which @a characteristic belongs to
4235 * @return 0 on success, otherwise a negative error value
4236 * @retval #BT_ERROR_NONE Successful
4237 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4238 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4240 int bt_gatt_characteristic_get_service(bt_gatt_h characteristic, bt_gatt_h *service);
4243 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4244 * @brief Gets the properties which a characteristic's GATT handle has.
4245 * @since_tizen 2.3.1
4247 * @param[in] characteristic The characteristic's GATT handle
4248 * @param[out] properties The properties which a characteristic's GATT handle has
4249 * @return 0 on success, otherwise a negative error value
4250 * @retval #BT_ERROR_NONE Successful
4251 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4252 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4254 * @see bt_gatt_property_e
4256 int bt_gatt_characteristic_get_properties(bt_gatt_h characteristic, int *properties);
4259 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4260 * @brief Gets the write type of the specified characteristic.
4261 * @since_tizen 2.3.1
4263 * @param[in] characteristic The characteristic's GATT handle
4264 * @param[out] write_type The write type of the specified characteristic
4265 * @return 0 on success, otherwise a negative error value
4266 * @retval #BT_ERROR_NONE Successful
4267 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4268 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4270 * @see bt_gatt_write_type_e
4272 int bt_gatt_characteristic_get_write_type(bt_gatt_h characteristic,
4273 bt_gatt_write_type_e *write_type);
4276 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4277 * @brief Updates the write type of the specified characteristic.
4278 * @since_tizen 2.3.1
4280 * @param[in] characteristic The characteristic's GATT handle
4281 * @param[in] write_type The write type to be updated
4282 * @return 0 on success, otherwise a negative error value
4283 * @retval #BT_ERROR_NONE Successful
4284 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4285 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4287 * @see bt_gatt_client_write_value()
4288 * @see bt_gatt_write_type_e
4290 int bt_gatt_characteristic_set_write_type(bt_gatt_h characteristic,
4291 bt_gatt_write_type_e write_type);
4294 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4295 * @brief Gets a descriptor's GATT handle which has specific UUID.
4296 * @since_tizen 2.3.1
4298 * @remarks The returned GATT handle must not be freed by application. \n
4299 * It will be freed when an associated client is destroyed by bt_gatt_client_destroy(). \n
4300 * If there are multiple descriptors which have same UUID, only the first matched one will be returned.
4302 * @param[in] characteristic The characteristic's GATT handle
4303 * @param[in] uuid The descriptor's GATT handle which has this UUID will be returned if it exists
4304 * @param[out] descriptor The descriptor's GATT handle which has @a uuid if it exists
4305 * @return 0 on success, otherwise a negative error value
4306 * @retval #BT_ERROR_NONE Successful
4307 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4308 * @retval #BT_ERROR_NO_DATA No data available
4309 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4311 int bt_gatt_characteristic_get_descriptor(bt_gatt_h characteristic, const char *uuid,
4312 bt_gatt_h *descriptor);
4315 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4316 * @brief Invokes @a callback function on each descriptor that belongs to the specified characteristic.
4317 * @since_tizen 2.3.1
4319 * @param[in] characteristic The characteristic's GATT handle
4320 * @param[in] callback The function to be invoked on each descriptor
4321 * @param[in] user_data The user data to be passed to @a callback function
4322 * @return 0 on success, otherwise a negative error value
4323 * @retval #BT_ERROR_NONE Successful
4324 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4325 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4327 * @see bt_gatt_foreach_cb()
4329 int bt_gatt_characteristic_foreach_descriptors(bt_gatt_h characteristic,
4330 bt_gatt_foreach_cb callback, void *user_data);
4333 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4334 * @brief Gets the characteristic's GATT handle which the specified descriptor belongs to.
4335 * @since_tizen 2.3.1
4337 * @remarks The returned GATT handle must not be freed by application. \n
4338 * It will be freed when an associated client is destroyed by bt_gatt_client_destroy().
4340 * @param[in] descriptor The descriptor's GATT handle
4341 * @param[out] characteristic The characteristic's GATT handle which @a descriptor belongs to
4342 * @return 0 on success, otherwise a negative error value
4343 * @retval #BT_ERROR_NONE Successful
4344 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4345 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4347 int bt_gatt_descriptor_get_characteristic(bt_gatt_h descriptor, bt_gatt_h *characteristic);
4350 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4351 * @brief Creates the GATT client handle.
4352 * @since_tizen 2.3.1
4354 * @remarks The GATT client handle must be freed by bt_gatt_client_destroy() after use.
4356 * @param[in] remote_address The address of the remote device
4357 * @param[out] client The created GATT client's handle
4358 * @return 0 on success, otherwise a negative error value
4359 * @retval #BT_ERROR_NONE Successful
4360 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4361 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
4362 * @retval #BT_ERROR_ALREADY_DONE Operation is already done
4363 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4365 * @see bt_gatt_client_destroy()
4367 int bt_gatt_client_create(const char *remote_address, bt_gatt_client_h *client);
4370 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4371 * @brief Destroys the GATT client's handle.
4372 * @since_tizen 2.3.1
4374 * @remarks All related service, characteristic and descriptor's GATT handles are freed also.
4376 * @param[in] client The GATT client's handle
4377 * @return 0 on success, otherwise a negative error value
4378 * @retval #BT_ERROR_NONE Successful
4379 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4380 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4382 * @see bt_gatt_client_create()
4384 int bt_gatt_client_destroy(bt_gatt_client_h client);
4387 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4388 * @brief Gets the address of remote device.
4389 * @since_tizen 2.3.1
4391 * @param[in] client The created GATT client's handle
4392 * @param[out] remote_address The address of the remote device which is associated with @a client
4393 * @return 0 on success, otherwise a negative error value
4394 * @retval #BT_ERROR_NONE Successful
4395 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4396 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4398 * @see bt_gatt_client_create()
4400 int bt_gatt_client_get_remote_address(bt_gatt_client_h client,
4401 char **remote_address);
4404 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4405 * @brief Reads the value of a characteristic or descriptor from the remote device asynchronously.
4406 * @since_tizen 2.3.1
4408 * @privilege %http://tizen.org/privilege/bluetooth
4410 * @param[in] gatt_handle The GATT handle of a characteristic or descriptor
4411 * @param[in] callback When a read request is completed, this callback function will be called
4412 * @param[in] user_data The user data to be passed to @a callback function
4413 * @return 0 on success, otherwise a negative error value
4414 * @retval #BT_ERROR_NONE Successful
4415 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4416 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4417 * @retval #BT_ERROR_NOT_ENABLED Not enabled
4418 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4419 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation now in progress
4420 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4421 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4423 * @see bt_gatt_client_create()
4424 * @see bt_gatt_client_request_completed_cb()
4426 int bt_gatt_client_read_value(bt_gatt_h gatt_handle,
4427 bt_gatt_client_request_completed_cb callback, void *user_data);
4430 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4431 * @brief Writes the value of a characteristic or descriptor to the remote device asynchronously.
4432 * @since_tizen 2.3.1
4434 * @privilege %http://tizen.org/privilege/bluetooth
4436 * @param[in] gatt_handle The GATT handle of a characteristic or descriptor
4437 * @param[in] callback When a write request is completed, this callback function will be called
4438 * @param[in] user_data The user data to be passed to @a callback function
4439 * @return 0 on success, otherwise a negative error value
4440 * @retval #BT_ERROR_NONE Successful
4441 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4442 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4443 * @retval #BT_ERROR_NOT_ENABLED Not enabled
4444 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4445 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation now in progress
4446 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4447 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4449 * @see bt_gatt_client_create()
4450 * @see bt_gatt_characteristic_set_write_type()
4451 * @see bt_gatt_set_value()
4452 * @see bt_gatt_set_int_value()
4453 * @see bt_gatt_set_float_value()
4454 * @see bt_gatt_client_request_completed_cb()
4456 int bt_gatt_client_write_value(bt_gatt_h gatt_handle,
4457 bt_gatt_client_request_completed_cb callback, void *user_data);
4460 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4461 * @brief Requests a change of the ATT MTU value.
4464 * @privilege %http://tizen.org/privilege/bluetooth
4466 * @param[in] client The created GATT client's handle
4467 * @param[in] mtu The new MTU value
4469 * @return 0 on success, otherwise a negative error value.
4470 * @retval #BT_ERROR_NONE Successful
4471 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4472 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4473 * @retval #BT_ERROR_NOT_ENABLED Not enabled
4474 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4475 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4476 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4477 * @see bt_gatt_client_set_att_mtu_changed_cb()
4479 int bt_gatt_client_request_att_mtu_change(bt_gatt_client_h client, unsigned int mtu);
4482 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4483 * @brief Gets the ATT MTU value set for a connection.
4486 * @param[in] client The created GATT client's handle
4487 * @param[out] mtu The MTU value set for a connection
4489 * @return 0 on success, otherwise a negative error value.
4490 * @retval #BT_ERROR_NONE Successful
4491 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4492 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4493 * @retval #BT_ERROR_NOT_ENABLED Not enabled
4494 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4495 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4496 * @retval #BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected
4498 int bt_gatt_client_get_att_mtu(bt_gatt_client_h client, unsigned int *mtu);
4501 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4502 * @brief Registers a callback function to be invoked when the ATT MTU is changed.
4504 * @param[in] client The created GATT client's handle
4505 * @param[in] callback The callback function to register
4506 * @param[in] user_data The user data to be passed to the callback function
4507 * @return 0 on success, otherwise a negative error value.
4508 * @retval #BT_ERROR_NONE Successful
4509 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4510 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4511 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4513 * @pre The Bluetooth service must be initialized with bt_initialize().
4514 * @post bt_device_connection_state_changed_cb() will be invoked.
4515 * @see bt_initialize()
4516 * @see bt_gatt_client_request_att_mtu_change()
4517 * @see bt_gatt_client_unset_att_mtu_changed_cb()
4519 int bt_gatt_client_set_att_mtu_changed_cb(bt_gatt_client_h client, bt_gatt_client_att_mtu_changed_cb callback, void *user_data);
4522 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4523 * @brief Unregisters the callback function to be invoked when the ATT MTU is changed.
4525 * @param[in] client The created GATT client's handle
4526 * @return 0 on success, otherwise a negative error value.
4527 * @retval #BT_ERROR_NONE Successful
4528 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4529 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4530 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4532 * @pre The Bluetooth service must be initialized with bt_initialize().
4533 * @see bt_initialize()
4534 * @see bt_gatt_client_request_att_mtu_change()
4535 * @see bt_gatt_client_set_att_mtu_changed_cb()
4537 int bt_gatt_client_unset_att_mtu_changed_cb(bt_gatt_client_h client);
4540 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4541 * @brief Registers a callback function to be invoked when the characteristic value is changed on the remote device.
4542 * @since_tizen 2.3.1
4544 * @param[in] characteristic The characteristic's GATT handle
4545 * @param[in] callback The callback to be invoked when the value is changed and it is informed
4546 * @param[in] user_data The user data to be passed to @a callback function
4547 * @return 0 on success, otherwise a negative error value
4548 * @retval #BT_ERROR_NONE Successful
4549 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4550 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4551 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4553 * @see bt_gatt_client_characteristic_value_changed_cb()
4554 * @see bt_gatt_client_unset_characteristic_value_changed_cb()
4556 int bt_gatt_client_set_characteristic_value_changed_cb(bt_gatt_h characteristic,
4557 bt_gatt_client_characteristic_value_changed_cb callback,
4561 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4562 * @brief Unregisters a callback function to be invoked when the characteristic value is changed on the remote device.
4563 * @since_tizen 2.3.1
4565 * @param[in] characteristic The characteristic's GATT handle, whose value change will not be informed
4566 * @return 0 on success, otherwise a negative error value
4567 * @retval #BT_ERROR_NONE Successful
4568 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4569 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4570 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4572 * @see bt_gatt_client_set_characteristic_value_changed_cb()
4574 int bt_gatt_client_unset_characteristic_value_changed_cb(bt_gatt_h characteristic);
4577 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4578 * @brief Gets a service's GATT handle which has specific UUID.
4579 * @since_tizen 2.3.1
4581 * @remarks The returned GATT handle must not be freed by application. \n
4582 * It will be freed when an associated client is destroyed by bt_gatt_client_destroy(). \n
4583 * If there are multiple services which have same UUID, only the first matched one will be returned.
4585 * @param[in] client The GATT client's handle
4586 * @param[in] uuid The service's GATT handle which has this UUID will be returned if it exists
4587 * @param[out] service The service's GATT handle which has @a uuid if it exists
4588 * @return 0 on success, otherwise a negative error value
4589 * @retval #BT_ERROR_NONE Successful
4590 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4591 * @retval #BT_ERROR_NO_DATA No data available
4592 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4594 int bt_gatt_client_get_service(bt_gatt_client_h client, const char *uuid,
4595 bt_gatt_h *service);
4598 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4599 * @brief Invokes @a callback function on each service that belongs to the specified GATT client.
4600 * @since_tizen 2.3.1
4602 * @param[in] client The GATT client's handle
4603 * @param[in] callback The function to be invoked on each service
4604 * @param[in] user_data The user data to be passed to @a callback function
4605 * @return 0 on success, otherwise a negative error value
4606 * @retval #BT_ERROR_NONE Successful
4607 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4608 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4610 * @see bt_gatt_foreach_cb()
4612 int bt_gatt_client_foreach_services(bt_gatt_client_h client,
4613 bt_gatt_foreach_cb callback, void *user_data);
4616 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4617 * @brief Registers a callback function to be invoked when service is changed from a remote device(GATT server).
4620 * @param[in] client The GATT client's handle
4621 * @param[in] callback The callback to be invoked
4622 * @param[in] user_data The user data to be passed to @a callback function
4623 * @return 0 on success, otherwise a negative error value
4624 * @retval #BT_ERROR_NONE Successful
4625 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4626 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4628 * @see bt_gatt_client_unset_service_changed_cb()
4630 int bt_gatt_client_set_service_changed_cb(bt_gatt_client_h client,
4631 bt_gatt_client_service_changed_cb callback, void *user_data);
4634 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4635 * @brief Unregisters a callback function.
4638 * @param[in] client The GATT client's handle
4639 * @return 0 on success, otherwise a negative error value
4640 * @retval #BT_ERROR_NONE Successful
4641 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4642 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4644 * @see bt_gatt_client_set_service_changed_cb()
4646 int bt_gatt_client_unset_service_changed_cb(bt_gatt_client_h client);
4649 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4650 * @brief Connects to a specific LE based service on a remote bluetooth device address, asynchronously.
4651 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
4653 * @privilege %http://tizen.org/privilege/bluetooth
4655 * @remarks A connection can be disconnected by bt_gatt_disconnect().
4657 * @param[in] address The address of the remote Bluetooth device.
4658 * @param[in] auto_connect The flag of the auto connection.
4660 * @return 0 on success, otherwise a negative error value.
4661 * @retval #BT_ERROR_NONE Successful
4662 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4663 * @retval #BT_ERROR_NOT_ENABLED Not enabled
4664 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4665 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4666 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4667 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4669 * @pre The Bluetooth service must be initialized with bt_initialize().
4670 * @pre The remote device must support le connection.
4671 * @post This function invokes bt_gatt_connection_state_changed_cb().
4673 * @see bt_initialize()
4674 * @see bt_gatt_disconnect()
4675 * @see bt_gatt_set_connection_state_changed_cb()
4676 * @see bt_gatt_unset_connection_state_changed_cb()
4677 * @see bt_gatt_connection_state_changed_cb()
4679 int bt_gatt_connect(const char *address, bool auto_connect);
4682 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_CLIENT_MODULE
4683 * @brief Disconnects to LE connection with the given remote Bluetooth device address, asynchronously or cancels a LE connection attempt currently in progress.
4684 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
4686 * @privilege %http://tizen.org/privilege/bluetooth
4688 * @param[in] address The address of the remote Bluetooth device
4690 * @return 0 on success, otherwise a negative error value.
4691 * @retval #BT_ERROR_NONE Successful
4692 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4693 * @retval #BT_ERROR_NOT_ENABLED Not enabled
4694 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4695 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4696 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
4697 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4699 * @post This function invokes bt_gatt_connection_state_changed_cb().
4701 * @see bt_initialize()
4702 * @see bt_gatt_connect()
4703 * @see bt_gatt_set_connection_state_changed_cb()
4704 * @see bt_gatt_unset_connection_state_changed_cb()
4705 * @see bt_gatt_connection_state_changed_cb()
4707 int bt_gatt_disconnect(const char *address);
4710 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4711 * @brief Registers a callback function that will be invoked when the connection state is changed.
4712 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
4714 * @param[in] callback The callback function to register.
4715 * @param[in] user_data The user data to be passed to the callback function.
4717 * @return 0 on success, otherwise a negative error value.
4718 * @retval #BT_ERROR_NONE Successful
4719 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4720 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4721 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4723 * @see bt_gatt_connect()
4724 * @see bt_gatt_disconnect()
4725 * @see bt_gatt_unset_connection_state_changed_cb()
4727 int bt_gatt_set_connection_state_changed_cb(bt_gatt_connection_state_changed_cb callback, void *user_data);
4730 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4731 * @brief Unregisters a callback function that will be invoked when the connection state is changed.
4732 * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
4734 * @return 0 on success, otherwise a negative error value.
4735 * @retval #BT_ERROR_NONE Successful
4736 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4737 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4739 * @see bt_gatt_connect()
4740 * @see bt_gatt_disconnect()
4741 * @see bt_gatt_connection_state_changed_cb()
4743 int bt_gatt_unset_connection_state_changed_cb(void);
4746 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4747 * @brief Destroys the GATT handle of service.
4750 * @param[in] gatt_handle The handle of service
4751 * @return 0 on success, otherwise a negative error value
4752 * @retval #BT_ERROR_NONE Successful
4753 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4754 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4756 * @see bt_gatt_service_create()
4758 int bt_gatt_service_destroy(bt_gatt_h gatt_handle);
4761 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4762 * @brief Destroys the GATT handle of characteristic.
4765 * @param[in] gatt_handle The handle of characteristic
4766 * @return 0 on success, otherwise a negative error value
4767 * @retval #BT_ERROR_NONE Successful
4768 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4769 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4771 * @see bt_gatt_characteristic_create()
4773 int bt_gatt_characteristic_destroy(bt_gatt_h gatt_handle);
4776 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4777 * @brief Destroys the GATT handle of descriptor.
4780 * @param[in] gatt_handle The handle of descriptor
4781 * @return 0 on success, otherwise a negative error value
4782 * @retval #BT_ERROR_NONE Successful
4783 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4784 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4786 * @see bt_gatt_descriptor_create()
4788 int bt_gatt_descriptor_destroy(bt_gatt_h gatt_handle);
4791 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4792 * @brief Gets the permissions which a characteristic's GATT handle has.
4795 * @remarks The @a permissions can be one or more values of #bt_gatt_permission_e, combined with bitwise 'or'.
4797 * @param[in] gatt_handle The handle of a characteristic
4798 * @param[out] permissions The permissions which a characteristic's GATT handle has
4799 * @return 0 on success, otherwise a negative error value
4800 * @retval #BT_ERROR_NONE Successful
4801 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4802 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4804 * @see bt_gatt_characteristic_create()
4805 * @see bt_gatt_permission_e
4807 int bt_gatt_characteristic_get_permissions(bt_gatt_h gatt_handle, int *permissions);
4810 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4811 * @brief Gets the permissions which a descriptor's GATT handle has.
4814 * @remarks The @a permissions can be one or more values of #bt_gatt_permission_e, combined with bitwise 'or'.
4816 * @param[in] gatt_handle The handle of a descriptor
4817 * @param[out] permissions The permissions which a descriptor's GATT handle has
4818 * @return 0 on success, otherwise a negative error value
4819 * @retval #BT_ERROR_NONE Successful
4820 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4821 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4823 * @see bt_gatt_descriptor_create()
4824 * @see bt_gatt_permission_e
4826 int bt_gatt_descriptor_get_permissions(bt_gatt_h gatt_handle, int *permissions);
4829 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4830 * @brief Creates the GATT service.
4833 * @remarks The @a service should be destroyed by using bt_gatt_service_destroy().
4835 * @param[in] uuid The UUID of the service
4836 * @param[in] type The type of the service
4837 * @param[out] service The GATT handle of the created service
4838 * @return 0 on success, otherwise a negative error value
4839 * @retval #BT_ERROR_NONE Successful
4840 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4841 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
4842 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4844 * @see bt_gatt_service_destroy()
4846 int bt_gatt_service_create(const char *uuid, bt_gatt_service_type_e type,
4847 bt_gatt_h *service);
4850 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4851 * @brief Adds a characteristic to a specified service.
4854 * @param[in] service The service's GATT handle
4855 * @param[in] characteristic The characteristic's GATT handle to be added
4856 * @return 0 on success, otherwise a negative error value
4857 * @retval #BT_ERROR_NONE Successful
4858 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4859 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4861 * @see bt_gatt_service_create()
4862 * @see bt_gatt_characteristic_create()
4864 int bt_gatt_service_add_characteristic(bt_gatt_h service,
4865 bt_gatt_h characteristic);
4868 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4869 * @brief Adds a service to a specified service as included service.
4872 * @param[in] service The service's GATT handle
4873 * @param[in] included_service The service's GATT handle to be added as included service
4874 * @return 0 on success, otherwise a negative error value
4875 * @retval #BT_ERROR_NONE Successful
4876 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4877 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4879 * @see bt_gatt_service_create()
4881 int bt_gatt_service_add_included_service(bt_gatt_h service,
4882 bt_gatt_h included_service);
4885 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4886 * @brief Gets the GATT server handle to which the specified service belongs.
4889 * @remarks The returned Server handle must not be freed by application.
4891 * @param[in] service The service's GATT handle
4892 * @param[out] server The GATT server handle to which @a service belongs
4893 * @return 0 on success, otherwise a negative error value
4894 * @retval #BT_ERROR_NONE Successful
4895 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4896 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4898 * @see bt_gatt_server_create()
4899 * @see bt_gatt_service_create()
4900 * @see bt_gatt_server_register_service()
4902 int bt_gatt_service_get_server(bt_gatt_h service, bt_gatt_server_h *server);
4905 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4906 * @brief Creates the GATT characteristic.
4909 * @remarks The @a permissions can be one or more values of #bt_gatt_permission_e, combined with bitwise 'or'. \n
4910 * @remarks The @a properties can be one or more values of #bt_gatt_property_e, combined with bitwise 'or'. \n
4911 * @remarks The @a characteristic should be destroyed by using bt_gatt_characteristic_destroy().
4913 * @param[in] uuid The UUID of the characteristic
4914 * @param[in] permissions the permissions of the characteristic
4915 * @param[in] properties The properties of the characteristic
4916 * @param[in] value The value(byte stream) of the characteristic
4917 * @param[in] value_length The length of @a value
4918 * @param[out] characteristic The GATT handle of the created characteristic
4919 * @return 0 on success, otherwise a negative error value
4920 * @retval #BT_ERROR_NONE Successful
4921 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4922 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
4923 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4925 * @see bt_gatt_characteristic_destroy()
4927 int bt_gatt_characteristic_create(const char *uuid, int permissions,
4928 int properties, const char *value, int value_length,
4929 bt_gatt_h *characteristic);
4932 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4933 * @brief Adds a descriptor to a specified characteristic.
4936 * @param[in] characteristic The GATT handle of the characteristic
4937 * @param[in] descriptor The descriptor's GATT handle to be added
4938 * @return 0 on success, otherwise a negative error value
4939 * @retval #BT_ERROR_NONE Successful
4940 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4941 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4943 * @see bt_gatt_characteristic_create()
4944 * @see bt_gatt_descriptor_create()
4946 int bt_gatt_characteristic_add_descriptor(bt_gatt_h characteristic,
4947 bt_gatt_h descriptor);
4950 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_MODULE
4951 * @brief Creates the GATT characteristic descriptor.
4954 * @remarks The @a permissions can be one or more values of #bt_gatt_permission_e, combined with bitwise 'or'. \n
4955 * @remarks The @a descriptor should be destroyed by using bt_gatt_descriptor_destroy().
4957 * @param[in] uuid The UUID of the descriptor
4958 * @param[in] permissions The permissions of the descriptor
4959 * @param[in] value The value(byte stream) associated with the descriptor
4960 * @param[in] value_length The length of @a value
4961 * @param[out] descriptor The GATT handle of the created characteristic descriptor
4962 * @return 0 on success, otherwise a negative error value
4963 * @retval #BT_ERROR_NONE Successful
4964 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
4965 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
4966 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4968 * @see bt_gatt_descriptor_destroy()
4970 int bt_gatt_descriptor_create(const char *uuid, int permissions,
4971 const char *value, int value_length,
4972 bt_gatt_h *descriptor);
4975 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4976 * @brief Initializes the GATT Server.
4979 * @return 0 on success, otherwise a negative error value.
4980 * @retval #BT_ERROR_NONE Successful
4981 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4982 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4983 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
4985 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
4986 * @see bt_gatt_server_deinitialize()
4988 int bt_gatt_server_initialize(void);
4991 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
4992 * @brief DeInitializes the GATT server.
4995 * @return 0 on success, otherwise a negative error value.
4996 * @retval #BT_ERROR_NONE Successful
4997 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
4998 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
4999 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5001 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
5002 * @see bt_gatt_server_initialize()
5004 int bt_gatt_server_deinitialize(void);
5007 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5008 * @brief Creates the GATT server's handle.
5011 * @remarks The @a server handle should be destroyed by using bt_gatt_server_destroy().
5013 * @param[out] server The GATT server's handle
5014 * @return 0 on success, otherwise a negative error value
5015 * @retval #BT_ERROR_NONE Successful
5016 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5017 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
5018 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5020 * @see bt_gatt_server_destroy()
5022 int bt_gatt_server_create(bt_gatt_server_h *server);
5025 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5026 * @brief Destroys the GATT server's handle.
5029 * @remarks All registered services to GATT server are unregistered.
5031 * @param[in] server The GATT server's handle
5032 * @return 0 on success, otherwise a negative error value
5033 * @retval #BT_ERROR_NONE Successful
5034 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5035 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5037 * @see bt_gatt_server_create()
5039 int bt_gatt_server_destroy(bt_gatt_server_h server);
5042 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5043 * @brief Registers a callback function to be invoked when a read request for a specified characteristic or descriptor is issued from a remote device(GATT client).
5046 * @param[in] gatt_handle The GATT handle of a characteristic or descriptor
5047 * @param[in] callback The callback to be invoked
5048 * @param[in] user_data The user data to be passed to @a callback function
5049 * @return 0 on success, otherwise a negative error value
5050 * @retval #BT_ERROR_NONE Successful
5051 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5052 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5054 * @see bt_gatt_server_read_value_requested_cb()
5055 * @see bt_gatt_server_send_response()
5057 int bt_gatt_server_set_read_value_requested_cb(bt_gatt_h gatt_handle,
5058 bt_gatt_server_read_value_requested_cb callback,
5062 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5063 * @brief Registers a callback function to be invoked when the remote device enables or disables the Notification/Indication for particular characteristics.
5066 * @param[in] gatt_handle The GATT handle of a characteristic
5067 * @param[in] callback The callback to be invoked
5068 * @param[in] user_data The user data to be passed to @a callback function
5069 * @return 0 on success, otherwise a negative error value
5070 * @retval #BT_ERROR_NONE Successful
5071 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5072 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5074 * @see bt_gatt_server_characteristic_notification_state_changed_cb()
5076 int bt_gatt_server_set_characteristic_notification_state_change_cb(bt_gatt_h gatt_handle,
5077 bt_gatt_server_characteristic_notification_state_changed_cb callback,
5081 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5082 * @brief Registers a callback function to be invoked when a value of a characteristic or descriptor has been changed by a remote device(GATT client)'s request.
5085 * @param[in] gatt_handle The GATT handle of a characteristic or descriptor
5086 * @param[in] callback The callback to be invoked
5087 * @param[in] user_data The user data to be passed to @a callback function
5088 * @return 0 on success, otherwise a negative error value
5089 * @retval #BT_ERROR_NONE Successful
5090 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5091 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5093 * @see bt_gatt_server_write_value_requested_cb()
5095 int bt_gatt_server_set_write_value_requested_cb(bt_gatt_h gatt_handle,
5096 bt_gatt_server_write_value_requested_cb callback,
5100 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5101 * @brief Registers a specified service to the specified GATT server that the local device is hosting.
5104 * @privilege %http://tizen.org/privilege/bluetooth
5106 * @param[in] server The GATT server that local device is hosting
5107 * @param[in] service The service, which needs to be registered in @a server
5108 * @return 0 on success, otherwise a negative error value
5109 * @retval #BT_ERROR_NONE Successful
5110 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5111 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
5112 * @retval #BT_ERROR_ALREADY_DONE Operation is already done
5113 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
5114 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5116 * @see bt_gatt_server_create()
5117 * @see bt_gatt_service_create()
5118 * @see bt_gatt_server_start()
5119 * @see bt_gatt_server_unregister_service()
5121 int bt_gatt_server_register_service(bt_gatt_server_h server, bt_gatt_h service);
5124 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5125 * @brief Unregisters a specified service from the specified GATT server that the local device is hosting.
5128 * @privilege %http://tizen.org/privilege/bluetooth
5130 * @param[in] server The GATT server that local device is hosting
5131 * @param[in] service The service, which needs to be unregistered from @a server
5132 * @return 0 on success, otherwise a negative error value
5133 * @retval #BT_ERROR_NONE Successful
5134 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5135 * @retval #BT_ERROR_SERVICE_NOT_FOUND Service not found
5136 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
5137 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5139 * @see bt_gatt_server_register_service()
5141 int bt_gatt_server_unregister_service(bt_gatt_server_h server, bt_gatt_h service);
5144 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5145 * @brief Unregisters all services from the specified GATT server that the local device is hosting.
5148 * @privilege %http://tizen.org/privilege/bluetooth
5150 * @param[in] server The GATT server that local device is hosting
5151 * @return 0 on success, otherwise a negative error value
5152 * @retval #BT_ERROR_NONE Successful
5153 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5154 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
5155 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5157 * @see bt_gatt_server_register_service()
5159 int bt_gatt_server_unregister_all_services(bt_gatt_server_h server);
5162 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5163 * @brief Registers the application along with the GATT services of the application it is hosting.
5166 * @privilege %http://tizen.org/privilege/bluetooth
5168 * @return 0 on success, otherwise a negative error value
5169 * @retval #BT_ERROR_NONE Successful
5170 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
5171 * @retval #BT_ERROR_ALREADY_DONE Operation is already done
5172 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
5173 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5175 * @see bt_gatt_server_initialize()
5176 * @see bt_gatt_server_create()
5177 * @see bt_gatt_service_create()
5178 * @see bt_gatt_server_unregister_service()
5180 int bt_gatt_server_start(void);
5183 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5184 * @brief Sends a response to the remote device as a result of a read/write request.
5187 * @privilege %http://tizen.org/privilege/bluetooth
5189 * @remarks Until this function is called, a read/write request is not finished.
5191 * @param[in] request_id The identification of a read/write request
5192 * @param[in] request_type The request type for read/write
5193 * @param[in] offset The offset from where a value is read
5194 * @param[in] resp_status The application error if any occurred or BT_ERROR_NONE for successful.
5195 * @param[in] value The value to be sent. It will be sent from @a offset. If it is NULL, a requested GATT handle's value will be sent from @a offset.
5196 * @param[in] value_length Value Length
5197 * @return 0 on success, otherwise a negative error value
5198 * @retval #BT_ERROR_NONE Successful
5199 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5200 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
5201 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5203 * @see bt_gatt_server_read_value_requested_cb()
5205 int bt_gatt_server_send_response(int request_id, bt_gatt_att_request_type_e request_type,
5206 int offset, int resp_status, char *value, int value_length);
5209 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5210 * @brief Notifies value change of the characteristic to the remote devices which enable a Client Characteristic Configuration Descriptor.
5213 * @param[in] characteristic The characteristic which has a changed value
5214 * @param[in] callback The function to be invoked on each remote device when a sending operation is done
5215 * @param[in] device_address Remote device address to send notify or indicate and if set to NULL then notify/indicate all is enabled.
5216 * @param[in] user_data The user data to be passed to @a callback function
5217 * @return 0 on success, otherwise a negative error value
5218 * @retval #BT_ERROR_NONE Successful
5219 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5220 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5222 * @see bt_gatt_server_notification_sent_cb()
5224 int bt_gatt_server_notify_characteristic_changed_value(bt_gatt_h characteristic,
5225 bt_gatt_server_notification_sent_cb callback,
5226 const char *device_address, void *user_data);
5229 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5230 * @brief Gets a service's GATT handle which has specific UUID.
5233 * @remarks The returned GATT handle must not be freed by application. \n
5234 * It will be freed when an associated server is destroyed by bt_gatt_server_destroy(). \n
5235 * If there are multiple services which have same UUID, only the first matched one will be returned.
5237 * @param[in] server The GATT server's handle
5238 * @param[in] uuid The service's GATT handle which has this UUID will be returned if it exists
5239 * @param[out] service The service's GATT handle which has @a uuid if it exists
5240 * @return 0 on success, otherwise a negative error value
5241 * @retval #BT_ERROR_NONE Successful
5242 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5243 * @retval #BT_ERROR_NO_DATA No data available
5244 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5246 int bt_gatt_server_get_service(bt_gatt_server_h server, const char *uuid,
5247 bt_gatt_h *service);
5250 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5251 * @brief Invokes @a callback function on each service that belongs to the specified GATT server.
5254 * @param[in] server The GATT server's handle
5255 * @param[in] callback The function to be invoked on each service
5256 * @param[in] user_data The user data to be passed to @a callback function
5257 * @return 0 on success, otherwise a negative error value
5258 * @retval #BT_ERROR_NONE Successful
5259 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5260 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5262 * @see bt_gatt_foreach_cb()
5264 int bt_gatt_server_foreach_services(bt_gatt_server_h server,
5265 bt_gatt_foreach_cb callback, void *user_data);
5269 * @ingroup CAPI_NETWORK_BLUETOOTH_GATT_SERVER_MODULE
5270 * @brief Gets an ATT MTU value for a connection.
5273 * @param[in] remote_address The address of the remote Bluetooth device
5274 * @param[out] mtu The MTU value for a connection
5276 * @return 0 on success, otherwise a negative error value.
5277 * @retval #BT_ERROR_NONE Successful
5278 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5279 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5280 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5281 * @retval #BT_ERROR_NOT_ENABLED Not enabled
5282 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
5284 int bt_gatt_server_get_device_mtu(const char *remote_address, unsigned int *mtu);
5288 * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5289 * @brief Initializes the Bluetooth PBAP Client.
5290 * @details This initialization is necessary to call other PBAP client APIs.
5293 * @remarks This function must be called to initialize Bluetooth PBAP client. You must free all resources of the Bluetooth service \n
5294 * by calling bt_pbap_client_deinitialize() if Bluetooth PBAP Client is no longer needed.
5295 * @return 0 on success, otherwise a negative error value.
5296 * @retval #BT_ERROR_NONE Successful
5297 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5298 * @retval #BT_ERROR_NOT_ENABLED Not enabled
5299 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
5300 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5302 * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5304 * @see bt_pbap_client_deinitialize()
5305 * @see bt_pbap_client_connect()
5306 * @see bt_pbap_client_disconnect()
5307 * @see bt_pbap_client_get_phone_book_size()
5308 * @see bt_pbap_client_get_phone_book()
5309 * @see bt_pbap_client_get_list()
5310 * @see bt_pbap_client_pull_vcard()
5311 * @see bt_pbap_client_search_phone_book()
5313 int bt_pbap_client_initialize(void);
5317 * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5318 * @brief Deinitializes the Bluetooth PBAP Client.
5319 * @details This deinitialization must be done to free resources when the PBAP client is not longer needed.
5322 * @return 0 on success, otherwise a negative error value.
5323 * @retval #BT_ERROR_NONE Successful
5324 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5325 * @retval #BT_ERROR_NOT_ENABLED Not enabled
5326 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
5327 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5329 * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5330 * The PBAP client must be initialized with bt_pbap_client_initialize().
5331 * @see bt_pbap_client_initialize()
5332 * @see bt_pbap_client_connect()
5333 * @see bt_pbap_client_disconnect()
5334 * @see bt_pbap_client_get_phone_book_size()
5335 * @see bt_pbap_client_get_phone_book()
5336 * @see bt_pbap_client_get_list()
5337 * @see bt_pbap_client_pull_vcard()
5338 * @see bt_pbap_client_search_phone_book()
5340 int bt_pbap_client_deinitialize(void);
5344 * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5345 * @brief Registers a callback function that will be invoked when the connection state is changed.
5347 * @param[in] callback The callback function to register
5348 * @param[in] user_data The user data to be passed to the callback function
5349 * @return 0 on success, otherwise a negative error value.
5350 * @retval #BT_ERROR_NONE Successful
5351 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5352 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5353 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5355 * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5356 * @see bt_pbap_client_initialize()
5358 int bt_pbap_client_set_connection_state_changed_cb(bt_pbap_connection_state_changed_cb callback, void *user_data);
5362 * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5363 * @brief Unregisters a callback function that will be invoked when the connection state is changed.
5365 * @return 0 on success, otherwise a negative error value.
5366 * @retval #BT_ERROR_NONE Successful
5367 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5368 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5370 * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5371 * @see bt_pbap_client_initialize()
5373 int bt_pbap_client_unset_connection_state_changed_cb(void);
5377 * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5378 * @brief Connects to PBAP server, asynchronously.
5381 * @privilege %http://tizen.org/privilege/bluetooth
5383 * @param[in] address The other device's address
5385 * @return 0 on success, otherwise a negative error value.
5386 * @retval #BT_ERROR_NONE Successful
5387 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5388 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5389 * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
5390 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
5391 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
5392 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5393 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation is in progress
5395 * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5396 * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5397 * @pre The local device must be bonded with the remote device by bt_device_create_bond().
5398 * @post bt_pbap_connection_state_changed_cb() will be invoked.
5399 * @see bt_pbap_client_disconnect()
5400 * @see bt_pbap_client_set_connection_state_changed_cb()
5402 int bt_pbap_client_connect(const char *address);
5406 * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5407 * @brief Disconnects from PBAP server, asynchronously.
5410 * @privilege %http://tizen.org/privilege/bluetooth
5412 * @param[in] address The other device's address
5414 * @return 0 on success, otherwise a negative error value.
5415 * @retval #BT_ERROR_NONE Successful
5416 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5417 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5418 * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
5419 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
5420 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
5421 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5422 * @retval #BT_ERROR_NOW_IN_PROGRESS Operation is in progress
5424 * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5425 * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5426 * @pre PBAP connection must be created with bt_pbap_client_connect().
5427 * @post bt_pbap_connection_state_changed_cb() will be invoked.
5428 * @see bt_pbap_client_connect()
5429 * @see bt_pbap_client_set_connection_state_changed_cb()
5431 int bt_pbap_client_disconnect(const char *address);
5435 * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5436 * @brief Gets size of phone book from PBAP server, asynchronously.
5439 * @privilege %http://tizen.org/privilege/bluetooth
5441 * @param[in] address The other device's address
5442 * @param[in] source Source of the phone book (Phone/SIM)
5443 * @param[in] folder_type Type of folder
5444 * @param[in] callback The callback function called when PBAP phone book size is returned.
5445 * @param[in] user_data Data to be passed to the PBAP phone book size callback.
5447 * @return 0 on success, otherwise a negative error value.
5448 * @retval #BT_ERROR_NONE Successful
5449 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5450 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5451 * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
5452 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
5453 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
5454 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5456 * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5457 * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5458 * @pre PBAP connection must be created with bt_pbap_client_connect().
5460 * @see bt_pbap_client_connect()
5462 int bt_pbap_client_get_phone_book_size(const char *address,
5463 bt_pbap_address_book_source_e source,
5464 bt_pbap_folder_type_e folder_type,
5465 bt_pbap_phone_book_size_cb callback,
5470 * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5471 * @brief Gets all contacts and call logs as vCard from PBAP server, asynchronously.
5472 * @details The received phone book file will be saved in the platform downloads folder.
5475 * @privilege %http://tizen.org/privilege/bluetooth
5476 * %http://tizen.org/privilege/mediastorage
5478 * @param[in] address The other device's address
5479 * @param[in] source Source of phone book (Phone/SIM)
5480 * @param[in] folder_type Type of folder
5481 * @param[in] format The vCard format
5482 * @param[in] order Specifies which field shall be used to sort vCards.
5483 * @param[in] offset The number of vCards to be excluded, counting from the beginning
5484 * @param[in] max_list_count The maximum number of vCards to be fetched
5485 * @param[in] fields vCard fields to be fetched; one or more #bt_pbap_field_e values combined with bitwise 'or'
5486 * @param[in] callback The callback function called when PBAP phone book is Pulled.
5487 * @param[in] user_data Data to be passed to the PBAP phone book pulling callback.
5489 * @return 0 on success, otherwise a negative error value.
5490 * @retval #BT_ERROR_NONE Successful
5491 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5492 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5493 * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
5494 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
5495 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
5496 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5498 * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5499 * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5500 * @pre PBAP connection must be created with bt_pbap_client_connect().
5502 * @see bt_pbap_client_connect()
5504 int bt_pbap_client_get_phone_book(const char *address,
5505 bt_pbap_address_book_source_e source,
5506 bt_pbap_folder_type_e folder_type,
5507 bt_pbap_vcard_format_e format,
5508 bt_pbap_sort_order_e order,
5509 unsigned short offset,
5510 unsigned short max_list_count,
5511 unsigned int fields,
5512 bt_pbap_phone_book_received_cb callback,
5517 * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5518 * @brief Gets contact and call log information from the PBAP server, asynchronously.
5521 * @privilege %http://tizen.org/privilege/bluetooth
5523 * @param[in] address The other device's address
5524 * @param[in] source Source of phone book (Phone/SIM)
5525 * @param[in] folder_type Type of folder
5526 * @param[in] order Specifies which field shall be used to sort vCards.
5527 * @param[in] offset vCards to be excluded from beginning.
5528 * @param[in] max_list_count Maximum number of vCards to be fetched
5529 * @param[in] callback The callback function called when PBAP List is returned.
5530 * @param[in] user_data Data to be passed to the PBAP phone book pulling callback.
5532 * @return 0 on success, otherwise a negative error value.
5533 * @retval #BT_ERROR_NONE Successful
5534 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5535 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5536 * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
5537 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
5538 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
5539 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5541 * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5542 * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5543 * @pre PBAP connection must be created with bt_pbap_client_connect().
5545 * @see bt_pbap_client_connect()
5547 int bt_pbap_client_get_list(const char *address,
5548 bt_pbap_address_book_source_e source,
5549 bt_pbap_folder_type_e folder_type,
5550 bt_pbap_sort_order_e order,
5551 unsigned short offset,
5552 unsigned short max_list_count,
5553 bt_pbap_list_vcards_cb callback,
5558 * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5559 * @brief Gets the selected contact using the index parameter as vCard from PBAP server, asynchronously.
5560 * @details The received phone book file will be saved in the platform downloads folder.
5561 * The @a index value should be equal to the value of the @a index field in the #bt_pbap_vcard_info_s structure,
5562 * which can be obtained with bt_pbap_client_get_list() or bt_pbap_client_search_phone_book().
5565 * @privilege %http://tizen.org/privilege/bluetooth
5566 * %http://tizen.org/privilege/mediastorage
5568 * @param[in] address The other device's address
5569 * @param[in] source Source of phone book (Phone/SIM)
5570 * @param[in] folder_type Type of folder
5571 * @param[in] index The handle index of vCard to be fetched
5572 * @param[in] format Format of vCard
5573 * @param[in] fields vCard fields to be fetched; one or more #bt_pbap_field_e values combined with bitwise 'or'
5574 * @param[in] callback The callback function called when PBAP phone book is Pulled.
5575 * @param[in] user_data Data to be passed to the PBAP phone book Pulling callback.
5577 * @return 0 on success, otherwise a negative error value.
5578 * @retval #BT_ERROR_NONE Successful
5579 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5580 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5581 * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
5582 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
5583 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
5584 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5586 * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5587 * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5588 * @pre PBAP connection must be created with bt_pbap_client_connect().
5589 * @pre The vCard information (#bt_pbap_vcard_info_s) must be obtained with bt_pbap_client_get_list() or bt_pbap_client_search_phone_book().
5590 * @see bt_pbap_client_connect()
5591 * @see bt_pbap_client_get_list()
5592 * @see bt_pbap_client_search_phone_book()
5594 int bt_pbap_client_pull_vcard(const char *address,
5595 bt_pbap_address_book_source_e source,
5596 bt_pbap_folder_type_e folder_type,
5598 bt_pbap_vcard_format_e format,
5599 unsigned int fields,
5600 bt_pbap_phone_book_received_cb callback,
5605 * @ingroup CAPI_NETWORK_BLUETOOTH_PBAP_MODULE
5606 * @brief Finds and fetches the contact and call log information from the PBAP server, asynchronously.
5609 * @privilege %http://tizen.org/privilege/bluetooth
5611 * @param[in] address The other device's address
5612 * @param[in] source Source of phone book (Phone/SIM)
5613 * @param[in] folder_type Type of folder
5614 * @param[in] search_attribute field to be search
5615 * @param[in] search_value pattern to be searched for
5616 * @param[in] order Specifies which field shall be used to sort vCards.
5617 * @param[in] offset vCards to be excluded from beginning.
5618 * @param[in] max_list_count Maximum number of vCards to be fetched
5619 * @param[in] callback The callback function called when PBAP List is returned.
5620 * @param[in] user_data Data to be passed to the PBAP phone book pulling callback.
5622 * @return 0 on success, otherwise a negative error value.
5623 * @retval #BT_ERROR_NONE Successful
5624 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5625 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5626 * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
5627 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
5628 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
5629 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5631 * @pre The state of the local Bluetooth adapter must be #BT_ADAPTER_ENABLED.
5632 * @pre The PBAP client must be initialized with bt_pbap_client_initialize().
5633 * @pre PBAP connection must be created with bt_pbap_client_connect().
5635 * @see bt_pbap_client_connect()
5637 int bt_pbap_client_search_phone_book(const char *address,
5638 bt_pbap_address_book_source_e source,
5639 bt_pbap_folder_type_e folder_type,
5640 bt_pbap_search_field_e search_attribute,
5641 const char *search_value,
5642 bt_pbap_sort_order_e order,
5643 unsigned short offset,
5644 unsigned short max_list_count,
5645 bt_pbap_list_vcards_cb callback,
5649 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5650 * @brief Creates a scan filter to find only LE advertisements which match specific requirements.
5651 * @details If the filter's attribute is not set, then the filter will accept
5652 * all values of that attribute. If an attribute is set, the filter
5653 * will accept only advertisements which match the set attribute.
5655 * For example, if device name is set with
5656 * bt_adapter_le_scan_filter_set_device_name(), the filter will accept
5657 * only advertisements from devices with the given name. If device name
5658 * is not set, advertisements will be filtered without regard to device
5662 * @remarks The @a scan_filter should be destroyed with bt_adapter_le_scan_filter_destroy().
5664 * @param[out] scan_filter The scan filter handle
5666 * @return 0 on success, otherwise a negative error value.
5667 * @retval #BT_ERROR_NONE Successful
5668 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5669 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5670 * @retval #BT_ERROR_OUT_OF_MEMORY Out of memory
5671 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5673 * @pre The Bluetooth service must be initialized with bt_initialize().
5675 * @see bt_adapter_le_scan_filter_destroy()
5677 int bt_adapter_le_scan_filter_create(bt_scan_filter_h *scan_filter);
5680 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5681 * @brief Destroys a scan filter.
5684 * @param[in] scan_filter The scan filter handle
5686 * @return 0 on success, otherwise a negative error value.
5687 * @retval #BT_ERROR_NONE Successful
5688 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5689 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5690 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5692 * @pre The Bluetooth service must be initialized with bt_initialize().
5694 * @see bt_adapter_le_scan_filter_create()
5696 int bt_adapter_le_scan_filter_destroy(bt_scan_filter_h scan_filter);
5699 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5700 * @brief Sets the device address for the advertisements filter.
5703 * @param[in] scan_filter The scan filter handle
5704 * @param[in] address The device address by which advertisements will be filtered
5706 * @return 0 on success, otherwise a negative error value.
5707 * @retval #BT_ERROR_NONE Successful
5708 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5709 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5710 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5712 * @pre The Bluetooth service must be initialized with bt_initialize().
5715 int bt_adapter_le_scan_filter_set_device_address(bt_scan_filter_h scan_filter, const char *address);
5718 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5719 * @brief Sets the device name for the advertisements filter.
5720 * @details Any previously set value will be overwritten.
5723 * @param[in] scan_filter The scan filter handle
5724 * @param[in] name The device name by which advertisements will be filtered
5726 * @return 0 on success, otherwise a negative error value.
5727 * @retval #BT_ERROR_NONE Successful
5728 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5729 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5730 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5732 * @pre The Bluetooth service must be initialized with bt_initialize().
5735 int bt_adapter_le_scan_filter_set_device_name(bt_scan_filter_h scan_filter, const char *name);
5738 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5739 * @brief Sets the service UUID for the advertisements filter.
5740 * @details Any previously set value will be overwritten.
5743 * @param[in] scan_filter The scan filter handle
5744 * @param[in] uuid The service UUID by which advertisements will be filtered
5746 * @return 0 on success, otherwise a negative error value.
5747 * @retval #BT_ERROR_NONE Successful
5748 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5749 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5750 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5752 * @pre The Bluetooth service must be initialized with bt_initialize().
5755 int bt_adapter_le_scan_filter_set_service_uuid(bt_scan_filter_h scan_filter, const char *uuid);
5758 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5759 * @brief Sets the service UUID and the mask for the advertisements filter,
5760 * to use for filtering by partial data.
5761 * @details Any previously set value will be overwritten. The mask works as follows:
5762 * For each bit set to 1 in the mask, the corresponding bits in @a uuid
5763 * and in the filtered data will have to be equal. If the mask bit is set to 0,
5764 * the corresponding bits will be ignored.
5767 * @remarks The @a mask and the service @a uuid must have equal lengths.
5769 * @param[in] scan_filter The scan filter handle
5770 * @param[in] uuid The service UUID by which advertisements will be filtered
5771 * @param[in] mask The mask to filter advertisements
5773 * @return 0 on success, otherwise a negative error value.
5774 * @retval #BT_ERROR_NONE Successful
5775 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5776 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5777 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5779 * @pre The Bluetooth service must be initialized with bt_initialize().
5782 int bt_adapter_le_scan_filter_set_service_uuid_with_mask(bt_scan_filter_h scan_filter,
5783 const char *uuid, const char *mask);
5786 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5787 * @brief Sets the service solicitation UUID for the advertisements filter.
5788 * @details Any previously set value will be overwritten.
5791 * @param[in] scan_filter The scan filter handle
5792 * @param[in] uuid The service solicitation UUID by which advertisements will be filtered
5794 * @return 0 on success, otherwise a negative error value.
5795 * @retval #BT_ERROR_NONE Successful
5796 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5797 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5798 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5800 * @pre The Bluetooth service must be initialized with bt_initialize().
5803 int bt_adapter_le_scan_filter_set_service_solicitation_uuid(bt_scan_filter_h scan_filter, const char *uuid);
5806 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5807 * @brief Sets the service solicitation UUID and the mask for the advertisements filter,
5808 * to use for filtering by partial data.
5809 * @details Any previously set value will be overwritten. The mask works as follows:
5810 * For each bit set to 1 in the mask, the corresponding bits in @a uuid
5811 * and in the filtered data will have to be equal. If the mask bit is set to 0,
5812 * the corresponding bits will be ignored.
5815 * @remarks The @a mask and the service solicitation @a uuid must have equal lengths.
5817 * @param[in] scan_filter The scan filter handle
5818 * @param[in] uuid The service solicitation UUID by which advertisements will be filtered
5819 * @param[in] mask The mask by which advertisements will be filtered
5821 * @return 0 on success, otherwise a negative error value.
5822 * @retval #BT_ERROR_NONE Successful
5823 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5824 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5825 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5827 * @pre The Bluetooth service must be initialized with bt_initialize().
5830 int bt_adapter_le_scan_filter_set_service_solicitation_uuid_with_mask(bt_scan_filter_h scan_filter,
5831 const char *uuid, const char *mask);
5834 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5835 * @brief Sets the service data for the advertisements filter.
5836 * @details Any previously set value will be overwritten.
5839 * @param[in] scan_filter The scan filter handle
5840 * @param[in] uuid The service UUID by which advertisements will be filtered
5841 * @param[in] data The service data by which advertisements will be filtered
5842 * @param[in] data_len The length of the service data
5844 * @return 0 on success, otherwise a negative error value.
5845 * @retval #BT_ERROR_NONE Successful
5846 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5847 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5848 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5850 * @pre The Bluetooth service must be initialized with bt_initialize().
5853 int bt_adapter_le_scan_filter_set_service_data(bt_scan_filter_h scan_filter,
5854 const char *uuid, const char *data, unsigned int data_len);
5857 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5858 * @brief Sets the service data and the mask for the advertisements filter,
5859 * to use for filtering by partial data.
5860 * @details Any previously set value will be overwritten. The mask works as follows:
5861 * For each bit set to 1 in the mask, the corresponding bits in @a data
5862 * and in the filtered data will have to be equal. If the mask bit is set to 0,
5863 * the corresponding bits will be ignored.
5866 * @remarks The @a mask and the service @a data must have equal lengths.
5868 * @param[in] scan_filter The scan filter handle
5869 * @param[in] uuid The service UUID by which advertisements will be filtered
5870 * @param[in] data The service data by which advertisements will be filtered
5871 * @param[in] data_len The length of the service data
5872 * @param[in] mask The mask by which advertisements will be filtered
5873 * @param[in] mask_len The length of the mask
5875 * @return 0 on success, otherwise a negative error value.
5876 * @retval #BT_ERROR_NONE Successful
5877 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5878 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5879 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5881 * @pre The Bluetooth service must be initialized with bt_initialize().
5884 int bt_adapter_le_scan_filter_set_service_data_with_mask(bt_scan_filter_h scan_filter,
5887 unsigned int data_len,
5889 unsigned int mask_len);
5892 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5893 * @brief Sets the manufacturer data for the advertisements filter.
5894 * @details Any previously set value will be overwritten.
5897 * @param[in] scan_filter The scan filter handle
5898 * @param[in] manufacturer_id The manufacturer ID (0x0000 ~ 0xFFFF)
5899 * @param[in] data The manufacturer data (byte array)
5900 * @param[in] data_len The length of the manufacturer data
5902 * @return 0 on success, otherwise a negative error value.
5903 * @retval #BT_ERROR_NONE Successful
5904 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5905 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5906 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5908 * @pre The Bluetooth service must be initialized with bt_initialize().
5911 int bt_adapter_le_scan_filter_set_manufacturer_data(bt_scan_filter_h scan_filter,
5912 int manufacturer_id,
5914 unsigned int data_len);
5917 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5918 * @brief Sets the manufacturer data and the mask for the advertisements filter,
5919 * to use for filtering by partial data.
5920 * @details Any previously set value will be overwritten. The mask works as follows:
5921 * For each bit set to 1 in the mask, the corresponding bits in @a data
5922 * and in the filtered data will have to be equal. If the mask bit is set to 0,
5923 * the corresponding bits will be ignored.
5926 * @remarks The @a mask and the manufacturer @a data must have equal lengths.
5928 * @param[in] scan_filter The scan filter handle
5929 * @param[in] manufacturer_id The manufacturer ID (0x0000 ~ 0xFFFF)
5930 * @param[in] data The manufacturer data (byte array)
5931 * @param[in] data_len The length of the manufacturer data
5932 * @param[in] mask The mask by which advertisements will be filtered
5933 * @param[in] mask_len The length of the mask
5935 * @return 0 on success, otherwise a negative error value.
5936 * @retval #BT_ERROR_NONE Successful
5937 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5938 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5939 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5941 * @pre The Bluetooth service must be initialized with bt_initialize().
5944 int bt_adapter_le_scan_filter_set_manufacturer_data_with_mask(bt_scan_filter_h scan_filter,
5945 int manufacturer_id,
5947 unsigned int data_len,
5949 unsigned int mask_len);
5952 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5953 * @brief Sets the scan filter type for the advertisements filter.
5954 * @details The filter type is used when searching only for iBeacon or proximity
5955 * type's advertising data. If the type is not set, LE scanner will
5956 * search devices as with regard to other filtered attributes.
5957 * If the type is set, all other attributes set for the filter are ignored.
5960 * @param[in] scan_filter The scan filter handle
5961 * @param[in] mode The scan filter type
5963 * @return 0 on success, otherwise a negative error value.
5964 * @retval #BT_ERROR_NONE Successful
5965 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5966 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5967 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5969 * @pre The Bluetooth service must be initialized with bt_initialize().
5972 int bt_adapter_le_scan_filter_set_type(bt_scan_filter_h scan_filter,
5973 bt_adapter_le_scan_filter_type_e mode);
5976 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
5977 * @brief Registers a scan filter to use for scanning.
5978 * @details If the filter is registered, it cannot be changed.
5981 * @privilege %http://tizen.org/privilege/bluetooth
5983 * @remarks Several scan filters can be registered. If an advertisement passes \n
5984 * any of the registered scan filters, it will be included in the results.
5986 * @param[in] scan_filter The scan filter handle
5988 * @return 0 on success, otherwise a negative error value.
5989 * @retval #BT_ERROR_NONE Successful
5990 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
5991 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
5992 * @retval #BT_ERROR_NOW_IN_PROGRESS Scan is in progress
5993 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
5994 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
5996 * @pre The Bluetooth service must be initialized with bt_initialize().
5999 int bt_adapter_le_scan_filter_register(bt_scan_filter_h scan_filter);
6002 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
6003 * @brief Unregisters all registered scan filters.
6006 * @privilege %http://tizen.org/privilege/bluetooth
6008 * @param[in] scan_filter The scan filter handle
6010 * @return 0 on success, otherwise a negative error value.
6011 * @retval #BT_ERROR_NONE Successful
6012 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
6013 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
6014 * @retval #BT_ERROR_NOW_IN_PROGRESS Scan is in progress
6015 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
6016 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
6018 * @pre The Bluetooth service must be initialized with bt_initialize().
6021 int bt_adapter_le_scan_filter_unregister(bt_scan_filter_h scan_filter);
6024 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE
6025 * @brief Unregisters all registered scan filters.
6028 * @privilege %http://tizen.org/privilege/bluetooth
6030 * @return 0 on success, otherwise a negative error value.
6031 * @retval #BT_ERROR_NONE Successful
6032 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
6033 * @retval #BT_ERROR_NOW_IN_PROGRESS Scan is in progress
6034 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
6035 * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
6037 * @pre The Bluetooth service must be initialized with bt_initialize().
6040 int bt_adapter_le_scan_filter_unregister_all(void);
6043 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_50_MODULE
6044 * @brief Checks if LE 2M PHY feature is supported or not.
6047 * @remarks The LE 2M PHY feature was introduced in the BT 5.0 core specification.
6049 * @param[out] is_supported The LE 2M PHY feature support: (@c true = supported , @c false = not supported)
6051 * @return 0 on success, otherwise a negative error value.
6052 * @retval #BT_ERROR_NONE Successful
6053 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
6054 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
6055 * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
6056 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
6057 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
6059 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
6061 int bt_adapter_le_is_2m_phy_supported(bool *is_supported);
6064 * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_50_MODULE
6065 * @brief Checks if LE CODED PHY feature is supported or not.
6068 * @remarks The LE CODED PHY feature was introduced in the BT 5.0 core specification.
6070 * @param[out] is_supported The LE CODED PHY feature support: (@c true = supported , @c false = not supported)
6072 * @return 0 on success, otherwise a negative error value.
6073 * @retval #BT_ERROR_NONE Successful
6074 * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
6075 * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
6076 * @retval #BT_ERROR_NOT_ENABLED Adapter is not enabled
6077 * @retval #BT_ERROR_OPERATION_FAILED Operation failed
6078 * @retval #BT_ERROR_NOT_SUPPORTED Not supported
6080 * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
6082 int bt_adapter_le_is_coded_phy_supported(bool *is_supported);
6088 #endif /* __cplusplus */
6090 #endif /* __TIZEN_NETWORK_BLUETOOTH_H__ */