jacdac.barcode_reader

Submodules

Package Contents

Classes

BarcodeReaderClient

A device that reads various barcodes, like QR codes. For the web, see [BarcodeDetector](https://developer.mozilla.org/en-US/docs/Web/API/BarcodeDetector).

class jacdac.barcode_reader.BarcodeReaderClient(bus: jacdac.bus.Bus, role: str)

Bases: jacdac.bus.Client

A device that reads various barcodes, like QR codes. For the web, see [BarcodeDetector](https://developer.mozilla.org/en-US/docs/Web/API/BarcodeDetector). Implements a client for the Barcode reader service.

property enabled Optional[bool]

Turns on or off the detection of barcodes.,

on_detect(handler: jacdac.bus.EventHandlerFn) jacdac.bus.UnsubscribeFn

Raised when a bar code is detected and decoded. If the reader detects multiple codes, it will issue multiple events. In case of numeric barcodes, the data field should contain the ASCII (which is the same as UTF8 in that case) representation of the number.