1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

netdev_driver_t::recv: Clarified small buf case

Clarified in the documentation how netdev_driver_t::recv() should behave in case
the size of the buffer in parameter buf (indicated by parameter len) is to small
to fit the received frame.
This commit is contained in:
Marian Buschsieweke 2018-12-26 20:40:25 +01:00
parent 87055d7b6d
commit e81b6191aa
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -323,6 +323,13 @@ typedef struct netdev_driver {
* If @p buf == NULL and @p len > 0, drops the packet and returns the packet * If @p buf == NULL and @p len > 0, drops the packet and returns the packet
* size. * size.
* *
* If called with @p buf != NULL and @p len is smaller than the received
* packet:
* - The received packet is dropped
* - The content in @p buf becomes invalid. (The driver may use the memory
* to implement the dropping - or may not change it.)
* - `-ENOBUFS` is returned
*
* @param[in] dev network device descriptor. Must not be NULL. * @param[in] dev network device descriptor. Must not be NULL.
* @param[out] buf buffer to write into or NULL to return the packet * @param[out] buf buffer to write into or NULL to return the packet
* size. * size.