Skip to content
Snippets Groups Projects
Commit f189fff0 authored by danukeru's avatar danukeru Committed by schneider
Browse files

I hate embedded string manipulation.

parent 2766e2f1
Branches
Tags
No related merge requests found
Pipeline #2722 passed
......@@ -120,7 +120,7 @@ static void setAddress(void)
bdAddr[4] = b;
bdAddr[5] = a;
}
LOG_INFO(
"ble",
"Setting MAC address to %02X:%02X:%02X:%02X:%02X:%02X",
......
......@@ -326,11 +326,11 @@ static void bleClose(bleMsg_t *pMsg)
static void bleSetup(bleMsg_t *pMsg)
{
char buf[32];
char a, b, c, d, e, f;
char a, b, c, d, e, f, K;
if (fs_read_text_file("mac.txt", buf, sizeof(buf)))
{
if (sscanf(buf, "**:**:**:%c%c:%c%c:%c%c", &a, &b, &c, &d, &e, &f) == 6)
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)
{
bleScanDataDisc[9] = a;
bleScanDataDisc[10] = b;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment