Tizen(Headless) Native API
6.0
|
Bluetooth IPSP(Internet Protocol Support Profile) API provides functions for supporting of exchanging IPv6 packets between devices over the BLE transport.
Required Header
#include <bluetooth.h>
Overview
Two roles are defined for devices that implement IPSP. The Router is used for devices that can route IPv6 packets. The Node is used for devices that can originate or consume IPv6 application packets.
Related Features
This API is related with the following features:
- http://tizen.org/feature/network.bluetooth.le.ipsp
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_ipsp_initialize (bt_ipsp_init_state_changed_cb callback, void *user_data) |
Initializes the Bluetooth IPSP (Internet Protocol Support Profile) service. | |
int | bt_ipsp_deinitialize (void) |
Deinitializes the Bluetooth IPSP (Internet Protocol Support Profile) service. | |
int | bt_ipsp_connect (const char *remote_address) |
Connects to a remote device's IPSP service over LE, asynchronously. | |
int | bt_ipsp_disconnect (const char *remote_address) |
Disconnects from a remote device's IPSP service, asynchronously. | |
int | bt_ipsp_set_connection_state_changed_cb (bt_ipsp_connection_state_changed_cb callback, void *user_data) |
Registers a callback function that will be invoked when the connection state changes. | |
int | bt_ipsp_unset_connection_state_changed_cb (void) |
Unregisters the callback function called when the connection state changes. | |
Typedefs | |
typedef void(* | bt_ipsp_init_state_changed_cb )(int result, bool ipsp_initialized, void *user_data) |
Called when the IPSP initialization state changes. | |
typedef void(* | bt_ipsp_connection_state_changed_cb )(int result, bool connected, const char *remote_address, const char *iface_name, void *user_data) |
Called when the IPSP connection state changes. |
Typedef Documentation
typedef void(* bt_ipsp_connection_state_changed_cb)(int result, bool connected, const char *remote_address, const char *iface_name, void *user_data) |
Called when the IPSP connection state changes.
- Since :
- 4.0
- Parameters:
-
[in] result The result of the connection or disconnection request [in] connected The connection status: ( true
= connected,false
= disconnected)[in] remote_address Address of remote device [in] iface_name The network interface name for IPv6 network interface [in] user_data The user data passed from the callback registration function
- See also:
- bt_ipsp_connect()
- bt_ipsp_disconnect()
typedef void(* bt_ipsp_init_state_changed_cb)(int result, bool ipsp_initialized, void *user_data) |
Called when the IPSP initialization state changes.
- Since :
- 4.0
- Parameters:
-
[in] result The result of the initialization or deinitialization request [in] ipsp_initialized The initialized state: ( true
= initialized,false
= deinitialized)[in] user_data The user data passed from the initialization request function
Function Documentation
int bt_ipsp_connect | ( | const char * | remote_address | ) |
Connects to a remote device's IPSP service over LE, asynchronously.
- Since :
- 4.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] remote_address The remote address
- 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
- Postcondition:
- bt_ipsp_set_connection_state_changed_cb() will be invoked.
int bt_ipsp_deinitialize | ( | void | ) |
Deinitializes the Bluetooth IPSP (Internet Protocol Support Profile) service.
- Since :
- 4.0
- 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:
- The Bluetooth service must be initialized with bt_initialize().
- See also:
- bt_initialize()
int bt_ipsp_disconnect | ( | const char * | remote_address | ) |
Disconnects from a remote device's IPSP service, asynchronously.
- Since :
- 4.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/bluetooth
- Parameters:
-
[in] remote_address The remote address
- 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_OPERATION_FAILED Operation failed BT_ERROR_PERMISSION_DENIED Permission denied BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The remote device must be connected by bt_ipsp_connect().
- Postcondition:
- bt_ipsp_set_connection_state_changed_cb() will be invoked.
int bt_ipsp_initialize | ( | bt_ipsp_init_state_changed_cb | callback, |
void * | user_data | ||
) |
Initializes the Bluetooth IPSP (Internet Protocol Support Profile) service.
- Since :
- 4.0
- Parameters:
-
[in] callback The callback called when the initialization is finished [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_OPERATION_FAILED Operation failed BT_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- The Bluetooth service must be initialized with bt_initialize().
- See also:
- bt_initialize()
int bt_ipsp_set_connection_state_changed_cb | ( | bt_ipsp_connection_state_changed_cb | callback, |
void * | user_data | ||
) |
Registers a callback function that will be invoked when the connection state changes.
- Since :
- 4.0
- 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_initialize()
int bt_ipsp_unset_connection_state_changed_cb | ( | void | ) |
Unregisters the callback function called when the connection state changes.
- Since :
- 4.0
- 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_initialize()