comparison rust/src/main.rs @ 596:ca8102feaca6 rust

sensor takes config parameter
author Matt Johnston <matt@ucc.asn.au>
date Fri, 06 Jan 2017 22:04:10 +0800
parents e87655ed8429
children a440eafa84a9
comparison
equal deleted inserted replaced
595:e87655ed8429 596:ca8102feaca6
45 45
46 let (sensor_s, sensor_r) = mpsc::channel(1); 46 let (sensor_s, sensor_r) = mpsc::channel(1);
47 let sensor_r = sensor_r.map_err(|_| io::Error::new(io::ErrorKind::Other, "Problem with sensor_r channel")); 47 let sensor_r = sensor_r.map_err(|_| io::Error::new(io::ErrorKind::Other, "Problem with sensor_r channel"));
48 48
49 let sensor_stream = if cfg!(feature = "testmode") { 49 let sensor_stream = if cfg!(feature = "testmode") {
50 sensor::TestSensor::stream(&handle) 50 sensor::TestSensor::stream(&handle, &config)
51 } else { 51 } else {
52 sensor::OneWireSensor::stream(&handle) 52 sensor::OneWireSensor::stream(&handle, &config)
53 }; 53 };
54 54
55 // Send the sensors of interest to the fridge (sensor_s), 55 // Send the sensors of interest to the fridge (sensor_s),
56 // while streaming them all to the web sender. 56 // while streaming them all to the web sender.
57 let s = sensor_stream.map(|r| { 57 let s = sensor_stream.map(|r| {