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
card10
firmware
Commits
bd170694
Commit
bd170694
authored
Jan 27, 2020
by
schneider
Browse files
fix(ble): write new mac if files does not exist
parent
2cd151e7
Pipeline
#4470
passed with stages
in 2 minutes and 9 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
epicardium/ble/ble.c
View file @
bd170694
...
...
@@ -96,7 +96,7 @@ static void setAddress(void)
int
result
=
fs_read_text_file
(
"mac.txt"
,
buf
,
sizeof
(
buf
));
if
(
result
==
-
1
)
{
if
(
result
<
0
)
{
APP_TRACE_INFO0
(
"mac.txt not found, generating random MAC"
);
epic_trng_read
(
bdAddr
+
3
,
3
);
sprintf
(
buf
,
...
...
epicardium/ble/ble_main.c
View file @
bd170694
...
...
@@ -333,7 +333,7 @@ static void bleSetup(bleMsg_t *pMsg)
char
buf
[
32
];
char
a
,
b
,
c
,
d
,
e
,
f
,
K
;
if
(
fs_read_text_file
(
"mac.txt"
,
buf
,
sizeof
(
buf
)))
if
(
fs_read_text_file
(
"mac.txt"
,
buf
,
sizeof
(
buf
))
>
0
)
{
if
(
sscanf
(
buf
,
"%c%c:%c%c:%c%c:%c%c:%c%c:%c%c"
,
&
K
,
&
K
,
&
K
,
&
K
,
&
K
,
&
K
,
&
a
,
&
b
,
&
c
,
&
d
,
&
e
,
&
f
)
==
12
)
{
...
...
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