osd-contiki/cpu/cc26xx-cc13xx/rf-core
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
..
api Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
dot-15-4g.h Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
ieee-mode.c Wait for a valid RSSI reading in CC13xx/CC26xx RF drivers 2016-07-17 18:20:22 +01:00
prop-mode.c Wait for a valid RSSI reading in CC13xx/CC26xx RF drivers 2016-07-17 18:20:22 +01:00
rf-ble.c This fixes an event handling issue in the cc26xx BLE driver. Currently, the rf_ble_beacon_process triggers the BLE beacon upon receiving any event, rather than verifying that the event timer has expired. This means that any PROCESS_BROADCAST (e.g. any sensor event) will fire the beacon. This commit adds logic to prevent this. 2016-04-18 17:14:37 +08:00
rf-ble.h Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
rf-core.c cc26xx: implement poll mode, hardware timestamps, and other minor changes in the IEEE radio driver 2016-06-14 00:54:32 +03:00
rf-core.h cc26xx: implement poll mode, hardware timestamps, and other minor changes in the IEEE radio driver 2016-06-14 00:54:32 +03:00
smartrf-settings.c Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00
smartrf-settings.h Add support for the CC13xx CPU 2015-08-23 19:54:42 +01:00