1Net::UPnP(3) User Contributed Perl Documentation Net::UPnP(3)
2
3
4
6 Net::UPnP - Perl extension for UPnP
7
9 use Net::UPnP::ControlPoint;
10
11 my $obj = Net::UPnP::ControlPoint->new();
12
13 @dev_list = $obj->search(st =>'upnp:rootdevice', mx => 3);
14
15 $devNum= 0;
16 foreach $dev (@dev_list) {
17 $device_type = $dev->getdevicetype();
18 if ($device_type ne 'urn:schemas-upnp-org:device:MediaServer:1') {
19 next;
20 }
21 print "[$devNum] : " . $dev->getfriendlyname() . "\n";
22 unless ($dev->getservicebyname('urn:schemas-upnp-org:service:ContentDirectory:1')) {
23 next;
24 }
25 $condir_service = $dev->getservicebyname('urn:schemas-upnp-org:service:ContentDirectory:1');
26 unless (defined(condir_service)) {
27 next;
28 }
29 %action_in_arg = (
30 'ObjectID' => 0,
31 'BrowseFlag' => 'BrowseDirectChildren',
32 'Filter' => '*',
33 'StartingIndex' => 0,
34 'RequestedCount' => 0,
35 'SortCriteria' => '',
36 );
37 $action_res = $condir_service->postcontrol('Browse', \%action_in_arg);
38 unless ($action_res->getstatuscode() == 200) {
39 next;
40 }
41 $actrion_out_arg = $action_res->getargumentlist();
42 unless ($actrion_out_arg->{'Result'}) {
43 next;
44 }
45 $result = $actrion_out_arg->{'Result'};
46 while ($result =~ m/<dc:title>(.*?)<\/dc:title>/sgi) {
47 print "\t$1\n";
48 }
49 $devNum++;
50 }
51
53 This package provides some functions to control UPnP devices.
54
55 Currently, the package provides only functions for the control point.
56 To control UPnP devices, see Net::UPnP::ControlPoint.
57
58 As a sample of the control point, the package provides
59 Net::UPnP::AV::MediaServer to control the devices such as DLNA media
60 servers. As the example, please dms2vodcast.pl that converts from the
61 MPEG2 movies to the MPEG4 one and outputs the RSS file for Vodcasting.
62
64 Net::UPnP::ControlPoint
65
66 Net::UPnP::AV::MediaServer
67
69 Satoshi Konno skonno@cybergarage.org
70
71 CyberGarage http://www.cybergarage.org
72
74 Copyright (C) 2005 by Satoshi Konno
75
76 It may be used, redistributed, and/or modified under the terms of BSD
77 License.
78
79
80
81perl v5.32.0 2020-07-28 Net::UPnP(3)