Log in

View Full Version : Getting the MAC address of the Bluetooth unit of your Pocket PC


Menneisyys
10-31-2006, 10:08 AM
In my article Getting the MAC address of your Wi-Fi unit/card (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=606&more=1&c=1&tb=1&pb=1), I’ve already elaborated on getting the MAC address of Wi-Fi cards / units in Pocket PC's. Now I’ve received the same question (http://forum.xda-developers.com/showthread.php?t=281452) regarding Bluetooth units.

If you have a Widcomm / Broadcomm Bluetooth stack -based device…

Just go to Bluetooth Settings / Accessibility; you’ll see the MAC address right under the “Name” text input field at the top. Examples: PL720 (http://www.winmobiletech.com/kuvat/PL720BTMAC.bmp.png); Widcomm-hacked x51v (http://www.winmobiletech.com/kuvat/x51vBTMAC.bmp.png); iPAQ hx4700 (http://www.winmobiletech.com/kuvat/hx4700BTMAC.bmp.png) and iPAQ 2210 (http://www.winmobiletech.com/kuvat/2210BTMAC.bmp.png).

If you have a Microsoft Bluetooth stack-based device…

Then, it’ll be a bit more complicated because you can’t directly get the BT MAC address of your PDA right on it. This means you’ll need to connect (at least pair with) it to some other Bluetooth device to find out its BT MAC address. In the following section, I discuss all the possible scenarios:

If you have a Widcomm / Broadcomm-based desktop computer, go to Entire Bluetooth Neighborhood (or, if you still haven’t paired your PDA with the computer, Find Bluetooth Devices). There, all BT MAC addresses will be listed. In this screenshot (http://www.winmobiletech.com/kuvat/BTMACAddressOnWidcommDesktop.png), you can for example see that my Plantronics 590A (the highlighted icon) has the MAC address 00:03:89:5f:60:f1.

If you have another Microsoft BT-stack based desktop OR Pocket PC OR Smartphone device, first, pair it with the MS BT-stack based PDA you’d like to find out its MAC address of, fire up Regedit (on the Pocket PC, for example, Resco Registry Editor – see for a complete overview of all alternatives here (http://www.pocketpcmag.com/blogs/menneisyys/UltimateRoundupOfRegistryEditors.asp)) and go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Bluetooth\Device\. In there, there will be a separate subkey for all your paired Bluetooth devices. For example, with my 590A headset with the MAC address 00:03:89:5f:60:f1, there will be a subkey named 0003895f60f1 (note that it’s generated directly from the MAC address, by just leaving the colons); that is, the entire key name will be as follows:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Bluetooth\Device\0003895f60f1]

This means the Plantronics 590 with the MAC address 00:03:89:5f:60:f1 will show up in the Registry like this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Bluetooth\Device\0003895f60f1]
"trusted"=dword:00000001
"class"=dword:00240404
"name"="590Plantronics"

If you don’t have many paired BT devices on the other PDA / desktop, then, you’ll find your device very quickly based on this. If you, on the other hand, have many paired devices, check out the “name” String value in each subkey until you find the right one.

Finally, in the Widcomm / Broadcom BT stack running on a Pocket PC, after creating at least one service shortcut to the MS BT stack-based device, tap and hold the icon and select Properties (http://www.winmobiletech.com/kuvat/x51vSelectprop.bmp.png). Then, the device address will be displayed right under the device name (http://www.winmobiletech.com/kuvat/x51vSelectprop2.bmp.png).

(Incidentally, in the registry, it’s at both HKEY_LOCAL_MACHINE\SOFTWARE\Widcomm\BtConfig\Devices\ (with all paired BT devices) and, if you you’ve also discovered the services of the device and also created shortcuts to them, you’ll directly see them under HKEY_LOCAL_MACHINE\SOFTWARE\Widcomm\Connections\<serial number>.

Examples of this:

Paired devices:

[HKEY_LOCAL_MACHINE\SOFTWARE\Widcomm\BtConfig\Devices\00:03:89:5f:60:f1]
"LinkKey"=hex:72,F0,08,9D,BD,70,AE,6E,7F,72,4D,75,0D,2F,54,A2
"TimeStamp"=dword:00000000
"Features"=hex:BF,EC,01,00,18,18,00,00
"DevClass"=hex:24,04,04
"Name"=hex:35,39,30,50,6C,61,6E,74,72,6F,6E,69,63,73,00
"TrustedMask"=dword:00000000

Note that “name” is in hex; therefore, with a simply registry export, you won’t easily find it; with a registry editor with hex -> ASCII conversion, you will.

With discovered services (with shortcuts):

[HKEY_LOCAL_MACHINE\SOFTWARE\Widcomm\Connections\0001]
"PluginProfile"="AV"
"Shortcut"="High Quality Audio on 590Plantronics"
"LocationBitMask"=dword:00000001
"DefaultConnection"=dword:00000001
"LocalDirectory"="\\My Documents"
"BDName"="590Plantronics"
"BDDevClass"=hex:24,04,04
"BDAddress"=hex:00,03,89,5F,60,F1
"PropertiesDll"=""
"StatusDll"=""
"GUID"="{0000110B-0000-1000-8000-00805F9B34FB}"
"Name"=""
"SecurityId"=dword:00000012
"Encryption"=dword:00000000
"Authentication"=dword:00000000
"Authorization"=dword:00000000
"UUID"=dword:0000110B)