Skip to content

Commit 2f7d1cb

Browse files
committed
Temp: check network interface type only for boards with ethernet support
1 parent 120fe75 commit 2f7d1cb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: src/ArduinoIoTCloudTCP.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,11 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress,
308308
if (enable_watchdog) {
309309
watchdog_enable();
310310
#if defined (WIFI_HAS_FEED_WATCHDOG_FUNC) || defined (ARDUINO_PORTENTA_H7_WIFI_HAS_FEED_WATCHDOG_FUNC)
311+
#ifdef BOARD_HAS_ETHERNET
311312
bool const use_ethernet = _connection->getInterface() == NetworkAdapter::ETHERNET ? true : false;
313+
#else
314+
bool const use_ethernet = false;
315+
#endif
312316
watchdog_enable_network_feed(use_ethernet);
313317
#endif
314318
}
@@ -831,7 +835,11 @@ void ArduinoIoTCloudTCP::onOTARequest()
831835
#endif
832836

833837
#ifdef BOARD_STM32H7
838+
#ifdef BOARD_HAS_ETHERNET
834839
bool const use_ethernet = _connection->getInterface() == NetworkAdapter::ETHERNET ? true : false;
840+
#else
841+
bool const use_ethernet = false;
842+
#endif
835843
_ota_error = portenta_h7_onOTARequest(_ota_url.c_str(), use_ethernet);
836844
#endif
837845
}

0 commit comments

Comments
 (0)