Tizen Native API  5.5
Bluetooth Adapter

Bluetooth Adapter API provides functions for setting up Bluetooth and discovering other devices.

Required Header

#include <bluetooth.h>

Overview

This set of function is used to control a bluetooth adapter. You can also control visibility of the device, its appearance for others (adapter name). In addition, this api is used to discover neighboring bluetooth devices. This process is asynchronous, so it is up to you to build and hold list of devices in the neighborhood

Related Features

This API is related with the following features:

It is recommended to design feature related codes in your application for reliability.

You can check if a device supports the related features for this API by using System Information,thereby controlling the procedure of your application.

To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.

More details on featuring your application can be found from Feature Element.

Asynchronous Operations

FUNCTION CALLBACK DESCRIPTION
bt_adapter_set_name() bt_adapter_name_changed_cb() Used to set adapter name.
bt_adapter_visibility_mode_changed_cb() Used to set visibility mode (bt_adapter_visibility_mode_e).
bt_adapter_start_device_discovery()
bt_adapter_stop_device_discovery()
bt_adapter_device_discovery_state_changed_cb() Used to start or cancel device discovery.

Callback(Event) Operations

REGISTER UNREGISTER CALLBACK DESCRIPTION
bt_adapter_set_state_changed_cb() bt_adapter_unset_state_changed_cb() bt_adapter_state_changed_cb() Used to be notified of state change (enable or disable).
bt_adapter_set_name_changed_cb() bt_adapter_unset_name_changed_cb() bt_adapter_name_changed_cb() Used to be notified of name change.
bt_adapter_set_visibility_mode_changed_cb() bt_adapter_unset_visibility_mode_changed_cb() bt_adapter_visibility_mode_changed_cb() Used to be notified of change of visibility mode (bt_adapter_visibility_mode_e).
bt_adapter_set_device_discovery_state_changed_cb() bt_adapter_unset_device_discovery_state_changed_cb() bt_adapter_device_discovery_state_changed_cb() Used to be notified of change of device discovery state (bt_adapter_device_discovery_state_e).

Foreach Operations

FOREACH CALLBACK DESCRIPTION
bt_adapter_foreach_bonded_device() bt_adapter_bonded_device_cb() Used to get bonded devices.


Please refer Bluetooth Tutorial if you want to get more detailed usages and information of this api.

Functions

int bt_adapter_get_state (bt_adapter_state_e *adapter_state)
 Gets the current state of local Bluetooth adapter.
int bt_adapter_get_address (char **local_address)
 Gets the address of local Bluetooth adapter.
int bt_adapter_get_name (char **local_name)
 Gets the name of local Bluetooth adapter.
int bt_adapter_set_name (const char *local_name)
 Sets the name of local Bluetooth adapter.
int bt_adapter_get_visibility (bt_adapter_visibility_mode_e *mode, int *duration)
 Gets the visibility mode of local Bluetooth adapter.
int bt_adapter_start_device_discovery (void)
 Starts the device discovery, asynchronously.
int bt_adapter_stop_device_discovery (void)
 Stops the device discovery, asynchronously.
int bt_adapter_is_discovering (bool *is_discovering)
 Checks for the device discovery is in progress or not.
int bt_adapter_foreach_bonded_device (bt_adapter_bonded_device_cb callback, void *user_data)
 Retrieves the device information of all bonded devices.
int bt_adapter_get_bonded_device_info (const char *remote_address, bt_device_info_s **device_info)
 Gets the device information of a bonded device.
int bt_adapter_free_device_info (bt_device_info_s *device_info)
 Frees device info.
int bt_adapter_is_service_used (const char *service_uuid, bool *used)
 Checks whether the UUID of service is used or not.
int bt_adapter_set_state_changed_cb (bt_adapter_state_changed_cb callback, void *user_data)
 Registers a callback function to be invoked when the Bluetooth adapter state changes.
int bt_adapter_unset_state_changed_cb (void)
 Unregisters the callback function.
int bt_adapter_set_name_changed_cb (bt_adapter_name_changed_cb callback, void *user_data)
 Registers a callback function to be invoked when the name of Bluetooth adapter changes.
int bt_adapter_unset_name_changed_cb (void)
 Unregisters the callback function.
int bt_adapter_set_visibility_mode_changed_cb (bt_adapter_visibility_mode_changed_cb callback, void *user_data)
 Registers a callback function to be invoked when the visibility mode changes.
int bt_adapter_unset_visibility_mode_changed_cb (void)
 Unregisters the callback function.
int bt_adapter_set_visibility_duration_changed_cb (bt_adapter_visibility_duration_changed_cb callback, void *user_data)
 Registers a callback function to be invoked every second.
int bt_adapter_unset_visibility_duration_changed_cb (void)
 Unregisters the callback function.
int bt_adapter_set_device_discovery_state_changed_cb (bt_adapter_device_discovery_state_changed_cb callback, void *user_data)
 Registers a callback function to be invoked when the device discovery state changes.
int bt_adapter_unset_device_discovery_state_changed_cb (void)
 Unregisters the callback function.

Typedefs

typedef void(* bt_adapter_state_changed_cb )(int result, bt_adapter_state_e adapter_state, void *user_data)
 Called when the Bluetooth adapter state changes.
typedef void(* bt_adapter_name_changed_cb )(char *device_name, void *user_data)
 Called when adapter name changes.
typedef void(* bt_adapter_visibility_mode_changed_cb )(int result, bt_adapter_visibility_mode_e visibility_mode, void *user_data)
 Called when the visibility mode changes.
typedef void(* bt_adapter_visibility_duration_changed_cb )(int duration, void *user_data)
 Called every second until the visibility mode is changed to BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE.
typedef void(* bt_adapter_device_discovery_state_changed_cb )(int result, bt_adapter_device_discovery_state_e discovery_state, bt_adapter_device_discovery_info_s *discovery_info, void *user_data)
 Called when the state of device discovery changes.
typedef bool(* bt_adapter_bonded_device_cb )(bt_device_info_s *device_info, void *user_data)
 Called when you get bonded devices repeatedly.

Typedef Documentation

typedef bool(* bt_adapter_bonded_device_cb)(bt_device_info_s *device_info, void *user_data)

Called when you get bonded devices repeatedly.

Since :
2.3
Parameters:
[in]device_infoThe bonded device information
[in]user_dataThe user data passed from the foreach function
Returns:
true to continue with the next iteration of the loop,
false to break out of the loop.
Precondition:
bt_adapter_foreach_bonded_device() will invoke this function.
See also:
bt_adapter_foreach_bonded_device()
typedef void(* bt_adapter_device_discovery_state_changed_cb)(int result, bt_adapter_device_discovery_state_e discovery_state, bt_adapter_device_discovery_info_s *discovery_info, void *user_data)

Called when the state of device discovery changes.

Since :
2.3
Remarks:
If discovery_state is BT_ADAPTER_DEVICE_DISCOVERY_FOUND,
then you can get some information, such as remote device address, remote device name, rssi, and bonding state.
Parameters:
[in]resultThe result of the device discovery
[in]discovery_stateThe discovery state to be changed
[in]discovery_infoThe information of the discovered device
If discovery_state is BT_ADAPTER_DEVICE_DISCOVERY_STARTED or BT_ADAPTER_DEVICE_DISCOVERY_FINISHED, then discovery_info is NULL.
[in]user_dataThe user data passed from the callback registration function
Precondition:
Either bt_adapter_start_device_discovery() or bt_adapter_stop_device_discovery() will invoke this function if you register this callback using bt_adapter_set_device_discovery_state_changed_cb().
See also:
bt_adapter_start_device_discovery()
bt_adapter_stop_device_discovery()
bt_adapter_set_device_discovery_state_changed_cb()
bt_adapter_unset_device_discovery_state_changed_cb()
typedef void(* bt_adapter_name_changed_cb)(char *device_name, void *user_data)

Called when adapter name changes.

Since :
2.3
Parameters:
[in]device_nameThe name of the Bluetooth device to be changed
[in]user_dataThe user data passed from the callback registration function
Precondition:
This function will be invoked when the name of Bluetooth adapter changes if you register this callback using bt_adapter_set_name_changed_cb().
See also:
bt_adapter_set_name()
bt_adapter_set_name_changed_cb()
bt_adapter_unset_name_changed_cb()
typedef void(* bt_adapter_state_changed_cb)(int result, bt_adapter_state_e adapter_state, void *user_data)

Called when the Bluetooth adapter state changes.

Since :
2.3
Parameters:
[in]resultThe result of the adapter state changing
[in]adapter_stateThe adapter state to be changed
[in]user_dataThe user data passed from the callback registration function
See also:
bt_adapter_set_state_changed_cb()
bt_adapter_unset_state_changed_cb()
typedef void(* bt_adapter_visibility_duration_changed_cb)(int duration, void *user_data)

Called every second until the visibility mode is changed to BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE.

Since :
2.3
Remarks:
This callback function is called only if visibility mode is BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE.
Parameters:
[in]durationThe duration until the visibility mode is changed to BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE (in seconds)
[in]user_dataThe user data passed from the callback registration function
Precondition:
This function will be invoked if you register this callback using bt_adapter_set_visibility_duration_changed_cb().
See also:
bt_adapter_set_visibility_duration_changed_cb()
bt_adapter_unset_visibility_duration_changed_cb()
typedef void(* bt_adapter_visibility_mode_changed_cb)(int result, bt_adapter_visibility_mode_e visibility_mode, void *user_data)

Called when the visibility mode changes.

Since :
2.3
Parameters:
[in]resultThe result of the visibility mode changing
[in]visibility_modeThe visibility mode to be changed
[in]user_dataThe user data passed from the callback registration function
Precondition:
This function will be invoked when the visibility of Bluetooth adapter changes if you register this callback using bt_adapter_set_visibility_mode_changed_cb().
See also:
bt_adapter_set_visibility_mode_changed_cb()
bt_adapter_unset_visibility_mode_changed_cb()

Enumeration Type Documentation

Enumerations of the discovery state of Bluetooth device.

Since :
2.3
Enumerator:
BT_ADAPTER_DEVICE_DISCOVERY_STARTED 

Device discovery is started

BT_ADAPTER_DEVICE_DISCOVERY_FINISHED 

Device discovery is finished

BT_ADAPTER_DEVICE_DISCOVERY_FOUND 

The remote Bluetooth device is found

Enumerations of the Bluetooth adapter state.

Since :
2.3
Enumerator:
BT_ADAPTER_DISABLED 

Bluetooth adapter is disabled

BT_ADAPTER_ENABLED 

Bluetooth adapter is enabled

Enumerations of the Bluetooth visibility mode.

Since :
2.3
Enumerator:
BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE 

Other devices cannot find your device via discovery

BT_ADAPTER_VISIBILITY_MODE_GENERAL_DISCOVERABLE 

Discoverable mode

BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE 

Discoverable mode with time limit. After specific period, it is changed to BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE.


Function Documentation

int bt_adapter_foreach_bonded_device ( bt_adapter_bonded_device_cb  callback,
void *  user_data 
)

Retrieves the device information of all bonded devices.

Since :
2.3
Parameters:
[in]callbackThe callback function to invoke
[in]user_dataThe user data passed from the foreach function
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_OUT_OF_MEMORYOut of memory
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The state of local Bluetooth must be BT_ADAPTER_ENABLED.
Postcondition:
This function invokes bt_adapter_bonded_device_cb().
See also:
bt_adapter_bonded_device_cb()

Frees device info.

Since :
2.3
Parameters:
[in]device_infoThe bonded device information
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_SUPPORTEDNot supported
See also:
bt_adapter_get_bonded_device_info()
int bt_adapter_get_address ( char **  local_address)

Gets the address of local Bluetooth adapter.

Since :
2.3
Remarks:
The local_address must be released with free() by you.
Parameters:
[out]local_addressThe device address of local Bluetooth adapter
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OUT_OF_MEMORYOut of memory
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The state of local Bluetooth must be BT_ADAPTER_ENABLED.
See also:
bt_adapter_get_name()
int bt_adapter_get_bonded_device_info ( const char *  remote_address,
bt_device_info_s **  device_info 
)

Gets the device information of a bonded device.

Since :
2.3
Remarks:
The device_info must be released with bt_adapter_free_device_info() by you .
Parameters:
[in]remote_addressThe address of remote device
[out]device_infoThe bonded device information
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_OUT_OF_MEMORYOut of memory
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_REMOTE_DEVICE_NOT_BONDEDRemote device not bonded
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The state of local Bluetooth must be BT_ADAPTER_ENABLED.
Postcondition:
This function invokes bt_adapter_bonded_device_cb().
See also:
bt_adapter_bonded_device_cb()
int bt_adapter_get_name ( char **  local_name)

Gets the name of local Bluetooth adapter.

Use this function to get the friendly name associated with Bluetooth
device, retrieved by the remote Bluetooth devices.

Since :
2.3
Remarks:
The local_name must be released with free() by you.
Parameters:
[out]local_nameThe local device name
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OUT_OF_MEMORYOut of memory
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The state of local Bluetooth must be BT_ADAPTER_ENABLED.
See also:
bt_adapter_set_name()
int bt_adapter_get_state ( bt_adapter_state_e adapter_state)

Gets the current state of local Bluetooth adapter.

Since :
2.3
Parameters:
[out]adapter_stateThe current adapter state
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
Bluetooth service must be initialized with bt_initialize().
See also:
bt_initialize()
int bt_adapter_get_visibility ( bt_adapter_visibility_mode_e mode,
int *  duration 
)

Gets the visibility mode of local Bluetooth adapter.

Since :
2.3
Parameters:
[out]modeThe visibility mode of the Bluetooth device
[out]durationThe duration until the visibility mode is changed to BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE (in seconds). duration is valid only if mode is BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE. This value can be NULL.
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The state of local Bluetooth must be BT_ADAPTER_ENABLED.
int bt_adapter_is_discovering ( bool *  is_discovering)

Checks for the device discovery is in progress or not.

Since :
2.3
Remarks:
If Bluetooth discovery is in progress, other operations are not allowed and
you have to either stop the discovery operation, or wait for it to be finished,
before performing other operations.
Parameters:
[out]is_discoveringThe discovering status: (true = in progress , false = not in progress )
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The state of local Bluetooth must be BT_ADAPTER_ENABLED.
See also:
bt_adapter_start_device_discovery()
bt_adapter_stop_device_discovery()
int bt_adapter_is_service_used ( const char *  service_uuid,
bool *  used 
)

Checks whether the UUID of service is used or not.

Since :
2.3
Parameters:
[in]service_uuidThe UUID of service
[out]usedIndicates whether the service is used or not
Returns:
true on success, otherwise false.
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_NOT_SUPPORTEDNot supported

Registers a callback function to be invoked when the device discovery state changes.

Since :
2.3
Parameters:
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized with bt_initialize().
Postcondition:
bt_adapter_device_discovery_state_changed_cb() will be invoked.
See also:
bt_initialize()
bt_adapter_device_discovery_state_changed_cb()
bt_adapter_unset_device_discovery_state_changed_cb()
int bt_adapter_set_name ( const char *  local_name)

Sets the name of local Bluetooth adapter.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]local_nameThe name of the Bluetooth device.
The maximum length is 248 characters.
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_PERMISSION_DENIEDPermission denied
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The state of local Bluetooth must be BT_ADAPTER_ENABLED.
Postcondition:
bt_adapter_name_changed_cb() will be invoked if this function returns BT_ERROR_NONE.
See also:
bt_adapter_get_name()
bt_adapter_name_changed_cb()
bt_adapter_set_name_changed_cb()
bt_adapter_unset_name_changed_cb()
int bt_adapter_set_name_changed_cb ( bt_adapter_name_changed_cb  callback,
void *  user_data 
)

Registers a callback function to be invoked when the name of Bluetooth adapter changes.

Since :
2.3
Parameters:
[in]callbackThe callback function to invoke
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized with bt_initialize().
Postcondition:
bt_adapter_name_changed_cb() will be invoked.
See also:
bt_initialize()
bt_adapter_name_changed_cb()
bt_adapter_unset_name_changed_cb()
int bt_adapter_set_state_changed_cb ( bt_adapter_state_changed_cb  callback,
void *  user_data 
)

Registers a callback function to be invoked when the Bluetooth adapter state changes.

Since :
2.3
Parameters:
[in]callbackThe callback function to invoke
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized with bt_initialize().
Postcondition:
bt_adapter_state_changed_cb() will be invoked.
See also:
bt_initialize()
bt_adapter_state_changed_cb()
bt_adapter_unset_state_changed_cb()

Registers a callback function to be invoked every second.

When you set visibility mode as BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE,
callback will be called every second until visibility mode is changed to BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE.

Since :
2.3 until the visibility mode is changed from BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE to BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE.
Parameters:
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized by bt_initialize().
Postcondition:
bt_adapter_visibility_duration_changed_cb() will be invoked.
See also:
bt_initialize()
bt_adapter_visibility_duration_changed_cb()
bt_adapter_unset_visibility_duration_changed_cb()

Registers a callback function to be invoked when the visibility mode changes.

Since :
2.3
Parameters:
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_INVALID_PARAMETERInvalid parameter
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized with bt_initialize().
Postcondition:
bt_adapter_visibility_mode_changed_cb() will be invoked.
See also:
bt_initialize()
bt_adapter_visibility_mode_changed_cb()
bt_adapter_unset_visibility_mode_changed_cb()

Starts the device discovery, asynchronously.

If a device is discovered, bt_adapter_device_discovery_state_changed_cb() will be invoked
with BT_ADAPTER_DEVICE_DISCOVERY_FOUND, and then bt_adapter_device_discovery_state_changed_cb()
will be called with BT_ADAPTER_DEVICE_DISCOVERY_FINISHED in case of the completion or cancellation of the discovery.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Remarks:
To connect to peer Bluetooth device, you need to know its Bluetooth address.
The device discovery can be stopped by bt_adapter_stop_device_discovery().
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_NOW_IN_PROGRESSOperation is now in progress
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_PERMISSION_DENIEDPermission denied
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The state of local Bluetooth must be BT_ADAPTER_ENABLED.
Postcondition:
This function invokes bt_adapter_device_discovery_state_changed_cb().
See also:
bt_adapter_is_discovering()
bt_adapter_stop_device_discovery()
bt_adapter_device_discovery_state_changed_cb()
bt_adapter_set_device_discovery_state_changed_cb()
bt_adapter_unset_device_discovery_state_changed_cb()

Stops the device discovery, asynchronously.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Remarks:
The device discovery process will take 10 ~ 20 seconds to get all the devices in vicinity.
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_NOT_ENABLEDNot enabled
BT_ERROR_NOT_IN_PROGRESSOperation is not in progress
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_PERMISSION_DENIEDPermission denied
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The device discovery must be in progress with bt_adapter_start_device_discovery().
Postcondition:
This function invokes bt_adapter_device_discovery_state_changed_cb().
See also:
bt_adapter_is_discovering()
bt_adapter_start_device_discovery()
bt_adapter_set_device_discovery_state_changed_cb()
bt_adapter_unset_device_discovery_state_changed_cb()
bt_adapter_device_discovery_state_changed_cb()

Unregisters the callback function.

Since :
2.3
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized with bt_initialize().
See also:
bt_initialize()
bt_adapter_set_device_discovery_state_changed_cb()

Unregisters the callback function.

Since :
2.3
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized with bt_initialize().
See also:
bt_initialize()
bt_adapter_set_name_changed_cb()

Unregisters the callback function.

Since :
2.3
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized with bt_initialize().
See also:
bt_initialize()
bt_adapter_set_state_changed_cb()

Unregisters the callback function.

Since :
2.3
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized with bt_initialize().
See also:
bt_initialize()
bt_adapter_set_visibility_duration_changed_cb()

Unregisters the callback function.

Since :
2.3
Returns:
0 on success, otherwise a negative error value.
Return values:
BT_ERROR_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized with bt_initialize().
See also:
bt_initialize()
bt_adapter_set_visibility_mode_changed_cb()