Device's MAC Address

Login to reply to this topic.
Sat, 2004-08-21 09:18
Joined: 2003-12-30
Forum posts: 93
Hello !

I know how to extract the MAC (Ethernet) Address of Bluetooth devices, but what about the MAC Address of my smartphone ? How can I found out the MAC Address of my mobile phone ? I need this because I need a unique identifier that will be avalaible on BT and Smartphones. The MAC Address would be the only solution, getting IMEI is not enough because not available on BT Devices.

Can I extract the MAC Address using the etel libs ? If yes how, because I really have no id how it could work

Thx a lot for your advices !

MatD:-)

MatD


Mon, 2004-08-23 14:51
Joined: 2004-07-18
Forum posts: 25
Device's MAC Address
Mon, 2004-08-23 22:44
Joined: 2003-12-30
Forum posts: 93
Device's MAC Address
Hi ribizli

Yes I read your post before posting this one. But unfortunately I can't get the Mac Address of my Smartphone, i face the same problem as you. By the way, if you have managed to get other digits than 00 00 00 00 it'll be nice if you could post a code snippet.
I've also read thread : http://forum.newlc.com/viewtopic.php?t=1768 but couldn't retrieve the Mac Address

It seems like the way to get the Mac Address of a symbian smartphone is a real mystery. Why Huh Other Bluetooth devices simply have it written on a little stick and can be so easily retrieved.

Thx for your help and explanations !

MatD:-)

MatD

Tue, 2004-08-24 08:38
Joined: 2004-07-18
Forum posts: 25
Device's MAC Address
Sorry, I didn´t test the code. I use the IMEI meanwhile.
The only way to find out the address of my phone was from a remote device.
Thu, 2004-08-26 13:33
Joined: 2003-12-30
Forum posts: 93
Device's MAC Address
Hi !

I've finally found it out how to get the MAC Address on your device. It works fine and goes like this :

Code:
RSocketServ aSocketServer;
aSocketServer.Connect();
RSocket socket;
User::LeaveIfError(socket.Open(aSocketServer,_L("L2CAP")));
TPckgBuf<TBTDevAddr> devAddr;
TRequestStatus stat;
socket.Ioctl(KHCILocalAddressIoctl, stat, &devAddr, KSolBtHCI);

User::WaitForRequest(stat);
if(stat == KErrNone) {
    TBTDevAddr localAddr=devAddr();
    TBuf<1024> btAddr;
   for(int i=0;i<localAddr.Des().Length();i++)
   {
btAddr.AppendNumFixedWidth(localAddr[i],EHex,2);
   }
 // Outputs MAC Address
  User::InfoPrint(btAddr);
}
else
{
User::InfoPrint(_L("Error :-( "));
}
socket.Close();
aSocketServer.Close();

You must use the HCI Commands

MatD:-)

MatD

Fri, 2005-07-08 15:41
Joined: 2005-06-08
Forum posts: 53
Re: Device's MAC Address
Thanks for your code. It is great!!
Tue, 2005-09-13 10:17
Joined: 2005-02-11
Forum posts: 214
Re: Device's MAC Address
For Symbian 8.0a I get error -5 (not supported). Has there been any changes from 7?

Code:
_LIT(KServerIoCtrl,"L2CAP");
RSocketServ socketserver;
    RSocket ioctrlsocket;

    User::LeaveIfError(socketserver.Connect());
    User::LeaveIfError(ioctrlsocket.Open(socketserver, KServerIoCtrl));

    TPckgBuf<TBTDevAddr> addr;
    TRequestStatus status;
    ioctrlsocket.Ioctl( KHCILocalAddressIoctl, status, &addr, KSolBtHCI);
    User::WaitForRequest(status);
//status=-5
    ioctrlsocket.Close();
    socketserver.Close();

"I only know that I know nothing." (Socrates)

Fri, 2008-01-04 13:52
Joined: 2008-01-04
Forum posts: 3
Re: Device's MAC Address

Hi,

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. Thanks in advance.


Jayanth

Fri, 2008-01-04 13:52
Joined: 2008-01-04
Forum posts: 3
Re: How to find the MAC address of the mobile device in C#

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.

if u find anything just send me a mail to . it's very urgent. please help me.

Thanks in advance.


Jayanth

Fri, 2008-01-04 15:35
Forum Nokia Champion
Joined: 2003-06-10
Forum posts: 695
Re: Device's MAC Address

See my reply to your duplicate post in this thread: http://www.newlc.com/forum/how-find-mac-address-mobile-device

  • Login to reply to this topic.