Net::Fritz::Service - represents a TR064 service
version v0.0.9
my $fritz = Net::Fritz::Box->new(); my $device = $fritz->discover(); my $service = $device->get_service('DeviceInfo:1'); # call an action my $response = $service->call('GetSecurityPort'); # show all data $service->dump();
This class represents a TR064 service belonging to a Net::Fritz::Device. A service consists of one or more Net::Fritz::Actions that interact with the underlying device.
A Net::Fritz::Box instance containing the current configuration information (device address, authentication etc.).
A complex hashref containing most information about this Net::Fritz::Service. This is the parsed form of the TR064 XML which describes the service. It contains nearly all information besides "fritz" and "scpd".
A complex hashref containing all information about this Net::Fritz::Service. This is the parsed form of the XML available at "SCPDURL" which describes the service and its Net::Fritz::Actions.
A hashref containing all Net::Fritz::Actions of this service indexed by their "name" in Net::Fritz::Action.
The serviceType (string) of this service which is used by Net::Fritz::Device to look up services.
The serviceId (string) of this service.
The controlURL (URL string) of this service which is needed to call any Net::Fritz::Actions of this service.
The eventSubURL (URL string) of this service for subscribing to or unsubscribing from events.
The SCPDURL (URL string) of the SCPD file of this service where most of the other attributes are read from.
See "error" in Net::Fritz::IsNoError.
Creates a new Net::Fritz::Service object. You propably don't have to call this method, it's mostly used internally. Expects parameters in key => value form with the following keys:
key => value
Net::Fritz::Box configuration object
service information in parsed XML format
Calls the Net::Fritz::Action named action_name of this service. Response data from the service call is wrapped as Net::Fritz::Data. If the action expects parameters, they must be provided via the argument_hash as key=>value pairs.
If no matching action is found, the parameters don't match the action or any other error occurs, a Net::Fritz::Error is returned.
Returns some preformatted multiline information about the object. Useful for debugging purposes, printing or logging. The optional parameter indent is used for indentation of the output by prepending it to every line.
Recursively descends into actions, so dumping a service also shows all its actions as well.
See "errorcheck" in Net::Fritz::IsNoError.
See Net::Fritz for general information about this package, especially "INTERFACE" in Net::Fritz for links to the other classes.
Christian Garbs <mitch@cgarbs.de>
Copyright (C) 2017 Christian Garbs
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
To install Net::Fritz, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Fritz
CPAN shell
perl -MCPAN -e shell install Net::Fritz
For more information on module installation, please visit the detailed CPAN module installation guide.