3 use Net::UPnP::ControlPoint;
5 my $obj = Net::UPnP::ControlPoint->new();
7 @dev_list = $obj->search(st =>'upnp:rootdevice', mx => 3);
10 foreach $dev (@dev_list) {
11 $device_type = $dev->getdevicetype();
12 if ($device_type ne 'urn:schemas-upnp-org:device:MediaServer:1') {
15 print "[$devNum] : " . $dev->getfriendlyname() . "\n";
16 unless ($dev->getservicebyname('urn:schemas-upnp-org:service:ContentDirectory:1')) {
19 $condir_service = $dev->getservicebyname('urn:schemas-upnp-org:service:ContentDirectory:1');
20 unless (defined(condir_service)) {
25 'BrowseFlag' => 'BrowseDirectChildren',
28 'RequestedCount' => 0,
31 $action_res = $condir_service->postcontrol('Browse', \%action_in_arg);
32 unless ($action_res->getstatuscode() == 200) {
35 $actrion_out_arg = $action_res->getargumentlist();
36 unless ($actrion_out_arg->{'Result'}) {
39 $result = $actrion_out_arg->{'Result'};
40 while ($result =~ m/<dc:title>(.*?)<\/dc:title>/sgi) {