Commit 114de217 authored by Mike Hibler's avatar Mike Hibler

Changes from Kevin Lahey <lahey@ISI.EDU> for RPC28 units

parent 0607b3b4
......@@ -280,10 +280,18 @@ sub syncandsend($$$) {
}
#
# Got the following prompt, all done.
#
# XXX the prompt+command does not always get echoed correctly
# (e.g. "atatus" or "ststus" instead of "status") so we also
# exit if we parsed any status data.
#
# XXX RPC28 units split up the power data into columns for outlets
# 1-10 and then for outlets 11-21, ala:
#
# RPC28: True RMS Current: 3.9 Amps : 4.7 Amps
#
# hence the unusual REs for power and current.
#
if (($gotcmd || $gotstatus) && $line =~ $RPC27_PROMPT) {
last;
}
......@@ -291,11 +299,19 @@ sub syncandsend($$$) {
if ($line =~ /Temperature:\s+(\d+\.\d+) C/) {
$status{tempC} = $1;
$gotstatus = 1;
} elsif ($line =~ /Average Power:\s+(\d+) Watts/) {
} elsif ($line =~ /Average\ Power:\s+(\d+)\ Watts\s+
(Apparent|\:\s+(\d+)\ Watts)/x) {
$status{power} = $1;
if ($3) {
$status{power} += $3;
}
$gotstatus = 1;
} elsif ($line =~ /True RMS Current:\s+(\d+\.\d+) Amps/) {
} elsif ($line =~ /True\ RMS\ Current:\s+(\d+\.\d+)\ Amps\s+
(Maximum|\:\s+(\d+\.\d+)\ Amps)/x) {
$status{current} = $1;
if ($3) {
$status{current} += $3;
}
$gotstatus = 1;
}
# note the /g, controllers with 20 ports put two outlets per line
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment