Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
François Revol
firmware
Commits
74e9dfa1
Commit
74e9dfa1
authored
Aug 20, 2019
by
Martin Ling
Committed by
Martin Ling
Aug 20, 2019
Browse files
Use prefix CA:4D:10 for random MAC addresses.
parent
613265f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
epicardium/ble/ble.c
View file @
74e9dfa1
...
...
@@ -97,10 +97,18 @@ static void setAddress(void)
if
(
result
==
-
1
)
{
APP_TRACE_INFO0
(
"mac.txt not found, generating random MAC"
);
TRNG_Read
(
MXC_TRNG
,
bdAddr
,
sizeof
(
bdAddr
));
sprintf
(
buf
,
"%02x:%02x:%02x:%02x:%02x:%02x
\n
"
,
bdAddr
[
0
],
bdAddr
[
1
],
bdAddr
[
2
],
bdAddr
[
3
],
bdAddr
[
4
],
bdAddr
[
5
]);
bdAddr
[
0
]
=
0xCA
;
bdAddr
[
1
]
=
0x4D
;
bdAddr
[
2
]
=
0x10
;
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
));
}
else
{
APP_TRACE_INFO1
(
"mac file contents: %s"
,
buf
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment