Commit d9bebb1b authored by rygelgit's avatar rygelgit

Added support to not ignore Basic Management version other than 2.

parent be7a5788
......@@ -45,7 +45,15 @@ sub lookup_diage_device {
$devNum= 0;
my (@temp_device_list, @temp_device_ip, @temp_device_port, @temp_scpd_url)= ();
foreach my $dev_temp (@$device_list_search) {
unless ($dev_temp->getservicebyname('urn:schemas-upnp-org:service:BasicManagement:2')) {
my @service_list = $dev_temp->getservicelist();
my $diage_present='false';
foreach $service_temp (@service_list) {
if ($service_temp->getserviceid() eq 'urn:upnp-org:serviceId:BasicManagement') {
$diage_present='true';
}
}
if ($diage_present eq 'false') {
$devNum++;
next;
}
......@@ -55,10 +63,9 @@ sub lookup_diage_device {
my @nodes = $doc->getElementsByTagName("service");
foreach my $node (@nodes) {
if ($node->hasChildNodes()){
print "Before serviceType";
if ($node->getChildrenByTagName( "serviceType" ) eq 'urn:schemas-upnp-org:service:BasicManagement:2') {
my $service_no_version=$node->getChildrenByTagName( "serviceType" );
if ((substr $service_no_version, 0 , length($service_no_version)-1) eq 'urn:schemas-upnp-org:service:BasicManagement:') {
push (@temp_scpd_url, $node->getChildrenByTagName("controlURL")->string_value());
print "Before controlURL";
}
}
}
......
......@@ -51,7 +51,7 @@ while( select($reader_output = $reader_input, undef, undef, 10) ) {
my $post_response = $http_request->post($host_address, $host_port, "GET", $dev_path, "", "");
my $post_content = $post_response->getcontent();
print "$post_content";
#print "$post_content";
my $dev = Net::UPnP::Device->new();
$dev->setssdp($ssdp_response);
$dev->setdescription($post_content);
......@@ -64,7 +64,7 @@ close(SSDP_SOCK);
# Multiple arrays cannot be passed by value., If passed then all the values will be dumped into the first array
# So return the array references. And also use my qualifier, so that a new instance will be created where it is assigned.
return ( \@device_list, \@device_addr, \@device_port);
return ( \@device_list, \@device_addr, \@device_port);
}
1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment