Doubts about the use of PIPEs in Zephyr

Hi. I have two questions about the PIPEs in Zephyr RTOS, especially regarding the correct use of the k_pipe_put and k_pipe_get functions:

1) In both functions, what is the meaning of the min_xfer parameter? According to the documentation, if they process fewer bytes than min_xfer (between zero and min_xfer minus one), they return -EAGAIN. But why is this necessary? Can’t I simply check the number of bytes processed with the bytes_written parameter?

2) Is the timeout parameter only involved when the bytes written do not exceed min_xfer? Or is it also involved when the bytes written are between min_xfer and bytes_to_write? I read a post about this, and it confused me: can the functions return before the timeout if the number of bytes written is between min_xfer and bytes_to_write?

Related