furi_stream_buffer_receive

Function furi_stream_buffer_receive 

Source
pub unsafe extern "C" fn furi_stream_buffer_receive(
    stream_buffer: *mut FuriStreamBuffer,
    data: *mut c_void,
    length: usize,
    timeout: u32,
) -> usize
Expand description

Receives bytes from a stream buffer. Wakes up task waiting for space to become available if called from ISR.

§Arguments

  • stream_buffer - The stream buffer instance.
  • data - A pointer to the buffer into which the received bytes will be copied.
  • length - The length of the buffer pointed to by the data parameter.
  • timeout - The maximum amount of time the task should remain in the Blocked state to wait for data to become available if the stream buffer is empty. Will return immediately if timeout is zero. Setting timeout to FuriWaitForever will cause the task to wait indefinitely. Ignored if called from ISR.

§Returns

The number of bytes read from the stream buffer, if any.