Thursday, May 30, 2019

Bluetooth/Mac address to string

public static String FormatMacAddress(UInt32 macAddress)
{
    return String.Format("{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}",
        (macAddress >> 40) & 0xFF, (macAddress >> 32) & 0xFF, (macAddress >> 24) & 0xFF,
        (macAddress >> 16) & 0xFF, (macAddress >> 08) & 0xFF, (macAddress >> 00) & 0xFF);
}

No comments:

Post a Comment