Skip to content
Snippets Groups Projects
Unverified Commit 861fbe9a authored by Francisco Acosta's avatar Francisco Acosta Committed by GitHub
Browse files

Merge pull request #9510 from Josar/pr/at86rf2xx_rssi

at86rf2xx: correct rssi
parents 635ecf9f 4482c985
No related branches found
No related tags found
No related merge requests found
...@@ -166,18 +166,39 @@ static int _recv(netdev_t *netdev, void *buf, size_t len, void *info) ...@@ -166,18 +166,39 @@ static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
at86rf2xx_fb_read(dev, tmp, 2); at86rf2xx_fb_read(dev, tmp, 2);
(void)tmp; (void)tmp;
/* at86rf212 RSSI_BASE_VAL +3.1*RSSI, base varies for diff. modulation and datarates
* at86RF232 RSSI_BASE_VAL +3.0*RSSI, base -91dBm
* at86RF233 RSSI_BASE_VAL +3.0*RSSI, base -94dBm
* at86RF231 RSSI_BASE_VAL +3.0*(RSSI-1), base -91dBm
* at***RFR2 RSSI_BASE_VAL +3.0*(RSSI-1), base -90dBm
*
* AT86RF231 MAN. p.89 8.3.2 Reading RSSI
* AT86RF232 MAN. p.88 8.3.2 Reading RSSI
* AT86RF233 MAN. p.99 8.4.2 Reading RSSI
* "It is not recommended reading the RSSI value when using the Extended
* Operating Modes, use ED instead"
* at86RF231 RSSI_BASE_VAL +ED, base -90dBm
* at86RF232 RSSI_BASE_VAL +ED, base -91dBm
* at86RF233 RSSI_BASE_VAL +ED, base -94dBm
* at***RFR2 RSSI_BASE_VAL +ED, base -90dBm
*/
if (info != NULL) { if (info != NULL) {
uint8_t rssi = 0; uint8_t rssi = 0;
netdev_ieee802154_rx_info_t *radio_info = info; netdev_ieee802154_rx_info_t *radio_info = info;
#if defined(MODULE_AT86RF231) || defined(MODULE_AT86RF232) || defined(MODULE_AT86RF233)
at86rf2xx_fb_read(dev, &(radio_info->lqi), 1); at86rf2xx_fb_read(dev, &(radio_info->lqi), 1);
#ifndef MODULE_AT86RF231
at86rf2xx_fb_read(dev, &(rssi), 1);
at86rf2xx_fb_stop(dev); at86rf2xx_fb_stop(dev);
rssi = at86rf2xx_reg_read(dev, AT86RF2XX_REG__PHY_ED_LEVEL);
#else #else
at86rf2xx_fb_read(dev, &(radio_info->lqi), 1);
at86rf2xx_fb_read(dev, &(rssi), 1);
at86rf2xx_fb_stop(dev); at86rf2xx_fb_stop(dev);
rssi = at86rf2xx_reg_read(dev, AT86RF2XX_REG__PHY_ED_LEVEL); rssi = 3 * rssi;
#endif #endif
radio_info->rssi = RSSI_BASE_VAL + rssi; radio_info->rssi = RSSI_BASE_VAL + rssi;
DEBUG("[at86rf2xx] LQI:%d high is good, RSSI:%d high is either good or"
"too much interference.\n", radio_info->lqi, radio_info->rssi);
} }
else { else {
at86rf2xx_fb_stop(dev); at86rf2xx_fb_stop(dev);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment