Tizen Native API  7.0
Bluetooth OOB

Bluetooth OOB (Out of Band) API provides functions for exchanging some information used in the pairing process.

Required Header

#include <bluetooth.h>

Overview

This set of functions is used for exchanging the hash key and randomizer. This API uses an external means of communication, such as near-field communication (NFC) to exchange some information used in the pairing process.

Related Features

This API is related with the following features:

  • http://tizen.org/feature/network.bluetooth.oob

It is recommended to use features in your application for reliability.

You can check if a device supports the related features for this API by using System Information, and control your application's actions accordingly.

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_adapter_get_local_oob_data (unsigned char **hash, unsigned char **randomizer, int *hash_len, int *randomizer_len)
 Gets the Hash and Randomizer value, synchronously.
int bt_adapter_set_remote_oob_data (const char *remote_address, unsigned char *hash, unsigned char *randomizer, int hash_len, int randomizer_len)
 Sets the Hash and Randomizer value, synchronously.
int bt_adapter_get_local_oob_ext_data (unsigned char **hash192, unsigned char **randomizer192, int *hash192_len, int *randomizer192_len, unsigned char **hash256, unsigned char **randomizer256, int *hash256_len, int *randomizer256_len)
 Gets the Hash and Randomizer value, synchronously.
int bt_adapter_set_remote_oob_ext_data (const char *remote_address, const unsigned char *hash192, const unsigned char *randomizer192, int hash192_len, int randomizer192_len, const unsigned char *hash256, const unsigned char *randomizer256, int hash256_len, int randomizer256_len)
 Sets the Hash and Randomizer value, synchronously.
int bt_adapter_remove_remote_oob_data (const char *remote_address)
 Deletes the Hash and Randomizer value, synchronously.

Function Documentation

int bt_adapter_get_local_oob_data ( unsigned char **  hash,
unsigned char **  randomizer,
int *  hash_len,
int *  randomizer_len 
)

Gets the Hash and Randomizer value, synchronously.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Remarks:
http://tizen.org/privilege/bluetooth (public level privilege) is required to use this API since 5.5.
Parameters:
[out]hashThe hash value received from the controller
[out]randomizerThe hash value received from the controller
[out]hash_lenThe length of the hash value
[out]randomizer_lenThe length of the randomizer value
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.
The Bluetooth service must be initialized with bt_initialize().
See also:
bt_initialize()
int bt_adapter_get_local_oob_ext_data ( unsigned char **  hash192,
unsigned char **  randomizer192,
int *  hash192_len,
int *  randomizer192_len,
unsigned char **  hash256,
unsigned char **  randomizer256,
int *  hash256_len,
int *  randomizer256_len 
)

Gets the Hash and Randomizer value, synchronously.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Remarks:
http://tizen.org/privilege/bluetooth (public level privilege) is required to use this API since 5.5.
The hash192, randomizer192, hash256 and randomizer256 must be released using free().
Parameters:
[out]hash192The hash value derived from the P-192 public key
[out]randomizer192The randomizer value associated with the P-192 public key
[out]hash192_lenThe length of hash192
[out]randomizer192_lenThe length of randomizer192
[out]hash256The hash value derived from the P-256 public key
[out]randomizer256The randomizer value associated with the P-256 public key
[out]hash256_lenThe length of hash256
[out]randomizer256_lenThe length of randomizer256
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.
The Bluetooth service must be initialized with bt_initialize().
See also:
bt_initialize()
int bt_adapter_remove_remote_oob_data ( const char *  remote_address)

Deletes the Hash and Randomizer value, synchronously.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]remote_addressRemote device 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
Precondition:
The state of local Bluetooth must be BT_ADAPTER_ENABLED.
The Bluetooth service must be initialized with bt_initialize().
See also:
bt_initialize()
int bt_adapter_set_remote_oob_data ( const char *  remote_address,
unsigned char *  hash,
unsigned char *  randomizer,
int  hash_len,
int  randomizer_len 
)

Sets the Hash and Randomizer value, synchronously.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]remote_addressRemote device address
[in]hashThe hash value received from the controller
[in]randomizerThe hash value received from the controller
[in]hash_lenThe length of the hash value. Allowed value is 16
[in]randomizer_lenThe length of the randomizer value. Allowed value is 16
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.
The Bluetooth service must be initialized with bt_initialize().
See also:
bt_initialize()
int bt_adapter_set_remote_oob_ext_data ( const char *  remote_address,
const unsigned char *  hash192,
const unsigned char *  randomizer192,
int  hash192_len,
int  randomizer192_len,
const unsigned char *  hash256,
const unsigned char *  randomizer256,
int  hash256_len,
int  randomizer256_len 
)

Sets the Hash and Randomizer value, synchronously.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/bluetooth
Parameters:
[in]remote_addressRemote device address
[in]hash192The P-192 hash value received via OOB from remote device
[in]randomizer192The P-192 randomizer value received via OOB from remote device
[in]hash192_lenThe length of hash192
[in]randomizer192_lenThe length of randomizer192
[in]hash256The P-256 hash value received via OOB from remote device
[in]randomizer256The P-256 randomizer value received via OOB from remote device
[in]hash256_lenThe length of hash256
[in]randomizer256_lenThe length of randomizer256
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.
The Bluetooth service must be initialized with bt_initialize().
See also:
bt_initialize()