Skip to main content

otPlatRadioCancelScheduledTx

Function otPlatRadioCancelScheduledTx 

Source
pub unsafe extern "C" fn otPlatRadioCancelScheduledTx(
    aInstance: *mut otInstance,
) -> otError
Expand description

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 return OT_ERROR_NONE. The radio platform MUST NOT invoke otPlatRadioScheduledTxDone() for a canceled transmission.
  • When otPlatRadioCancelScheduledTx() returns OT_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 call otPlatRadioScheduleTx() 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_ABORT completion is already queued to be reported), it MUST return OT_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_ABORT callback is pending (e.g., due to a past/missed target time or Coex denial), the radio platform MAY handle otPlatRadioCancelScheduledTx() in whichever way it prefers: it may either cancel the pending callback and return OT_ERROR_NONE, or return OT_ERROR_BUSY and let the otPlatRadioScheduledTxDone() callback be invoked.

@param[in] aInstance The OpenThread instance structure.

@retval OT_ERROR_NONE Successfully canceled the scheduled transmission (or no scheduled transmission was pending). @retval OT_ERROR_BUSY The scheduled transmission has already started and could not be canceled.