diff options
author | Garrett Brown <garbearucla@gmail.com> | 2011-04-09 23:05:00 -0700 |
---|---|---|
committer | WiSo <wiso@xbmc.org> | 2011-04-10 13:39:24 +0200 |
commit | 8409c7b75f70a20d19061e1ac59fe92e5fc92a4b (patch) | |
tree | d1b8b858bb0bc2cb5b2a957ca829613e41a72a9b | |
parent | 5218c31484bb2dffae1888343fe5d1b4e8f6da41 (diff) |
Fixes blank MAC address showing in the system info by implementing CNetworkInterfaceWin32::GetMacAddress()
-rw-r--r-- | xbmc/network/windows/NetworkWin32.cpp | 5 | ||||
-rw-r--r-- | xbmc/utils/SystemInfo.cpp | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/xbmc/network/windows/NetworkWin32.cpp b/xbmc/network/windows/NetworkWin32.cpp index a2b292509b..f6489aa366 100644 --- a/xbmc/network/windows/NetworkWin32.cpp +++ b/xbmc/network/windows/NetworkWin32.cpp @@ -75,8 +75,9 @@ bool CNetworkInterfaceWin32::IsConnected() CStdString CNetworkInterfaceWin32::GetMacAddress() { - CStdString result = ""; - result = CStdString((char*)m_adapter.Address); + CStdString result; + unsigned char* mAddr = m_adapter.Address; + result.Format("%02X:%02X:%02X:%02X:%02X:%02X", mAddr[0], mAddr[1], mAddr[2], mAddr[3], mAddr[4], mAddr[5]); return result; } diff --git a/xbmc/utils/SystemInfo.cpp b/xbmc/utils/SystemInfo.cpp index cbe22f1ba0..fca71837ff 100644 --- a/xbmc/utils/SystemInfo.cpp +++ b/xbmc/utils/SystemInfo.cpp @@ -88,7 +88,7 @@ CSysData::INTERNET_STATE CSysInfoJob::GetInternetState() CStdString CSysInfoJob::GetMACAddress() { -#if defined(HAS_LINUX_NETWORK) +#if defined(HAS_LINUX_NETWORK) || defined(HAS_WIN32_NETWORK) CNetworkInterface* iface = g_application.getNetwork().GetFirstConnectedInterface(); if (iface) return iface->GetMacAddress(); |