Add reboot, use parent get()
parent
31e497ec91
commit
46dc4f3f17
|
@ -131,6 +131,8 @@ sub open {
|
|||
} else {
|
||||
Debug('No headers line');
|
||||
} # end if headers
|
||||
# For parent get
|
||||
$$self{BaseURL} = $uri->canonical();
|
||||
} else {
|
||||
Debug('Failed to open '.$uri->canonical().$url.' status: '.$res->status_line());
|
||||
} # end if $res->status_line() eq '401 Unauthorized'
|
||||
|
@ -140,19 +142,7 @@ sub sendCmd {
|
|||
my $self = shift;
|
||||
my $cmd = shift;
|
||||
|
||||
$self->printMsg($cmd, 'Tx');
|
||||
|
||||
my $url = $uri->canonical().$cmd;
|
||||
my $res = $self->{ua}->get($url);
|
||||
|
||||
if ( $res->is_success ) {
|
||||
Debug('sndCmd command: '.$url.' content: '.$res->content);
|
||||
return !undef;
|
||||
}
|
||||
|
||||
Error("Error cmd $url failed: '".$res->status_line()."'");
|
||||
|
||||
return undef;
|
||||
return $self->get($url);
|
||||
}
|
||||
|
||||
sub cameraReset {
|
||||
|
@ -514,6 +504,13 @@ sub presetHome {
|
|||
$self->sendCmd($cmd);
|
||||
}
|
||||
|
||||
sub reboot {
|
||||
my $self = shift;
|
||||
$uri->path('/axis-cgi/restart.cgi');
|
||||
my $response = $self->get($uri->canonical);
|
||||
return $response->is_success;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
# Below is stub documentation for your module. You'd better edit it!
|
||||
|
|
Loading…
Reference in New Issue