diff --git a/drivers/cc110x/cc110x-netdev2.c b/drivers/cc110x/cc110x-netdev2.c index ffb241efa1e9dbb034eed094e274cbfd875711f5..9d9ab3738be12313e9a96dbf7d50341a8e2eac94 100644 --- a/drivers/cc110x/cc110x-netdev2.c +++ b/drivers/cc110x/cc110x-netdev2.c @@ -47,11 +47,12 @@ static int _send(netdev2_t *dev, const struct iovec *vector, int count) return cc110x_send(&netdev2_cc110x->cc110x, cc110x_pkt); } -static int _recv(netdev2_t *dev, char* buf, int len) +static int _recv(netdev2_t *dev, char* buf, int len, void *info) { DEBUG("%s:%u\n", __func__, __LINE__); cc110x_t *cc110x = &((netdev2_cc110x_t*) dev)->cc110x; + netdev2_cc110x_rx_info_t *cc110x_info = info; cc110x_pkt_t *cc110x_pkt = &cc110x->pkt_buf.packet; if (cc110x_pkt->length > len) { @@ -59,6 +60,8 @@ static int _recv(netdev2_t *dev, char* buf, int len) } memcpy(buf, (void*)cc110x_pkt, cc110x_pkt->length); + cc110x_info->rssi = cc110x->pkt_buf.rssi; + cc110x_info->lqi = cc110x->pkt_buf.lqi; return cc110x_pkt->length; } diff --git a/drivers/cc110x/include/cc110x-netdev2.h b/drivers/cc110x/include/cc110x-netdev2.h index 742e3ef9a429b23a59bf017696b828608d62a783..055ac60e657eaa2411cbf6e5122d6bfee04f793f 100644 --- a/drivers/cc110x/include/cc110x-netdev2.h +++ b/drivers/cc110x/include/cc110x-netdev2.h @@ -43,6 +43,10 @@ typedef struct netdev2_cc110x { cc110x_t cc110x; /**< documentation here */ } netdev2_cc110x_t; +/** + * @brief Received packet status information for cc110x radios + */ +typedef struct netdev2_radio_rx_info netdev2_cc110x_rx_info_t; /** * @brief netdev2 <-> cc110x glue code initialization function