If it isn't offtopic...
Does anybody have expirience on reading barcodes on Linux?
A little introduction.
Everything is pretty simple (on a first sight).
We have barcode scanner connected to serial port.
The device is accessible as file '/dev/ttyS0' or '/dev/ttyS1', so all that you need is open this pseudo-file and read data from it.
like this (perl source):
===8<===
open(SERIAL,"</dev/ttyS1") or die "can't open port\n";
while (<SERIAL>)
{
print "$_"
}
===8<===
but, of course, port does need some configuration before opening. 'stty' is a command to do this, and it has a lot of options. This seems to fit our needs:
'stty -F /dev/ttyS1 9600 -parenb -parodd clocal raw'
(set baud rate to 9600, disable all translations)
And now the problem.
Everything OK for ASCII data.
And everything OK with binary data.
Unless that binary data is spread across number of Macro PDF417 symbols.
Even in this case 90% barcodes are read OK, but remaining 10% make scanner stop responding.
It seems to me that stty settings aren't just all right, but I cannot figure out what I've missed...
