Tizen Native API
6.5
|
Bluetooth HDP(Health Device Profile) API provides functions for managing connections to health devices and exchanging data.
Required Header
#include <bluetooth.h>
Overview
The Source is a transmitter of application data that is to be transferred to a Sink. The Sink is a receiver of application data delivered from a Source. This API supports the Sink role in HDP spec.
Related Features
This API is related with the following features:
- http://tizen.org/feature/network.bluetooth.health
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_hdp_register_sink_app (unsigned short data_type, char **app_id) |
Registers an application that acts as the Sink role of HDP (Health Device Profile). | |
int | bt_hdp_unregister_sink_app (const char *app_id) |
Unregisters the given application that acts as the Sink role of HDP (Health Device Profile). | |
int | bt_hdp_connect_to_source (const char *remote_address, const char *app_id) |
Connects the remote device which acts as Source role, asynchronously. | |
int | bt_hdp_disconnect (const char *remote_address, unsigned int channel) |
Disconnects the remote device, asynchronously. | |
int | bt_hdp_send_data (unsigned int channel, const char *data, unsigned int size) |
Sends the data to the remote device. | |
int | bt_hdp_set_connection_state_changed_cb (bt_hdp_connected_cb connected_cb, bt_hdp_disconnected_cb disconnected_cb, void *user_data) |
Registers a callback function that will be invoked when the connection state is changed. | |
int | bt_hdp_unset_connection_state_changed_cb (void) |
Unregisters a callback function that will be invoked when the connection state is changed. | |
int | bt_hdp_set_data_received_cb (bt_hdp_data_received_cb callback, void *user_data) |
Registers a callback function that will be invoked when you receive the data. | |
int | bt_hdp_unset_data_received_cb (void) |
Unregisters a callback function that will be invoked when you receive the data. | |
Typedefs | |
typedef void(* | bt_hdp_connected_cb )(int result, const char *remote_address, const char *app_id, bt_hdp_channel_type_e type, unsigned int channel, void *user_data) |
Called when the connection is established. | |
typedef void(* | bt_hdp_disconnected_cb )(int result, const char *remote_address, unsigned int channel, void *user_data) |
Called when the connection is disconnected. | |
typedef void(* | bt_hdp_data_received_cb )(unsigned int channel, const char *data, unsigned int size, void *user_data) |
Called when the you receive the data. |
Typedef Documentation
typedef void(* bt_hdp_connected_cb)(int result, const char *remote_address, const char *app_id, bt_hdp_channel_type_e type, unsigned int channel, void *user_data) |
Called when the connection is established.
- Deprecated:
- Deprecated since 5.0.
- Since :
- 2.3.1
- Remarks:
- Deprecated, because of no usecase and supported devices.
- Parameters:
-
[in] result The result of connecting to the remote device [in] remote_address The address of connected remote device [in] app_id The ID of application [in] type The type of HDP (Health Device Profile) channel [in] channel The connected data channel [in] user_data The user data passed from the callback registration function
typedef void(* bt_hdp_data_received_cb)(unsigned int channel, const char *data, unsigned int size, void *user_data) |
Called when the you receive the data.
- Deprecated:
- Deprecated since 5.0.
- Since :
- 2.3.1
- Remarks:
- Deprecated, because of no usecase and supported devices.
- Parameters:
-
[in] channel The connected data channel [in] data The received data [in] size The size of received data (byte) [in] user_data The user data passed from the callback registration function
typedef void(* bt_hdp_disconnected_cb)(int result, const char *remote_address, unsigned int channel, void *user_data) |
Called when the connection is disconnected.
- Deprecated:
- Deprecated since 5.0.
- Since :
- 2.3.1
- Remarks:
- Deprecated, because of no usecase and supported devices.
- Parameters:
-
[in] result The result of disconnecting from the remote device [in] remote_address The address of disconnected remote device [in] channel The connected data channel [in] user_data The user data passed from the callback registration function
Enumeration Type Documentation
Enumerations for the data channel type.
- Deprecated:
- Deprecated since 5.0.
- Since :
- 2.3.1
- Remarks:
- Deprecated, because of no usecase and supported devices.
Function Documentation
int bt_hdp_connect_to_source | ( | const char * | remote_address, |
const char * | app_id | ||
) |
Connects the remote device which acts as Source role, asynchronously.
- Deprecated:
- Deprecated since 5.0.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Remarks:
- Deprecated, because of no usecase and supported devices.
- Parameters:
-
[in] remote_address The remote address [in] app_id The ID of application
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OUT_OF_MEMORY Out of memory BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_PERMISSION_DENIED Permission denied BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The Sink role of HDP must be registered with bt_hdp_register_sink_app().
- The local device must be bonded with the remote device by bt_device_create_bond().
- Postcondition:
- bt_hdp_connected_cb() will be invoked.
int bt_hdp_disconnect | ( | const char * | remote_address, |
unsigned int | channel | ||
) |
Disconnects the remote device, asynchronously.
- Deprecated:
- Deprecated since 5.0.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Remarks:
- Deprecated, because of no usecase and supported devices.
- Parameters:
-
[in] remote_address The remote address [in] channel The connected data channel
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED Remote device is not connected BT_ERROR_OUT_OF_MEMORY Out of memory BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_PERMISSION_DENIED Permission denied BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.
- Postcondition:
- bt_hdp_disconnected_cb() will be invoked.
int bt_hdp_register_sink_app | ( | unsigned short | data_type, |
char ** | app_id | ||
) |
Registers an application that acts as the Sink role of HDP (Health Device Profile).
- Deprecated:
- Deprecated since 5.0.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Remarks:
- The app_id must be released with free() by you.
Deprecated, because of no usecase and supported devices.
- Parameters:
-
[in] data_type The data type of MDEP. This value is defined in ISO/IEEE 11073-20601 spec. For example, pulse oximeter is 0x1004 and blood pressure monitor is 0x1007. [out] app_id The ID of application
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_OUT_OF_MEMORY Out of memory BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_PERMISSION_DENIED Permission denied BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The state of local Bluetooth must be BT_ADAPTER_ENABLED.
- See also:
- bt_hdp_unregister_sink_app()
int bt_hdp_send_data | ( | unsigned int | channel, |
const char * | data, | ||
unsigned int | size | ||
) |
Sends the data to the remote device.
- Deprecated:
- Deprecated since 5.0.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Remarks:
- Deprecated, because of no usecase and supported devices.
- Parameters:
-
[in] channel The connected data channel [in] data The data to send [in] size The size of data to send (byte)
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_PERMISSION_DENIED Permission denied BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected.
int bt_hdp_set_connection_state_changed_cb | ( | bt_hdp_connected_cb | connected_cb, |
bt_hdp_disconnected_cb | disconnected_cb, | ||
void * | user_data | ||
) |
Registers a callback function that will be invoked when the connection state is changed.
- Deprecated:
- Deprecated since 5.0.
- Since :
- 2.3.1
- Remarks:
- Deprecated, because of no usecase and supported devices.
- Parameters:
-
[in] connected_cb The callback function called when a connection is established [in] disconnected_cb The callback function called when a connection is disconnected [in] user_data The user data to be passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The Bluetooth service must be initialized with bt_initialize().
int bt_hdp_set_data_received_cb | ( | bt_hdp_data_received_cb | callback, |
void * | user_data | ||
) |
Registers a callback function that will be invoked when you receive the data.
- Deprecated:
- Deprecated since 5.0.
- Since :
- 2.3.1
- Remarks:
- Deprecated, because of no usecase and supported devices.
- Parameters:
-
[in] callback The callback function to register [in] user_data The user data to be passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The Bluetooth service must be initialized with bt_initialize().
- See also:
- bt_hdp_unset_data_received_cb()
int bt_hdp_unregister_sink_app | ( | const char * | app_id | ) |
Unregisters the given application that acts as the Sink role of HDP (Health Device Profile).
- Deprecated:
- Deprecated since 5.0.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Remarks:
- Deprecated, because of no usecase and supported devices.
- Parameters:
-
[in] app_id The ID of application
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_INVALID_PARAMETER Invalid parameter BT_ERROR_NOT_ENABLED Not enabled BT_ERROR_OPERATION_FAILED Operation failed BT_ERROR_PERMISSION_DENIED Permission denied BT_ERROR_NOT_SUPPORTED Not supported
- See also:
- bt_hdp_register_sink_app()
int bt_hdp_unset_connection_state_changed_cb | ( | void | ) |
Unregisters a callback function that will be invoked when the connection state is changed.
- Deprecated:
- Deprecated since 5.0.
- Since :
- 2.3.1
- Remarks:
- Deprecated, because of no usecase and supported devices.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The Bluetooth service must be initialized with bt_initialize().
int bt_hdp_unset_data_received_cb | ( | void | ) |
Unregisters a callback function that will be invoked when you receive the data.
- Deprecated:
- Deprecated since 5.0.
- Since :
- 2.3.1
- Remarks:
- Deprecated, because of no usecase and supported devices.
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
BT_ERROR_NONE Successful BT_ERROR_NOT_INITIALIZED Not initialized BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The Bluetooth service must be initialized with bt_initialize().
- See also:
- bt_hdp_set_data_received_cb()