sdio_slave_recv_packet() function
Get buffer of received data if exist with packet information. The driver returns the ownership of the buffer to the app. When you see return value is ``ESP_ERR_NOT_FINISHED``, you should call this API iteratively until the return value is ``ESP_OK``. All the continuous buffers returned with ``ESP_ERR_NOT_FINISHED``, together with the last buffer returned with ``ESP_OK``, belong to one packet from the host. You can call simpler ``sdio_slave_recv`` instead, if the host never send data longer than the Receiving buffer size, or you don't care about the packet boundary (e.g. the data is only a byte stream).
Arguments
handle_ret
Handle of the buffer holding received data. Use this handle in ``sdio_slave_recv_load_buf()`` to receive in the same buffer again.
wait
Time to wait before data received.
Return value
- ESP_ERR_INVALID_ARG if handle_ret is NULL - ESP_ERR_TIMEOUT if timeout before receiving new data - ESP_ERR_NOT_FINISHED if returned buffer is not the end of a packet from the host, should call this API again until the end of a packet - ESP_OK if success
Notes
Call ``sdio_slave_load_buf`` with the handle to re-load the buffer onto the link list, and receive with the same buffer again. The address and length of the buffer got here is the same as got from `sdio_slave_get_buffer`.
sdio_slave_recv_packet() is called by 1 function and calls 7 functions:
![]()
sdio_slave_recv_packet()
sdio_slave_recv_packet() reads 13 variables:
![]()
sdio_slave_recv_packet()