Skip to content
Snippets Groups Projects
Commit 74e9dfa1 authored by Martin Ling's avatar Martin Ling Committed by Martin Ling
Browse files

Use prefix CA:4D:10 for random MAC addresses.

parent 613265f1
No related branches found
No related tags found
No related merge requests found
...@@ -97,10 +97,18 @@ static void setAddress(void) ...@@ -97,10 +97,18 @@ static void setAddress(void)
if (result == -1) { if (result == -1) {
APP_TRACE_INFO0("mac.txt not found, generating random MAC"); APP_TRACE_INFO0("mac.txt not found, generating random MAC");
TRNG_Read(MXC_TRNG, bdAddr, sizeof(bdAddr)); bdAddr[0] = 0xCA;
sprintf(buf, "%02x:%02x:%02x:%02x:%02x:%02x\n", bdAddr[1] = 0x4D;
bdAddr[0], bdAddr[1], bdAddr[2], bdAddr[2] = 0x10;
bdAddr[3], bdAddr[4], bdAddr[5]); TRNG_Read(MXC_TRNG, bdAddr + 3, 3);
sprintf(buf,
"%02x:%02x:%02x:%02x:%02x:%02x\n",
bdAddr[0],
bdAddr[1],
bdAddr[2],
bdAddr[3],
bdAddr[4],
bdAddr[5]);
fs_write_file("mac.txt", buf, strlen(buf)); fs_write_file("mac.txt", buf, strlen(buf));
} else { } else {
APP_TRACE_INFO1("mac file contents: %s", buf); APP_TRACE_INFO1("mac file contents: %s", buf);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment