The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Wireless::802_11::WPA::CLI - Provides a interface to wpa_cli.

VERSION

Version 2.0.2

SYNOPSIS

    use Net::Wireless::802_11::WPA::CLI;

    my $foo = Net::Wireless::802_11::WPA::CLI->new();
    ...

FUNCTIONS

new

This initializes the object to be used for making use of wpa_cli.

    my $foo->Net::Wireless::802_11::WPA::CLI->new();
    if( $foo->error ){
            warn('Error:'.$foo->error.': '.$foo->errorString);
    }

status

This function gets the current status from wpa_cli.

No arguments are taken.

    my %status=$foo->status;
    if( $foo->error ){
            warn('Error:'.$foo->error.': '.$foo->errorString);
    }
    

save_config

This saves the current configuration. The user requesting this does not need write permissions to file being used

No arguments are taken.

        my $returned=$foo->save_config;
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

reassociate

This saves the current configuration. The user requesting this does not need write permissions to file being used

It takes no arguments.

    $foo->reassociate;
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

set_network

This sets a variable for for a specific network ID.

Three arguments are taken. The first is the network ID, the second is the variable to set, and the third is the value to set it to.

        $foo->set_network($networkID, $variable, $value);
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

get_network

This gets a variable for for a specific network ID.

Two arguments are taken and that is the network ID and variable.

        $value=$foo->get_network($networkID, $variable);
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

pin

This sets the pin for a network.

Two arguments are taken. The first is the network ID and the second is the pin.

        $foo->pin($networkID, $newpin);
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

new_password

This sets a new password for a network.

Two arguments are taken. The first is the network ID and the second is the new password.

        $return=$foo->new_password($networkID, $newpass);
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

add_network

This adds a network.

No arguments are taken.

The returned value is a the new network ID.

        $newNetworkID=$foo->add_network;
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

remove_network

This removes the specified network.

One argument is accepted and it the network ID.

        $return=$foo->remove_network($networkID)
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

select_network

This is the network ID to select, while disabling the others.

One argument is accepted and it is the network ID to select.

        $return=$foo->select_network($networkID)
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

enable_network

This enables a network ID.

One argument is required and that is the network ID to enable.

        $foo->enable_network($networkID)
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

disable_network

This disables a network ID.

One argument is required and that is the network ID in question.

        $foo->disable_network($networkID)
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

reconfigure

This causes wpa_supplicant to reread it's configuration file.

No arguments are taken.

        $return=$obj->reconfigure;
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

preauthenticate

Force preauthentication for a BSSID.

One argument is accepted and the is the BSSID in question.

        $foo->preauthenticate($BSSID);
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

disconnect

Disconnect and wait for a reassosiate command.

No arguments are taken.

        $return=$foo->disconnect;
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

list_networks

This lists the configured networks.

No arguments are taken.

They keys for the hash are the network IDs. The value of each is another hash. It contians the SSID, BSSID, and flag. All keys are lower case.

        %return=$foo->list_networks;
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

mib

This lists the configured networks.

Unless it errored, a hash is returned.

They keys for the hash are the network IDs. The value of each is another hash. It contians the SSID, BSSID, and flag. All keys are lower case.

        %return=$foo->get_network($networkID, $variable);
    if( $foo->error ){
            warn('error:'.$foo->error.': '.$foo->errorString);
        }

run_TF_command

This runs a arbirary command in which the expected values are either 'FAIL' or 'OK'. This function is largely intended for internal use by this module.

It takes two argument. The first is string containing the command and any arguments for it. The second is what to return on a unknown return.

A status of 'FAIL' will also set a error of 5.

A unknown status will also set a error of 6.

        $returned=$foo->run_TF_command($command, 0);
    if( $foo->error ){
            warn('error:'.$foo->error.': '.$foo->errorString);
        }

run_command

This runs a arbirary command in which. This function is largely intended for internal use by this module.

It takes argument, which is string containing the command and any arguments for it.

UNDEF is returned upon with running wpa_cli. Otherwise the return is the return from executed command.

        $returned=$foo->run_command($command)
    if( $foo->error ){
        warn('Error:'.$foo->error.': '.$foo->errorString);
    }

status_breakdown

This is a internal function.

NOTES

This makes use of wpa_cli in a non-interactive form. This means that interface and otp are not usable.

Better documentation and etc shall be coming shortly. Publishing this and starting work on something that uses it in it's current form.

ERROR CODES

1

Unable to to initialize the object. A wpa_cli status check failed.

This error is permanent.

2

Status breakdown failed because of a unexpected return.

3

Command failed and exited with a non-zero.

4

Invalid argument supplies.

5

The executed command exited with zero, but still failed.

This error code is not warned for.

6

Unknown return.

AUTHOR

Zane C. Bowers-Hadley, <vvelox at vvelox.net>

BUGS

Please report any bugs or feature requests to bug-net-wireless-802_11--wpa-cli at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Wireless-802_11-WPA-CLI. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Net::Wireless::802_11::WPA::CLI

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2011 Zane C. Bowers-Hadley, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.