openthread_sys

Type Alias otTcpReceiveAvailable

Source
pub type otTcpReceiveAvailable = Option<unsafe extern "C" fn(aEndpoint: *mut otTcpEndpoint, aBytesAvailable: usize, aEndOfStream: bool, aBytesRemaining: usize)>;
Expand description

This callback indicates the number of bytes available for consumption from the receive buffer.

It is called whenever bytes are added to the receive buffer and when the end of stream is reached. If the end of the stream has been reached (i.e., if no more data will become available to read because the connection peer has closed their end of the connection for writing), then @p aEndOfStream is true. Finally, @p aBytesRemaining indicates how much capacity is left in the receive buffer to hold additional data that arrives.

@param[in] aEndpoint The TCP endpoint for the connection. @param[in] aBytesAvailable The number of bytes in the connection’s receive buffer. @param[in] aEndOfStream Indicates if additional data, beyond what is already in the connection’s receive buffer, can be received. @param[in] aBytesRemaining The number of additional bytes that can be received before the receive buffer becomes full.

Aliased Type§

enum otTcpReceiveAvailable {
    None,
    Some(unsafe extern "C" fn(_: *mut otTcpEndpoint, _: usize, _: bool, _: usize)),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(_: *mut otTcpEndpoint, _: usize, _: bool, _: usize))

Some value of type T.