[][src]Crate zg_co2

A no_std crate implementing the ZyAura ZG CO₂ sensor protocol.

This crate decodes the packets, but does not perform the decryption commonly required for USB devices using this sensor. To read data from one of the compatible commercially-available USB sensors, use the co2mon crate.

The implementation was tested using a TFA-Dostmann AIRCO2TROL MINI sensor.

Example

let packet = [0x50, 0x04, 0x57, 0xab, 0x0d];
let reading = zg_co2::decode(packet)?;
println!("{:?}", reading);

Features

The std feature, enabled by default, makes Error implement the Error trait.

The serde feature enables serialization and deserialization support for the SingleReading struct.

References

See this link for more information about the protocol.

Enums

Error

A possible error value when decoding a sensor message.

SingleReading

A single sensor reading.

Functions

decode

Decodes a message from the sensor.

Type Definitions

Result

A specialized Result type for the decode function.