Skip to content

Commit 93e5665

Browse files
committed
Updated MAC printout
1 parent 1a1fe30 commit 93e5665

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/LoadComms/LoadComms.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@ bool LoadComms::begin() {
5252

5353
etl::array<uint8_t, 6> MACAddress = {0};
5454
esp_err_t opStatus = esp_wifi_get_mac(WIFI_IF_STA, MACAddress.data());
55-
ESP_LOGI(TAG, "Device MAC: %02X:%02X:%02X:%02X:%02X:%02X", MACAddress[0],
56-
MACAddress[1], MACAddress[2], MACAddress[3], MACAddress[4], MACAddress[5]);
55+
if(opStatus != ESP_OK) {
56+
ESP_LOGE(TAG, "Failed to get MAC address: %d", opStatus);
57+
return false;
58+
} else {
59+
ESP_LOGI(TAG, "Device MAC: %02X:%02X:%02X:%02X:%02X:%02X",
60+
MACAddress[0], MACAddress[1], MACAddress[2],
61+
MACAddress[3], MACAddress[4], MACAddress[5]);
62+
}
5763

5864

5965
if (!WiFi.STA.bandwidth(WIFI_BW_HT20)) {

0 commit comments

Comments
 (0)