w1_therm_reader

Crates.iow1_therm_reader
lib.rsw1_therm_reader
version0.1.0
sourcesrc
created_at2019-09-01 13:32:31.79656
updated_at2019-09-01 13:32:31.79656
descriptionA simple parser for w1_therm file on linux
homepage
repositoryhttps://github.com/gaetronik/w1_therm_reader
max_upload_size
id161338
size6,768
Gaëtan Duchaussois (gaetronik)

documentation

README

w1_therm_reader: simple parser to read temp out of 1wire temperzture sensor

Purpose

This lib aims at providing a simple way to read temperature out of a w1_therm compatible sensor connected to a linux machine. See the kernel documentation to know which devices are compatibles.

If you want a complete OneWire library, this crate is not the one you're looking for. Maybe Onewire.

It was a way to give nom a try.

Status

This lib as passed the "work for me stage" but it has not been thoroughly tested. This is developed on my free tim and I'm not a seasoned developer. Feel free to create PRs.

Usage

extern crate w1_therm_reader;
use w1_therm_reader::{read_from_file, read_from_device, convert_to_metric};

fn main() {
    // get the temperature from a file
    let t = read_from_file("/path/to/w1/").unwrap();
    // get the temperature from device
    let t = read_from_file("10-000001").unwrap();
    // get the temperature in °C instead of m°C
    let t_metric = convert_to_metric(t);
}
Commit count: 3

cargo fmt