rfsimulator: use ceil() to calculate the integer number of chan_offset samples from the prop_delay_ms

The actual propagation delay should not be smaller than the one specified.
A too short propagation delay might result in too early reception of Msg1, and with that in a mis-detection of the RAPID.
This commit is contained in:
Thomas Schlichter
2024-07-11 14:48:52 +02:00
parent 9dc0dc5ffe
commit 359880fa73
+1 -1
View File
@@ -983,7 +983,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
rfsimulator->tx_bw=openair0_cfg->tx_bw;
rfsimulator_readconfig(rfsimulator);
if (rfsimulator->prop_delay_ms > 0.0)
rfsimulator->chan_offset = rfsimulator->sample_rate * rfsimulator->prop_delay_ms / 1000;
rfsimulator->chan_offset = ceil(rfsimulator->sample_rate * rfsimulator->prop_delay_ms / 1000);
if (rfsimulator->chan_offset != 0) {
if (CirSize < minCirSize + rfsimulator->chan_offset) {
CirSize = minCirSize + rfsimulator->chan_offset;