Forum > Windows CE

Reading MAC address of ethernet (wifi) from WinCE device

<< < (3/3)

Jurassic Pork:
hello,
you can try also to use the iphlpapi   unit like that :



--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---// uses iphlpapi procedure TForm1.Button1Click(Sender: TObject);var pAdapterInfo:PIP_ADAPTER_INFO;   BufLen,Status:cardinal; i:Integer;   tmp : string;begin  BufLen:= sizeof(IP_ADAPTER_INFO);  GetAdaptersInfo(nil, BufLen);  pAdapterInfo:= AllocMem(BufLen);  try    Status:= GetAdaptersInfo(pAdapterInfo,BufLen);    if (Status = 0 ) then    begin      while (pAdapterInfo<>nil) do    begin    tmp := '';    if pAdapterInfo^.AddressLength>0 then    for i := 0 to pAdapterInfo^.AddressLength - 1 do      tmp :=  tmp + IntToHex(pAdapterInfo^.Address[I], 2) + ' ';     memo1.Append(tmp);     pAdapterInfo:=pAdapterInfo^.next;    end;    end;  finally    Freemem(pAdapterInfo);  end;end;      
it's OK for me on my old PDA   Fuji Loox 420    PXA255   with      wince (pocket pc)  4.2   
need to activate WLAN to see the MAC address of the Wifi adapter.

Friendly, J.P 

ertank:
That seems to be another solution. Shorter, easier to read.

Are you sure that you need to activate WiFi in order to read MAC address? I tested my code when WiFi is closed and it run OK.

Thanks.

Jurassic Pork:
on my device (fuji Loox 420) when i disable WLAN, i can't see the Wifi adapter infos from my program. What is your device ?

ertank:
Producer is Korean. Web address: http://www.dsic.co.kr/ You can find it under Mobile Solutions. Model is DS5

Jurassic Pork:
your PDA is  relatively recent , mine is jurassic ( 2004)   ;D

Navigation

[0] Message Index

[*] Previous page

Go to full version