From 454f78a7bb29e19ab0e505f84ee82163cb01d489 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 2 Jan 2024 17:58:28 +0100 Subject: Get config dialog to work --- src/config.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 33ba361..d54e01a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -34,11 +34,12 @@ impl Default for TunnelConfig { } } -type DurationSeconds = std::num::NonZeroU32; +pub(crate) type DurationSeconds = u32; #[derive(Debug, Serialize, Deserialize, Clone)] pub struct BeaconConfig { - pub period_seconds: Option, + // A period of zero means beaconing is disabled + pub period_seconds: DurationSeconds, #[serde(default)] pub max_hops: u8, pub latitude: Option, @@ -47,13 +48,13 @@ pub struct BeaconConfig { pub comment: Option, pub antenna_height: Option, pub antenna_gain: Option, - pub tx_power: Option, + pub tx_power: Option, // dBm } impl Default for BeaconConfig { fn default() -> Self { BeaconConfig { - period_seconds: None, + period_seconds: 0, max_hops: 3, latitude: None, longitude: None, -- cgit v1.2.3