@@ -88,13 +88,21 @@ NetworkConnectionState EthernetConnectionHandler::update_handleInit()
88
88
NetworkConnectionState EthernetConnectionHandler::update_handleConnecting ()
89
89
{
90
90
if (_ip != INADDR_NONE) {
91
+ #if defined(ARDUINO_TEENSY41)
92
+ if (Ethernet.begin (nullptr , _ip, _dns, _gateway, _netmask) == 0 ) {
93
+ #else
91
94
if (Ethernet.begin (nullptr , _ip, _dns, _gateway, _netmask, _timeout, _response_timeout) == 0 ) {
95
+ #endif
92
96
Debug.print (DBG_ERROR, F (" Failed to configure Ethernet, check cable connection" ));
93
97
Debug.print (DBG_VERBOSE, " timeout: %d, response timeout: %d" , _timeout, _response_timeout);
94
98
return NetworkConnectionState::CONNECTING;
95
99
}
96
100
} else {
101
+ #if defined(ARDUINO_TEENSY41)
102
+ if (Ethernet.begin (nullptr , _timeout) == 0 ) {
103
+ #else
97
104
if (Ethernet.begin (nullptr , _timeout, _response_timeout) == 0 ) {
105
+ #endif
98
106
Debug.print (DBG_ERROR, F (" Waiting Ethernet configuration from DHCP server, check cable connection" ));
99
107
Debug.print (DBG_VERBOSE, " timeout: %d, response timeout: %d" , _timeout, _response_timeout);
100
108
return NetworkConnectionState::CONNECTING;
@@ -119,7 +127,11 @@ NetworkConnectionState EthernetConnectionHandler::update_handleConnected()
119
127
120
128
NetworkConnectionState EthernetConnectionHandler::update_handleDisconnecting ()
121
129
{
130
+ #if defined(ARDUINO_TEENSY41)
131
+ Ethernet.end ();
132
+ #else
122
133
Ethernet.disconnect ();
134
+ #endif
123
135
return NetworkConnectionState::DISCONNECTED;
124
136
}
125
137
0 commit comments