Skip to content

Commit 24aba67

Browse files
committed
Merge pull request arduino#387 from mysensors/fix-udp-compile-problems
Fix compile problems when enabling UDP
2 parents 528e09d + 748e3ee commit 24aba67

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Diff for: libraries/MySensors/core/MyGatewayTransportEthernet.cpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,16 @@ bool gatewayTransportAvailable()
264264

265265
if (packet_size) {
266266
//debug(PSTR("UDP packet available. Size:%d\n"), packet_size);
267-
_ethernetServer.read(inputString[0].string, MY_GATEWAY_MAX_RECEIVE_LENGTH);
268-
_w5100_spi_en(false);
269-
debug(PSTR("UDP packet received: %s\n"), inputString[0].string);
270-
return protocolParse(_ethernetMsg, inputString[0].string);
267+
#if defined(MY_GATEWAY_ESP8266)
268+
_ethernetServer.read(inputString[0].string, MY_GATEWAY_MAX_RECEIVE_LENGTH);
269+
debug(PSTR("UDP packet received: %s\n"), inputString[0].string);
270+
return protocolParse(_ethernetMsg, inputString[0].string);
271+
#else
272+
_ethernetServer.read(inputString.string, MY_GATEWAY_MAX_RECEIVE_LENGTH);
273+
_w5100_spi_en(false);
274+
debug(PSTR("UDP packet received: %s\n"), inputString.string);
275+
return protocolParse(_ethernetMsg, inputString.string);
276+
#endif
271277
}
272278
#else
273279
#if defined(MY_GATEWAY_ESP8266)

0 commit comments

Comments
 (0)