pylabrobot.generic.SerialBarcodeScanner#
- class pylabrobot.generic.SerialBarcodeScanner(port: str | None = None, vid: int | None = None, pid: int | None = None, baudrate: int = 9600, bytesize: int = 8, parity: str = 'N', stopbits: int = 1, write_timeout: float = 1, read_timeout: float = 1, rtscts: bool = False, dsrdtr: bool = False, xonxoff: bool = False, encoding: str = 'utf-8', terminators: Sequence[bytes] = (b'\r', b'\n'), max_line_length: int = 4096, trigger_command: bytes | None = None, untrigger_command: bytes | None = None)#
Bases:
objectBarcode scanner that returns one barcode per terminated serial line.
This class is intended for scanners configured as RS-232 or USB virtual COM devices. It reads bytes from
pylabrobot.io.Serialuntil a configured line terminator is seen.Methods
__init__([port, vid, pid, baudrate, ...])read_line([timeout])Read one barcode line from the serial stream.
Clear unread bytes buffered by the serial transport.
scan_barcode([read_time, symbology, ...])Scan one barcode from the serial stream.
setup()Connect to the scanner's serial port.
stop()Disconnect from the scanner's serial port.
write(data)Write raw bytes to the scanner.
- Parameters: