diff --git a/src/dsmr/reader.rs b/src/dsmr/reader.rs index 4fa79c6..f5889af 100644 --- a/src/dsmr/reader.rs +++ b/src/dsmr/reader.rs @@ -98,7 +98,7 @@ pub fn read_from_serial_port( let error = result.expect_err("Expected an error, but there is none?"); log::info!("Read error {}, clearing buffer", error.to_string()); // Just drop this telegram - buffer.clear(); + buffer.clear(); } else { let clone = buffer.clone(); @@ -113,9 +113,7 @@ pub fn read_from_serial_port( } } -pub fn connect_to_meter( - serial_settings: settings::SerialSettings, -) -> Box { +pub fn connect_to_meter(serial_settings: settings::SerialSettings) -> Box { log::info!( "Connecting to {} using baud rate {}, byte size {} and parity bit {:#?}", &serial_settings.port, diff --git a/src/main.rs b/src/main.rs index 10adc54..5982179 100644 --- a/src/main.rs +++ b/src/main.rs @@ -51,7 +51,7 @@ pub fn main() { log::info!("dsmr-rs starting..."); let (serial_settings, api_settings) = dsmr::settings::settings(settings).unwrap(); let mut consumer = dsmr::sender::DelegatingConsumer::new(api_settings.hosts); - + let port: Box = dsmr::reader::connect_to_meter(serial_settings); dsmr::reader::read_from_serial_port(port, &mut consumer);