Mercurial > templog
comparison rust/src/sensor.rs @ 609:7bda01659426 rust
not building, paramwaiter work
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 18 Feb 2017 00:21:10 +0800 |
parents | 8dd63473b6d8 |
children | f3e39e2107fd |
comparison
equal
deleted
inserted
replaced
608:71f045231a07 | 609:7bda01659426 |
---|---|
70 | 70 |
71 Ok(f32::from_str(v)?) | 71 Ok(f32::from_str(v)?) |
72 } | 72 } |
73 | 73 |
74 fn sensor_names(&self) -> Result<Vec<String>, Box<Error>> { | 74 fn sensor_names(&self) -> Result<Vec<String>, Box<Error>> { |
75 // TODO: needs to handle multiple busses. | |
75 let mut path = PathBuf::from(&self.config.SENSOR_BASE_DIR); | 76 let mut path = PathBuf::from(&self.config.SENSOR_BASE_DIR); |
76 path.push("w1_master_slaves"); | 77 path.push("w1_master_slaves"); |
77 | 78 |
78 let f = BufReader::new(File::open(path)?); | 79 let f = BufReader::new(File::open(path)?); |
79 let s = f.lines().collect::<Result<Vec<String>, io::Error>>()?; | 80 let s = f.lines().collect::<Result<Vec<String>, io::Error>>()?; |