Results 1 to 5 of 5

Thread: How to get MAC address of a WLAN device?

  1. #1
    Join Date
    Jun 2009
    Posts
    3,620

    How to get MAC address of a WLAN device?

    Hi
    I use windows vista as operating system and I use Nokia N900, and in my phone I activated WiFi utility and in my home I use WLAN for connecting my computer and my laptop and also I use to connect my mobile phone also now I want to get the all the network information of my mobile like get MAC address of a WLAN device and also know the IP address of my mobile device, I don’t if it’s possible or not please give me suggestion for that.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,277

    Re: How to get MAC address of a WLAN device?

    Hey I give you best solution for that because I also face this same query for that I search lots of site then I got following code I tried on network and it will properly work and give perfect response to me.

    #include <in_sock.h>
    LIBRARY insock.lib

    RServrsockt servrsockt;
    User::LeaveIfError(servrsockt.Connect());
    CleanupClosePushL(servrsockt);

    // Open a soktserv
    RSoktserv soktserv;
    User::LeaveIfError(soktserv.Open (servrsockt,KAfInet,KSockStream,KProtocolInetTcp));
    CleanupClosePushL(soktserv);

    // Start enumerating the interfaces
    TPckgBuf<Intrfcdetail> info;
    soktserv.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl);
    TBuf<32> macadres;

    while(soktserv.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, info) == KErrNone)
    {
    if(info().iName.FindF(_L("Wlan")) == KErrNotFound)
    continue;

    macadres.Zero();
    for(TUint i = sizeof(SSockAddr) ; i < sizeof(SSockAddr) + 6 ; i++)
    if(i < (TUint)info().iHwAddr.Length())
    macadres.AppendFormat(_L("%02X:"), info().iHwAddr[i] );

    if(macadres.Length()) // remove trailing ':'
    macadres.Delete(macadres.Length()-1, 1);
    }
    CleanupStack:opAndDestroy(2);

  3. #3
    Join Date
    May 2008
    Posts
    2,134

    Re: How to get MAC address of a WLAN device?

    In Windows you get the winipcfg utility, using this utility you able to displays the computer's MAC address. And ipconfig utility will you can use in currently latest version of windows operating system. Using both 'winipcfg' and 'ipconfig' of windows utility may you able to display multiple MAC addresses for one computer. In windows at one computer you get only one MAC address which computer installed network card.

  4. #4
    Join Date
    May 2008
    Posts
    2,792

    Re: How to get MAC address of a WLAN device?

    you get the MAC address using IP address also for that you have to send one packet in the network with the help of IP address, if you want to know the MAC address of your WLAN then you have to know the IP address of receivers or those device which device you want to know the MAC address, for that you have to do one thing send broadcast the packet in network with receivers IP address, after some some time you get the response or you get the acknowledgment from this computer and with this acknowledgment you get the MAC address of this computer, use this solution and I sure this solution will definitely help you.

  5. #5
    Join Date
    Apr 2008
    Posts
    2,572

    Re: How to get MAC address of a WLAN device?

    I think for knowing the MAC address of WLAN device then you have to take help of ipconfig, using this command line utility, this utility available on all versions of Microsoft Windows. This utility design for run on the Windows command prompt and using this utility you able to get the IP address information of a Windows computer and using IP address you easily find out the MAC address of you WLAN device. It also allows some control over active TCP/IP connections. ipconfig is an alternative to the older 'winipcfg' utility.

Similar Threads

  1. Device not accepting address 4, error -110 with Debian Squeeze
    By Shailu in forum Hardware Peripherals
    Replies: 2
    Last Post: 22-05-2012, 03:33 PM
  2. Replies: 4
    Last Post: 30-03-2012, 03:33 PM
  3. Replies: 9
    Last Post: 29-03-2012, 10:45 PM
  4. device eth1 has different mac address than expected
    By LinuxeD in forum Operating Systems
    Replies: 3
    Last Post: 07-08-2009, 07:18 PM
  5. How to ping a network device using mac address
    By Pragnya in forum Networking & Security
    Replies: 3
    Last Post: 03-08-2009, 10:35 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,141,142.13499 seconds with 16 queries