zephyr::raw

Function k_msgq_get

source
pub unsafe extern "C" fn k_msgq_get(
    msgq: *mut k_msgq,
    data: *mut c_void,
    timeout: k_timeout_t,
) -> i32
Expand description

@brief Receive a message from a message queue.

This routine receives a message from message queue @a q in a “first in, first out” manner.

@note @a timeout must be set to K_NO_WAIT if called from ISR.

@funcprops \isr_ok

@param msgq Address of the message queue. @param data Address of area to hold the received message. @param timeout Waiting period to receive the message, or one of the special values K_NO_WAIT and K_FOREVER.

@retval 0 Message received. @retval -ENOMSG Returned without waiting or queue purged. @retval -EAGAIN Waiting period timed out.