Wifi::Manage - A class for managing wifi connection


Wifi documentation Contained in the Wifi distribution.

Index


Code Index:

NAME

Top

Wifi::Manage - A class for managing wifi connection

SYNOPSIS

Top

use Wifi::Manage;

$manager = Wifi::Manage->new("PATH_FILE");

$manage->start;

DESCRIPTION

Top

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.

METHOD DESCRIPTIONS

Top



This sections contains only the methods in Manage.pm itself.
    • start();

      Start the connection.
    • start_with_module();

      Start the connection with loading module.
    • stop();

      Stop the connection.
    • stop_with_module();

      Stop the connection with unloading module.
  • AUTHORS

    Top


    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__