feat: add events command to zmonvif-probe.pl

Add 'events' command to check if an ONVIF camera supports the events
service. Returns "Events: yes" or "Events: no" for easy parsing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
pull/4608/head
Isaac Connor 2026-02-07 21:13:56 -05:00
parent eb7ad81e40
commit f7858f3770
2 changed files with 20 additions and 0 deletions

View File

@ -367,6 +367,22 @@ sub metadata {
}
sub events {
my ($client) = @_;
my $events_ep = $client->get_endpoint('events');
if (!$events_ep) {
print "Events: no\n";
print "Device does not support ONVIF events.\n" if $verbose;
return 0;
}
print "Events: yes\n";
print "Device supports ONVIF events.\n" if $verbose;
return 1;
}
1;
__END__

View File

@ -49,6 +49,7 @@ sub HELP_MESSAGE {
profiles - print the device's supported stream configurations
metadata - print some of the device's configuration settings
move - move the device (only ptz cameras)
events - check if the device supports ONVIF events
Common parameters:
-v - increase verbosity
Device access parameters (for all commands but 'probe'):
@ -122,6 +123,8 @@ if ( $action eq 'probe' ) {
ZoneMinder::ONVIF::move($client, $dir);
} elsif ( $action eq 'metadata' ) {
ZoneMinder::ONVIF::metadata($client);
} elsif ( $action eq 'events' ) {
ZoneMinder::ONVIF::events($client);
} else {
my $media = $client->get_endpoint('media');
if ( ! $media ) {
@ -158,6 +161,7 @@ zmonvif-probe.pl - ZoneMinder ONVIF probing tool
profiles - print the device's supported stream configurations
metadata - print some of the device's configuration settings
move - move the device (only ptz cameras)
events - check if the device supports ONVIF events
other - Any command supported by the ONVIF Media element.
Common parameters: