Rev 964 |
Blame |
Compare with Previous |
Last modification |
View Log
| SVN
| RSS feed
#!/usr/bin/perl -w
################################################
#
# This file should not be edited for settings
# use settings.pl for that
#
# author: arune @ efnet
#
################################################
#Set autoflush on ( http://www.perlmonks.org/?node_id=20590 )
$| = 1;
use IO::Socket;
use integer;
use threads;
#for printing timestamps on printed messages: set to 1, else set to 0
$timestamp = 1;
$host = "localhost";
$port = 1200;
$remote = IO::Socket::INET->new(
Proto => "tcp",
PeerAddr => $host,
PeerPort => $port,
)
or die "cannot connect to port $port at $host";
print "Connected to canDaemon. Printf strings on can will be printed below.\n";
print "Don't forget to terminate your strings with '\\n'.\n";
$newline = 1;
#read line from socket (blocking)
while ( $line = <$remote> ) {
#$idhex = substr($line, 4, 8);
if ($id == hex("1f000080")) {
#@data = ();
if ($newline == 1) {
if ($timestamp == 1) {
}
$newline = 0;
}
for ($i = 17; $i < length($line); $i=$i+3) {
$newline = 1;
}
}
}
}
}