hsw-nbt 1.2.0
OPTIGA Authenticate NBT Host Library for C
Data Structures | Macros | Functions
ifx-record-bluetooth.h File Reference

Model interface to create the Bluetooth carrier configuration record types and set/get record fields. More...

#include <stddef.h>
#include <stdint.h>
#include "infineon/ifx-error.h"
#include "infineon/ifx-utils.h"

Go to the source code of this file.

Data Structures

struct  ifx_bt_config_field_t
 Defines the data structure of Bluetooth configuration field. More...
 
struct  ifx_record_eir_data_t
 Structure for extended inquiry response (EIR) data object. Each EIR structure consists of an EIR Length field of 1 octet, an EIR Type field and an EIR Data field. More...
 

Macros

#define IFX_RECORD_BT_SET   UINT8_C(0x01)
 Identifier for model set Bluetooth record.
 
#define IFX_RECORD_BT_GET   UINT8_C(0x02)
 Identifier for model get Bluetooth record ID.
 
#define IFX_RECORD_BT_RELEASE_MEMORY   UINT8_C(0x03)
 Identifier for model Bluetooth record ID release memory.
 
#define IFX_RECORD_BT_TYPE   "application/vnd.bluetooth.ep.oob"
 Type information for bluetooth record.
 

Functions

ifx_status_t ifx_record_bt_new (ifx_record_handle_t *handle)
 Creates the Bluetooth record and handle of the created record. This handle holds values of the record needed for encode and decode operations.
 
ifx_status_t ifx_record_bt_set_device_addr (ifx_record_handle_t *handle, const uint8_t *device_addr)
 Sets the device address in the Bluetooth carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_bt_set_device_class (ifx_record_handle_t *handle, const ifx_bt_config_field_t *device_class)
 Sets the device class in the Bluetooth carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_bt_set_simple_pairing_hash_c (ifx_record_handle_t *handle, uint8_t config_type, const ifx_bt_config_field_t *simple_pairing_hash_c)
 Sets the simple pairing hash in the Bluetooth carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_bt_set_simple_pairing_randomizer_r (ifx_record_handle_t *handle, uint8_t config_type, const ifx_bt_config_field_t *simple_pairing_randomizer_r)
 Sets the simple pairing randomizer R in the Bluetooth carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_bt_set_service_class_uuid (ifx_record_handle_t *handle, uint8_t config_type, const ifx_bt_config_field_t *service_class_uuid)
 Sets the service class universal unique identifier (UUID) in the Bluetooth carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_bt_set_local_name (ifx_record_handle_t *handle, uint8_t config_type, const ifx_bt_config_field_t *local_name)
 Sets the local name in the Bluetooth carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_bt_set_additional_eir_data (ifx_record_handle_t *handle, const ifx_record_eir_data_t *additional_data, uint32_t count)
 Sets the array of additional EIR data in Bluetooth carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_bt_get_device_addr (const ifx_record_handle_t *handle, uint8_t *device_addr)
 Gets the device address of the Bluetooth carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_bt_get_device_class (const ifx_record_handle_t *handle, ifx_bt_config_field_t *device_class)
 Gets the device class of Bluetooth carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_bt_get_simple_pairing_hash_c (const ifx_record_handle_t *handle, uint8_t *config_type, ifx_bt_config_field_t *simple_pairing_hash_c)
 Gets the simple pairing hash of the Bluetooth carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_bt_get_simple_pairing_randomizer_r (const ifx_record_handle_t *handle, uint8_t *config_type, ifx_bt_config_field_t *simple_pairing_randomizer_r)
 Gets the simple pairing randomizer R of the Bluetooth carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_bt_get_service_class_uuid (const ifx_record_handle_t *handle, uint8_t *config_type, ifx_bt_config_field_t *service_class_uuid)
 Gets the service class UUID of the Bluetooth carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_bt_get_local_name (const ifx_record_handle_t *handle, uint8_t *config_type, ifx_bt_config_field_t *local_name)
 Gets the local name in the Bluetooth carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_bt_get_additional_eir_data (const ifx_record_handle_t *handle, ifx_record_eir_data_t *additional_data, uint32_t *count)
 Gets an array of additional EIR data of the Bluetooth carrier configuration record from the given record handle.
 

Detailed Description

Model interface to create the Bluetooth carrier configuration record types and set/get record fields.

Definition in file ifx-record-bluetooth.h.

Macro Definition Documentation

◆ IFX_RECORD_BT_GET

#define IFX_RECORD_BT_GET   UINT8_C(0x02)

Identifier for model get Bluetooth record ID.

Definition at line 32 of file ifx-record-bluetooth.h.

◆ IFX_RECORD_BT_RELEASE_MEMORY

#define IFX_RECORD_BT_RELEASE_MEMORY   UINT8_C(0x03)

Identifier for model Bluetooth record ID release memory.

Definition at line 37 of file ifx-record-bluetooth.h.

◆ IFX_RECORD_BT_SET

#define IFX_RECORD_BT_SET   UINT8_C(0x01)

Identifier for model set Bluetooth record.

Definition at line 27 of file ifx-record-bluetooth.h.

◆ IFX_RECORD_BT_TYPE

#define IFX_RECORD_BT_TYPE   "application/vnd.bluetooth.ep.oob"

Type information for bluetooth record.

Definition at line 42 of file ifx-record-bluetooth.h.

Function Documentation

◆ ifx_record_bt_get_additional_eir_data()

ifx_status_t ifx_record_bt_get_additional_eir_data ( const ifx_record_handle_t * handle,
ifx_record_eir_data_t * additional_data,
uint32_t * count )

Gets an array of additional EIR data of the Bluetooth carrier configuration record from the given record handle.

Parameters
[in]handlePointer to the record handle obtained while creating the record.
[out]additional_dataPointer to the array of additional data.
[out]countCount of additional data.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the get operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid
IFX_INVALID_STATEIf the object is in an invalid state

◆ ifx_record_bt_get_device_addr()

ifx_status_t ifx_record_bt_get_device_addr ( const ifx_record_handle_t * handle,
uint8_t * device_addr )

Gets the device address of the Bluetooth carrier configuration record from the given record handle.

Parameters
[in]handlePointer to the record handle obtained while creating the record.
[out]device_addr6 octets of the Bluetooth device address are encoded in the Little Endian order.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf get operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_bt_get_device_class()

ifx_status_t ifx_record_bt_get_device_class ( const ifx_record_handle_t * handle,
ifx_bt_config_field_t * device_class )

Gets the device class of Bluetooth carrier configuration record from the given record handle.

Parameters
[in]handlePointer to the record handle obtained while creating the record.
[out]device_classPointer to the device class.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf get operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid
IFX_INVALID_STATEIf the object is in an invalid state

◆ ifx_record_bt_get_local_name()

ifx_status_t ifx_record_bt_get_local_name ( const ifx_record_handle_t * handle,
uint8_t * config_type,
ifx_bt_config_field_t * local_name )

Gets the local name in the Bluetooth carrier configuration record from the given record handle.

Parameters
[in]handlePointer to the record handle obtained while creating the record.
[out]config_typeType of the local name (SHORTENED_LOCAL_NAME or COMPLETE_LOCAL_NAME).
[out]local_namePointer to the Bluetooth local name.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the get operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid
IFX_INVALID_STATEIf the object is in an invalid state

◆ ifx_record_bt_get_service_class_uuid()

ifx_status_t ifx_record_bt_get_service_class_uuid ( const ifx_record_handle_t * handle,
uint8_t * config_type,
ifx_bt_config_field_t * service_class_uuid )

Gets the service class UUID of the Bluetooth carrier configuration record from the given record handle.

Parameters
[in]handlePointer to the record handle obtained while creating the record.
[out]config_typeType of the simple pairing hash.
[out]service_class_uuidPointer to the service class UUID.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the get operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid
IFX_INVALID_STATEIf the object is in an invalid state

◆ ifx_record_bt_get_simple_pairing_hash_c()

ifx_status_t ifx_record_bt_get_simple_pairing_hash_c ( const ifx_record_handle_t * handle,
uint8_t * config_type,
ifx_bt_config_field_t * simple_pairing_hash_c )

Gets the simple pairing hash of the Bluetooth carrier configuration record from the given record handle.

Parameters
[in]handlePointer to the record handle obtained while creating the record.
[out]config_typeType of the simple pairing hash.
[out]simple_pairing_hash_cPointer to the simple pairing hash
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the get operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid
IFX_INVALID_STATEIf the object is in an invalid state

◆ ifx_record_bt_get_simple_pairing_randomizer_r()

ifx_status_t ifx_record_bt_get_simple_pairing_randomizer_r ( const ifx_record_handle_t * handle,
uint8_t * config_type,
ifx_bt_config_field_t * simple_pairing_randomizer_r )

Gets the simple pairing randomizer R of the Bluetooth carrier configuration record from the given record handle.

Parameters
[in]handlePointer to the record handle obtained while creating the record.
[out]config_typeType of the simple pairing randomizer.
[out]simple_pairing_randomizer_rPointer to the simple pairing randomizer R.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the get operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid
IFX_INVALID_STATEIf the object is in an invalid state

◆ ifx_record_bt_new()

ifx_status_t ifx_record_bt_new ( ifx_record_handle_t * handle)

Creates the Bluetooth record and handle of the created record. This handle holds values of the record needed for encode and decode operations.

Parameters
[out]handleHandle of the created Bluetooth carrier configuration record.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf record creation operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORYIf memory allocation fails

◆ ifx_record_bt_set_additional_eir_data()

ifx_status_t ifx_record_bt_set_additional_eir_data ( ifx_record_handle_t * handle,
const ifx_record_eir_data_t * additional_data,
uint32_t count )

Sets the array of additional EIR data in Bluetooth carrier configuration record for the given record handle.

Parameters
[out]handlePointer to the record handle obtained while creating the record.
[in]additional_dataPointer to the array of additional EIR data.
[in]countCount of additional data.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the set operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid
IFX_OUT_OF_MEMORYIf memory allocation is invalid

◆ ifx_record_bt_set_device_addr()

ifx_status_t ifx_record_bt_set_device_addr ( ifx_record_handle_t * handle,
const uint8_t * device_addr )

Sets the device address in the Bluetooth carrier configuration record for the given record handle.

Parameters
[out]handlePointer to the record handle obtained while creating the record.
[in]device_addr6 octets of the Bluetooth device address are encoded in the little endian order.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf set operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_bt_set_device_class()

ifx_status_t ifx_record_bt_set_device_class ( ifx_record_handle_t * handle,
const ifx_bt_config_field_t * device_class )

Sets the device class in the Bluetooth carrier configuration record for the given record handle.

Parameters
[out]handlePointer to the record handle obtained while creating the record.
[in]device_classPointer to the device class.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf set operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_bt_set_local_name()

ifx_status_t ifx_record_bt_set_local_name ( ifx_record_handle_t * handle,
uint8_t config_type,
const ifx_bt_config_field_t * local_name )

Sets the local name in the Bluetooth carrier configuration record for the given record handle.

Parameters
[out]handlePointer to the record handle obtained while creating the record.
[in]config_typeType of the local name (SHORTENED_LOCAL_NAME or COMPLETE_LOCAL_NAME).
[in]local_namePointer to the Bluetooth local name.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf set operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_bt_set_service_class_uuid()

ifx_status_t ifx_record_bt_set_service_class_uuid ( ifx_record_handle_t * handle,
uint8_t config_type,
const ifx_bt_config_field_t * service_class_uuid )

Sets the service class universal unique identifier (UUID) in the Bluetooth carrier configuration record for the given record handle.

Parameters
[out]handlePointer to the record handle obtained while creating the record.
[in]config_typeType of the service class UUID.
[in]service_class_uuidPointer to the service class UUID.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf set operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_bt_set_simple_pairing_hash_c()

ifx_status_t ifx_record_bt_set_simple_pairing_hash_c ( ifx_record_handle_t * handle,
uint8_t config_type,
const ifx_bt_config_field_t * simple_pairing_hash_c )

Sets the simple pairing hash in the Bluetooth carrier configuration record for the given record handle.

Parameters
[out]handlePointer to the record handle obtained while creating the record.
[in]config_typeType of the simple pairing hash.
[in]simple_pairing_hash_cPointer to the simple pairing hash.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf set operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_bt_set_simple_pairing_randomizer_r()

ifx_status_t ifx_record_bt_set_simple_pairing_randomizer_r ( ifx_record_handle_t * handle,
uint8_t config_type,
const ifx_bt_config_field_t * simple_pairing_randomizer_r )

Sets the simple pairing randomizer R in the Bluetooth carrier configuration record for the given record handle.

Parameters
[out]handlePointer to the record handle obtained while creating the record.
[in]config_typeType of the simple pairing randomizer.
[in]simple_pairing_randomizer_rPointer to the simple pairing randomizer R.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf set operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_INVALIDIf record type is invalid