Click here to Skip to main content
11,496,146 members (570 online)
Click here to Skip to main content

Wireless signal indicator

, 7 Feb 2008 CPOL 75.7K 3.8K 49
A desktop utility to indicate the current wireless singnal strength, signal quality, and link status.
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.

Introduction

Wireless signal status indicator is a simple tray application which gives continuous status information about the signal strength, signal quality, and link status. The application is rich in UI to show all these details in an effective manner.

Background

  • Signal strength: The received strength of the wireless signal at the client adapter.
  • Signal quality: The quality of the signal received at the client adapter.
  • Link status: The link quality between the client adapter and the corresponding wireless network.

Using the code

The native Wifi WlanQueryInterface() function is used to query the "connection attributes" of a wireless connection. This function will be called in client program in a timer functionality to get the signal quality continuously.

Based on interpolation between the signal quality and signal strength, the signal strength is calculated as:

public static uint GetSignalQuality(Guid gg)
{
    UInt32 dwSize = 0;
    IntPtr ppData = IntPtr.Zero;
    IntPtr ppChannel = IntPtr.Zero;
    WLAN_OPCODE_VALUE_TYPE pOpcodeValueType;

    if (WlanQueryInterface(m_pClientHandle, ref gg, 
        WLAN_INTF_OPCODE.wlan_intf_opcode_current_connection, 
        IntPtr.Zero, out dwSize, out ppData, 
        out pOpcodeValueType) != ERROR_SUCCESS)
    {
        m_errorMessage = "Failed WlanQueryInterface() - " + 
                         "Current  Connection Attributes";
        return 0;
    }

    if (ppData != IntPtr.Zero)
    {
        WLAN_CONNECTION_ATTRIBUTES connectionAttributes = 
             new WLAN_CONNECTION_ATTRIBUTES(ppData);
        return connectionAttributes.wlanAssociationAttributes.wlanSignalQuality;

    }
    return 0;
}

Points of interest

The tool also provides a context menu in the tray icon to select the network interface through which you want to query the signal quality, and an Exit menu to close the application.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

No Biography provided

Comments and Discussions

 
QuestionCan this application be used for more than 1 network? Pin
mona199019-Mar-14 8:46
membermona199019-Mar-14 8:46 
Question[My vote of 2] Getting marshalling error on GetSignalQuality and no source for ConnectionClass.dll Pin
cobaia0129-May-13 12:19
membercobaia0129-May-13 12:19 
QuestionNo signal strength reported on Win7 tablet PC, Thoughts? Pin
Rascal910-Apr-13 12:43
memberRascal910-Apr-13 12:43 
QuestionWin7 64Bit Issue Pin
Stan Bartsch18-Sep-12 7:17
memberStan Bartsch18-Sep-12 7:17 
GeneralMy vote of 1 Pin
ranummark24-May-12 10:51
memberranummark24-May-12 10:51 
QuestionConnectionClass Source Code Pin
aefaustino25-Apr-12 3:09
memberaefaustino25-Apr-12 3:09 
QuestionUsing DeviceIoControl Pin
Debojyoti Majumder30-Mar-11 19:43
memberDebojyoti Majumder30-Mar-11 19:43 
GeneralGreat work Pin
TJTurner28-Sep-09 17:17
memberTJTurner28-Sep-09 17:17 
GeneralMy vote of 1 Pin
sesar30-Aug-09 16:06
membersesar30-Aug-09 16:06 
GeneralRe: My vote of 1 Pin
RickNash14-Sep-09 3:46
memberRickNash14-Sep-09 3:46 
GeneralMy vote of 2 Pin
Country Man9-Jun-09 5:37
memberCountry Man9-Jun-09 5:37 
GeneralMy vote of 1 Pin
Bikkel324-Jun-09 21:22
memberBikkel324-Jun-09 21:22 
GeneralConnectionClass Pin
buratino2214-Jul-08 23:55
memberburatino2214-Jul-08 23:55 
GeneralConnectionClass.dll Pin
RickNash14-Apr-08 6:20
memberRickNash14-Apr-08 6:20 
GeneralRe: ConnectionClass.dll Pin
mygapula sudheer11-Sep-09 0:52
membermygapula sudheer11-Sep-09 0:52 
GeneralExcellent One........ Pin
ravinaik7-Feb-08 19:14
memberravinaik7-Feb-08 19:14 
GeneralGreat Work!! Pin
Member 42857637-Feb-08 18:53
memberMember 42857637-Feb-08 18:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150520.1 | Last Updated 7 Feb 2008
Article Copyright 2008 by mygapula sudheer
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid