1Net::UPnP::Device(3) User Contributed Perl Documentation Net::UPnP::Device(3)
2
3
4
6 Net::UPnP::Device - 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 The package is used a object of UPnP device.
54
56 getdescription - get the description.
57 $description = $dev->getdescription(
58 name => $name # undef
59 );
60
61 Get the device description of the SSDP location header.
62
63 The function returns the all description when the name parameter is
64 not specified, otherwise return a value the specified name.
65
66 getdevicetype - get the device type.
67 $description = $dev->getdevicetype();
68
69 Get the device type from the device description.
70
71 getfriendlyname - get the device type.
72 $friendlyname = $dev->getfriendlyname();
73
74 Get the friendly name from the device description.
75
76 getmanufacturer - get the manufacturer.
77 $manufacturer = $dev->getmanufacturer();
78
79 Get the manufacturer name from the device description.
80
81 getmanufacturerrul - get the manufacturer url.
82 $manufacturer_url = $dev->getmanufacturerrul();
83
84 Get the manufacturer url from the device description.
85
86 getmodeldescription - get the model description.
87 $model_description = $dev->getmodeldescription();
88
89 Get the model description from the device description.
90
91 getmodelname - get the model name.
92 $model_name = $dev->getmodelname();
93
94 Get the model name from the device description.
95
96 getmodelnumber - get the model number.
97 $model_number = $dev->getmodelnumber();
98
99 Get the model number from the device description.
100
101 getmodelurl - get the model url.
102 $model_url = $dev->getmodelurl();
103
104 Get the model url from the device description.
105
106 getserialnumber - get the serialnumber.
107 $serialnumber = $dev->getserialnumber();
108
109 Get the model description from the device description.
110
111 getudn - get the device UDN.
112 $udn = $dev->getudn();
113
114 Get the UDN from the device description.
115
116 getupc - get the device UPC.
117 $upc = $dev->getupc();
118
119 Get the UPC from the device description.
120
121 getservicelist - get the device type.
122 @service_list = $dev->getservicelist();
123
124 Get the service list in the device. Please see Net::UPnP::Service
125 too.
126
128 Net::UPnP::Service
129
131 Satoshi Konno skonno@cybergarage.org
132
133 CyberGarage http://www.cybergarage.org
134
136 Copyright (C) 2005 by Satoshi Konno
137
138 It may be used, redistributed, and/or modified under the terms of BSD
139 License.
140
141
142
143perl v5.28.1 2018-12-23 Net::UPnP::Device(3)