diff --git a/EthernetGateway/EthernetGateway.ino b/EthernetGateway/EthernetGateway.ino index 3004ab0..75fa991 100644 --- a/EthernetGateway/EthernetGateway.ino +++ b/EthernetGateway/EthernetGateway.ino @@ -127,35 +127,40 @@ void processEthernetMessages() // bytes available to read via the client object EthernetClient client = server.available(); - if (client) + if (client) { - // read the bytes incoming from the client - char inChar = client.read(); + // if got 1 or more bytes + if (client.available()) + { + // read the bytes incoming from the client + char inChar = client.read(); - // echo the bytes to the serial port - Serial.print(inChar); + if (inputPos