otMessageTxCallback

Type Alias otMessageTxCallback 

Source
pub type otMessageTxCallback = Option<unsafe extern "C" fn(aMessage: *const otMessage, aError: otError, aContext: *mut c_void)>;
Expand description

Represents the callback function pointer to notify the transmission outcome (success or failure) of a message.

The error indicates the transmission status of the IPv6 message from this device to an immediate neighbor (one-hop transmission). It doesn’t indicate that the message is received by its final intended destination (multi-hop away).

For a unicast IPv6 message, an OT_ERROR_NONE error indicates that the message (all its corresponding fragment frames if the message is larger and requires fragmentation) was successfully delivered to the immediate neighbor, and a MAC layer acknowledgment was received for all fragments. This is reported regardless of whether the message is sent using direct TX or indirect TX (to a sleepy child using CSL or data poll triggered TX).

For a multicast message, an OT_ERROR_NONE status indicates that the message (all its fragment frames) was successfully broadcast. Note that no MAC-level acknowledgment is required for broadcast frame TX.

The OpenThread stack may alter the content of the message as it is prepared for transmission (e.g., IPv6 headers may be prepended, or additional metadata appended at the end). So, the content of @p aMessage when this callback is invoked may differ from its original content (e.g., when it was given as input in otIp6Send() for transmission).

@param[in] aMessage A pointer to the message. @param[in] aError The TX error when sending the message. @param[in] aContext A pointer to the user-provided context when the callback was registered.

Aliased Type§

pub enum otMessageTxCallback {
    None,
    Some(unsafe extern "C" fn(*const otMessage, u32, *mut c_void)),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(*const otMessage, u32, *mut c_void))

Some value of type T.