[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:
@@ -158,7 +158,13 @@ impl RigCat for DummyRig {
|
|||||||
fn get_signal_strength<'a>(
|
fn get_signal_strength<'a>(
|
||||||
&'a mut self,
|
&'a mut self,
|
||||||
) -> Pin<Box<dyn std::future::Future<Output = DynResult<u8>> + Send + 'a>> {
|
) -> 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>(
|
fn get_tx_power<'a>(
|
||||||
|
|||||||
Reference in New Issue
Block a user