FreeRTOS: BLE
BLE
Return to main page ↑
BTInterface_t Struct Reference

Represents the standard SAL device management interface. More...

#include <bt_hal_manager.h>

Data Fields

BTStatus_t(* pxBtManagerInit )(const BTCallbacks_t *pxCallbacks)
 Initializes the interface and provides callback routines. More...
 
BTStatus_t(* pxBtManagerCleanup )(void)
 Free up the memory. More...
 
BTStatus_t(* pxEnable )(uint8_t ucGuestMode)
 Enables Bluetooth module. More...
 
BTStatus_t(* pxDisable )(void)
 Disables Bluetooth module. More...
 
BTStatus_t(* pxGetAllDeviceProperties )(void)
 Retrieves all properties of local device. More...
 
BTStatus_t(* pxGetDeviceProperty )(BTPropertyType_t xType)
 Get Bluetooth Adapter property of 'type'. More...
 
BTStatus_t(* pxSetDeviceProperty )(const BTProperty_t *pxProperty)
 Sets Bluetooth Adapter property of 'type'.Based on the type, val shall be one of BTBdaddr_t or BTBdname_t or BTScanmode_t etc. More...
 
BTStatus_t(* pxGetAllRemoteDeviceProperties )(BTBdaddr_t *pxRemoteAddr)
 Retrieves all properties of a remote device. More...
 
BTStatus_t(* pxGetRemoteDeviceProperty )(BTBdaddr_t *pxRemoteAddr, BTPropertyType_t xType)
 Get Bluetooth property of 'type' associated with a remote device. More...
 
BTStatus_t(* pxSetRemoteDeviceProperty )(BTBdaddr_t *pxRemoteAddr, const BTProperty_t *pxProperty)
 Sets Bluetooth property of 'type'.Based on the type, to a remote device. More...
 
BTStatus_t(* pxPair )(const BTBdaddr_t *pxBdAddr, BTTransport_t xTransport, bool bCreateBond)
 Initiates Bluetooth pairing to a remote device. More...
 
BTStatus_t(* pxCreateBondOutOfBand )(const BTBdaddr_t *pxBdAddr, BTTransport_t xTransport, const BTOutOfBandData_t *pxOobData)
 Sets out of band data for a device for pairing. More...
 
BTStatus_t(* pxSendSlaveSecurityRequest )(const BTBdaddr_t *pxBdAddr, BTSecurityLevel_t xSecurityLevel, bool bBonding)
 Request authentication from the master. More...
 
BTStatus_t(* pxCancelBond )(const BTBdaddr_t *pxBdAddr)
 Cancels an on going bonding procedure for the given device. More...
 
BTStatus_t(* pxRemoveBond )(const BTBdaddr_t *pxBdAddr)
 Removes the bonding with a device. If there is an active connection with the device, connection will be disconnected. More...
 
BTStatus_t(* pxGetConnectionState )(const BTBdaddr_t *pxBdAddr, bool *bConnectionState)
 Retrieves connection status for a device. More...
 
BTStatus_t(* pxPinReply )(const BTBdaddr_t *pxBdAddr, uint8_t ucAccept, uint8_t ucPinLen, BTPinCode_t *pxPinCode)
 BT Legacy PinKey Reply. More...
 
BTStatus_t(* pxSspReply )(const BTBdaddr_t *pxBdAddr, BTSspVariant_t xVariant, uint8_t ucAccept, uint32_t ulPasskey)
 BT SSP Reply - Just Works, Numeric Comparison and Passkey. More...
 
BTStatus_t(* pxReadEnergyInfo )(void)
 Read Energy info details. More...
 
BTStatus_t(* pxDutModeConfigure )(bool bEnable)
 
BTStatus_t(* pxDutModeSend )(uint16_t usOpcode, uint8_t *pucBuf, size_t xLen)
 Send any test HCI (vendor-specific) command to the controller. Must be in DUT Mode. More...
 
BTStatus_t(* pxLeTestMode )(uint16_t usOpcode, uint8_t *pucBuf, size_t xLen)
 Send LE test command (LE_Receiver_Test, LE_Transmitter_Test, LE_Test_End ) command to the controller. More...
 
BTStatus_t(* pxConfigHCISnoopLog )(bool bEnable)
 Enables/disables capturing of HCI (snoop) logs. More...
 
BTStatus_t(* pxConfigClear )(void)
 Clears the stack configuration cache. Equivalent to BT layer Factory reset. More...
 
BTStatus_t(* pxReadRssi )(const BTBdaddr_t *pxBdAddr)
 Retrieves RSSI of a remote device. More...
 
BTStatus_t(* pxGetTxpower )(const BTBdaddr_t *pxBdAddr, BTTransport_t xTransport)
 Retrieves TX power of a remote device. More...
 
const void *(* pxGetClassicAdapter )(void)
 Retrieves the Classic interface. More...
 
const void *(* pxGetLeAdapter )(void)
 Retrieves the HAL LE interface. More...
 
uint32_t(* pxGetLastError )(void)
 Retrieves last error number from the stack. More...
 
BTStatus_t(* pxGetStackFeaturesSupport )(uint32_t *pulFeatureMask)
 get stack features supported. More...
 

Detailed Description

Represents the standard SAL device management interface.

Field Documentation

◆ pxBtManagerInit

BTStatus_t( * BTInterface_t::pxBtManagerInit) (const BTCallbacks_t *pxCallbacks)

Initializes the interface and provides callback routines.

Parameters
[in]pxCallbacksInitializer for common GAP callbacks.
Returns
Returns eBTStatusSuccess on successful call.

◆ pxBtManagerCleanup

BTStatus_t( * BTInterface_t::pxBtManagerCleanup) (void)

Free up the memory.

: Note that similarly to pxBtManagerInit. Memory of adapter of server/client needs to be freed first (by calling pxUnregisterBleApp for example)

Returns
Returns eBTStatusSuccess on successful call.

◆ pxEnable

BTStatus_t( * BTInterface_t::pxEnable) (uint8_t ucGuestMode)

Enables Bluetooth module.

Trigger BTDeviceStateChangedCallback_t.

Parameters
[in]ucGuestModeTrue if Bluetooth needs to be enabled in guest mode else FALSE.
Returns
eBTStatusSuccess if BT enable permitted. Else error code.

◆ pxDisable

BTStatus_t( * BTInterface_t::pxDisable) (void)

Disables Bluetooth module.

Trigger BTDeviceStateChangedCallback_t.

Returns
eBTStatusSuccess if BT disable permitted. Else error code.

◆ pxGetAllDeviceProperties

BTStatus_t( * BTInterface_t::pxGetAllDeviceProperties) (void)

Retrieves all properties of local device.

Triggers BTDevicePropertiesCallback_t.

Returns
eBTStatusSuccess if the operation is successful, else error code. When properties are read, they will be returned as part of pxAdapterPropertiesCb()

◆ pxGetDeviceProperty

BTStatus_t( * BTInterface_t::pxGetDeviceProperty) (BTPropertyType_t xType)

Get Bluetooth Adapter property of 'type'.

Triggers BTDevicePropertiesCallback_t.

Parameters
[in]xTypeProperty type.
Returns
eBTStatusSuccess if the operation is successful, else error code. When property is read, it will be returned as part of pxAdapterPropertiesCb()
eBTStatusSuccess if the operation is successful, else error code.

◆ pxSetDeviceProperty

BTStatus_t( * BTInterface_t::pxSetDeviceProperty) (const BTProperty_t *pxProperty)

Sets Bluetooth Adapter property of 'type'.Based on the type, val shall be one of BTBdaddr_t or BTBdname_t or BTScanmode_t etc.

Triggers BTDevicePropertiesCallback_t.

Parameters
[in]pxPropertyProperty containing BTProperty_t structure.
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxGetAllRemoteDeviceProperties

BTStatus_t( * BTInterface_t::pxGetAllRemoteDeviceProperties) (BTBdaddr_t *pxRemoteAddr)

Retrieves all properties of a remote device.

Triggers BTRemoteDevicePropertiesCallback_t.

Parameters
[in]pxRemoteAddrBT Address of remote device
Returns
eBTStatusSuccess if the operation is successful, else error code. When properties are read, they will be returned as part of pxAdapterPropertiesCb()

◆ pxGetRemoteDeviceProperty

BTStatus_t( * BTInterface_t::pxGetRemoteDeviceProperty) (BTBdaddr_t *pxRemoteAddr, BTPropertyType_t xType)

Get Bluetooth property of 'type' associated with a remote device.

Triggers BTRemoteDevicePropertiesCallback_t.

Parameters
[in]pxRemoteAddrBT Address of remote device.
[in]xTypeProperty type.
Returns
eBTStatusSuccess if the operation is successful, else error code. When property is read, it will be returned as part of pxRemoteDevicePropertiesCb()

◆ pxSetRemoteDeviceProperty

BTStatus_t( * BTInterface_t::pxSetRemoteDeviceProperty) (BTBdaddr_t *pxRemoteAddr, const BTProperty_t *pxProperty)

Sets Bluetooth property of 'type'.Based on the type, to a remote device.

Triggers BTRemoteDevicePropertiesCallback_t.

Parameters
[in]pxRemoteAddrBT Address of remote device.
[in]pxPropertyProperty to be set on remote device.
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxPair

BTStatus_t( * BTInterface_t::pxPair) (const BTBdaddr_t *pxBdAddr, BTTransport_t xTransport, bool bCreateBond)

Initiates Bluetooth pairing to a remote device.

Triggers BTPairingStateChangedCallback_t on both central and peripheral.

Parameters
[in]pxBdAddrBT Address of remote device.
[in]xTransportTransport for bonding, one of the enumeration value from BTTransport_t.
[in]bCreateBondset this flag to TRUE if device needs to be bonded. (Remember link authentication information)
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxCreateBondOutOfBand

BTStatus_t( * BTInterface_t::pxCreateBondOutOfBand) (const BTBdaddr_t *pxBdAddr, BTTransport_t xTransport, const BTOutOfBandData_t *pxOobData)

Sets out of band data for a device for pairing.

Triggers BTPairingStateChangedCallback_t.

Parameters
[in]pxBdAddrBT Address of remote device.
[in]xTransportSpecify if BLE and BT classic is being used.
[in]pxOobDataOut of band data
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxSendSlaveSecurityRequest

BTStatus_t( * BTInterface_t::pxSendSlaveSecurityRequest) (const BTBdaddr_t *pxBdAddr, BTSecurityLevel_t xSecurityLevel, bool bBonding)

Request authentication from the master.

Triggers BTSlaveSecurityRequestCallBack_t and BTPairingStateChangedCallback_t if request is accepted.

Parameters
[in]pxBdaRemote device address.
[in]xSecurityLevelRequest security
[in]bBondingTrue is bonding is requested
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxCancelBond

BTStatus_t( * BTInterface_t::pxCancelBond) (const BTBdaddr_t *pxBdAddr)

Cancels an on going bonding procedure for the given device.

Triggers BTPairingStateChangedCallback_t.

Parameters
[in]pxBdAddrBT Address of device getting bonded.
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxRemoveBond

BTStatus_t( * BTInterface_t::pxRemoveBond) (const BTBdaddr_t *pxBdAddr)

Removes the bonding with a device. If there is an active connection with the device, connection will be disconnected.

Will invoke pxBondedCb.

Parameters
[in]pxBdAddrBT Address of device that needs to be unbonded.
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxGetConnectionState

BTStatus_t( * BTInterface_t::pxGetConnectionState) (const BTBdaddr_t *pxBdAddr, bool *bConnectionState)

Retrieves connection status for a device.

!TODO need an enum for connection state

Parameters
[in]pxBdAddrBT Address of device.
[in]bConnectionStatetrue if connected false if not connected
Returns
Fail if there is no connection.

◆ pxPinReply

BTStatus_t( * BTInterface_t::pxPinReply) (const BTBdaddr_t *pxBdAddr, uint8_t ucAccept, uint8_t ucPinLen, BTPinCode_t *pxPinCode)

BT Legacy PinKey Reply.

Parameters
[in]pxBdAddrBT Address of device.
[in]ucAcceptTRUE is pairing request is accepted, else FALSE.
[in]ucPinLenlength of the pin code.
[in]pxPinCodePin code.
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxSspReply

BTStatus_t( * BTInterface_t::pxSspReply) (const BTBdaddr_t *pxBdAddr, BTSspVariant_t xVariant, uint8_t ucAccept, uint32_t ulPasskey)

BT SSP Reply - Just Works, Numeric Comparison and Passkey.

Parameters
[in]pxBdAddrBT Address of device.
[in]xVariantPairing variant.
[in]ucAcceptTRUE is pairing request is accepted, else FALSE. When accept = FALSE,passkey shall be zero
[in]ulPasskey: passkey valid only when variant is BTSspVariantPasskeyEntry and BTSspVariantPasskeyNotification
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxReadEnergyInfo

BTStatus_t( * BTInterface_t::pxReadEnergyInfo) (void)

Read Energy info details.

Triggers BTEnergyInfoCallback_t.

Returns
value indicates eBTStatusSuccess or eBTStatusNotReady, Success indicates that the VSC command was sent to controller

◆ pxDutModeConfigure

BTStatus_t( * BTInterface_t::pxDutModeConfigure) (bool bEnable)

Enables/disables local device to DUT mode.

Parameters
[in]bEnableTRUE if DUT mode needs to be enabled, else FALSE.
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxDutModeSend

BTStatus_t( * BTInterface_t::pxDutModeSend) (uint16_t usOpcode, uint8_t *pucBuf, size_t xLen)

Send any test HCI (vendor-specific) command to the controller. Must be in DUT Mode.

Triggers BTDutModeRecvCallback_t on remote device.

Parameters
[in]usOpcodeHCI VSC opcode.
[in]pucBufParameters associated with the command represented in byte buffer.
[in]xLenTotal length of parameter buffer.
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxLeTestMode

BTStatus_t( * BTInterface_t::pxLeTestMode) (uint16_t usOpcode, uint8_t *pucBuf, size_t xLen)

Send LE test command (LE_Receiver_Test, LE_Transmitter_Test, LE_Test_End ) command to the controller.

Triggers BTLeTestModeCallback_t.

Parameters
[in]usOpcode,LEtest VSC opcode.
[in]pucBufParameters associated with the command represented in byte buffer.
[in]xLenTotal length of parameter buffer.
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxConfigHCISnoopLog

BTStatus_t( * BTInterface_t::pxConfigHCISnoopLog) (bool bEnable)

Enables/disables capturing of HCI (snoop) logs.

Parameters
[in]bEnableTRUE if snoop logs needs to be enabled, else FALSE
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxConfigClear

BTStatus_t( * BTInterface_t::pxConfigClear) (void)

Clears the stack configuration cache. Equivalent to BT layer Factory reset.

Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxReadRssi

BTStatus_t( * BTInterface_t::pxReadRssi) (const BTBdaddr_t *pxBdAddr)

Retrieves RSSI of a remote device.

Triggers BTReadRssiCallback_t.

Parameters
[in]pxBdAddrBT Address of remote device
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxGetTxpower

BTStatus_t( * BTInterface_t::pxGetTxpower) (const BTBdaddr_t *pxBdAddr, BTTransport_t xTransport)

Retrieves TX power of a remote device.

Triggers BTTxPowerCallback_t.

Parameters
[in]pxBdAddrBT Address of remote device.
[in]xTransportLE / Classic.
Returns
eBTStatusSuccess if the operation is successful, else error code.

◆ pxGetClassicAdapter

const void*( * BTInterface_t::pxGetClassicAdapter) (void)

Retrieves the Classic interface.

Returns
void* pointer that points to the profile interface itself. This needs to be type-casted to the Classic interface by the caller

◆ pxGetLeAdapter

const void*( * BTInterface_t::pxGetLeAdapter) (void)

Retrieves the HAL LE interface.

Returns
void* pointer that points to the BLE adapter interface itself. This needs to be type-casted to the LE interface by the caller

◆ pxGetLastError

uint32_t( * BTInterface_t::pxGetLastError) (void)

Retrieves last error number from the stack.

Returns
error no of the last operation.

◆ pxGetStackFeaturesSupport

BTStatus_t( * BTInterface_t::pxGetStackFeaturesSupport) (uint32_t *pulFeatureMask)

get stack features supported.

Parameters
[out]pulFeatureMaskfeature mask
Returns
Returns eBTStatusSuccess on successful call.

The documentation for this struct was generated from the following file: