zephyr::raw

Function k_pipe_read

Source
pub unsafe extern "C" fn k_pipe_read(
    pipe: *mut k_pipe,
    data: *mut u8,
    len: usize,
    timeout: k_timeout_t,
) -> i32
Expand description

@brief Read data from a pipe This routine reads up to @a len bytes of data from @a pipe. If the pipe is empty, the routine will block until the data can be read or the timeout expires.

@param pipe Address of the pipe. @param data Address to place the data read from pipe. @param len Requested number of bytes to read. @param timeout Waiting period to wait for the data to be read.

@retval number of bytes read on success @retval -EAGAIN if no data could be read before the timeout expired @retval -ECANCELED if the read was interrupted by k_pipe_reset(..) @retval -EPIPE if the pipe was closed