Regarding the MAC Address portion, there are a few issues:
- A MAC address is a 48-bit number, not a 64-bit one. (e.g. 6 bytes)
- You’re starting your read from the MAC address entry in the memory map, but reading 8 bytes means you’re going to grab the 6 bytes of MAC address plus the first 2 bytes of the IP address that immediately follows, which may taint your result.
- The way you pack the resulting bytes into a 64-bit integer is endian dependent, so you may get different results depending on what platform you compile and run this code.
I’d approach it more like this:
uint32_t MMP = 0xF030002E; // address for the MAC address
int length = 6; // MAC address is 48 bits = 6 bytes
uint8_t response[6]; // variable to hold the six bytes
int nResult = EPIC.ReadBytes(MMP, length, response);
char hexString[18] = {0}; // 6 bytes at 2 characters each, plus 5 colons between them, plus a null terminator, initialized to 0
snprintf(hexString, 18, "%02x:%02x:%02x:%02x:%02x:%02x", response[0], response[1], response[2], response[3], response[4], response[5]);