Skip to content

Commit 40e52f8

Browse files
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.
1 parent 972b7f5 commit 40e52f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/lwIP_ESPHost/src/lwIP_ESPHost.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void ESPHostLwIP::setBSSID(const uint8_t *bssid) {
5454
if (bssid == nullptr) {
5555
ap.bssid[0] = 0;
5656
} else {
57-
memcpy(ap.bssid, bssid, sizeof(ap.bssid));
57+
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]);
5858
}
5959
}
6060

0 commit comments

Comments
 (0)