File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,17 @@ class NetworkClient : public Client
7070
7171 operator bool ()
7272 {
73- return _client;
73+ #if defined(COMPILE_ETHERNET)
74+ if (_networkType == NETWORK_TYPE_ETHERNET)
75+ if (_client)
76+ return (*((EthernetClient *)_client));
77+ #endif // COMPILE_ETHERNET
78+ #if defined(COMPILE_WIFI)
79+ if (_networkType == NETWORK_TYPE_WIFI)
80+ if (_client)
81+ return (*((WiFiClient *)_client));
82+ #endif // COMPILE_WIFI
83+ return false ;
7484 }
7585
7686 // ------------------------------
Original file line number Diff line number Diff line change @@ -60,7 +60,17 @@ class NetworkUDP : public UDP
6060
6161 operator bool ()
6262 {
63- return _udp;
63+ #if defined(COMPILE_ETHERNET)
64+ if (_networkType == NETWORK_TYPE_ETHERNET)
65+ if (_udp)
66+ return (*((EthernetUDP *)_udp));
67+ #endif // COMPILE_ETHERNET
68+ #if defined(COMPILE_WIFI)
69+ if (_networkType == NETWORK_TYPE_WIFI)
70+ if (_udp)
71+ return (*((WiFiUDP *)_udp));
72+ #endif // COMPILE_WIFI
73+ return false ;
6474 }
6575
6676 // ------------------------------
You can’t perform that action at this time.
0 commit comments