fix: MQTT connection on Portduino/Linux native nodes (#10330)
isConnectedToNetwork() always returned false on ARCH_PORTDUINO because none of HAS_WIFI, HAS_ETHERNET, or USE_WS5500 are defined for Linux native builds. This caused wantsLink() to always return false, preventing the MQTT thread from ever connecting at boot. Fix: return true for ARCH_PORTDUINO since Linux always has network access available. Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
This commit is contained in:
co-authored by
GitHub
Jonathan Bennett
parent
e19f531059
commit
a0951f23c3
@@ -350,6 +350,8 @@ inline bool isConnectedToNetwork()
|
|||||||
return WiFi.isConnected();
|
return WiFi.isConnected();
|
||||||
#elif HAS_ETHERNET
|
#elif HAS_ETHERNET
|
||||||
return Ethernet.linkStatus() == LinkON;
|
return Ethernet.linkStatus() == LinkON;
|
||||||
|
#elif defined(ARCH_PORTDUINO)
|
||||||
|
return true;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user