| Crates.io | escpos-rw |
| lib.rs | escpos-rw |
| version | 1.0.2 |
| created_at | 2025-01-11 10:42:48.793261+00 |
| updated_at | 2025-01-27 14:39:05.184078+00 |
| description | Low level communication with esc/pos printers |
| homepage | |
| repository | https://github.com/nicolasbauw/escpos-rw |
| max_upload_size | |
| id | 1512292 |
| size | 13,116 |
Escpos-rw is a "low level" fork of escpos-rs, aiming at providing the USB connection and read/write functions.
You can find ESC/POS Command Reference here.
// Creating the printer object
let Some(printer) = Printer::new(0x04b8, 0x0202)? else {
return Err(escpos_rw::Error::PrinterError(
"No printer found !".to_string(),
));
};
The printer object has a write_raw method...
// Open the cash drawer
printer.write_raw([0x1B, 0x70, 0x00, 0x7E, 0x7E])?;
...and a read_raw method:
// Reads data from printer output buffer
printer.read_raw()?;