Radio Operation
This module includes the platform abstraction for radio operations.
Summary
Functions |
|
|---|---|
otPlatDiagRadioReceiveDone(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
void
The radio driver calls this function to notify OpenThread diagnostics module of a received frame.
|
otPlatDiagRadioTransmitDone(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
void
The radio driver calls this function to notify OpenThread diagnostics module that the transmission has completed.
|
otPlatRadioAddCalibratedPower(otInstance *aInstance, uint8_t aChannel, int16_t aActualPower, const uint8_t *aRawPowerSetting, uint16_t aRawPowerSettingLength)
|
Add a calibrated power of the specified channel to the power calibration table.
|
otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
Add an extended address to the source address match table.
|
otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, otShortAddress aShortAddress)
|
Add a short address to the source address match table.
|
otPlatRadioAvailabilityUpdated(otInstance *aInstance)
|
void
The radio driver calls this function to notify OpenThread that the radio availability has changed.
|
otPlatRadioBusLatencyChanged(otInstance *aInstance)
|
void
The radio driver calls this function to notify OpenThread that the spinel bus latency has been changed.
|
otPlatRadioCancelScheduledTx(otInstance *aInstance)
|
Cancel a previously scheduled transmission.
|
otPlatRadioClearCalibratedPowers(otInstance *aInstance)
|
Clear all calibrated powers from the power calibration table.
|
otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
void
Clear all the extended/long addresses from source address match table.
|
otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
Remove an extended address from the source address match table.
|
otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
void
Clear all short addresses from the source address match table.
|
otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, otShortAddress aShortAddress)
|
Remove a short address from the source address match table.
|
otPlatRadioConfigureEnhAckProbing(otInstance *aInstance, otLinkMetrics aLinkMetrics, otShortAddress aShortAddress, const otExtAddress *aExtAddress)
|
Enable/disable or update Enhanced-ACK Based Probing in radio for a specific Initiator.
|
otPlatRadioDisable(otInstance *aInstance)
|
Disable the radio.
|
otPlatRadioEnable(otInstance *aInstance)
|
Enable the radio.
|
otPlatRadioEnableCsl(otInstance *aInstance, uint32_t aCslPeriod, otShortAddress aShortAddr, const otExtAddress *aExtAddr)
|
Enable or disable CSL receiver.
|
otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
void
Enable/Disable source address match feature.
|
otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
Begin the energy scan sequence on the radio.
|
otPlatRadioEnergyScanDone(otInstance *aInstance, int8_t aEnergyScanMaxRssi)
|
void
The radio driver calls this function to notify OpenThread that the energy scan is complete.
|
otPlatRadioGetAvailability(otInstance *aInstance, otRadioAvailability *aAvailability)
|
Gets the current radio availability schedule.
|
otPlatRadioGetCoexMetrics(otInstance *aInstance, otRadioCoexMetrics *aCoexMetrics)
|
Get the radio coexistence metrics.
|
otPlatRadioGetCslAccuracy(otInstance *aInstance)
|
uint8_t
Get the current estimated worst case accuracy (maximum ± deviation from the nominal frequency) of the local radio clock in units of PPM.
|
otPlatRadioGetCslUncertainty(otInstance *aInstance)
|
uint8_t
The fixed uncertainty (i.e.
|
otPlatRadioGetPreferredChannelMask(otInstance *aInstance)
|
uint32_t
Gets the radio preferred channel mask that the device prefers to form on.
|
otPlatRadioGetRawPowerSetting(otInstance *aInstance, uint8_t aChannel, uint8_t *aRawPowerSetting, uint16_t *aRawPowerSettingLength)
|
Get the raw power setting for the given channel.
|
otPlatRadioGetRegion(otInstance *aInstance, uint16_t *aRegionCode)
|
Get the region code.
|
otPlatRadioGetRssi(otInstance *aInstance)
|
int8_t
Return a recent RSSI measurement when the radio is in receive state.
|
otPlatRadioGetScheduledTxFrame(otInstance *aInstance)
|
Get the radio transmit frame buffer dedicated for scheduled transmissions (
otPlatRadioScheduleTx()). |
otPlatRadioGetState(otInstance *aInstance)
|
Get current state of the radio.
|
otPlatRadioGetSupportedChannelMask(otInstance *aInstance)
|
uint32_t
Get the radio supported channel mask that the device is allowed to be on.
|
otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
Get the radio transmit frame buffer.
|
otPlatRadioIsCoexEnabled(otInstance *aInstance)
|
bool
Check whether radio coex is enabled or not.
|
otPlatRadioIsEnabled(otInstance *aInstance)
|
bool
Check whether radio is enabled or not.
|
otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
Transition the radio from Sleep to Receive (turn on the radio).
|
otPlatRadioReceiveAt(otInstance *aInstance, uint8_t aChannel, otRadioTime32 aStart, uint32_t aDuration)
|
Schedules a radio reception window at a specific time and duration.
|
otPlatRadioReceiveDone(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
void
The radio driver calls this function to notify OpenThread of a received frame.
|
otPlatRadioResetCsl(otInstance *aInstance)
|
Reset CSL receiver in the platform.
|
otPlatRadioScheduleTx(otInstance *aInstance, otRadioTime64 aTxTime)
|
Schedule a radio frame transmission at a specific target time.
|
otPlatRadioScheduledTxDone(otInstance *aInstance, otRadioFrame *aAckFrame, otError aError)
|
void
The radio driver calls this function to notify OpenThread that a scheduled transmission (initiated via
otPlatRadioScheduleTx()) has completed, providing both the transmission outcome and, if applicable, the received acknowledgment frame. |
otPlatRadioSetChannelMaxTransmitPower(otInstance *aInstance, uint8_t aChannel, int8_t aMaxPower)
|
Set the max transmit power for a specific channel.
|
otPlatRadioSetChannelTargetPower(otInstance *aInstance, uint8_t aChannel, int16_t aTargetPower)
|
Set the target power for the given channel.
|
otPlatRadioSetCoexEnabled(otInstance *aInstance, bool aEnabled)
|
Enable the radio coex.
|
otPlatRadioSetRegion(otInstance *aInstance, uint16_t aRegionCode)
|
Set the region code.
|
otPlatRadioSleep(otInstance *aInstance)
|
Transition the radio to the Sleep state (turn off the radio).
|
otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
Begin the transmit sequence on the radio.
|
otPlatRadioTxDone(otInstance *aInstance, otRadioFrame *aFrame, otRadioFrame *aAckFrame, otError aError)
|
void
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.
|
otPlatRadioTxStarted(otInstance *aInstance, otRadioFrame *aFrame)
|
void
The radio driver calls this function to notify OpenThread that the transmission has started.
|
otPlatRadioUpdateCslSampleTime(otInstance *aInstance, otRadioTime32 aCslSampleTime)
|
void
Update CSL sample time in radio driver.
|
Functions
otPlatDiagRadioReceiveDone
void otPlatDiagRadioReceiveDone( otInstance *aInstance, otRadioFrame *aFrame, otError aError )
The radio driver calls this function to notify OpenThread diagnostics module of a received frame.
Is used when diagnostics is enabled.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
otPlatDiagRadioTransmitDone
void otPlatDiagRadioTransmitDone( otInstance *aInstance, otRadioFrame *aFrame, otError aError )
The radio driver calls this function to notify OpenThread diagnostics module that the transmission has completed.
Is used when diagnostics is enabled.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
otPlatRadioAddCalibratedPower
otError otPlatRadioAddCalibratedPower( otInstance *aInstance, uint8_t aChannel, int16_t aActualPower, const uint8_t *aRawPowerSetting, uint16_t aRawPowerSettingLength )
Add a calibrated power of the specified channel to the power calibration table.
The aActualPower is the actual measured output power when the parameters of the radio hardware modules are set to the aRawPowerSetting.
The raw power setting is an opaque byte array. OpenThread doesn't define the format of the raw power setting. Its format is radio hardware related and it should be defined by the developers in the platform radio driver. For example, if the radio hardware contains both the radio chip and the FEM chip, the raw power setting can be a combination of the radio power register and the FEM gain value.
| Details | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
||||||||||
| Return Values |
|
otPlatRadioAddSrcMatchExtEntry
otError otPlatRadioAddSrcMatchExtEntry( otInstance *aInstance, const otExtAddress *aExtAddress )
Add an extended address to the source address match table.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Return Values |
|
otPlatRadioAddSrcMatchShortEntry
otError otPlatRadioAddSrcMatchShortEntry( otInstance *aInstance, otShortAddress aShortAddress )
Add a short address to the source address match table.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Return Values |
|
otPlatRadioAvailabilityUpdated
void otPlatRadioAvailabilityUpdated( otInstance *aInstance )
The radio driver calls this function to notify OpenThread that the radio availability has changed.
When Thread shares the same radio chip with BT or 2.4GHz WiFi, the radio driver knows when BT or WiFi will occupy the radio. The radio driver calls this function to notify OpenThread, which then retrieves the current schedule via otPlatRadioGetAvailability(). The radio availability schedule is intended to be used for Thread Direct scheduling. OpenThread does not use it to perform general radio coexistence.
The radio driver should call this function once the radio is enabled (see otPlatRadioEnable()) to report the initial radio availability schedule, and whenever the radio availability schedule changes thereafter.
A radio driver that calls this function MUST implement otPlatRadioGetAvailability().
| Details | |||
|---|---|---|---|
| Parameters |
|
otPlatRadioBusLatencyChanged
void otPlatRadioBusLatencyChanged( otInstance *aInstance )
The radio driver calls this function to notify OpenThread that the spinel bus latency has been changed.
| Details | |||
|---|---|---|---|
| Parameters |
|
otPlatRadioCancelScheduledTx
otError otPlatRadioCancelScheduledTx( otInstance *aInstance )
Cancel a previously scheduled transmission.
This API requires the radio platform to support the OT_RADIO_CAPS_SCHEDULED_TX capability.
- If there is no pending scheduled transmission (e.g., none was scheduled, or a previous schedule was already canceled or completed), calling this function MUST take no action and return
OT_ERROR_NONE. - If a scheduled transmission is pending and can still be aborted before transmission starts on the air, the radio platform MUST cancel it, release ownership of the scheduled TX frame buffer (
otPlatRadioGetScheduledTxFrame()) back to the OpenThread stack, and returnOT_ERROR_NONE. The radio platform MUST NOT invokeotPlatRadioScheduledTxDone()for a canceled transmission. - When
otPlatRadioCancelScheduledTx()returnsOT_ERROR_NONE, the OpenThread stack immediately reclaims ownership of the scheduled TX frame buffer and may immediately prepare a new frame in that buffer and callotPlatRadioScheduleTx()to schedule a new transmission. - If the radio platform cannot cancel the scheduled transmission (for example, because the transmission has already started and is currently in progress on the air or waiting for an acknowledgment, or because an
OT_ERROR_ABORTcompletion is already queued to be reported), it MUST returnOT_ERROR_BUSY. In this case:- The scheduled transmission is NOT canceled, and the radio platform retains ownership of the scheduled TX frame buffer.
- The radio platform MUST subsequently report the outcome of the transmission via the
otPlatRadioScheduledTxDone()callback. - The OpenThread stack will wait until
otPlatRadioScheduledTxDone()is invoked before modifying the scheduled TX frame buffer or scheduling a new transmission.
- Note that if a deferred
OT_ERROR_ABORTcallback is pending (e.g., due to a past/missed target time or Coex denial), the radio platform MAY handleotPlatRadioCancelScheduledTx()in whichever way it prefers: it may either cancel the pending callback and returnOT_ERROR_NONE, or returnOT_ERROR_BUSYand let theotPlatRadioScheduledTxDone()callback be invoked.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Return Values |
|
otPlatRadioClearCalibratedPowers
otError otPlatRadioClearCalibratedPowers( otInstance *aInstance )
Clear all calibrated powers from the power calibration table.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Return Values |
|
otPlatRadioClearSrcMatchExtEntries
void otPlatRadioClearSrcMatchExtEntries( otInstance *aInstance )
Clear all the extended/long addresses from source address match table.
| Details | |||
|---|---|---|---|
| Parameters |
|
otPlatRadioClearSrcMatchExtEntry
otError otPlatRadioClearSrcMatchExtEntry( otInstance *aInstance, const otExtAddress *aExtAddress )
Remove an extended address from the source address match table.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Return Values |
|
otPlatRadioClearSrcMatchShortEntries
void otPlatRadioClearSrcMatchShortEntries( otInstance *aInstance )
Clear all short addresses from the source address match table.
| Details | |||
|---|---|---|---|
| Parameters |
|
otPlatRadioClearSrcMatchShortEntry
otError otPlatRadioClearSrcMatchShortEntry( otInstance *aInstance, otShortAddress aShortAddress )
Remove a short address from the source address match table.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Return Values |
|
otPlatRadioConfigureEnhAckProbing
otError otPlatRadioConfigureEnhAckProbing( otInstance *aInstance, otLinkMetrics aLinkMetrics, otShortAddress aShortAddress, const otExtAddress *aExtAddress )
Enable/disable or update Enhanced-ACK Based Probing in radio for a specific Initiator.
After Enhanced-ACK Based Probing is configured by a specific Probing Initiator, the Enhanced-ACK sent to that node should include Vendor-Specific IE containing Link Metrics data. This function informs the radio to start/stop to collect Link Metrics data and include Vendor-Specific IE that containing the data in Enhanced-ACK sent to that Probing Initiator.
Regarding aExtAddress, this function assumes big-endian byte order. Note that this differs from otPlatRadioSetExtendedAddress(), otPlatRadioAddSrcMatchExtEntry(), and otPlatRadioClearSrcMatchExtEntry(), which use little-endian byte order for the Extended MAC address.
| Details | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
||||||||||
| Return Values |
|
otPlatRadioDisable
otError otPlatRadioDisable( otInstance *aInstance )
Disable the radio.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Return Values |
|
otPlatRadioEnable
otError otPlatRadioEnable( otInstance *aInstance )
Enable the radio.
When the radio is enabled and address filtering is active (i.e., promiscuous mode is disabled; see otPlatRadioSetPromiscuous()), the radio platform is expected to perform the following address filtering behaviors:
- Accept received Data and MAC Command frames that have no destination address (Destination Addressing Mode =
0b00), in addition to Beacon frames and frames addressed to the broadcast address (0xffff) or matching the short address (or alternate short address) or extended address configured viaotPlatRadioSetShortAddress(),otPlatRadioSetAlternateShortAddress(), andotPlatRadioSetExtendedAddress(). - Check a received frame's Destination PAN ID against the PAN ID configured via
otPlatRadioSetPanId()(or the broadcast PAN ID0xffff) only when a Destination PAN ID field is present in the frame. Frames that omit the Destination PAN ID field MUST NOT be rejected due to PAN ID mismatch, and the Source PAN ID (if present) MUST NOT be checked against the configured PAN ID. - Thread frames that omit the destination address (Destination Addressing Mode =
0b00) always have the Acknowledgment Request (AR) bit set to0. Received frames with no destination address (Destination Addressing Mode =0b00) SHOULD NOT be acknowledged, even if theARbit is set to1.
Address filtering is required by the radio platform for auto-ACK generation. While filtering received frames in the radio platform before calling otPlatRadioReceiveDone() is not strictly required (as the OpenThread Mac layer also performs address filtering on received frames), it is recommended (especially on RCP platforms to avoid forwarding unaddressed frames over Spinel to the host), and whenever performed by the radio platform, it MUST follow the rules above.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Return Values |
|
otPlatRadioSetPanId()
otPlatRadioSetExtendedAddress()
otPlatRadioSetShortAddress()
otPlatRadioSetAlternateShortAddress()
otPlatRadioSetPromiscuous()
otPlatRadioEnableCsl
otError otPlatRadioEnableCsl( otInstance *aInstance, uint32_t aCslPeriod, otShortAddress aShortAddr, const otExtAddress *aExtAddr )
Enable or disable CSL receiver.
Regarding aExtAddr, this function assumes big-endian byte order. Note that this differs from otPlatRadioSetExtendedAddress(), otPlatRadioAddSrcMatchExtEntry(), and otPlatRadioClearSrcMatchExtEntry(), which use little-endian byte order for the Extended MAC address.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
||||||||
| Return Values |
|
otPlatRadioEnableSrcMatch
void otPlatRadioEnableSrcMatch( otInstance *aInstance, bool 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.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
otPlatRadioEnergyScan
otError otPlatRadioEnergyScan( otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration )
Begin the energy scan sequence on the radio.
Is used when radio provides OT_RADIO_CAPS_ENERGY_SCAN capability.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
||||||
| Return Values |
|
otPlatRadioEnergyScanDone
void otPlatRadioEnergyScanDone( otInstance *aInstance, int8_t aEnergyScanMaxRssi )
The radio driver calls this function to notify OpenThread that the energy scan is complete.
Is used when radio provides OT_RADIO_CAPS_ENERGY_SCAN capability.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
otPlatRadioGetAvailability
otError otPlatRadioGetAvailability( otInstance *aInstance, otRadioAvailability *aAvailability )
Gets the current radio availability schedule.
OpenThread (the caller) provides the otRadioAvailability structure pointed to by aAvailability, and the radio driver populates all of its fields, including copying the bitmaps into it. OpenThread owns the structure, so the radio driver does not need to keep any buffer valid after this function returns.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Return Values |
|
otPlatRadioGetCoexMetrics
otError otPlatRadioGetCoexMetrics( otInstance *aInstance, otRadioCoexMetrics *aCoexMetrics )
Get the radio coexistence metrics.
Is used when feature OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE is enabled.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Return Values |
|
otPlatRadioGetCslAccuracy
uint8_t otPlatRadioGetCslAccuracy( otInstance *aInstance )
Get the current estimated worst case accuracy (maximum ± deviation from the nominal frequency) of the local radio clock in units of PPM.
This is the clock used to schedule CSL operations.
In case the implementation does not estimate the current value but returns a fixed value, this value MUST be the worst-case accuracy over all possible foreseen operating conditions (temperature, pressure, etc) of the implementation.
| Details | |||
|---|---|---|---|
| Parameters |
|
||
| Returns |
The current CSL rx/tx scheduling drift, in PPM.
|
otPlatRadioGetCslUncertainty
uint8_t otPlatRadioGetCslUncertainty( otInstance *aInstance )
The fixed uncertainty (i.e.
random jitter) of the arrival time of CSL transmissions received by this device in units of 10 microseconds.
This designates the worst case constant positive or negative deviation of the actual arrival time of a transmission from the transmission time calculated relative to the local radio clock independent of elapsed time. In addition to uncertainty accumulated over elapsed time, the CSL channel sample ("RX window") must be extended by twice this deviation such that an actual transmission is guaranteed to be detected by the local receiver in the presence of random arrival time jitter.
| Details | |||
|---|---|---|---|
| Parameters |
|
||
| Returns |
The CSL Uncertainty in units of 10 us.
|
otPlatRadioGetPreferredChannelMask
uint32_t otPlatRadioGetPreferredChannelMask( otInstance *aInstance )
Gets the radio preferred channel mask that the device prefers to form on.
| Details | |||
|---|---|---|---|
| Parameters |
|
||
| Returns |
The radio preferred channel mask.
|
otPlatRadioGetRawPowerSetting
otError otPlatRadioGetRawPowerSetting( otInstance *aInstance, uint8_t aChannel, uint8_t *aRawPowerSetting, uint16_t *aRawPowerSettingLength )
Get the raw power setting for the given channel.
Platform radio layer should parse the raw power setting based on the radio layer defined format and set the parameters of each radio hardware module.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
||||||||
| Return Values |
|
otPlatRadioGetRegion
otError otPlatRadioGetRegion( otInstance *aInstance, uint16_t *aRegionCode )
Get the region code.
The radio region format is the 2-bytes ascii representation of the ISO 3166 alpha-2 code.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
||||||||
| Return Values |
|
otPlatRadioGetRssi
int8_t otPlatRadioGetRssi( otInstance *aInstance )
Return a recent RSSI measurement when the radio is in receive state.
If the radio is not in receive state, then OT_RADIO_RSSI_INVALID MUST be returned. If the radio is in receive state, then a single RSSI measurement is taken on the current receive channel and returned.
| Details | |||
|---|---|---|---|
| Parameters |
|
||
| Returns |
The RSSI in dBm when it is valid.
OT_RADIO_RSSI_INVALID when RSSI is invalid. |
otPlatRadioGetScheduledTxFrame
otRadioFrame * otPlatRadioGetScheduledTxFrame( otInstance *aInstance )
Get the radio transmit frame buffer dedicated for scheduled transmissions (otPlatRadioScheduleTx()).
This API requires the radio platform to support the OT_RADIO_CAPS_SCHEDULED_TX capability.
Similar to how otPlatRadioGetTransmitBuffer() provides the otRadioFrame buffer used for regular transmissions via otPlatRadioTransmit(), this function provides a separate, single otRadioFrame buffer used exclusively for scheduled transmissions via otPlatRadioScheduleTx(). Having a dedicated frame buffer allows the OpenThread stack to prepare and schedule a future timed transmission independently of ongoing or regular transmissions via otPlatRadioTransmit().
Frame buffer ownership and lifecycle:
- The OpenThread stack forms the IEEE 802.15.4 frame in this buffer and then calls
otPlatRadioScheduleTx()to schedule its transmission. - Upon a successful call to
otPlatRadioScheduleTx()(returningOT_ERROR_NONE), the radio platform takes ownership of this frame buffer. The OpenThread stack guarantees that it will not modify or access the frame buffer or its PSDU content while it is owned by the radio platform. - Ownership of the frame buffer is released back to the OpenThread stack when:
- The radio platform invokes the
otPlatRadioScheduledTxDone()callback, - A call to
otPlatRadioCancelScheduledTx()succeeds (returningOT_ERROR_NONE), or - The radio is disabled via
otPlatRadioDisable().
- The radio platform invokes the
- Once ownership is released back to OpenThread, the stack may immediately modify the buffer to prepare and schedule a new transmission (including directly from within the
otPlatRadioScheduledTxDone()callback). - The returned
otRadioFramepointer (and itsmPsdubuffer of at leastOT_RADIO_FRAME_MAX_SIZEbytes) MUST remain valid and constant for the lifetime ofaInstance(including beforeotPlatRadioEnable()is called).
| Details | |||
|---|---|---|---|
| Parameters |
|
||
| Returns |
A pointer to the scheduled transmit frame buffer.
|
otPlatRadioGetState
otRadioState otPlatRadioGetState( otInstance *aInstance )
Get current state of the radio.
Is not required by OpenThread. It may be used for debugging and/or application-specific purposes.
| Details | |||
|---|---|---|---|
| Parameters |
|
||
| Returns |
Current state of the radio.
|
otPlatRadioGetSupportedChannelMask
uint32_t otPlatRadioGetSupportedChannelMask( otInstance *aInstance )
Get the radio supported channel mask that the device is allowed to be on.
| Details | |||
|---|---|---|---|
| Parameters |
|
||
| Returns |
The radio supported channel mask.
|
otPlatRadioGetTransmitBuffer
otRadioFrame * otPlatRadioGetTransmitBuffer( otInstance *aInstance )
Get the radio transmit frame buffer.
OpenThread forms the IEEE 802.15.4 frame in this buffer then calls otPlatRadioTransmit() to request transmission.
| Details | |||
|---|---|---|---|
| Parameters |
|
||
| Returns |
A pointer to the transmit frame buffer.
|
otPlatRadioIsCoexEnabled
bool otPlatRadioIsCoexEnabled( otInstance *aInstance )
Check whether radio coex is enabled or not.
Is used when feature OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE is enabled.
| Details | |||
|---|---|---|---|
| Parameters |
|
||
| Returns |
TRUE if the radio coex is enabled, FALSE otherwise.
|
otPlatRadioIsEnabled
bool otPlatRadioIsEnabled( otInstance *aInstance )
Check whether radio is enabled or not.
| Details | |||
|---|---|---|---|
| Parameters |
|
||
| Returns |
TRUE if the radio is enabled, FALSE otherwise.
|
otPlatRadioReceive
otError otPlatRadioReceive( otInstance *aInstance, uint8_t aChannel )
Transition the radio from Sleep to Receive (turn on the radio).
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Return Values |
|
otPlatRadioReceiveAt
otError otPlatRadioReceiveAt( otInstance *aInstance, uint8_t aChannel, otRadioTime32 aStart, uint32_t aDuration )
Schedules a radio reception window at a specific time and duration.
This function is an optional platform API used to schedule a future reception window on a specific channel for features such as Coordinated Sampled Listening (CSL) or Thread Direct.
OpenThread supports two approaches for timed reception:
- Software-driven (default and recommended): OpenThread's
SubMaclayer manages all timed RX internally using software timers and standardotPlatRadioReceive()andotPlatRadioSleep()calls. In this mode, the radio platform does NOT need to implementotPlatRadioReceiveAt(), and MUST omit theOT_RADIO_CAPS_RECEIVE_TIMINGcapability fromotPlatRadioGetCaps(). - Platform-offloaded (optional): The radio platform explicitly declares
OT_RADIO_CAPS_RECEIVE_TIMINGviaotPlatRadioGetCaps()and implementsotPlatRadioReceiveAt()to handle window timing directly in the platform layer or hardware.
Because OpenThread's built-in SubMac software implementation is comprehensive, robust, and fully tested, it is strongly recommended that radio platform implementers rely on the default software-driven mode and do NOT implement otPlatRadioReceiveAt(), unless there is a clear justification for offloading timed reception to the radio platform.
If the radio platform implements this function, the following rules and behaviors are expected:
If this function is called while the radio is disabled (OT_RADIO_STATE_DISABLED), the radio platform MUST return OT_ERROR_INVALID_STATE.
When the radio is enabled, this function can be called from any radio state (OT_RADIO_STATE_SLEEP, OT_RADIO_STATE_RECEIVE, or OT_RADIO_STATE_TRANSMIT). The radio platform driver MUST handle the scheduling internally: calling this function merely registers a (future) time window for the radio to sample/receive and MUST NOT immediately force the radio into Receive mode at the time of the call (unless the window is already active).
The radio platform MUST execute the scheduled reception as follows:
- Operational Precedence and Radio Sleep:
- Timed reception scheduled by this function is only applicable when the radio is in the Sleep state (whether the radio is put to sleep explicitly via
otPlatRadioSleep()or manages sleep state automatically on its own). - Any active radio operation, such as transmission (
otPlatRadioTransmit()or an active scheduled transmission fromotPlatRadioScheduleTx()) or continuous reception (otPlatRadioReceive()), takes precedence over timed reception.
- Timed reception scheduled by this function is only applicable when the radio is in the Sleep state (whether the radio is put to sleep explicitly via
- Starting the Reception Window:
- At the scheduled start time
aStart, the radio receiver MUST enter Receive mode on channelaChannel, provided the radio is not busy with another operation. This MUST behave the same as ifotPlatRadioReceive()were called at that time. - The OpenThread stack already accounts for and includes any necessary radio ramp-up and receiver settling time when computing
aStart. Therefore, the radio platform driver does not need to adjustaStartor schedule ramp-up ahead of time.
- At the scheduled start time
- Ending the Reception Window:
- At the end of the duration (
aStart+aDuration), the radio MUST automatically transition back to Sleep unless it is actively receiving a frame. - If frame reception has started (e.g., SHR detected) before the duration expires, the radio receiver MUST remain on until the frame reception completes (either successfully or with an error) and any subsequent acknowledgment transmission is finished, after which the radio transitions to Sleep.
- At the end of the duration (
- Subsequent Schedules and Overlapping Windows:
- If the start time of a previously scheduled reception window has not yet arrived, a subsequent call to
otPlatRadioReceiveAt()MUST cancel and replace the previous schedule. - If a previous reception window has already started and is currently active:
- A subsequent call to
otPlatRadioReceiveAt()with a future start time MUST NOT abort or interrupt the ongoing reception. The new window is scheduled to start at its specified time. - At the start time of the new window (or immediately if its start time has already arrived), the radio MUST honor the new window:
- Channel: If the new window specifies the same channel, reception SHOULD continue seamlessly without toggling the receiver state off and on. If the new window specifies a different channel, the radio MUST switch to the new channel. However, if the radio has started receiving a frame on the previous channel (e.g., SHR detected) or is transmitting an acknowledgment, it MUST complete the frame reception and any acknowledgment transmission before switching to the new channel (or transitioning to Sleep if the new window has already expired).
- End time: The reception window MUST end according to the new window (
aStart+aDuration). The new window always dictates when reception ends, replacing any previous end time. Note that this behavior is common and often used to shrink an ongoing sample window.
- A subsequent call to
- If a new window starts immediately upon the end of the previous window (back-to-back), the transition SHOULD occur seamlessly without cycling the radio through Sleep.
- If the start time of a previously scheduled reception window has not yet arrived, a subsequent call to
- Interactions with Sleep and Other Operations:
- If the radio is busy executing another operation (such as transmission or continuous reception) when the scheduled window starts or while it is active, that operation takes precedence. Once that operation completes and the radio returns to Sleep, if the scheduled window is still ongoing (before
aStart+aDuration), the radio SHOULD start or resume the scheduled timed reception by entering Receive mode onaChannelfor the remaining duration of the window. - Calls to
otPlatRadioSleep()MUST NOT cancel a scheduled reception window, nor abort an ongoing active timed reception window. If the radio is already in the Sleep state and performing an active scheduled timed reception, subsequent calls tootPlatRadioSleep()MUST NOT interrupt or alter its operation. - Calls to
otPlatRadioDisable()MUST immediately abort and cancel any pending (scheduled) or ongoing active timed reception window.
- If the radio is busy executing another operation (such as transmission or continuous reception) when the scheduled window starts or while it is active, that operation takes precedence. Once that operation completes and the radio returns to Sleep, if the scheduled window is still ongoing (before
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
||||||||
| Return Values |
|
otPlatRadioReceiveDone
void otPlatRadioReceiveDone( otInstance *aInstance, otRadioFrame *aFrame, otError aError )
The radio driver calls this function to notify OpenThread of a received frame.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
otPlatRadioResetCsl
otError otPlatRadioResetCsl( otInstance *aInstance )
Reset CSL receiver in the platform.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
||||||
| Return Values |
|
otPlatRadioScheduleTx
otError otPlatRadioScheduleTx( otInstance *aInstance, otRadioTime64 aTxTime )
Schedule a radio frame transmission at a specific target time.
This API requires the radio platform to support the OT_RADIO_CAPS_SCHEDULED_TX capability. Its primary purpose is to support Thread Direct, though it may also be used for other time-sensitive transmission use cases in the future.
The caller forms the IEEE 802.15.4 frame in the buffer provided by otPlatRadioGetScheduledTxFrame() before calling this function to schedule the transmission at aTxTime.
The radio platform MUST execute the scheduled transmission according to the following rules:
- Target Transmission Time and Strict On-Time Requirement:
- The radio platform MUST transmit the requested frame at the exact specified time
aTxTime. aTxTimeis anotRadioTime64value in microseconds relative to the local radio clock (seeotPlatRadioGetNow()).aTxTimeSHALL point to the exact point in time when the end of the Start of Frame Delimiter (SFD) will be present at the local antenna. The radio platform driver MUST account for any necessary radio ramp-up, channel switching, Clear Channel Assessment (CCA, if enabled), and SHR (preamble and SFD) transmission durations so that the end of the SFD aligns withaTxTime.- Strict on-time execution (no early or late transmission): It is critical that the frame is transmitted at
aTxTime. If at the target transmission time the radio driver determines that it cannot transmit the frame ataTxTime(for example, due to Coex denial or hardware unavailability), it MUST NOT transmit the frame earlier or later. Instead, it MUST abort the transmission and invokeotPlatRadioScheduledTxDone()withOT_ERROR_ABORTto indicate that the frame was not sent. - Past or missed
aTxTimeat schedule time: The OpenThread stack callsotPlatRadioScheduleTx()as early as possible (as soon as it knows a scheduled transmission is needed), providing the radio platform with ample lead time ahead ofaTxTime(for example, to account for radio ramp-up, Coex requests, etc.). However,aTxTimemay still occasionally be in the past or too close to the current radio timeotPlatRadioGetNow()(for example, if a frame is queued very close to the target slot, or if a blocking operation such as a flash re-write stalls execution). In this case, the radio platform MUST NOT transmit the frame.otPlatRadioScheduleTx()MUST still returnOT_ERROR_NONEand asynchronously report the failure by invokingotPlatRadioScheduledTxDone()withOT_ERROR_ABORT. The radio platform MUST NOT invokeotPlatRadioScheduledTxDone()synchronously from withinotPlatRadioScheduleTx(). IfotPlatRadioCancelScheduledTx()is called before this deferredOT_ERROR_ABORTcallback is invoked, the radio platform MAY either cancel the pending callback and returnOT_ERROR_NONE, or returnOT_ERROR_BUSYand proceed with invoking theotPlatRadioScheduledTxDone()callback.
- The radio platform MUST transmit the requested frame at the exact specified time
- Operational Precedence, Preemption, and State Restoration:
- A scheduled transmission SHOULD be prioritized over other radio operations when
aTxTimearrives:- Ongoing Receive or Acknowledgment TX: If the radio is in Receive mode and is in the middle of receiving a frame (e.g., after SHR detection) or transmitting an acknowledgment for a received frame when the radio needs to prepare/transmit for
aTxTime, the scheduled transmission SHOULD take precedence—the active reception or acknowledgment transmission SHOULD be stopped/aborted so that the scheduled transmission goes out on time ataTxTime. When an ongoing reception or acknowledgment transmission is aborted, the radio platform MAY either invokeotPlatRadioReceiveDone()withOT_ERROR_ABORTor not invokeotPlatRadioReceiveDone()at all (if the radio platform still delivers a received frame whose acknowledgment transmission was aborted viaotPlatRadioReceiveDone()withOT_ERROR_NONE,mAckedWithFramePendingandmAckedWithSecEnhAckMUST be set tofalse). - Concurrent
otPlatRadioTransmit(): If the radio is instructed to transmit a frame viaotPlatRadioTransmit()close to or overlapping with a previously scheduled transmission, the scheduled transmission SHOULD take precedence and be performed ataTxTime. For the conflictingotPlatRadioTransmit()operation, the radio platform MAY either:- Abort the
otPlatRadioTransmit()operation and invokeotPlatRadioTxDone()withOT_ERROR_ABORT(so the OpenThread stack does not remain blocked waiting forotPlatRadioTxDone()and can handle any retries), or - Defer the
otPlatRadioTransmit()operation until after the scheduled transmission completes, provided that theotPlatRadioTransmit()has not yet started on the air (otPlatRadioTxStarted()has not been invoked) and is not a timed transmission (mTxDelay != 0) whose target time would be missed. If theotPlatRadioTransmit()has already started on the air or is a timed transmission whose target time would be missed, it MUST be aborted viaotPlatRadioTxDone()withOT_ERROR_ABORT.
- Abort the
- Ongoing Receive or Acknowledgment TX: If the radio is in Receive mode and is in the middle of receiving a frame (e.g., after SHR detection) or transmitting an acknowledgment for a received frame when the radio needs to prepare/transmit for
- Radio State and Post-Transmission Restoration:
- If this function is called while the radio is disabled (
OT_RADIO_STATE_DISABLED), it MUST returnOT_ERROR_INVALID_STATE. CallingotPlatRadioDisable()while a scheduled TX is pending or active MUST immediately abort and cancel it without invokingotPlatRadioScheduledTxDone()(and MUST NOT fail withOT_ERROR_INVALID_STATEdue to the active scheduled TX when the underlying state isSleep). - When the radio is enabled,
otPlatRadioScheduleTx()can be called from any radio state (Sleep,Receive, orTransmit). Conversely, subsequent calls tootPlatRadioSleep(),otPlatRadioReceive(),otPlatRadioReceiveAt(), orotPlatRadioTransmit()while a scheduled TX is pending MUST NOT cancel or alter the pending scheduled transmission (onlyotPlatRadioCancelScheduledTx()orotPlatRadioDisable()cancels it). - If
otPlatRadioSleep()orotPlatRadioReceive()is called while the scheduled transmission is actively in progress on the air (or waiting for its acknowledgment) ataTxTime, the radio platform MUST NOT abort the ongoing scheduled transmission and MUST NOT fail the call withOT_ERROR_BUSYorOT_ERROR_INVALID_STATE. Instead, it MUST returnOT_ERROR_NONE, complete the scheduled transmission, and then transition to the newly requested state (SleeporReceiveon the requested channel). - Once the scheduled transmission completes (after transmitting the frame and receiving the acknowledgment or timing out when an acknowledgment is requested, or if CCA fails or the transmission is aborted), the radio platform MUST automatically return to its target state (the state prior to the scheduled transmission, or any updated state requested via
otPlatRadioSleep()orotPlatRadioReceive()while the scheduled transmission was pending/active) and resume what it was doing:- If the target state is
Receiveon a channel (fromotPlatRadioReceive()), it MUST return toReceiveon that receive channel (mRxChannelAfterTxDoneinotRadioFrameMUST be ignored). - If the target state is
Sleepwith an active timed reception window (fromotPlatRadioReceiveAt()whose window has not yet expired), it MUST return toReceiveon that window's channel for the remaining duration of the window before transitioning back toSleep. - If the target state is
Sleep(and not in an active timed reception window), it MUST return toSleep. - If a transmission requested via
otPlatRadioTransmit()was deferred for the scheduled transmission, the radio platform SHOULD proceed with that transmission.
- If the target state is
- If this function is called while the radio is disabled (
- A scheduled transmission SHOULD be prioritized over other radio operations when
- Single Active Schedule and Frame Buffer Ownership:
- At most one scheduled transmission request can be active at any time, using the single
otRadioFrameprovided byotPlatRadioGetScheduledTxFrame(). - After a successful
otPlatRadioScheduleTx()call (and before it is canceled viaotPlatRadioCancelScheduledTx()orotPlatRadioDisable(), or completed viaotPlatRadioScheduledTxDone()), any new call tootPlatRadioScheduleTx()MUST be rejected by returningOT_ERROR_BUSYwithout affecting the active schedule. The OpenThread stack will generally not callotPlatRadioScheduleTx()again until the previous schedule is canceled or completed viaotPlatRadioScheduledTxDone(). - Upon a successful
otPlatRadioScheduleTx()call, the radio platform takes ownership of the frame buffer fromotPlatRadioGetScheduledTxFrame(). The OpenThread stack guarantees that it will not touch or modify the frame buffer or its contents while owned by the radio platform. - Invoking the
otPlatRadioScheduledTxDone()callback, a successfulotPlatRadioCancelScheduledTx()call (returningOT_ERROR_NONE), orotPlatRadioDisable()releases ownership of the frame buffer back to the OpenThread stack, allowing the stack to modify the frame again.
- At most one scheduled transmission request can be active at any time, using the single
- Handling of
otRadioFrame(mTxInfo) fields:mTxDelayBaseTimeandmTxDelay: MUST be ignored. The target transmission time is specified solely by theaTxTimeparameter.mCsmaCaEnabled: Indicates whether CCA MUST be performed before transmitting the frame:- When set to
false, the frame MUST be transmitted ataTxTimewithout performing CCA. - When set to
true, CCA MUST be performed prior to transmission (timed so that the end of the SFD still occurs ataTxTime). If CCA fails, the radio platform MUST NOT transmit the frame and MUST reportOT_ERROR_CHANNEL_ACCESS_FAILUREviaotPlatRadioScheduledTxDone().
- When set to
mMaxCsmaBackoffs: MUST always be ignored (treated as0). The radio platform MUST NOT perform any CSMA backoff for a scheduled transmission.mMaxFrameRetries: MUST always be ignored (treated as0). A scheduled transmission is a single transmission attempt with no retries by the radio platform (the OpenThread stack manages any retransmissions in subsequent time slots).mRxChannelAfterTxDone: MUST be ignored. Upon completing the scheduled transmission, the radio MUST return to its previous state and receive channel (if it was receiving).mIsARetxandmCslPresent: MUST be ignored.mTimestamp: When the frame is transmitted, the radio platform MUST update this field with the local radio clock timestamp (in microseconds) when the end of the SFD was present at the local antenna before invokingotPlatRadioScheduledTxDone().mIsHeaderUpdatedandmIsSecurityProcessed: Follow their existing behavior as defined forotPlatRadioTransmit()whenOT_RADIO_CAPS_TRANSMIT_SECis supported. WhenmIsHeaderUpdatedisfalse, the radio platform MUST assign the MAC frame counter and perform security processing when preparing the frame for transmission ataTxTime(rather than whenotPlatRadioScheduleTx()is called), ensuring that frame counters are used in order on the air if other transmissions or enhanced acknowledgments occur beforeaTxTimeand that no frame counter is wasted if the scheduled transmission is canceled or aborted before the frame is prepared ataTxTime.- All other fields (
mChannel,mAesKey,mIeInfo,mTxPower) MUST follow their existing behavior as defined forotPlatRadioTransmit().
- Completion and Callbacks:
- The radio platform MUST report the outcome of the scheduled transmission using the
otPlatRadioScheduledTxDone()callback. - Aside from
OT_ERROR_INVALID_STATE(when the radio is disabled) andOT_ERROR_BUSY(when a previously scheduled transmission is still active),otPlatRadioScheduleTx()MUST NOT return any other error synchronously. Any other runtime failure to schedule or transmit the frame (for example, ifmChannelon the scheduled TX frame is invalid or unsupported) MUST still returnOT_ERROR_NONEfromotPlatRadioScheduleTx()and be reported asynchronously by invokingotPlatRadioScheduledTxDone()withOT_ERROR_ABORT. - A scheduled transmission MUST NOT invoke
otPlatRadioTxStarted()orotPlatRadioTxDone(). Those callbacks are used exclusively for transmissions initiated viaotPlatRadioTransmit().
- The radio platform MUST report the outcome of the scheduled transmission using the
Why a dedicated scheduled TX API is used (and comparison with OT_RADIO_CAPS_TRANSMIT_TIMING):
- Coexistence (Coex) and Radio Arbitration: While the OpenThread stack can track time and schedule radio operations in software, it does not have visibility into platform-level radio coexistence (Coex) with other radios sharing the same device or antenna (such as Wi-Fi or Bluetooth/BLE). The radio platform driver is responsible for managing Coex arbitration and is therefore in a much better position to request appropriate Coex priority ahead of time and ensure the scheduled transmission goes out at the exact specified target time
aTxTime. Similarly, the radio platform can directly preempt ongoing radio activity (such as an active frame reception, acknowledgment transmission, or a regularotPlatRadioTransmit()operation) whenaTxTimearrives. - Differences from
OT_RADIO_CAPS_TRANSMIT_TIMING(mTxDelayBaseTimeandmTxDelay):OT_RADIO_CAPS_TRANSMIT_TIMINGwas originally introduced to support CSL in Thread 1.2 by extending the existingotPlatRadioTransmit()API usingmTxDelayBaseTimeandmTxDelay. That model has several limitations for more strict protocols like Thread Direct:- Existing vendor implementations of
OT_RADIO_CAPS_TRANSMIT_TIMINGvary in their behavior when the target transmission time is missed (for example, some implementations still transmit the frame after a delay even if the target time has passed). While a slightly delayed transmission may still fall within a peer's CSL sample window, transmitting late or outside the designated time slot in Thread Direct could result in unpredictable failures.otPlatRadioScheduleTx()defines strict, explicit requirements on timing accuracy, operational precedence, and missed-target handling. otPlatRadioTransmit()is a blocking state-transition operation: once called, the OpenThread stack must wait forotPlatRadioTxDone()before it can issue any other transmit, receive, or sleep commands to the radio (which also forces the stack to wait until just before the target time to issue a timedotPlatRadioTransmit()so the radio is not tied up prematurely). In contrast,otPlatRadioScheduleTx()schedules a future transmission using a dedicated frame buffer as soon as the stack knows a scheduled transmission is needed—allowing the radio to continue other operations in the meantime and supporting explicit cancellation viaotPlatRadioCancelScheduledTx().
- Existing vendor implementations of
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
||||||
| Return Values |
|
otPlatRadioScheduledTxDone
void otPlatRadioScheduledTxDone( otInstance *aInstance, otRadioFrame *aAckFrame, otError aError )
The radio driver calls this function to notify OpenThread that a scheduled transmission (initiated via otPlatRadioScheduleTx()) has completed, providing both the transmission outcome and, if applicable, the received acknowledgment frame.
This callback is used when the radio platform provides the OT_RADIO_CAPS_SCHEDULED_TX capability.
When the radio provides the OT_RADIO_CAPS_TRANSMIT_SEC capability, the radio platform layer updates the scheduled TX frame (otPlatRadioGetScheduledTxFrame()) with the security frame counter and key index values maintained by the radio (following the same rules as otPlatRadioTxDone()).
Frame buffer ownership and re-entrancy:
- Invoking this callback transfers ownership of the scheduled TX frame buffer (
otPlatRadioGetScheduledTxFrame()) from the radio platform back to the OpenThread stack. - Importantly, from within the
otPlatRadioScheduledTxDone()callback itself, the OpenThread stack may immediately modify the scheduled TX frame buffer and callotPlatRadioScheduleTx()to schedule a new transmission. The radio platform implementation MUST supportotPlatRadioScheduleTx()being called directly from within this callback.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
otPlatRadioSetChannelMaxTransmitPower
otError otPlatRadioSetChannelMaxTransmitPower( otInstance *aInstance, uint8_t aChannel, int8_t aMaxPower )
Set the max transmit power for a specific channel.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
||||||||
| Return Values |
|
otPlatRadioSetChannelTargetPower
otError otPlatRadioSetChannelTargetPower( otInstance *aInstance, uint8_t aChannel, int16_t aTargetPower )
Set the target power for the given channel.
The radio driver should set the actual output power to be less than or equal to the aTargetPower and as close as possible to the aTargetPower. If the aTargetPower is lower than the minimum output power supported by the platform, the output power should be set to the minimum output power supported by the platform. If the aTargetPower is higher than the maximum output power supported by the platform, the output power should be set to the maximum output power supported by the platform. If the aTargetPower is set to INT16_MAX, the corresponding channel is disabled.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
||||||
| Return Values |
|
otPlatRadioSetCoexEnabled
otError otPlatRadioSetCoexEnabled( otInstance *aInstance, bool aEnabled )
Enable the radio coex.
Is used when feature OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE is enabled.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Return Values |
|
otPlatRadioSetRegion
otError otPlatRadioSetRegion( otInstance *aInstance, uint16_t aRegionCode )
Set the region code.
The radio region format is the 2-bytes ascii representation of the ISO 3166 alpha-2 code.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
||||||
| Return Values |
|
otPlatRadioSleep
otError otPlatRadioSleep( otInstance *aInstance )
Transition the radio to the Sleep state (turn off the radio).
If the radio is already in the Sleep state, this function MUST return OT_ERROR_NONE with no effect.
If otPlatRadioSleep() is called while the radio is in the middle of receiving a frame or transmitting an ACK (e.g., during AIFS/turnaround wait or actively transmitting the ACK frame), the radio MUST complete the ongoing operation (finish frame reception and/or ACK transmission) and transition to Sleep immediately thereafter. In this scenario:
- The radio MUST return
OT_ERROR_NONEto indicate that the sleep request has been accepted and scheduled. - Upon finishing the frame reception (and any associated ACK transmission), the radio driver MUST invoke
otPlatRadioReceiveDone()to deliver the received frame (or report reception error) before transitioning to Sleep.
If any subsequent radio state transition function (e.g., otPlatRadioReceive() or otPlatRadioTransmit()) is called while a scheduled transition to Sleep is pending, the pending Sleep transition MUST be canceled/superseded, and the radio MUST transition to the newly requested state upon completing the ongoing reception and/or ACK transmission.
| Details | |||||||
|---|---|---|---|---|---|---|---|
| Parameters |
|
||||||
| Return Values |
|
otPlatRadioTransmit
otError otPlatRadioTransmit( otInstance *aInstance, otRadioFrame *aFrame )
Begin the transmit sequence on the radio.
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.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
||||
| Return Values |
|
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.
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.
| Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Parameters |
|
otPlatRadioTxStarted
void otPlatRadioTxStarted( otInstance *aInstance, otRadioFrame *aFrame )
The radio driver calls this function to notify OpenThread that the transmission has started.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
otPlatRadioUpdateCslSampleTime
void otPlatRadioUpdateCslSampleTime( otInstance *aInstance, otRadioTime32 aCslSampleTime )
Update CSL sample time in radio driver.
Sample time is stored in radio driver as a copy to calculate phase when sending ACK with CSL IE. The CSL sample (window) of the CSL receiver extends before and after the sample time. The CSL sample time marks a timestamp in the CSL sample window when a frame should be received in "ideal conditions" if there would be no inaccuracy/clock-drift.
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
Resources
OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.