Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

Commit 0a1f65f

Browse files
committed
Fixed Arduino builds by guarding the ESP‑IDF netif calls
1 parent 74e0b6f commit 0a1f65f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/esp_webPush/webPush_http.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,21 @@
33
extern "C" {
44
#include "esp_http_client.h"
55
#include "esp_log.h"
6+
}
7+
8+
#if defined(ESP_IDF_VERSION) && !defined(ARDUINO)
9+
extern "C" {
610
#include "esp_netif.h"
711
#include "lwip/ip_addr.h"
812
}
13+
#endif
914

1015
namespace {
1116
constexpr const char *kTag = "ESPWebPush";
1217
} // namespace
1318

1419
bool ESPWebPush::isNetworkReadyForPush() const {
20+
#if defined(ESP_IDF_VERSION) && !defined(ARDUINO)
1521
esp_netif_t *netif = esp_netif_get_default_netif();
1622
if (!netif) {
1723
return false;
@@ -28,6 +34,9 @@ bool ESPWebPush::isNetworkReadyForPush() const {
2834
return false;
2935
}
3036
return true;
37+
#else
38+
return true;
39+
#endif
3140
}
3241

3342
void ESPWebPush::printHeaderErr(esp_err_t headErr, const char *headKey) const {

0 commit comments

Comments
 (0)