Radio Operation#
This module includes the platform abstraction for radio operations.
Functions#
Get current state of the radio.
Enable the radio.
Disable the radio.
Check whether radio is enabled or not.
Transition the radio from Receive to Sleep (turn off the radio).
Transition the radio from Sleep to Receive (turn on the radio).
Schedule a radio reception window at a specific time and duration.
The radio driver calls this method to notify OpenThread of a received frame.
The radio driver calls this method to notify OpenThread diagnostics module of a received frame.
Get the radio transmit frame buffer.
Begin the transmit sequence on the radio.
The radio driver calls this method to notify OpenThread that the transmission has started.
The radio driver calls this function to notify OpenThread that the transmit operation has completed, providing both the transmitted frame and, if applicable, the received ack frame.
The radio driver calls this method to notify OpenThread diagnostics module that the transmission has completed.
Get the most recent RSSI measurement.
Begin the energy scan sequence on the radio.
The radio driver calls this method to notify OpenThread that the energy scan is complete.
Enable/Disable source address match feature.
Add a short address to the source address match table.
Add an extended address to the source address match table.
Remove a short address from the source address match table.
Remove an extended address from the source address match table.
Clear all short addresses from the source address match table.
Clear all the extended/long addresses from source address match table.
Get the radio supported channel mask that the device is allowed to be on.
Gets the radio preferred channel mask that the device prefers to form on.
Enable the radio coex.
Check whether radio coex is enabled or not.
Get the radio coexistence metrics.
Enable or disable CSL receiver.
Update CSL sample time in radio driver.
Get the current accuracy, in units of ± ppm, of the clock used for scheduling CSL operations.
The fixed uncertainty of the Device for scheduling CSL Transmissions in units of 10 microseconds.
Set the max transmit power for a specific channel.
Set the region code.
Get the region code.
Enable/disable or update Enhanced-ACK Based Probing in radio for a specific Initiator.
Add a calibrated power of the specified channel to the power calibration table.
Clear all calibrated powers from the power calibration table.
Set the target power for the given channel.
Get the raw power setting for the given channel.
Function Documentation#
otPlatRadioGetState#
otRadioState otPlatRadioGetState (otInstance * aInstance)
Get current state of the radio.
[in] | aInstance | The OpenThread instance structure. |
This function is not required by OpenThread. It may be used for debugging and/or application-specific purposes.
Note
This function may be not implemented. It does not affect OpenThread.
Returns
Current state of the radio.
722
of file include/openthread/platform/radio.h
otPlatRadioEnable#
otError otPlatRadioEnable (otInstance * aInstance)
Enable the radio.
[in] | aInstance | The OpenThread instance structure. |
733
of file include/openthread/platform/radio.h
otPlatRadioDisable#
otError otPlatRadioDisable (otInstance * aInstance)
Disable the radio.
[in] | aInstance | The OpenThread instance structure. |
744
of file include/openthread/platform/radio.h
otPlatRadioIsEnabled#
bool otPlatRadioIsEnabled (otInstance * aInstance)
Check whether radio is enabled or not.
[in] | aInstance | The OpenThread instance structure. |
Returns
TRUE if the radio is enabled, FALSE otherwise.
754
of file include/openthread/platform/radio.h
otPlatRadioSleep#
otError otPlatRadioSleep (otInstance * aInstance)
Transition the radio from Receive to Sleep (turn off the radio).
[in] | aInstance | The OpenThread instance structure. |
766
of file include/openthread/platform/radio.h
otPlatRadioReceive#
otError otPlatRadioReceive (otInstance * aInstance, uint8_t aChannel)
Transition the radio from Sleep to Receive (turn on the radio).
[in] | aInstance | The OpenThread instance structure. |
[in] | aChannel | The channel to use for receiving. |
778
of file include/openthread/platform/radio.h
otPlatRadioReceiveAt#
otError otPlatRadioReceiveAt (otInstance * aInstance, uint8_t aChannel, uint32_t aStart, uint32_t aDuration)
Schedule a radio reception window at a specific time and duration.
[in] | aInstance | The radio channel on which to receive. |
[in] | aChannel | The receive window start time, in microseconds. |
[in] | aStart | The receive window duration, in microseconds |
N/A | aDuration |
790
of file include/openthread/platform/radio.h
otPlatRadioReceiveDone#
void otPlatRadioReceiveDone (otInstance * aInstance, otRadioFrame * aFrame, otError aError)
The radio driver calls this method to notify OpenThread of a received frame.
[in] | aInstance | The OpenThread instance structure. |
[in] | aFrame | A pointer to the received frame or NULL if the receive operation failed. |
[in] | aError | OT_ERROR_NONE when successfully received a frame, OT_ERROR_ABORT when reception was aborted and a frame was not received, OT_ERROR_NO_BUFS when a frame could not be received due to lack of rx buffer space. |
802
of file include/openthread/platform/radio.h
otPlatDiagRadioReceiveDone#
void otPlatDiagRadioReceiveDone (otInstance * aInstance, otRadioFrame * aFrame, otError aError)
The radio driver calls this method to notify OpenThread diagnostics module of a received frame.
[in] | aInstance | The OpenThread instance structure. |
[in] | aFrame | A pointer to the received frame or NULL if the receive operation failed. |
[in] | aError | OT_ERROR_NONE when successfully received a frame, OT_ERROR_ABORT when reception was aborted and a frame was not received, OT_ERROR_NO_BUFS when a frame could not be received due to lack of rx buffer space. |
This function is used when diagnostics is enabled.
816
of file include/openthread/platform/radio.h
otPlatRadioGetTransmitBuffer#
otRadioFrame * otPlatRadioGetTransmitBuffer (otInstance * aInstance)
Get the radio transmit frame buffer.
[in] | aInstance | The OpenThread instance structure. |
OpenThread forms the IEEE 802.15.4 frame in this buffer then calls otPlatRadioTransmit()
to request transmission.
Returns
A pointer to the transmit frame buffer.
828
of file include/openthread/platform/radio.h
otPlatRadioTransmit#
otError otPlatRadioTransmit (otInstance * aInstance, otRadioFrame * aFrame)
Begin the transmit sequence on the radio.
[in] | aInstance | The OpenThread instance structure. |
[in] | aFrame | A pointer to the frame to be transmitted. |
The caller must form the IEEE 802.15.4 frame in the buffer provided by otPlatRadioGetTransmitBuffer()
before requesting transmission. The channel and transmit power are also included in the otRadioFrame structure.
The transmit sequence consists of:
Transitioning the radio to Transmit from one of the following states:
Receive if RX is on when the device is idle or OT_RADIO_CAPS_SLEEP_TO_TX is not supported
Sleep if RX is off when the device is idle and OT_RADIO_CAPS_SLEEP_TO_TX is supported.
Transmits the psdu on the given channel and at the given transmit power.
849
of file include/openthread/platform/radio.h
otPlatRadioTxStarted#
void otPlatRadioTxStarted (otInstance * aInstance, otRadioFrame * aFrame)
The radio driver calls this method to notify OpenThread that the transmission has started.
[in] | aInstance | A pointer to the OpenThread instance structure. |
[in] | aFrame | A pointer to the frame that is being transmitted. |
Note
This function should be called by the same thread that executes all of the other OpenThread code. It should not be called by ISR or any other task.
861
of file include/openthread/platform/radio.h
otPlatRadioTxDone#
void otPlatRadioTxDone (otInstance * aInstance, otRadioFrame * aFrame, otRadioFrame * aAckFrame, otError aError)
The radio driver calls this function to notify OpenThread that the transmit operation has completed, providing both the transmitted frame and, if applicable, the received ack frame.
[in] | aInstance | The OpenThread instance structure. |
[in] | aFrame | A pointer to the frame that was transmitted. |
[in] | aAckFrame | A pointer to the ACK frame, NULL if no ACK was received. |
[in] | aError | OT_ERROR_NONE when the frame was transmitted, OT_ERROR_NO_ACK when the frame was transmitted but no ACK was received, OT_ERROR_CHANNEL_ACCESS_FAILURE tx could not take place due to activity on the channel, OT_ERROR_ABORT when transmission was aborted for other reasons. |
When radio provides OT_RADIO_CAPS_TRANSMIT_SEC
capability, radio platform layer updates aFrame
with the security frame counter and key index values maintained by the radio.
879
of file include/openthread/platform/radio.h
otPlatDiagRadioTransmitDone#
void otPlatDiagRadioTransmitDone (otInstance * aInstance, otRadioFrame * aFrame, otError aError)
The radio driver calls this method to notify OpenThread diagnostics module that the transmission has completed.
[in] | aInstance | The OpenThread instance structure. |
[in] | aFrame | A pointer to the frame that was transmitted. |
[in] | aError | OT_ERROR_NONE when the frame was transmitted, OT_ERROR_CHANNEL_ACCESS_FAILURE tx could not take place due to activity on the channel, OT_ERROR_ABORT when transmission was aborted for other reasons. |
This function is used when diagnostics is enabled.
893
of file include/openthread/platform/radio.h
otPlatRadioGetRssi#
int8_t otPlatRadioGetRssi (otInstance * aInstance)
Get the most recent RSSI measurement.
[in] | aInstance | The OpenThread instance structure. |
Returns
The RSSI in dBm when it is valid. 127 when RSSI is invalid.
903
of file include/openthread/platform/radio.h
otPlatRadioEnergyScan#
otError otPlatRadioEnergyScan (otInstance * aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
Begin the energy scan sequence on the radio.
[in] | aInstance | The OpenThread instance structure. |
[in] | aScanChannel | The channel to perform the energy scan on. |
[in] | aScanDuration | The duration, in milliseconds, for the channel to be scanned. |
This function is used when radio provides OT_RADIO_CAPS_ENERGY_SCAN capability.
919
of file include/openthread/platform/radio.h
otPlatRadioEnergyScanDone#
void otPlatRadioEnergyScanDone (otInstance * aInstance, int8_t aEnergyScanMaxRssi)
The radio driver calls this method to notify OpenThread that the energy scan is complete.
[in] | aInstance | The OpenThread instance structure. |
[in] | aEnergyScanMaxRssi | The maximum RSSI encountered on the scanned channel. |
This function is used when radio provides OT_RADIO_CAPS_ENERGY_SCAN capability.
930
of file include/openthread/platform/radio.h
otPlatRadioEnableSrcMatch#
void otPlatRadioEnableSrcMatch (otInstance * aInstance, bool aEnable)
Enable/Disable source address match feature.
[in] | aInstance | The OpenThread instance structure. |
[in] | aEnable | Enable/disable source address match feature. |
The source address match feature controls how the radio layer decides the "frame pending" bit for acks sent in response to data request commands from children.
If disabled, the radio layer must set the "frame pending" on all acks to data request commands.
If enabled, the radio layer uses the source address match table to determine whether to set or clear the "frame pending" bit in an ack to a data request command.
The source address match table provides the list of children for which there is a pending frame. Either a short address or an extended/long address can be added to the source address match table.
950
of file include/openthread/platform/radio.h
otPlatRadioAddSrcMatchShortEntry#
otError otPlatRadioAddSrcMatchShortEntry (otInstance * aInstance, otShortAddress aShortAddress)
Add a short address to the source address match table.
[in] | aInstance | The OpenThread instance structure. |
[in] | aShortAddress | The short address to be added. |
962
of file include/openthread/platform/radio.h
otPlatRadioAddSrcMatchExtEntry#
otError otPlatRadioAddSrcMatchExtEntry (otInstance * aInstance, const otExtAddress * aExtAddress)
Add an extended address to the source address match table.
[in] | aInstance | The OpenThread instance structure. |
[in] | aExtAddress | The extended address to be added stored in little-endian byte order. |
974
of file include/openthread/platform/radio.h
otPlatRadioClearSrcMatchShortEntry#
otError otPlatRadioClearSrcMatchShortEntry (otInstance * aInstance, otShortAddress aShortAddress)
Remove a short address from the source address match table.
[in] | aInstance | The OpenThread instance structure. |
[in] | aShortAddress | The short address to be removed. |
986
of file include/openthread/platform/radio.h
otPlatRadioClearSrcMatchExtEntry#
otError otPlatRadioClearSrcMatchExtEntry (otInstance * aInstance, const otExtAddress * aExtAddress)
Remove an extended address from the source address match table.
[in] | aInstance | The OpenThread instance structure. |
[in] | aExtAddress | The extended address to be removed stored in little-endian byte order. |
998
of file include/openthread/platform/radio.h
otPlatRadioClearSrcMatchShortEntries#
void otPlatRadioClearSrcMatchShortEntries (otInstance * aInstance)
Clear all short addresses from the source address match table.
[in] | aInstance | The OpenThread instance structure. |
1006
of file include/openthread/platform/radio.h
otPlatRadioClearSrcMatchExtEntries#
void otPlatRadioClearSrcMatchExtEntries (otInstance * aInstance)
Clear all the extended/long addresses from source address match table.
[in] | aInstance | The OpenThread instance structure. |
1014
of file include/openthread/platform/radio.h
otPlatRadioGetSupportedChannelMask#
uint32_t otPlatRadioGetSupportedChannelMask (otInstance * aInstance)
Get the radio supported channel mask that the device is allowed to be on.
[in] | aInstance | The OpenThread instance structure. |
Returns
The radio supported channel mask.
1024
of file include/openthread/platform/radio.h
otPlatRadioGetPreferredChannelMask#
uint32_t otPlatRadioGetPreferredChannelMask (otInstance * aInstance)
Gets the radio preferred channel mask that the device prefers to form on.
[in] | aInstance | The OpenThread instance structure. |
Returns
The radio preferred channel mask.
1034
of file include/openthread/platform/radio.h
otPlatRadioSetCoexEnabled#
otError otPlatRadioSetCoexEnabled (otInstance * aInstance, bool aEnabled)
Enable the radio coex.
[in] | aInstance | The OpenThread instance structure. |
[in] | aEnabled | TRUE to enable the radio coex, FALSE otherwise. |
This function is used when feature OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE is enabled.
1048
of file include/openthread/platform/radio.h
otPlatRadioIsCoexEnabled#
bool otPlatRadioIsCoexEnabled (otInstance * aInstance)
Check whether radio coex is enabled or not.
[in] | aInstance | The OpenThread instance structure. |
This function is used when feature OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE is enabled.
Returns
TRUE if the radio coex is enabled, FALSE otherwise.
1060
of file include/openthread/platform/radio.h
otPlatRadioGetCoexMetrics#
otError otPlatRadioGetCoexMetrics (otInstance * aInstance, otRadioCoexMetrics * aCoexMetrics)
Get the radio coexistence metrics.
[in] | aInstance | The OpenThread instance structure. |
[out] | aCoexMetrics | A pointer to the coexistence metrics structure. |
This function is used when feature OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE is enabled.
1073
of file include/openthread/platform/radio.h
otPlatRadioEnableCsl#
otError otPlatRadioEnableCsl (otInstance * aInstance, uint32_t aCslPeriod, otShortAddress aShortAddr, const otExtAddress * aExtAddr)
Enable or disable CSL receiver.
[in] | aInstance | The OpenThread instance structure. |
[in] | aCslPeriod | CSL period, 0 for disabling CSL. |
[in] | aShortAddr | The short source address of CSL receiver's peer. |
[in] | aExtAddr | The extended source address of CSL receiver's peer. |
Note
Platforms should use CSL peer addresses to include CSL IE when generating enhanced acks.
1090
of file include/openthread/platform/radio.h
otPlatRadioUpdateCslSampleTime#
void otPlatRadioUpdateCslSampleTime (otInstance * aInstance, uint32_t aCslSampleTime)
Update CSL sample time in radio driver.
[in] | aInstance | The OpenThread instance structure. |
[in] | aCslSampleTime | The latest sample time. |
Sample time is stored in radio driver as a copy to calculate phase when sending ACK with CSL IE.
1104
of file include/openthread/platform/radio.h
otPlatRadioGetCslAccuracy#
uint8_t otPlatRadioGetCslAccuracy (otInstance * aInstance)
Get the current accuracy, in units of ± ppm, of the clock used for scheduling CSL operations.
[in] | aInstance | A pointer to an OpenThread instance. |
Note
Platforms may optimize this value based on operational conditions (i.e.: temperature).
Returns
The current CSL rx/tx scheduling drift, in units of ± ppm.
1116
of file include/openthread/platform/radio.h
otPlatRadioGetCslUncertainty#
uint8_t otPlatRadioGetCslUncertainty (otInstance * aInstance)
The fixed uncertainty of the Device for scheduling CSL Transmissions in units of 10 microseconds.
[in] | aInstance | A pointer to an OpenThread instance. |
Returns
The CSL Uncertainty in units of 10 us.
1126
of file include/openthread/platform/radio.h
otPlatRadioSetChannelMaxTransmitPower#
otError otPlatRadioSetChannelMaxTransmitPower (otInstance * aInstance, uint8_t aChannel, int8_t aMaxPower)
Set the max transmit power for a specific channel.
[in] | aInstance | The OpenThread instance structure. |
[in] | aChannel | The radio channel. |
[in] | aMaxPower | The max power in dBm, passing OT_RADIO_RSSI_INVALID will disable this channel. |
1141
of file include/openthread/platform/radio.h
otPlatRadioSetRegion#
otError otPlatRadioSetRegion (otInstance * aInstance, uint16_t aRegionCode)
Set the region code.
[in] | aInstance | The OpenThread instance structure. |
[in] | aRegionCode | The radio region. |