NAME

Net::Fritz::Box - main configuration and entry point for Net::Fritz distribution

VERSION

version v0.0.9

SYNOPSIS

my $fritz = Net::Fritz::Box->new();
$fritz->dump();

my $fritz_nossl = Net::Fritz::Box->new(
    upnp_url => 'http://fritz.box:49000'
);

my $fritz_auth = Net::Fritz::Box->new(
    username => 'admin',
    password => 's3cr3t'
);

DESCRIPTION

This class the global configuration state and provides discovery of Net::Fritz::Devices.

ATTRIBUTES (read-only, defaults can be changed)

upnp_url

Default value: https://fritz.box:49443

Base URL for all operations. This must point to your device. The default value expects a standard Fritz!Box installation with working local DNS.

If you can't do DNS lookups for your router, use an IP address instead.

If you have a Fritz!Box and don't know its IP, you can try 192.168.179.1 or 169.254.1.1, these adresses seem to be hardcoded for "emergency use" after a misconfiguration.

An address starting with https:// enables secure communication over SSL. To disable SSL, use an address starting with http://. The port will be different; the Fritz!Box default for unsecured access is http://fritz.box:49000

trdesc_path

Default value: /tr64desc.xml

The path below "upnp_url" from where the TR064 service description is fetched. There should be no need to change the default.

username

Default value: none

Sets the username to use for authentication against a device.

password

Default value: none

Sets the password to use for authentication against a device.

configfile

Default value: none

Sets a configuration file to read the configuration from.

For a description of the file format as well as default configfile locations that are automatically searched, see Net::Fritz::ConfigFile.

If an attribute is both defined by the configuration file and given as a parameter to "new", the parameter overwrites the value from the configuration file.

This attribute is available since v0.0.8.

error

See "error" in Net::Fritz::IsNoError.

METHODS

new

Creates a new Net::Fritz::Box object. This is propably the first thing to do when using Net::Fritz. Expects parameters in key => value form with the following keys to overwrite the default values:

discover

Tries to discover the TR064 device at the current "upnp_url". Returns a Net::Fritz::Device on success. Accepts no parameters.

call(service_name action_name [argument_hash])

Directly calls the Net::Fritz::Action named action_name of the Net::Fritz::Service matching the regular expression service_name.

This is a convenience method that internally calls "discover" followed by Net::Fritz::Device::call - see those methods for further details.

The intermediate Net::Fritz::Device is cached, so that further calls can skip that initial SOAP request.

This method is available since v0.0.8.

dump(indent)

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.

errorcheck

See "errorcheck" in Net::Fritz::IsNoError.

SEE ALSO

See Net::Fritz for general information about this package, especially "INTERFACE" in Net::Fritz for links to the other classes.

AUTHOR

Christian Garbs <mitch@cgarbs.de>

COPYRIGHT AND LICENSE

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/>.