osd-contiki/cpu
George Oikonomou 16f56abfad Wait for a valid RSSI reading in CC13xx/CC26xx RF drivers
As discussed in #1341, the current CC13xx/CC26xx IEEE mode driver sends `CMD_GET_RSSI` once and returns the RSSI reading uncondtionally. This happens within the `get_rssi()` function.

This logic is broken if `get_rssi()` is called with the radio off. The function will make sure to turn on the radio first, but it does not make sure the RSSI reading is valid, which only happens a number of symbol periods after the radio enters RX. The outcome is that `NETSTACK_RADIO.get_value(RADIO_PARAM_RSSI, ...)` will always return -128 (meaning that RSSI is unavailable) if the radio was off at the time of calling the function.

The same condition affects the prop mode driver.

This commit changes the logic of `get_rssi()`:
* For PROP mode, if `CMD_GET_RSSI` returns an invalid RSSI, we send it again. For unknown reasons, `CMD_GET_RSSI` on occasion returns 0, so we ignore that value too.
* For IEEE mode, we use `CMD_IEEE_CCA_REQ` and we inspect the value of `ccaInfo.ccaEnergy` of the return structure. If the value is 0x02 (Invalid), we send the command again.

Fixes #1341
2016-07-17 18:20:22 +01:00
..
6502 Make use of new cl65 option --print-target-path. 2016-06-03 13:30:25 +02:00
arm TSCH: use RTIMER_CLOCK_DIFF to compute estimated drift, fixing a bug that would occur on 16-bit rtimer platforms 2016-04-27 14:13:33 +02:00
avr Adding CRC valid check in rf230bb radios registermaps 2016-05-15 14:15:46 +02:00
cc26xx-cc13xx Wait for a valid RSSI reading in CC13xx/CC26xx RF drivers 2016-07-17 18:20:22 +01:00
cc253x Removed CC_FASTCALL. 2015-11-01 18:10:17 +01:00
cc2538 Remove unnecessary parentheses 2016-07-16 22:35:23 +01:00
mc1322x TSCH: use RTIMER_CLOCK_DIFF to compute estimated drift, fixing a bug that would occur on 16-bit rtimer platforms 2016-04-27 14:13:33 +02:00
msp430 Remove include of stdio.h 2016-05-04 11:12:37 +02:00
native Change the default IPv6 prefix from aaaa::/64 to fd00::/64 2016-03-07 17:47:44 +01:00
nrf52832 nrf52dk: cpu/nrf52832 support 2016-02-15 09:37:38 +01:00
pic32 [cpu/pic32] Removed excess end group 2014-11-10 23:53:33 +01:00
rl78 The -pedantic and -stdc flags trigger a few too many warnings 2015-10-20 10:11:35 +02:00
stm32w108 Merge pull request #1344 from tsparber/fix-doxygen 2015-11-30 22:07:15 +01:00
x86 x86, galileo: Add sample non-driver protection domain 2016-04-22 08:16:43 -07:00