zephyr/tests/subsys
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
..
canbus/isotp samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
debug tests: samples: cleanup test tags, add integration_platforms 2023-06-02 04:47:06 -04:00
dfu samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
dsp/basicmath samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
edac samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
emul emul: Migrate all emulation use to use DT_HAS_ 2023-04-28 08:37:33 -05:00
fs tests: use integration_platforms where applicable 2023-05-26 17:52:02 -04:00
input samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
ipc/ipc_service device: remove redundant init functions 2023-04-19 10:00:25 +02:00
jwt
logging tests/samples: set ram/rom limits on some samples/tests 2023-06-13 09:38:27 -04:00
mgmt tests: mcumgr: update tags 2023-06-07 05:41:31 -04:00
modbus tests: samples: cleanup test tags, add integration_platforms 2023-06-02 04:47:06 -04:00
openthread net: l2: ieee802154: standardize RSSI value 2023-06-17 07:16:32 -04:00
pm tests: samples: cleanup test tags, add integration_platforms 2023-06-02 04:47:06 -04:00
portability tests: samples: cleanup test tags, add integration_platforms 2023-06-02 04:47:06 -04:00
rtio/rtio_api tests: samples: cleanup test tags, add integration_platforms 2023-06-02 04:47:06 -04:00
sd samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
settings samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
shell samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
storage samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
testsuite/fff_fake_contexts samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
tracing/tracing_api
usb iterable_sections: move to specific header 2023-05-22 10:42:30 +02:00
zbus tests: samples: cleanup test tags, add integration_platforms 2023-06-02 04:47:06 -04:00