Crate weighty

Source
Expand description

Weighty is a simple library for reading from USB HID scales, as well as an example utility that consumes the library and performs one reading on all available scales.

If you have a little compilation time to spare, I recommend using the units feature to enable the read method on the drivers, which prevents you from bungling the units… not that you would… but I have.

Example:

use weighty;

for scale in weighty::get_all_scales() {
    println!("{:?}kgf", scale.read_kilograms());
}

Enums§

HidScaleError
A list of things that can go wrong when reading from a digital scale.

Traits§

ScaleDriver
A ScaleDriver takes care of decoding and making sense of the raw bytes coming from the HID scale.

Functions§

get_all_scales
Returns a collection of drivers for all of the currently available scales.
get_scale_by_serial_number
Returns one specific scale, if it is connected and we have access to it.
get_scales_by_usb_id
Returns all of one specific type of scale that are currently connected.

Type Aliases§

Result
Type alias to simplify signatures.