diff --git a/drivers/cc110x/cc110x-netdev.c b/drivers/cc110x/cc110x-netdev.c index e7af682307..bba8e3d4ba 100644 --- a/drivers/cc110x/cc110x-netdev.c +++ b/drivers/cc110x/cc110x-netdev.c @@ -27,6 +27,7 @@ #include "cc110x-netdev.h" #include "cc110x-internal.h" #include "cc110x-interface.h" +#include "cc110x-defines.h" #include "net/eui64.h" #include "periph/gpio.h" @@ -61,7 +62,7 @@ static int _recv(netdev_t *dev, void *buf, size_t len, void *info) if (info != NULL) { netdev_cc110x_rx_info_t *cc110x_info = info; - cc110x_info->rssi = cc110x->pkt_buf.rssi; + cc110x_info->rssi = (int16_t)cc110x->pkt_buf.rssi/2 - CC110X_RSSI_OFFSET; cc110x_info->lqi = cc110x->pkt_buf.lqi; } return cc110x_pkt->length; diff --git a/drivers/cc110x/include/cc110x-defines.h b/drivers/cc110x/include/cc110x-defines.h index ee5577a050..069076b58d 100644 --- a/drivers/cc110x/include/cc110x-defines.h +++ b/drivers/cc110x/include/cc110x-defines.h @@ -34,6 +34,15 @@ extern "C" { */ #define VARIABLE_PKTLEN (0x01) +/** + * @brief RSSI calculation offset. + * + * The cc1101 has 74 as a RSSI offset. The CC1100E has a + * slightly larger offset of 75 to 79 (not implemented here). + * With those devices we thus get a slightly optimistic result. + */ +#define CC110X_RSSI_OFFSET (74) + /** * @name Bitmasks for reading out status register values * @{