Tizen Native API  5.5
Bluetooth IPSP

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:

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]resultThe result of the connection or disconnection request
[in]connectedThe connection status: (true = connected, false = disconnected)
[in]remote_addressAddress of remote device
[in]iface_nameThe network interface name for IPv6 network interface
[in]user_dataThe 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]resultThe result of the initialization or deinitialization request
[in]ipsp_initializedThe initialized state: (true = initialized, false = deinitialized)
[in]user_dataThe user data passed from the initialization request function
See also:
bt_ipsp_initialize()
bt_ipsp_deinitialize()

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_addressThe remote address
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
Postcondition:
bt_ipsp_set_connection_state_changed_cb() will be invoked.
See also:
bt_ipsp_set_connection_state_changed_cb()
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_NONESuccessful
BT_ERROR_NOT_INITIALIZEDNot initialized
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_NOT_SUPPORTEDNot 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_addressThe remote address
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_REMOTE_DEVICE_NOT_CONNECTEDRemote device is not connected
BT_ERROR_OPERATION_FAILEDOperation failed
BT_ERROR_PERMISSION_DENIEDPermission denied
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The remote device must be connected by bt_ipsp_connect().
Postcondition:
bt_ipsp_set_connection_state_changed_cb() will be invoked.
See also:
bt_ipsp_connect()
bt_ipsp_set_connection_state_changed_cb()
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]callbackThe callback called when the initialization is finished
[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_OPERATION_FAILEDOperation failed
BT_ERROR_NOT_SUPPORTEDNot supported
Precondition:
The Bluetooth service must be initialized with bt_initialize().
See also:
bt_initialize()

Registers a callback function that will be invoked when the connection state changes.

Since :
4.0
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().
See also:
bt_initialize()

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_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()