Search code examples
c++windowsbluetoothhid

How to get MAC address of bluetooth HID device?


how can I get the MAC address of a bluetooth device which connected as HID device?

I have handle to the device

Handle = CreateFile(didetail->DevicePath, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, NULL);

but I can't find how to get the MAC address.

C++; Windows


Solution

  • At first I was going to say you should pipe the results of ipconfig/all into a file, but then I found this:

    http://www.codeguru.com/cpp/i-n/network/networkinformation/article.php/c5451/Three-ways-to-get-your-MAC-address.htm

    Scroll halfway down to GetAdaptersInfo, that should be what you're looking for.