Contents | Parent Topic | Previous Topic | Next Topic


9. Scam Library

This library is used for communicating with the SCAM executable via named pipes.


9.1. Using the Library

use Scam;

Be sure that the $SCAM variable is set to the correct value.


9.2. Variables

The following variable(s) can be set:

$SCAM

$DEBUG

$DFL_WAIT


9.3. Functions

init

recv

recv timeout

send string

reader readername

reset

talk string


9.4. Example

#!/usr/bin/perl

use Scam;

Scam::init();
Scam::reader("dumbmouse(wait_etu=100,conv=inverse,parity=odd)");

# Flush the serial port & the named pipe
Scam::send("dump");
Scam::recv();

Scam::reset();
($out, $err) = Scam::recv(5.2); # wait 5.2 seconds

chomp $out; chomp $err;
print "output = $out, error = $err\n";

The flush should not be necessary, but if we do not do this, for some reason the output on the named pipe is not correct the first time we read from it.


9.5. Bugs


Contents | Parent Topic | Previous Topic | Next Topic