From dad883c745ff7db9cd5d3934d63c9a19e52b016d Mon Sep 17 00:00:00 2001 From: Martine Lenders <mail@martine-lenders.eu> Date: Mon, 18 Jan 2016 14:54:05 +0100 Subject: [PATCH] netdev2: provide capability to pass up packet status information --- drivers/include/net/netdev2.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/include/net/netdev2.h b/drivers/include/net/netdev2.h index d6904a3dca..c268dce2e7 100644 --- a/drivers/include/net/netdev2.h +++ b/drivers/include/net/netdev2.h @@ -71,6 +71,16 @@ typedef enum { /* expand this list if needed */ } netdev2_event_t; +/** + * @brief Received packet status information for most radios + * + * May be different for certain radios. + */ +struct netdev2_radio_rx_info { + uint8_t rssi; /**< RSSI of a received packet */ + uint8_t lqi; /**< LQI of a received packet */ +}; + /** * @brief Forward declaration for netdev2 struct */ @@ -122,12 +132,15 @@ typedef struct netdev2_driver { * @param[in] dev network device descriptor * @param[out] buf buffer to write into or NULL * @param[in] len maximum nr. of bytes to read + * @param[out] info status information for the received packet. Might + * be of different type for different netdev2 devices. + * May be NULL if not needed or applicable. * * @return <=0 on error * @return nr of bytes read if buf != NULL * @return packet size if buf == NULL */ - int (*recv)(netdev2_t *dev, char* buf, int len); + int (*recv)(netdev2_t *dev, char *buf, int len, void *info); /** * @brief the driver's initialization function -- GitLab