46 lines
1.6 KiB
C
46 lines
1.6 KiB
C
/*
|
|
* bcode.h - barcode scanner input on the Workabout MX (integral laser).
|
|
*
|
|
* The Workabout MX integral laser is an UNDECODED (HHLC) scanner: it emits a
|
|
* raw bar/space signal, not decoded ASCII. The hardware serial decoder in the
|
|
* RS232/Barcode module only handles wands and wand-emulation scanners (the HC
|
|
* guide lists "Undecoded Laser Scanner (HHLC)" as unsupported there), which is
|
|
* why reading TTY:D directly yielded nothing even though the laser's own
|
|
* good-read LED lit.
|
|
*
|
|
* The decode is instead done in software by a barcode decoder LDD. The SDK
|
|
* ships several (\SIBOSDK\LIB): BAREAN (EAN/UPC), BARC39, BAR128, BARITF,
|
|
* BARMPLES, BARRAW. Each registers the device "BAR:". For UPC we load BAREAN.
|
|
*
|
|
* Usage: bcodeLoad() once, then bcodeOpen() to get a channel, then read it.
|
|
* The BAREAN.LDD file must be present on the device so p_loadldd can find it.
|
|
*/
|
|
#ifndef BCODE_H
|
|
#define BCODE_H
|
|
|
|
#include <plib.h>
|
|
|
|
/* Decoder LDD to load (BAREAN.LDD = EAN/UPC) and the device it registers. */
|
|
#define BCODE_LDD "BAREAN"
|
|
#define BCODE_DEV "BAR:"
|
|
|
|
/* Longest decoded barcode we handle (UPC-A is 12; headroom for EAN/supplements). */
|
|
#define BCODE_MAXLEN 24
|
|
|
|
/*
|
|
* Load the UPC/EAN decoder LDD. Returns 0 if loaded, or a negative PLIB error.
|
|
* E_FILE_EXIST (already loaded) is treated as success by callers.
|
|
*/
|
|
GLREF_C INT bcodeLoad(VOID);
|
|
|
|
/*
|
|
* Open a channel to the barcode decoder device (BAR:). Stores it in *pChan.
|
|
* Returns 0 on success or a negative PLIB error.
|
|
*/
|
|
GLREF_C INT bcodeOpen(VOID **pChan);
|
|
|
|
/* Close a channel opened by bcodeOpen. Safe to call with NULL. */
|
|
GLREF_C VOID bcodeClose(VOID *chan);
|
|
|
|
#endif /* BCODE_H */
|