Function esp_idf_svc::sys::xRingbufferReceiveUpToFromISR

source ยท
pub unsafe extern "C" fn xRingbufferReceiveUpToFromISR(
    xRingbuffer: *mut c_void,
    pxItemSize: *mut usize,
    xMaxSize: usize,
) -> *mut c_void
Expand description

@brief Retrieve bytes from a byte buffer, specifying the maximum amount of bytes to retrieve. Call this from an ISR.

Attempt to retrieve bytes from a byte buffer whilst specifying a maximum number of bytes to retrieve. This function will return immediately if there is no data available for retrieval.

@param[in] xRingbuffer Ring buffer to retrieve the item from @param[out] pxItemSize Pointer to a variable to which the size of the retrieved item will be written. @param[in] xMaxSize Maximum number of bytes to return. Size of 0 simply returns NULL.

@note A call to vRingbufferReturnItemFromISR() is required after this to free up the data received. @note This function should only be called on byte buffers @note Byte buffers do not allow multiple retrievals before returning an item

@return - Pointer to the retrieved item on success; *pxItemSize filled with the length of the item. - NULL when the ring buffer is empty, *pxItemSize is untouched in that case.