Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
111
Issues
111
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
070cd1f0
Commit
070cd1f0
authored
Dec 19, 2005
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sigh...more hacks to stay in sync with serial line output
parent
41f4d6a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
tbsetup/power_rpc27.pm.in
tbsetup/power_rpc27.pm.in
+12
-2
No files found.
tbsetup/power_rpc27.pm.in
View file @
070cd1f0
...
...
@@ -261,6 +261,7 @@ sub syncandsend($$$) {
#
my
%
status
=
();
my
$
gotcmd
=
0
;
my
$
gotstatus
=
0
;
print
"Reading output following command
\n
"
if
($
debug
);
while
(
my
$
line
=
rpc_readline
($
TIP
))
{
...
...
@@ -275,17 +276,25 @@ sub syncandsend($$$) {
if ($line =~ /Input error/) {
return -1;
}
# got the following prompt, all done
if ($gotcmd && $line =~ $RPC27_PROMPT) {
#
# 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.
#
if (($gotcmd || $gotstatus) && $line =~ $RPC27_PROMPT) {
last;
}
if ($statusp) {
if ($line =~ /Temperature:\s+(\d+\.\d+) C/) {
$status{tempC} = $1;
$gotstatus = 1;
} elsif ($line =~ /Average Power:\s+(\d+) Watts/) {
$status{power} = $1;
$gotstatus = 1;
} elsif ($line =~ /True RMS Current:\s+(\d+\.\d+) Amps/) {
$status{current} = $1;
$gotstatus = 1;
}
# note the /g, controllers with 20 ports put two outlets per line
elsif (my %ohash = $line =~ /Outlet\s+(\d+)\s+:\s+(On|Off)/g) {
...
...
@@ -293,6 +302,7 @@ sub syncandsend($$$) {
my $outlet = "outlet$o";
$status{$outlet} = $ohash{$o};
}
$gotstatus = 1;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment