Radio Configuration#

This module includes the platform abstraction for radio configuration.

Functions#

otPlatRadioGetCaps(otInstance *aInstance)

Get the radio capabilities.

const char *
otPlatRadioGetVersionString(otInstance *aInstance)

Get the radio version string.

int8_t
otPlatRadioGetReceiveSensitivity(otInstance *aInstance)

Get the radio receive sensitivity value.

void
otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)

Gets the factory-assigned IEEE EUI-64 for this interface.

void
otPlatRadioSetPanId(otInstance *aInstance, otPanId aPanId)

Set the PAN ID for address filtering.

void
otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aExtAddress)

Set the Extended Address for address filtering.

void
otPlatRadioSetShortAddress(otInstance *aInstance, otShortAddress aShortAddress)

Set the Short Address for address filtering.

otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)

Get the radio's transmit power in dBm.

otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)

Set the radio's transmit power in dBm.

otPlatRadioGetCcaEnergyDetectThreshold(otInstance *aInstance, int8_t *aThreshold)

Get the radio's CCA ED threshold in dBm measured at antenna connector per IEEE 802.15.4 - 2015 section 10.1.4.

otPlatRadioSetCcaEnergyDetectThreshold(otInstance *aInstance, int8_t aThreshold)

Set the radio's CCA ED threshold in dBm measured at antenna connector per IEEE 802.15.4 - 2015 section 10.1.4.

otPlatRadioGetFemLnaGain(otInstance *aInstance, int8_t *aGain)

Gets the external FEM's Rx LNA gain in dBm.

otPlatRadioSetFemLnaGain(otInstance *aInstance, int8_t aGain)

Sets the external FEM's Rx LNA gain in dBm.

bool
otPlatRadioGetPromiscuous(otInstance *aInstance)

Get the status of promiscuous mode.

void
otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)

Enable or disable promiscuous mode.

void
otPlatRadioSetMacKey(otInstance *aInstance, uint8_t aKeyIdMode, uint8_t aKeyId, const otMacKeyMaterial *aPrevKey, const otMacKeyMaterial *aCurrKey, const otMacKeyMaterial *aNextKey, otRadioKeyType aKeyType)

Update MAC keys and key index.

void
otPlatRadioSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCounter)

Sets the current MAC frame counter value.

void
otPlatRadioSetMacFrameCounterIfLarger(otInstance *aInstance, uint32_t aMacFrameCounter)

Sets the current MAC frame counter value only if the new given value is larger than the current value.

uint64_t
otPlatRadioGetNow(otInstance *aInstance)

Get the current estimated time (in microseconds) of the radio chip.

uint32_t
otPlatRadioGetBusSpeed(otInstance *aInstance)

Get the bus speed in bits/second between the host and the radio chip.

Function Documentation#

otPlatRadioGetCaps#

otRadioCaps otPlatRadioGetCaps (otInstance * aInstance)

Get the radio capabilities.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

Returns

  • The radio capability bit vector (see OT_RADIO_CAP_* definitions).


otPlatRadioGetVersionString#

const char * otPlatRadioGetVersionString (otInstance * aInstance)

Get the radio version string.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

This is an optional radio driver platform function. If not provided by platform radio driver, OpenThread uses the OpenThread version instead (See Also

Returns

  • A pointer to the OpenThread radio version.


otPlatRadioGetReceiveSensitivity#

int8_t otPlatRadioGetReceiveSensitivity (otInstance * aInstance)

Get the radio receive sensitivity value.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

Returns

  • The radio receive sensitivity value in dBm.


otPlatRadioGetIeeeEui64#

void otPlatRadioGetIeeeEui64 (otInstance * aInstance, uint8_t * aIeeeEui64)

Gets the factory-assigned IEEE EUI-64 for this interface.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

uint8_t *[out]aIeeeEui64

A pointer to the factory-assigned IEEE EUI-64.


otPlatRadioSetPanId#

void otPlatRadioSetPanId (otInstance * aInstance, otPanId aPanId)

Set the PAN ID for address filtering.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

otPanId[in]aPanId

The IEEE 802.15.4 PAN ID.


otPlatRadioSetExtendedAddress#

void otPlatRadioSetExtendedAddress (otInstance * aInstance, const otExtAddress * aExtAddress)

Set the Extended Address for address filtering.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

const otExtAddress *[in]aExtAddress

A pointer to the IEEE 802.15.4 Extended Address stored in little-endian byte order.


otPlatRadioSetShortAddress#

void otPlatRadioSetShortAddress (otInstance * aInstance, otShortAddress aShortAddress)

Set the Short Address for address filtering.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

otShortAddress[in]aShortAddress

The IEEE 802.15.4 Short Address.


otPlatRadioGetTransmitPower#

otError otPlatRadioGetTransmitPower (otInstance * aInstance, int8_t * aPower)

Get the radio's transmit power in dBm.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

int8_t *[out]aPower

The transmit power in dBm.

Note

  • The transmit power returned will be no larger than the power specified in the max power table for the current channel.


otPlatRadioSetTransmitPower#

otError otPlatRadioSetTransmitPower (otInstance * aInstance, int8_t aPower)

Set the radio's transmit power in dBm.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

int8_t[in]aPower

The transmit power in dBm.

Note

  • The real transmit power will be no larger than the power specified in the max power table for the current channel.


otPlatRadioGetCcaEnergyDetectThreshold#

otError otPlatRadioGetCcaEnergyDetectThreshold (otInstance * aInstance, int8_t * aThreshold)

Get the radio's CCA ED threshold in dBm measured at antenna connector per IEEE 802.15.4 - 2015 section 10.1.4.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

int8_t *[out]aThreshold

The CCA ED threshold in dBm.


otPlatRadioSetCcaEnergyDetectThreshold#

otError otPlatRadioSetCcaEnergyDetectThreshold (otInstance * aInstance, int8_t aThreshold)

Set the radio's CCA ED threshold in dBm measured at antenna connector per IEEE 802.15.4 - 2015 section 10.1.4.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

int8_t[in]aThreshold

The CCA ED threshold in dBm.


otPlatRadioGetFemLnaGain#

otError otPlatRadioGetFemLnaGain (otInstance * aInstance, int8_t * aGain)

Gets the external FEM's Rx LNA gain in dBm.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

int8_t *[out]aGain

The external FEM's Rx LNA gain in dBm.


otPlatRadioSetFemLnaGain#

otError otPlatRadioSetFemLnaGain (otInstance * aInstance, int8_t aGain)

Sets the external FEM's Rx LNA gain in dBm.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

int8_t[in]aGain

The external FEM's Rx LNA gain in dBm.


otPlatRadioGetPromiscuous#

bool otPlatRadioGetPromiscuous (otInstance * aInstance)

Get the status of promiscuous mode.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.


otPlatRadioSetPromiscuous#

void otPlatRadioSetPromiscuous (otInstance * aInstance, bool aEnable)

Enable or disable promiscuous mode.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance structure.

bool[in]aEnable

TRUE to enable or FALSE to disable promiscuous mode.


otPlatRadioSetMacKey#

void otPlatRadioSetMacKey (otInstance * aInstance, uint8_t aKeyIdMode, uint8_t aKeyId, const otMacKeyMaterial * aPrevKey, const otMacKeyMaterial * aCurrKey, const otMacKeyMaterial * aNextKey, otRadioKeyType aKeyType)

Update MAC keys and key index.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

A pointer to an OpenThread instance.

uint8_t[in]aKeyIdMode

The key ID mode.

uint8_t[in]aKeyId

Current MAC key index.

const otMacKeyMaterial *[in]aPrevKey

A pointer to the previous MAC key.

const otMacKeyMaterial *[in]aCurrKey

A pointer to the current MAC key.

const otMacKeyMaterial *[in]aNextKey

A pointer to the next MAC key.

otRadioKeyType[in]aKeyType

Key Type used.

Is used when radio provides OT_RADIO_CAPS_TRANSMIT_SEC capability.


otPlatRadioSetMacFrameCounter#

void otPlatRadioSetMacFrameCounter (otInstance * aInstance, uint32_t aMacFrameCounter)

Sets the current MAC frame counter value.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

A pointer to an OpenThread instance.

uint32_t[in]aMacFrameCounter

The MAC frame counter value.

Is used when radio provides OT_RADIO_CAPS_TRANSMIT_SEC capability.


otPlatRadioSetMacFrameCounterIfLarger#

void otPlatRadioSetMacFrameCounterIfLarger (otInstance * aInstance, uint32_t aMacFrameCounter)

Sets the current MAC frame counter value only if the new given value is larger than the current value.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

A pointer to an OpenThread instance.

uint32_t[in]aMacFrameCounter

The MAC frame counter value.

Is used when radio provides OT_RADIO_CAPS_TRANSMIT_SEC capability.


otPlatRadioGetNow#

uint64_t otPlatRadioGetNow (otInstance * aInstance)

Get the current estimated time (in microseconds) of the radio chip.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

A pointer to an OpenThread instance.

This microsecond timer must be a free-running timer. The timer must continue to advance with microsecond precision even when the radio is in the sleep state.

Returns

  • The current time in microseconds. UINT64_MAX when platform does not support or radio time is not ready.


otPlatRadioGetBusSpeed#

uint32_t otPlatRadioGetBusSpeed (otInstance * aInstance)

Get the bus speed in bits/second between the host and the radio chip.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The bus speed in bits/second between the host and the radio chip. Return 0 when the MAC and above layer and Radio layer resides on the same chip.