code style cleanups and uncomment get_service_urls call in create_services so that we actually parse the ONVIF response.

This commit is contained in:
Isaac Connor 2020-02-09 13:50:22 -05:00
parent 389a6b3ec8
commit 466468b0fd
1 changed files with 12 additions and 12 deletions

View File

@ -114,7 +114,7 @@ sub get_service_urls {
my $result = $self->service('device', 'ep')->GetServices( {
IncludeCapability => 'true', # boolean
},,
}
);
if ( $result ) {
foreach my $svc ( @{ $result->get_Service() } ) {
@ -142,7 +142,7 @@ sub get_service_urls {
if ( my $function = $capabilities->can( "get_$capability" ) ) {
my $Services = $function->( $capabilities );
if ( !$Services ) {
print "Nothing returned ffrom get_$capability\n";
#print "Nothing returned from get_$capability\n";
} else {
foreach my $svc ( @{ $Services } ) {
# The capability versions don't have a namespace, so just lowercase them.
@ -202,7 +202,7 @@ sub BUILD {
# deserializer_args => { strict => 0 }
});
$services_of{$ident}{'device'} = { url => $url_svc_device, ep => $svc_device };
$services_of{$ident}{device} = { url => $url_svc_device, ep => $svc_device };
# Can't, don't have credentials yet
# $self->get_service_urls();
@ -260,7 +260,7 @@ sub set_credentials {
sub create_services {
my ($self) = @_;
#$self->get_service_urls();
$self->get_service_urls();
if ( defined $self->service('media', 'url') ) {
$self->set_service('media', 'ep', ONVIF::Media::Interfaces::Media::MediaPort->new({