Click here to Skip to main content
Click here to Skip to main content

Wireless signal indicator

By , 7 Feb 2008
 

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)

About the Author

mygapula sudheer
India India
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionNo signal strength reported on Win7 tablet PC, Thoughts?memberRascal910 Apr '13 - 11:43 
QuestionWin7 64Bit IssuememberStan Bartsch18 Sep '12 - 6:17 
GeneralMy vote of 1memberranummark24 May '12 - 9:51 
QuestionConnectionClass Source Codememberaefaustino25 Apr '12 - 2:09 
QuestionUsing DeviceIoControlmemberDebojyoti Majumder30 Mar '11 - 18:43 
GeneralGreat workmemberTJTurner28 Sep '09 - 16:17 
GeneralMy vote of 1membersesar30 Aug '09 - 15:06 
GeneralRe: My vote of 1memberRickNash14 Sep '09 - 2:46 
GeneralMy vote of 2memberCountry Man9 Jun '09 - 4:37 
GeneralMy vote of 1memberBikkel324 Jun '09 - 20:22 
GeneralConnectionClassmemberburatino2214 Jul '08 - 22:55 
GeneralConnectionClass.dllmemberRickNash14 Apr '08 - 5:20 
GeneralRe: ConnectionClass.dllmembermygapula sudheer10 Sep '09 - 23:52 
GeneralExcellent One........memberravinaik7 Feb '08 - 18:14 
GeneralGreat Work!!memberMember 42857637 Feb '08 - 17:53 

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

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