@@ -51,9 +51,7 @@ EthernetConnectionHandler::EthernetConnectionHandler(IPAddress ip, IPAddress dns
51
51
NetworkConnectionState EthernetConnectionHandler::update_handleInit ()
52
52
{
53
53
if (Ethernet.hardwareStatus () == EthernetNoHardware) {
54
- #if !defined(__AVR__)
55
54
Debug.print (DBG_ERROR, F (" Error, ethernet shield was not found." ));
56
- #endif
57
55
return NetworkConnectionState::ERROR;
58
56
}
59
57
return NetworkConnectionState::CONNECTING;
@@ -63,33 +61,26 @@ NetworkConnectionState EthernetConnectionHandler::update_handleConnecting()
63
61
{
64
62
if (_ip != INADDR_NONE) {
65
63
if (Ethernet.begin (nullptr , _ip, _dns, _gateway, _subnet, 15000 , 4000 ) == 0 ) {
66
- #if !defined(__AVR__)
67
64
Debug.print (DBG_ERROR, F (" Failed to configure Ethernet, check cable connection" ));
68
- #endif
69
65
return NetworkConnectionState::CONNECTING;
70
66
}
71
67
} else {
72
68
if (Ethernet.begin (nullptr , 15000 , 4000 ) == 0 ) {
73
- #if !defined(__AVR__)
74
69
Debug.print (DBG_ERROR, F (" Waiting Ethernet configuration from DHCP server, check cable connection" ));
75
- #endif
76
70
return NetworkConnectionState::CONNECTING;
77
71
}
78
72
}
73
+
79
74
return NetworkConnectionState::CONNECTED;
80
75
}
81
76
82
77
NetworkConnectionState EthernetConnectionHandler::update_handleConnected ()
83
78
{
84
79
if (Ethernet.linkStatus () == LinkOFF) {
85
- #if !defined(__AVR__)
86
80
Debug.print (DBG_ERROR, F (" Ethernet link OFF, connection lost." ));
87
- #endif
88
81
if (_keep_alive)
89
82
{
90
- #if !defined(__AVR__)
91
83
Debug.print (DBG_ERROR, F (" Attempting reconnection" ));
92
- #endif
93
84
}
94
85
return NetworkConnectionState::DISCONNECTED;
95
86
}
0 commit comments