[feat](trx-backend): fluctuate dummy rig signal strength randomly

Use subsecond nanosecond jitter to return a varying signal strength
(2-8) from the dummy backend instead of a static value of 5.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
2026-02-08 12:14:43 +01:00
parent c67e8feb9c
commit 0a1447bb4d
+7 -1
View File
@@ -158,7 +158,13 @@ impl RigCat for DummyRig {
fn get_signal_strength<'a>(
&'a mut self,
) -> Pin<Box<dyn std::future::Future<Output = DynResult<u8>> + Send + 'a>> {
Box::pin(async { Ok(5) })
// Fluctuate between 2 and 8 using low-order time bits
let nanos = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap_or_default()
.subsec_nanos();
let val = 2 + (nanos % 7) as u8; // 2..=8
Box::pin(async move { Ok(val) })
}
fn get_tx_power<'a>(