diff --git a/src/espwifistack.cpp b/src/espwifistack.cpp index 986cd37..d168855 100644 --- a/src/espwifistack.cpp +++ b/src/espwifistack.cpp @@ -2024,4 +2024,16 @@ tl::expected get_sta_ap_info() } } +tl::expected get_base_mac_addr() +{ + wifi_stack::mac_t chipmac{}; + if (const auto result = esp_base_mac_addr_get(std::begin(chipmac)); result == ESP_OK) + return chipmac; + else + { + ESP_LOGE(TAG, "esp_base_mac_addr_get() failed with %s", esp_err_to_name(result)); + return tl::make_unexpected(std::string{"esp_base_mac_addr_get() failed with "} + esp_err_to_name(result)); + } +} + } // namespace wifi_stack diff --git a/src/espwifistack.h b/src/espwifistack.h index acf5dc9..7303c95 100644 --- a/src/espwifistack.h +++ b/src/espwifistack.h @@ -56,4 +56,6 @@ void delete_scan_result(); tl::expected get_sta_ap_info(); +tl::expected get_base_mac_addr(); + } // namespace wifi_stack