net/ieee802154/submac: calculate aUnitbackoffPeriod at runtime
Contribution description
Now aUnitBackoffPeriod is calculated at runtime from the current symbol duration and the value of the aTurnaroundTime and aCcaTime constants. This allows to add other PHYs that don't have fixed values for this constant and depend on the PHY configuration (symbol duration mostly).
Transceivers using the submac should work as usual since nrf52 and cc2538 use the same back-off period (320 us) and the added functions yield the same results. For other transceivers such as AT86RF212B (when ported to the HAL) may get a back-off period of either 320 us or 800 us depending on the band used.
Testing procedure
make -C tests/ieee802154_submac BOARD=<board> term
And send the constants command.
Issues/PRs references
N/A
nice one!
I haven't performed tests of the impact of the ACK and backoff calculations, but maybe they could be cached when some PHY parameter is changed as they are used each time a packet is transmitted. Any thoughts on this? It could add as much 4 bytes in total for both values on the ieee802154_submac_t structure (and deleting the symbol_duration one I added of course)
Stored them as fields on the submac structure, on https://github.com/RIOT-OS/RIOT/pull/16475/commits/e4df8c122ee80ac3e747d3abf5d1c3dadcf2c1fe and https://github.com/RIOT-OS/RIOT/pull/16475/commits/96a745f2859cb899c15dac9a80795cc16ce30d4b respectively.
@jeandudey, can you rebase please? @jia200x, @benpicco, any one up for an ACK upon a rebase?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.
Uh we still need this - want to give this a rebase?