osd-contiki/cpu/cc26xx-cc13xx
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
..
dev Merge pull request #1727 from g-oikonomou/contrib/cc26xx/trng 2016-07-16 23:34:53 +01:00
lib Update CCxxwares to our warning-free version 2015-10-20 10:11:41 +02:00
rf-core Wait for a valid RSSI reading in CC13xx/CC26xx RF drivers 2016-07-17 18:20:22 +01:00
cc26xx.ld Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
clock.c cc26xx: enable sync between radio timer and RTC, useful for TSCH 2016-06-14 00:54:33 +03:00
dbg.h Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
debug-uart.h Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
fault-handlers.c Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
ieee-addr.c Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
ieee-addr.h Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
lpm.c CC26xx: fix a regression in and refactor LPM code 2016-06-29 01:03:06 +03:00
lpm.h Fixed numeruous bus in CC26xx-CC13xx lpm 2016-02-23 10:41:01 -07:00
Makefile.cc13xx Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
Makefile.cc26xx Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
Makefile.cc26xx-cc13xx Add CC13xx/CC26xx RNG support to the build 2016-06-15 10:32:03 +01:00
mtarch.h Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
putchar.c Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
random.c Implement random.h API for the CC13xx/CC26xx 2016-06-15 10:32:03 +01:00
rtimer-arch.c Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
rtimer-arch.h cc26xx: add TSCH-related rtimer defines 2016-06-14 00:54:32 +03:00
slip-arch.c Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
ti-lib.h Add TRNG CCxxware macros 2016-06-15 10:30:17 +01:00