Hi Hugo,
If you are using the mbed libraries, you can call:
extern "C" void mbed_mac_address(char *mac);
which returns the 6 character mac address.
We haven't officially exposed the underlying mechanism it uses to generate this MAC, but it is currently a semihost request to the interface to get its UID from which it is extracted. Every mbed module has a UID which includes an officially allocated MAC address, so it is guaranteed unique. To get the UID code, you'll need to do something like:
int semihost_uid(char *uid) {
uint32_t args[2];
args[0] = (uint32_t)uid;
args[1] = 33;
return __semihost(0x101, &args);
}
In that string returned, you'll see starting at index 20 is a MAC address which you can read and encode.
Simon
How is the ethernet/MAC address assigned? Where is it stored? Where can I retreive it if I'm not using the Ethernet.address() class?
(I'm not using the mbed libraries at all, but would like to use a valid MAC address rather than just making one up)
Thanks!