diff --git a/libraries/MySensors/core/MyGatewayTransportEthernet.cpp b/libraries/MySensors/core/MyGatewayTransportEthernet.cpp index 00957c5..d04c7d8 100644 --- a/libraries/MySensors/core/MyGatewayTransportEthernet.cpp +++ b/libraries/MySensors/core/MyGatewayTransportEthernet.cpp @@ -264,10 +264,16 @@ bool gatewayTransportAvailable() if (packet_size) { //debug(PSTR("UDP packet available. Size:%d\n"), packet_size); - _ethernetServer.read(inputString[0].string, MY_GATEWAY_MAX_RECEIVE_LENGTH); - _w5100_spi_en(false); - debug(PSTR("UDP packet received: %s\n"), inputString[0].string); - return protocolParse(_ethernetMsg, inputString[0].string); + #if defined(MY_GATEWAY_ESP8266) + _ethernetServer.read(inputString[0].string, MY_GATEWAY_MAX_RECEIVE_LENGTH); + debug(PSTR("UDP packet received: %s\n"), inputString[0].string); + return protocolParse(_ethernetMsg, inputString[0].string); + #else + _ethernetServer.read(inputString.string, MY_GATEWAY_MAX_RECEIVE_LENGTH); + _w5100_spi_en(false); + debug(PSTR("UDP packet received: %s\n"), inputString.string); + return protocolParse(_ethernetMsg, inputString.string); + #endif } #else #if defined(MY_GATEWAY_ESP8266)