Unverified Commit 40e52f84 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Fix WiFiMulti and ESPhost STA connection w/BSSID (#2001)

WiFiMulti specifies a specific BSSID, in addition to the AP name and
password.  In the WiFi core the BSSID is stored as the raw 6-byte MAC
address, but the ESPHostedFG firmware expects a formatted C-String
(i.e. "ab:cd:ef:01:02:03" instead of {0xab, 0xcd, 0xef, 1, 2, 3})

Convert the raw bytes to the string format expected in the ESP FW.
parent 972b7f53
...@@ -54,7 +54,7 @@ void ESPHostLwIP::setBSSID(const uint8_t *bssid) { ...@@ -54,7 +54,7 @@ void ESPHostLwIP::setBSSID(const uint8_t *bssid) {
if (bssid == nullptr) { if (bssid == nullptr) {
ap.bssid[0] = 0; ap.bssid[0] = 0;
} else { } else {
memcpy(ap.bssid, bssid, sizeof(ap.bssid)); snprintf((char *)ap.bssid, sizeof(ap.bssid), "%02x:%02x:%02x:%02x:%02x:%02x", bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment