Tizen Native API
6.5
|
Bluetooth Service provides API to manage Bluetooth device.
Required Header
#include <bluetooth.h>
Overview
Bluetooth Service consists of Bluetooth Adapter, Bluetooth Device and Bluetooth Socket.
In order to use the above APIs, you must call bt_initialize() in advance. In addition, bt_deinitialize() should be called when Bluetooth Service is no longer needed. Please refer Bluetooth Tutorial if you want to get more detailed usages and information of this api.
Note on callbacks: All callbacks in this module are called in the main loop context.
Related Features
This API is related with the following features:
- http://tizen.org/feature/network.bluetooth
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.
Functions | |
int | bt_initialize (void) |
Initializes the Bluetooth API. | |
int | bt_deinitialize (void) |
Releases all resources of the Bluetooth API. | |
int | bt_get_uuid_name (const char *uuid, char **name) |
Gets the specification name for the given UUID. |
Enumeration Type Documentation
enum bt_error_e |
Enumerations of Bluetooth error codes.
- Since :
- 2.3.1
- Enumerator:
Function Documentation
int bt_deinitialize | ( | void | ) |
Releases all resources of the Bluetooth API.
- Since :
- 2.3.1
- Remarks:
- This function must be called if Bluetooth API is no longer needed.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- Bluetooth API must be initialized with bt_initialize().
- See also:
- bt_initialize()
int bt_get_uuid_name | ( | const char * | uuid, |
char ** | name | ||
) |
Gets the specification name for the given UUID.
- Since :
- 3.0
- Remarks:
- The name must be released using free().
- Parameters:
-
[in] uuid The UUID [out] name The specification name defined at www.bluetooth.com
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_SUPPORTED Not supported
- See also:
- bt_gatt_get_uuid()
int bt_initialize | ( | void | ) |
Initializes the Bluetooth API.
- Since :
- 2.3.1
- Remarks:
- This function must be called before Bluetooth API starts.
You must free all resources of the Bluetooth service by calling bt_deinitialize() if Bluetooth service is no longer needed.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_NOT_SUPPORTED Not supported
- See also:
- bt_deinitialize()