zephyr/modules/openthread/platform
Florian Grandel b224a099fd net: l2: ieee802154: standardize RSSI value
The RSSI value in net_pkt (net_pkt_cb_ieee802154.rssi) was used
inconsistently across drivers. Some drivers did cast a signed dBm value
directly to net_pkt's unsigned byte value. Others were assigning the
negative value of the signed dBm value and again others were offsetting
and stretching the signed dBm value linearly onto the full unsigned byte
range.

This change standardizes net_pkt's rssi attribute to represent RSSI on
the RX path as an unsigned integer ranging from 0 (–174 dBm) to 254 (80
dBm) and lets 255 represent an "unknown RSSI" (IEEE 802.15.4-2020,
section 6.16.2.8). On the TX path the rssi attribute will always be
zero. Out-of-range values will be truncated to max/min values.

The change also introduces conversion functions to and from signed dBm
values and introduces these consistently to all existing call sites. The
"unknown RSSI" value is represented as INT16_MIN in this case.

In some cases drivers had to be changed to calculate dBm values from
internal hardware specific representations.

The conversion functions are fully covered by unit tests.

Fixes: #58494

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-17 07:16:32 -04:00
..
alarm.c net: openthread: priortize usec timer for openthread port. 2022-09-12 10:54:56 +00:00
CMakeLists.txt
crypto_psa.c net: openthread: Add implementation of crypto api. 2023-05-11 12:10:25 +02:00
diag.c modules: openthread: remove code_utils.h include 2023-02-27 11:34:52 +01:00
entropy.c devices: constify statically initialized device pointers 2022-08-19 11:51:26 +02:00
logging.c
memory.c
misc.c
openthread-core-zephyr-config.h manifest: openthread upmerge to d9abe30 2023-05-18 15:52:13 +02:00
platform-zephyr.h modules: openthread: add otPlatDiagRadioTransmitCarrier 2023-02-24 09:26:01 +01:00
platform.c
radio.c net: l2: ieee802154: standardize RSSI value 2023-06-17 07:16:32 -04:00
settings.c
shell.c shell: fix MISRA 5.7 violations on struct shell 2023-04-14 12:21:08 +02:00
spi.c
uart.c net: openthread: Fix double initialization problem in openthread usb. 2023-05-19 19:53:21 +00:00