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

NAME

Net::Wireless::802_11::AP - Provides a OO representation to 802.11 AP based on WPA supplicant.

VERSION

Version 0.1.0

SYNOPSIS

    use Net::Wireless::802_11::AP;

    my $foo = Net::Wireless::802_11::AP->new({ ssid=>'"foo"' });

    #scan for value for scan_ssid
    $foo->setKey('scan_ssid', '1');

    #set the key management and key
    $foo->setKey( 'key_mgmt', 'WPA-PSK' );
    $foo->setKey( 'psk', '"bar..."' );

    #gets the ssid
    my $ssid=$foo->getKey( 'ssid' );

    #get the bssid
    my $bssid=$foo->getKey( 'bssid' );
    if( defined($bssid) ){
        print 'BSSID='.$bssid."\n";
    }else{
        print "No BSSID set.\n";
    }

METHODS

new

This initiates the object.

One arguement is required and it is the a hash reference to initiate the object with.

The hash reference has one required value and that is 'ssid'. This is SSID of the base station in question.

The others may be any valid key for a configured AP in wpa_supplicant.conf. For more information, please see wpa_supplicant.conf(5).

There is one break from this and this is the key 'networkID'. This represents the numeric ID used for with wpa_cli to reference that configured AP.

    my $new=$foo=Net::Wireless::802_11::AP->new( { ssid=>'"foo"' } );

getKey

This returns the requested keys.

One value is required and that is the requested key.

Undef is a valid return value for this if the requested key is not defined.

Error checking is not required as long as the requested key is defined and is valid.

    my $key=$foo->getKey( $key );
    if( $foo->error ){
        warn('error:'.$foo->error.': '.$foo->errorString);
    }

listKeys

This returns a list of defined keys.

No arguments are taken.

As long as the new method suceeded, this method will not error.

    my %APkeys=$foo->listKeys;

listValidKeys

This list the valid key possibilities.

The returned value is a array.

    my @validKeys=$foo->listValidKeys;

listWPAkeys

This is very similar to listValidKeys, but it does not include 'networkID', which represents the WPA supplicant network ID in the config file, but is not a valid key in the the config.

    my @WPAkeys=$foo->listWPAkeys;

setKey

This sets a key value.

Two values are taken. The first is the key and is required. The second is the key value, which may be undefined.

No error checking is required as long as the the key is valid. No value verification is done at this time.

    $foo->setKey( $key, $value );
    if( $foo->error ){
        warn('error:'.$foo->error.': '.$foo->errorString);
    }

ERROR CODES

1

No SSID specified.

2

Invalid key.

3

No key specified.

AUTHOR

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

BUGS

Please report any bugs or feature requests to bug-net-wireless-802_11-ap at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Wireless-802_11-AP. 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::AP

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2011 Zane C. Bowers-Hadley.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.