Hi All,

I am trying to get MAC(Media Access Control ) address of a mobile
connected in Bluetooth network programmatically through C#.I am using
Visual Studio 2005. Please help me.

Re: Reg Getting MAC(Media Access Control ) address of a mobile connect by eric

eric
Thu Jan 24 11:27:28 CST 2008

You'll have to use OpenNetCF for the following but this works

public static string GetMacAddress()

{

const int numSignificantBytes = 6;

StringBuilder st = new StringBuilder();

AdapterCollection aC = Networking.GetAdapters();

foreach (Adapter a in aC)

{

if (a.Type == AdapterType.Ethernet)

{

byte[] mAddress = a.MacAddress;

if (mAddress == null || mAddress.Length < numSignificantBytes) continue;

for (int ii = 0; ii < numSignificantBytes; ii++)

{

if (ii > 0) st.Append(':');

st.Append(mAddress[ii].ToString("X2"));

}

return st.ToString();

}

}

throw new AdapterException("No Ethernet adapter found");

}

"Jayanth Nadig" <Jayanth Nadig@discussions.microsoft.com> wrote in message
news:29FFC6E4-7E62-437B-BD84-B18CD4EC7FB1@microsoft.com...
> Hi All,
>
> I am trying to get MAC(Media Access Control ) address of a mobile
> connected in Bluetooth network programmatically through C#.I am using
> Visual Studio 2005. Please help me.



Re: Reg Getting MAC(Media Access Control ) address of a mobile connect by Peter

Peter
Thu Jan 24 12:21:50 CST 2008

Bluetooth radios have 6bit identifiers. Download the 32feet.NET library and
samples which will show you how to do device discovery from C# and get the
ids, names etc for nearby devices. http://inthehand.com/content/32feet.aspx
for details

Peter

--
Peter Foot
Microsoft Device Application Development MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility

"Jayanth Nadig" <Jayanth Nadig@discussions.microsoft.com> wrote in message
news:29FFC6E4-7E62-437B-BD84-B18CD4EC7FB1@microsoft.com...
> Hi All,
>
> I am trying to get MAC(Media Access Control ) address of a mobile
> connected in Bluetooth network programmatically through C#.I am using
> Visual Studio 2005. Please help me.