From bd8d2d3a8a273a094ee24447a52c5c323fa10c37 Mon Sep 17 00:00:00 2001 From: Martine Lenders <mlenders@inf.fu-berlin.de> Date: Fri, 29 Jan 2016 15:49:10 +0100 Subject: [PATCH] cc110x: adapt for info struct --- drivers/cc110x/cc110x-netdev2.c | 5 ++++- drivers/cc110x/include/cc110x-netdev2.h | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/cc110x/cc110x-netdev2.c b/drivers/cc110x/cc110x-netdev2.c index ffb241efa1..9d9ab3738b 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 742e3ef9a4..055ac60e65 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 -- GitLab