1
0
mirror of https://github.com/HEYAHONG/cc-tool.git synced 2025-05-08 19:51:05 +08:00

print the primary MAC address in the correct order (byte reversed)

the old version reads the MAC address from memory but it is byte reversed. To print it right I just made a simple loop to print each byte in reverse order. This could be done much better.

Signed-off-by: Scott Gustafson <scott@garlicsoftware.com>
This commit is contained in:
Scott Gustafson 2012-09-03 20:16:35 -07:00
parent 9b9615f15e
commit f6a399300f

View File

@ -334,9 +334,14 @@ void CC_Flasher::task_read_mac_address()
ByteVector mac1;
programmer_.unit_mac_address_read(1, mac1);
std::cout << " MAC addresses, primary: "
<< binary_to_hex(&mac0[0], mac0.size(), ":")
<< ", secondary: "
std::cout << " MAC addresses, primary: ";
for(char x = mac0.size() - 1; x >= 0; --x) {
std::cout << binary_to_hex(&mac0[x], 1, ":");
if (x > 0)
std::cout << ":";
}
std::cout << ", secondary: "
<< binary_to_hex(&mac1[0], mac1.size(), ":") << "\n";
}
}