| Wifi documentation | Contained in the Wifi distribution. |
Wifi::Manage - A class for managing wifi connection
use Wifi::Manage;
$manager = Wifi::Manage->new("PATH_FILE");
$manage->start;
Welcome to Wifi::Manage , a work in progress.It's a quick module to switch quickly wifi connection.All module use Wifi::WFile to configure the connection.
| Wifi documentation | Contained in the Wifi distribution. |
package Wifi::Manage; our $VERSION = '0.01'; use Wifi::WFile; use Wifi::WMod; use Wifi::WDevIw; use Wifi::WDevIf; use Wifi::WRoute; use strict; sub new{ my($class,$file) = @_; my($self) = { FICHIER => $file, }; bless($self,$class); return $self; } sub start{ my($self) = shift; my ($conf,$deviw,$devif,$route); $conf = Wifi::WFile->new( file => $self->{FICHIER} ); $conf->load; $deviw = Wifi::WDevIw->new($conf); $deviw->start; $devif = Wifi::WDevIf->new($conf); $devif->start; $route = Wifi::WRoute->new($conf); $route->start; } sub start_with_module{ my($self) = shift; my ($conf,$mod,$deviw,$devif,$route); $conf = Wifi::WFile->new( file => $self->{FICHIER} ); $conf->load; if($conf->{CONFIGMOD}{MODULE} ne undef){ $mod = Wifi::WMod->new($conf); $mod->load; } $deviw = Wifi::WDevIw->new($conf); $deviw->start; $devif = Wifi::WDevIf->new($conf); $devif->start; $route = Wifi::WRoute->new($conf); $route->start; } sub stop{ my($self) = shift; my($conf,$devif); $conf = Wifi::WFile->new( file => $self->{FICHIER} ); $conf->load; $devif = Wifi::WDevIf->new($conf); $devif->stop; } sub stop_with_module{ my($self) = shift; my ($conf,$mod,$deviw,$devif,$route); $conf = Wifi::WFile->new( file => $self->{FICHIER} ); $conf->load; $devif = Wifi::WDevIf->new($conf); $devif->stop; if($conf->{CONFIGMOD}{MODULE} ne undef){ $mod = Wifi::WMod->new($conf); $mod->unload; } } 1; __END__