The big issue with this approach is that half the MAC address is missing when
accessed through MonoTouch. Interestingly enough, the second half of the
address has been moved to the first half. Almost as if there a bad shift
reading memory happening.

Here's the MAC info from my emulator. The Obj-C MAC was obtained using code
from the StackOverflow link and the MonoTouch MAC was obtained using the
code at the bottom of this message.

Obj-C MAC: 00:16:CB:CB:BC:3B
MonoTouch MAC: CB:BC:3B:0:0:0

Here's the MonoTouch code (simple linq) used...

macVal = (from i in
System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
        where i.Id.Equals ("en0")
        orderby i.Id ascending
        select string.Join(":", i.GetPhysicalAddress().GetAddressBytes().Select
(x=>x.ToString("X")))).FirstOrDefault ();

I should also mention that this is not an "Emulator Only Issue", I had hoped
that it was, but that exact same results (different address of course) are
present on the device in both iOS 4.3 and 5.0. I'll post back if I find a
better way of getting the MAC address through MonoTouch.

--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/Get-MAC-address-tp4017921p4034908.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to