Git Product home page Git Product logo

win32-wlan's Introduction

Travis Build Status AppVeyor Build Status

NAME

Win32::Wlan - Query wlan properties

SYNOPSIS

require Win32::Wlan;
my $wlan = Win32::Wlan->new;
if ($wlan->available) {
    print "Connected to ", $wlan->connection->{profile_name},"\n";
    print "I see the following networks\n";
    for ($wlan->visible_networks) {
        printf "%s\t-%d dbm\n", $_->{name}, $_->{signal_quality};
    };

} else {
    print "No Wlan detected (or switched off)\n";
};

METHODS

Win32::Wlan->new( %args )

my $wlan = Win32::Wlan->new();

Creates a new Win32::Wlan object.

  • available - optional argument to force detection of general Wlan availability
  • handle - optional argument to give an existing Wlan handle to the object
  • interface - optional argument to give an existing guuid to the object

$wlan->handle

Returns the Windows API handle for the Wlan API.

$wlan->interface

print $wlan->interface->{name};

Returns a hashref describing the interface. The keys are guuid for the guuid, name for the human-readable name and status for the status of the interface.

$wlan->available

$wlan->available
    or warn "Wlan API is not available";

Returns whether the Wlan API is available. The Wlan API is available on Windows XP SP3 or higher.

$wlan->connected

$wlan->connected
    or warn "Wlan connection unavailable";

Returns whether a Wlan connection is established. No connection is established when Wlan is switched off or no access point is in range.

$wlan->connection

if ($wlan->connected) {
    print "Connected to ";
    print $wlan->connection->{profile_name};
};

Returns information about the current connection in a hashref. The keys are

  • profile_name - the name of the profile of the current connection

$wlan->visible_networks

Returns information about the currently visible networks as a list of hashrefs.

  • ssid - the SSID of the network
  • signal_quality - the signal quality ranging linearly from 0 to 100 meaning -100 dbm to -50 dbm

SIMPLIFICATIONS

This module only supports the first wireless connection. If your machine has more than one wireless connection, you will need to use Win32::Wlan::API directly.

Currently, the module also has no way of determining whether Wlan gets switched on or off.

SEE ALSO

Win32::Wlan::API - the wrapper for the Windows API

Windows Native Wifi Reference

https://msdn.microsoft.com/en-us/library/ms706274%28v=VS.85%29.aspx

REPOSITORY

The public repository of this module is https://github.com/Corion/Win32-Wlan.

SUPPORT

The public support forum of this module is https://perlmonks.org/.

BUG TRACKER

Please report bugs in this module via the RT CPAN bug queue at https://rt.cpan.org/Public/Dist/Display.html?Name=Win32-Wlan or via mail to [email protected].

AUTHOR

Max Maischein [email protected]

COPYRIGHT (c)

Copyright 2011-2022 by Max Maischein [email protected].

LICENSE

This module is released under the same terms as Perl itself.

win32-wlan's People

Contributors

szabgab avatar jddurand avatar corion avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

jddurand

win32-wlan's Issues

Confusion betweeen technical availibility, functionnality and error on usage

Hello,

The following are defects in this package:

  • It considers that API avaibility means that the functionality is available. Simply put the WlanSvc service off and you will be in the case where API is reachable but service is not
  • Usage of WlanOpenHandle() is wrong: it does not $^E but returns an error code

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.