@@ -51,9 +51,7 @@ EthernetConnectionHandler::EthernetConnectionHandler(IPAddress ip, IPAddress dns
5151NetworkConnectionState EthernetConnectionHandler::update_handleInit ()
5252{
5353 if (Ethernet.hardwareStatus () == EthernetNoHardware) {
54- #if !defined(__AVR__)
5554 Debug.print (DBG_ERROR, F (" Error, ethernet shield was not found." ));
56- #endif
5755 return NetworkConnectionState::ERROR;
5856 }
5957 return NetworkConnectionState::CONNECTING;
@@ -63,33 +61,26 @@ NetworkConnectionState EthernetConnectionHandler::update_handleConnecting()
6361{
6462 if (_ip != INADDR_NONE) {
6563 if (Ethernet.begin (nullptr , _ip, _dns, _gateway, _subnet, 15000 , 4000 ) == 0 ) {
66- #if !defined(__AVR__)
6764 Debug.print (DBG_ERROR, F (" Failed to configure Ethernet, check cable connection" ));
68- #endif
6965 return NetworkConnectionState::CONNECTING;
7066 }
7167 } else {
7268 if (Ethernet.begin (nullptr , 15000 , 4000 ) == 0 ) {
73- #if !defined(__AVR__)
7469 Debug.print (DBG_ERROR, F (" Waiting Ethernet configuration from DHCP server, check cable connection" ));
75- #endif
7670 return NetworkConnectionState::CONNECTING;
7771 }
7872 }
73+
7974 return NetworkConnectionState::CONNECTED;
8075}
8176
8277NetworkConnectionState EthernetConnectionHandler::update_handleConnected ()
8378{
8479 if (Ethernet.linkStatus () == LinkOFF) {
85- #if !defined(__AVR__)
8680 Debug.print (DBG_ERROR, F (" Ethernet link OFF, connection lost." ));
87- #endif
8881 if (_keep_alive)
8982 {
90- #if !defined(__AVR__)
9183 Debug.print (DBG_ERROR, F (" Attempting reconnection" ));
92- #endif
9384 }
9485 return NetworkConnectionState::DISCONNECTED;
9586 }
0 commit comments