From 48fc99a0e34ccb251935f53bff0d7503c30847b7 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 2 Feb 2022 14:34:53 -0500 Subject: [PATCH] Implement reboot and ping methods for Trendnet PTZ Control --- .../lib/ZoneMinder/Control/Trendnet.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Trendnet.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Trendnet.pm index 8bdf1db42..cc437974f 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/Trendnet.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Trendnet.pm @@ -374,6 +374,25 @@ sub reset { $self->sendCmdPost($url,$cmd); } +sub reboot { + my $self = shift; + Debug('Camera Reboot'); + $self->sendCmdPost('/eng/admin/reboot.cgi', { reboot => 'true' }); + #$referer = 'http://'.$HI->ip().'/eng/admin/tools_default.cgi'; + #$initial_url = $HI->ip().'/eng/admin/tools_default.cgi'; +} + +sub ping { + return -1 if ! $ADDRESS; + + require Net::Ping; + + my $p = Net::Ping->new(); + my $rv = $p->ping($ADDRESS); + $p->close(); + return $rv; +} + 1; __END__