1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

at86rf2xx: mask MSB in PHR for 802.15.4 compliance

This commit is contained in:
daniel-k 2015-09-24 15:51:29 +02:00
parent 026503d229
commit e754963c52

View File

@ -246,9 +246,11 @@ void at86rf2xx_tx_exec(at86rf2xx_t *dev)
size_t at86rf2xx_rx_len(at86rf2xx_t *dev)
{
uint8_t res;
at86rf2xx_fb_read(dev, &res, 1);
return (size_t)(res - 2); /* extract the PHR and LQI field */
uint8_t phr;
at86rf2xx_fb_read(dev, &phr, 1);
/* ignore MSB (refer p.80) and substract length of FCS field */
return (size_t)((phr & 0x7f) - 2);
}
void at86rf2xx_rx_read(at86rf2xx_t *dev, uint8_t *data, size_t len,