Fix compile problems when enabling UDP
Using #define MY_USE_UDP Failied building on AVR (only worked on ESP) Fixes https://github.com/mysensors/Arduino/issues/369
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
#define MY_RF24_CS_PIN 6
|
||||
|
||||
// Enable to UDP
|
||||
//#define MY_USE_UDP
|
||||
#define MY_USE_UDP
|
||||
|
||||
#define MY_IP_ADDRESS 192,168,178,66 // If this is disabled, DHCP is used to retrieve address
|
||||
// Renewal period if using DHCP
|
||||
|
||||
Reference in New Issue
Block a user