CORE-POS/IS4C

View on GitHub
documentation/Reference Code/Wedge/is4c/rs232/README

Summary

Maintainability
Test Coverage
The contents of the directories are the files that constitute
the IS4C  scanner scale driver for *nix

The different kinds of files are:

SOURCE FILES
-----------------------------------------

scannerscale.c and ssd.c are source files in C.
scannerscale.c is the original program that sets communication
parameters for the serial port to communicate with the
scanner scale. In-coming data from the scanner scale
is then written into either the file "scanner" or
"scale" depending on the prefix of the character strings.

ssd.c applies the necessary wrappers on
scannerscale.c to turn it into a daemon. When compiled,
scannerscale.c therefore becomes a child process of ssd.c

To compile ssd.c on my system (Slackware):
# gcc ssd.c -o ssd


COMPILED EXECUTABLE
-----------------------------------------

There is only one.
ssd.c is compiled as ssd, which runs as a daemon
and should be set to start up at boot time in
production.

For Slackware, the process I follow is to make
a soft link first

# ln -s /pos/is4c/rs232/ssd /etc/rc.d/rc.ssd

Afterwards, add the following to either rc.local
or rc.M

/etc/rc.d/rc.ssd


SHELL SCRIPTS
-----------------------------------------

goodBeep, errorBeep, wakeup, rePoll and twoPairs
are shell scripts that send signals to the
scanner scale. They are invoked by the php scripts
on an "as needed" basis.

setport sets the serial port communication
parameters so that they are compatible with
the factory default settings for the Magellan
scanner scale. It is not necessary to run
setport when ssd is running, and setport is mainly
used for testing.

As these files are invoked by php, and therefore
run from Apache, write permission for /dev/ttyS0
has to be set accordingly before they will work.
(On a somewhat noted, as a reminder, 
write permission for /dev/lp0 
also has to be set properly before the system
could print receipts)

goodBeep = One beep. 
called whenever a record is inserted into localtemptrans
to indicate a good scan. The scanner scale, by factory default,
also gives a "good scan beep" when an item is successfully
scanned. The Wedge disables the default factory beep because
IS4C does not consider an item as scanned if is is not entered 
into localtemptrans.
WFC has decided to  keep the factory beep, so that a fully 
successful scan results in two beeps.

errorBeep = A series of 3 beeps in quick succession,
usually called in association with error screens.

twoPairs = two sets of two quick beeps
Used to call attention to cash over amount

wakeup = sends scale status signals to initiate
responses from the scanner scale. Called 
manually when the string "wakeup" is entered into 
the input form, usually by a hotkey.

rePoll = similar to wakeup. Sends only one
signal, and is called by php as needed.

*** check that all scripts are made executable ***


DATA FILES
--------------------------------------------

scanner stores the last scanned input that
has not been processed by IS4C.

scale stores the last weight input

These are read and processed by the file 
/pos/is4c/chkserial.php
"scanner" is cleared every time is is read by
chkserial.php, but the record in "scale" 
persists, and is regulated only by ssd.

IMPORTANT
-----------------------------------------------
To re-emphasis. Write permission for /dev/ttyS0
has to be set properly before the shell scripts
(and therefore the scanner scale) will work
properly with IS4C.

Last updated: Dec 8, 2005