barcode-scanner

Crates.iobarcode-scanner
lib.rsbarcode-scanner
version0.1.0
sourcesrc
created_at2023-02-24 10:23:19.871515
updated_at2023-02-24 10:23:19.871515
descriptionLinux interface to barcode USB hand scanners
homepage
repositoryhttps://github.com/robohouse-delft/barcode-scanner-rs
max_upload_size
id793455
size18,466
Maarten de Vries (de-vri-es)

documentation

https://docs.rs/barcode-scanner

README

barcode-scanner

Scan 1D barcodes using a hand scanner for Rust.

The barcode-scanner crate provides a Linux interface to barcode USB hand scanners. It works with the Device struct from the evdev crate.

Currently supported features:

  • One [BarcodeScanner] struct for all USB hand scanners that operate as a keyboard.
  • Prevent other clients from receiving events from the selected device by grabbing it.
  • Read 1D barcode consisting of numbers and letters.
  • Omit special characters in a barcode.

Example

This example grabs a hand scanner and prints a barcode that is read.

	use barcode_scanner::BarcodeScanner;

	let scanner = BarcodeScanner::new("usb-0000:00:14.0-3/input0")?;
	loop {
    	let barcode = scanner.read()?;
    	println!("{}", barcode);
	}

License: BSD-2-Clause OR Apache-2.0

Commit count: 2

cargo fmt