diff --git a/src/bridge.rs b/src/bridge.rs index 2b14454..36c531c 100644 --- a/src/bridge.rs +++ b/src/bridge.rs @@ -23,7 +23,7 @@ impl Bridge { // setup meshtastic connection let stream_api = StreamApi::new(); - let tcp_stream = utils::stream::build_tcp_stream(config.meshtastic.hostname).await?; + let tcp_stream = utils::stream::build_tcp_stream(config.meshtastic.address).await?; let (meshtastic_listener, meshtastic_stream_api) = stream_api.connect(tcp_stream).await; // setup matrix client diff --git a/src/config.rs b/src/config.rs index ebc14f9..0f6e692 100644 --- a/src/config.rs +++ b/src/config.rs @@ -20,8 +20,8 @@ pub(crate) struct MatrixConfig { #[derive(serde::Deserialize, Debug)] pub(crate) struct MeshtasticConfig { - #[serde(default = "get_meshtastic_hostname")] - pub(crate) hostname: String, + #[serde(default = "get_meshtastic_address")] + pub(crate) address: String, // expected format is host:port } fn get_device_name() -> String { @@ -39,8 +39,8 @@ fn get_matrix_password() -> String { } } -fn get_meshtastic_hostname() -> String { - match std::env::var("MESHTASTIC_HOSTNAME") { +fn get_meshtastic_address() -> String { + match std::env::var("MESHTASTIC_ADDRESS") { Ok(p) => p, Err(_) => "meshtastic.local".to_string(), } diff --git a/src/meshtastic.rs b/src/meshtastic.rs index f4dc21d..7956414 100644 --- a/src/meshtastic.rs +++ b/src/meshtastic.rs @@ -19,7 +19,7 @@ pub(crate) async fn build( ) -> Result> { let stream_api = StreamApi::new(); - let tcp_stream = utils::stream::build_tcp_stream(config.hostname).await?; + let tcp_stream = utils::stream::build_tcp_stream(config.address).await?; let (decoded_listener, stream_api) = stream_api.connect(tcp_stream).await; log::info!("connected to meshtastic device");