File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed
scripts/ZoneMinder/lib/ZoneMinder/Control Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,8 @@ sub open {
131
131
} else {
132
132
Debug(' No headers line' );
133
133
} # end if headers
134
+ # For parent get
135
+ $$self {BaseURL } = $uri -> canonical();
134
136
} else {
135
137
Debug(' Failed to open ' .$uri -> canonical().$url .' status: ' .$res -> status_line());
136
138
} # end if $res->status_line() eq '401 Unauthorized'
@@ -140,19 +142,7 @@ sub sendCmd {
140
142
my $self = shift ;
141
143
my $cmd = shift ;
142
144
143
- $self -> printMsg($cmd , ' Tx' );
144
-
145
- my $url = $uri -> canonical().$cmd ;
146
- my $res = $self -> {ua }-> get($url );
147
-
148
- if ( $res -> is_success ) {
149
- Debug(' sndCmd command: ' .$url .' content: ' .$res -> content);
150
- return !undef ;
151
- }
152
-
153
- Error(" Error cmd $url failed: '" .$res -> status_line()." '" );
154
-
155
- return undef ;
145
+ return $self -> get($url );
156
146
}
157
147
158
148
sub cameraReset {
@@ -514,6 +504,13 @@ sub presetHome {
514
504
$self -> sendCmd($cmd );
515
505
}
516
506
507
+ sub reboot {
508
+ my $self = shift ;
509
+ $uri -> path(' /axis-cgi/restart.cgi' );
510
+ my $response = $self -> get($uri -> canonical);
511
+ return $response -> is_success;
512
+ }
513
+
517
514
1;
518
515
__END__
519
516
# Below is stub documentation for your module. You'd better edit it!
You can’t perform that action at this time.
0 commit comments