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

Model interface to create the Bluetooth low energy (BLE) carrier configuration record types and set/get record fields. More...

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

Go to the source code of this file.

Data Structures

struct  ifx_ble_config_field_t
 Structure defines the data structure of bluetooth low energy record such as data length and actual config data field. More...
 
struct  ifx_record_ad_data_t
 Structure defines advertising and scan response data (AD) format. Each AD structure consists of an AD Length field of 1 octet, an AD Type field and an AD Data field. More...
 

Macros

#define IFX_RECORD_BLE_GET   UINT8_C(0x01)
 Identifier for model get Bluetooth LE record.
 
#define IFX_RECORD_BLE_SET   UINT8_C(0x02)
 Identifier for model set bluetooth LE record ID.
 
#define IFX_RECORD_BLE_RELEASE_MEMORY   UINT8_C(0x03)
 Identifier for model bluetooth LE record release memory.
 
#define IFX_RECORD_BLE_TYPE   "application/vnd.bluetooth.le.oob"
 Type information for bluetooth record.
 
#define IFX_RECORD_TYPE_LEN_BLE_DEV_ADDR   UINT8_C(0x1)
 Length of device address type field.
 

Enumerations

enum  ifx_ble_device_addr_type { IFX_PUBLIC_DEVICE_ADDRESS , IFX_RANDOM_DEVICE_ADDRESS }
 Enumeration defines the bluetooth low energy device address type. More...
 

Functions

ifx_status_t ifx_record_ble_new (ifx_record_handle_t *handle)
 Creates the Bluetooth low energy carrier configuration record and handle of the created record. This handle holds the values of the record needed for encode and decode operations.
 
ifx_status_t ifx_record_ble_set_device_addr (ifx_record_handle_t *handle, const uint8_t *device_addr, ifx_ble_device_addr_type device_addr_type)
 Sets the device address in the Bluetooth low energy (BLE) carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_ble_set_role (ifx_record_handle_t *handle, const ifx_ble_config_field_t *role)
 Sets the low energy (LE) role in the Bluetooth low energy carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_ble_set_security_tk_val (ifx_record_handle_t *handle, const ifx_ble_config_field_t *security_manager_tk_val)
 Sets the security manager temporary key (TK) value in the Bluetooth low energy carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_ble_set_secure_conn_confirm (ifx_record_handle_t *handle, const ifx_ble_config_field_t *secure_conn_confirmation_val)
 Sets the secure connections confirmation value in the Bluetooth low energy carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_ble_set_secure_conn_random (ifx_record_handle_t *handle, const ifx_ble_config_field_t *secure_conn_random_val)
 Sets the secure connections random value in the Bluetooth low energy carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_ble_set_appearance (ifx_record_handle_t *handle, const ifx_ble_config_field_t *appearance)
 Sets an appearance in the Bluetooth low energy carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_ble_set_flags (ifx_record_handle_t *handle, const ifx_ble_config_field_t *flags)
 Sets the flags in the Bluetooth low energy carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_ble_set_local_name (ifx_record_handle_t *handle, uint8_t config_type, const ifx_ble_config_field_t *local_name)
 Sets the local name in the Bluetooth low energy carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_ble_set_additional_ad_data (ifx_record_handle_t *handle, const ifx_record_ad_data_t *additional_data, uint32_t count)
 Sets the array of additional AD data in the Bluetooth low energy carrier configuration record for the given record handle.
 
ifx_status_t ifx_record_ble_get_device_addr (const ifx_record_handle_t *handle, uint8_t *device_addr, ifx_ble_device_addr_type *device_addr_type)
 Gets the device address of the Bluetooth low energy carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_ble_get_role (const ifx_record_handle_t *handle, ifx_ble_config_field_t *role)
 Gets the low energy (LE) role of the Bluetooth low energy carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_ble_get_security_tk_val (const ifx_record_handle_t *handle, ifx_ble_config_field_t *security_manager_tk_val)
 Gets the security manager TK value of the Bluetooth low energy carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_ble_get_secure_conn_confirm (const ifx_record_handle_t *handle, ifx_ble_config_field_t *secure_conn_confirmation_val)
 Gets the secure connections confirmation value of the Bluetooth low energy carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_ble_get_secure_conn_random (const ifx_record_handle_t *handle, ifx_ble_config_field_t *secure_conn_random_val)
 Gets the secure connections random value of the Bluetooth low energy carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_ble_get_appearance (const ifx_record_handle_t *handle, ifx_ble_config_field_t *appearance)
 Gets the appearance of the Bluetooth low energy carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_ble_get_flags (const ifx_record_handle_t *handle, ifx_ble_config_field_t *flags)
 Gets the flags of the Bluetooth low energy carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_ble_get_local_name (const ifx_record_handle_t *handle, uint8_t *config_type, ifx_ble_config_field_t *local_name)
 Gets the local name of the Bluetooth low energy carrier configuration record from the given record handle.
 
ifx_status_t ifx_record_ble_get_additional_ad_data (const ifx_record_handle_t *handle, ifx_record_ad_data_t *additional_data, uint32_t *count)
 Gets the array of additional AD data of the Bluetooth low energy carrier configuration record from the given record handle.
 

Detailed Description

Model interface to create the Bluetooth low energy (BLE) carrier configuration record types and set/get record fields.

Definition in file ifx-record-bluetooth-le.h.

Macro Definition Documentation

◆ IFX_RECORD_BLE_GET

#define IFX_RECORD_BLE_GET   UINT8_C(0x01)

Identifier for model get Bluetooth LE record.

Definition at line 26 of file ifx-record-bluetooth-le.h.

◆ IFX_RECORD_BLE_RELEASE_MEMORY

#define IFX_RECORD_BLE_RELEASE_MEMORY   UINT8_C(0x03)

Identifier for model bluetooth LE record release memory.

Definition at line 36 of file ifx-record-bluetooth-le.h.

◆ IFX_RECORD_BLE_SET

#define IFX_RECORD_BLE_SET   UINT8_C(0x02)

Identifier for model set bluetooth LE record ID.

Definition at line 31 of file ifx-record-bluetooth-le.h.

◆ IFX_RECORD_BLE_TYPE

#define IFX_RECORD_BLE_TYPE   "application/vnd.bluetooth.le.oob"

Type information for bluetooth record.

Definition at line 41 of file ifx-record-bluetooth-le.h.

◆ IFX_RECORD_TYPE_LEN_BLE_DEV_ADDR

#define IFX_RECORD_TYPE_LEN_BLE_DEV_ADDR   UINT8_C(0x1)

Length of device address type field.

Definition at line 46 of file ifx-record-bluetooth-le.h.

Enumeration Type Documentation

◆ ifx_ble_device_addr_type

Enumeration defines the bluetooth low energy device address type.

Definition at line 53 of file ifx-record-bluetooth-le.h.

54{
55 IFX_PUBLIC_DEVICE_ADDRESS,
56 IFX_RANDOM_DEVICE_ADDRESS
ifx_ble_device_addr_type
Enumeration defines the bluetooth low energy device address type.

Function Documentation

◆ ifx_record_ble_get_additional_ad_data()

ifx_status_t ifx_record_ble_get_additional_ad_data ( const ifx_record_handle_t * handle,
ifx_record_ad_data_t * additional_data,
uint32_t * count )

Gets the array of additional AD data of the Bluetooth low energy 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 AD data.
[out]countPointer to the count 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_DATA_FIELD_NAIf the data field is invalid
IFX_OUT_OF_MEMORYIf memory allocation fails
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_ble_get_appearance()

ifx_status_t ifx_record_ble_get_appearance ( const ifx_record_handle_t * handle,
ifx_ble_config_field_t * appearance )

Gets the appearance of the Bluetooth low energy carrier configuration record from the given record handle.

Parameters
[in]handlePointer to the record handle obtained while creating the record.
[out]appearancePointer to the BLE appearance.
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_DATA_FIELD_NAIf the data field is invalid
IFX_RECORD_INVALIDIf record type is invalid
IFX_INVALID_STATEIf the object is in an invalid state

◆ ifx_record_ble_get_device_addr()

ifx_status_t ifx_record_ble_get_device_addr ( const ifx_record_handle_t * handle,
uint8_t * device_addr,
ifx_ble_device_addr_type * device_addr_type )

Gets the device address of the Bluetooth low energy 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 low energy device address are encoded in the Little Endian order.
[out]device_addr_typePointer to the type that specifies whether the device address is public(0) or random(1)
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_DATA_FIELD_NAIf data field is invalid
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_ble_get_flags()

ifx_status_t ifx_record_ble_get_flags ( const ifx_record_handle_t * handle,
ifx_ble_config_field_t * flags )

Gets the flags of the Bluetooth low energy carrier configuration record from the given record handle.

Parameters
[in]handlePointer to the record handle obtained while creating the record.
[out]flagsPointer to the LE flags.
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_DATA_FIELD_NAIf the data field is invalid
IFX_RECORD_INVALIDIf record type is invalid
IFX_INVALID_STATEIf the object is in an invalid state

◆ ifx_record_ble_get_local_name()

ifx_status_t ifx_record_ble_get_local_name ( const ifx_record_handle_t * handle,
uint8_t * config_type,
ifx_ble_config_field_t * local_name )

Gets the local name of the Bluetooth low energy 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 low energy 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_DATA_FIELD_NAIf the data field is invalid
IFX_RECORD_INVALIDIf record type is invalid
IFX_INVALID_STATEIf the object is in an invalid state

◆ ifx_record_ble_get_role()

ifx_status_t ifx_record_ble_get_role ( const ifx_record_handle_t * handle,
ifx_ble_config_field_t * role )

Gets the low energy (LE) role of the Bluetooth low energy carrier configuration record from the given record handle.

Parameters
[in]handlePointer to the record handle obtained while creating the record.
[out]rolePointer to the low energy role.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf get operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_DATA_FIELD_NAIf the data field is invalid
IFX_RECORD_INVALIDIf record type is invalid
IFX_INVALID_STATEIf the object is in an invalid state

◆ ifx_record_ble_get_secure_conn_confirm()

ifx_status_t ifx_record_ble_get_secure_conn_confirm ( const ifx_record_handle_t * handle,
ifx_ble_config_field_t * secure_conn_confirmation_val )

Gets the secure connections confirmation value of the Bluetooth low energy carrier configuration record from the given record handle.

Parameters
[in]handlePointer to the record handle obtained while creating the record.
[out]secure_conn_confirmation_valPointer to the BLE secure connections confirmation value.
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_DATA_FIELD_NAIf the data field is invalid
IFX_RECORD_INVALIDIf record type is invalid
IFX_INVALID_STATEIf the object is in an invalid state

◆ ifx_record_ble_get_secure_conn_random()

ifx_status_t ifx_record_ble_get_secure_conn_random ( const ifx_record_handle_t * handle,
ifx_ble_config_field_t * secure_conn_random_val )

Gets the secure connections random value of the Bluetooth low energy carrier configuration record from the given record handle.

Parameters
[in]handlePointer to the record handle obtained while creating the record.
[out]secure_conn_random_valPointer to the BLE secure connections random value.
Returns
ifx_status_t
Return values
IFX_SUCCESSIf get operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_RECORD_DATA_FIELD_NAIf the data field is invalid
IFX_RECORD_INVALIDIf record type is invalid
IFX_INVALID_STATEIf the object is in an invalid state

◆ ifx_record_ble_get_security_tk_val()

ifx_status_t ifx_record_ble_get_security_tk_val ( const ifx_record_handle_t * handle,
ifx_ble_config_field_t * security_manager_tk_val )

Gets the security manager TK value of the Bluetooth low energy carrier configuration record from the given record handle.

Parameters
[in]handlePointer to the record handle obtained while creating the record.
[out]security_manager_tk_valPointer to the BLE security manager TK value.
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_DATA_FIELD_NAIf the data field is invalid
IFX_RECORD_INVALIDIf record type is invalid
IFX_INVALID_STATEIf the object is in an invalid state

◆ ifx_record_ble_new()

ifx_status_t ifx_record_ble_new ( ifx_record_handle_t * handle)

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

Parameters
[out]handleHandle of the created Bluetooth low energy 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_ble_set_additional_ad_data()

ifx_status_t ifx_record_ble_set_additional_ad_data ( ifx_record_handle_t * handle,
const ifx_record_ad_data_t * additional_data,
uint32_t count )

Sets the array of additional AD data in the Bluetooth low energy 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 AD data.
[in]countCount of the 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_OUT_OF_MEMORYIf memory allocation fails
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_ble_set_appearance()

ifx_status_t ifx_record_ble_set_appearance ( ifx_record_handle_t * handle,
const ifx_ble_config_field_t * appearance )

Sets an appearance in the Bluetooth low energy carrier configuration record for the given record handle.

Parameters
[out]handlePointer to the record handle obtained while creating the record.
[in]appearancePointer to the BLE appearance.
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_record_ble_set_device_addr()

ifx_status_t ifx_record_ble_set_device_addr ( ifx_record_handle_t * handle,
const uint8_t * device_addr,
ifx_ble_device_addr_type device_addr_type )

Sets the device address in the Bluetooth low energy (BLE) 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 low energy device address are encoded in the Little Endian order.
[in]device_addr_typeSpecifies whether the device address is public(0) or random(1).
Returns
ifx_status_t
Return values
IFX_SUCCESSIf the set operation is successful
IFX_ILLEGAL_ARGUMENTIf invalid/NULL parameter is passed to function
IFX_OUT_OF_MEMORYIf memory allocation fails
IFX_RECORD_INVALIDIf record type is invalid

◆ ifx_record_ble_set_flags()

ifx_status_t ifx_record_ble_set_flags ( ifx_record_handle_t * handle,
const ifx_ble_config_field_t * flags )

Sets the flags in the Bluetooth low energy carrier configuration record for the given record handle.

Parameters
[out]handlePointer to the record handle obtained while creating the record.
[in]flagsPointer to the LE flags.
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_record_ble_set_local_name()

ifx_status_t ifx_record_ble_set_local_name ( ifx_record_handle_t * handle,
uint8_t config_type,
const ifx_ble_config_field_t * local_name )

Sets the local name in the Bluetooth low energy 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 low energy local name.
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_record_ble_set_role()

ifx_status_t ifx_record_ble_set_role ( ifx_record_handle_t * handle,
const ifx_ble_config_field_t * role )

Sets the low energy (LE) role in the Bluetooth low energy carrier configuration record for the given record handle.

Parameters
[out]handlePointer to the record handle obtained while creating the record.
[in]rolePointer to the low energy role.
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_ble_set_secure_conn_confirm()

ifx_status_t ifx_record_ble_set_secure_conn_confirm ( ifx_record_handle_t * handle,
const ifx_ble_config_field_t * secure_conn_confirmation_val )

Sets the secure connections confirmation value in the Bluetooth low energy carrier configuration record for the given record handle.

Parameters
[out]handlePointer to the record handle obtained while creating the record.
[in]secure_conn_confirmation_valPointer to the BLE secure connections confirmation value
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_record_ble_set_secure_conn_random()

ifx_status_t ifx_record_ble_set_secure_conn_random ( ifx_record_handle_t * handle,
const ifx_ble_config_field_t * secure_conn_random_val )

Sets the secure connections random value in the Bluetooth low energy carrier configuration record for the given record handle.

Parameters
[out]handlePointer to the record handle obtained while creating the record.
[in]secure_conn_random_valPointer to the BLE secure connections random value.
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_record_ble_set_security_tk_val()

ifx_status_t ifx_record_ble_set_security_tk_val ( ifx_record_handle_t * handle,
const ifx_ble_config_field_t * security_manager_tk_val )

Sets the security manager temporary key (TK) value in the Bluetooth low energy carrier configuration record for the given record handle.

Parameters
[out]handlePointer to the record handle obtained while creating the record.
[in]security_manager_tk_valPointer to the low energy (BLE) security manager TK value.
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