From f189fff08ec2f7fd81e14899fe7400bbc1f85cfc Mon Sep 17 00:00:00 2001 From: danukeru <danukeru@foulab.org> Date: Wed, 21 Aug 2019 14:52:22 -0400 Subject: [PATCH] I hate embedded string manipulation. --- epicardium/ble/ble.c | 2 +- epicardium/ble/ble_main.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epicardium/ble/ble.c b/epicardium/ble/ble.c index 7d0125f1..4be880c3 100644 --- a/epicardium/ble/ble.c +++ b/epicardium/ble/ble.c @@ -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", diff --git a/epicardium/ble/ble_main.c b/epicardium/ble/ble_main.c index a19c7983..af041f9c 100644 --- a/epicardium/ble/ble_main.c +++ b/epicardium/ble/ble_main.c @@ -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; -- GitLab