[−][src]Crate co2mon
A driver for the Holtek (ZyAura ZG) CO₂ USB monitors.
The implementation was tested using a TFA-Dostmann AIRCO2TROL MINI sensor.
Example usage
let sensor = Sensor::open_default()?; let reading = sensor.read()?; println!("{:?}", reading);
Permissions
On Linux, you need to be able to access the USB HID device. For that, you
can save the following udev
rule to /etc/udev/rules.d/60-co2mon.rules
:
ACTION=="add|change", SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="a052", MODE:="0666"
Then reload the rules and trigger them:
# udevadm control --reload
# udevadm trigger
Note that the udev
rule above makes the device accessible to every local user.
References
The USB HID protocol is not documented, but was reverse-engineered before.
Structs
OpenOptions | Sensor open options. |
Sensor | Sensor driver struct. |
Enums
Error | An error that occurred when reading the sensor. |
Measurement | A sensor measurement. |
Type Definitions
Result | Result type for the fallible functions. |