client can connect to provider and download an image.
Updated network component to add get mac address
This commit is contained in:
@@ -452,3 +452,22 @@ internal void blink_last_ip_octet()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// === MAC Address ===
|
||||
|
||||
esp_err_t get_mac_address(uint8_t *mac_out)
|
||||
{
|
||||
// Prefer Ethernet if connected, fall back to WiFi
|
||||
if (s_eth_netif != nullptr)
|
||||
{
|
||||
return esp_netif_get_mac(s_eth_netif, mac_out);
|
||||
}
|
||||
|
||||
if (s_wifi_netif != nullptr)
|
||||
{
|
||||
return esp_netif_get_mac(s_wifi_netif, mac_out);
|
||||
}
|
||||
|
||||
ESP_LOGE("NET", "No active network interface for MAC address");
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
@@ -15,3 +15,7 @@ esp_err_t connect_wifi(const char *ssid, const char *password,
|
||||
bool blockUntilIPAcquired);
|
||||
void disconnect_wifi();
|
||||
esp_err_t check_wifi_connection(uint32_t timeoutSeconds);
|
||||
|
||||
// Get the MAC address of the active network interface (WiFi STA).
|
||||
// mac_out must point to a buffer of at least 6 bytes.
|
||||
esp_err_t get_mac_address(uint8_t *mac_out);
|
||||
|
||||
Reference in New Issue
Block a user