Skip to main content

otPlatRadioScheduledTxDone

Function otPlatRadioScheduledTxDone 

Source
pub unsafe extern "C" fn otPlatRadioScheduledTxDone(
    aInstance: *mut otInstance,
    aAckFrame: *mut otRadioFrame,
    aError: otError,
)
Expand description

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 call otPlatRadioScheduleTx() to schedule a new transmission. The radio platform implementation MUST support otPlatRadioScheduleTx() being called directly from within this callback.

@note This function should be called by the same thread that executes all of the other OpenThread code. It should not be called by an ISR or any other task.

@param[in] aInstance The OpenThread instance structure. @param[in] aAckFrame A pointer to the received ACK frame, or NULL if no ACK was received. @param[in] aError OT_ERROR_NONE when the frame was transmitted at the target time (and an Ack was received if Ack was requested in the MAC header), OT_ERROR_NO_ACK when the frame was transmitted at the target time but no Ack was received, OT_ERROR_CHANNEL_ACCESS_FAILURE when transmission at the target time could not take place due to activity on the channel (CCA failure when mCsmaCaEnabled is true), OT_ERROR_ABORT when the frame could not be transmitted at the exact target time (e.g., due to Coex denial or missed target time) or the transmission was aborted for other reasons.