Available on crate feature
std only.Expand description
A blocking frame reader over std::io::Read: a serial port, a USB infrared head, a
TCP socket or a capture file.
use sml_kit::{Obis, io::FrameReader};
let port = std::fs::File::open("/dev/ttyUSB0")?; // 9600 8N1, configured beforehand
for frame in FrameReader::new(port) {
let Ok(frame) = frame else { continue }; // a damaged frame, or a read timeout
if let Ok(list) = sml_kit::readout(&frame) {
println!("A+ = {:?}", list.quantity(Obis::ENERGY_IMPORT));
}
}Only available with the std feature. The core decoder underneath is the same
sans-I/O Decoder.
Structs§
- Frame
Reader - An iterator of verified transport payloads read from
R.
Enums§
- Read
Error - What can go wrong while reading frames.
Constants§
- DEFAULT_
CAPACITY - The largest frame
FrameReader::newaccepts: far more than any meter telegram.