Hello,
Using ethernet sheld, I want to configure a telnet client to send a query to server and to compare response to a list of predefined value and reply to server. The query is:
client.println("-i.?\r")
The answer is '-i.x ', where x can be from 1 to 12.
The command should be "-i.y", where y is x+1, 12->1.
if (c == "-i.1") {client.println("-i.2")}
if (c == "-i.2") {client.println("-i.3")}
if (c == "-i.3") {client.println("-i.4")}
if (c == "-i.4") {client.println("-i.5")}
if (c == "-i.5") {client.println("-i.6")}
if (c == "-i.6") {client.println("-i.7")}
if (c == "-i.7") {client.println("-i.8")}
if (c == "-i.8") {client.println("-i.9")}
if (c == "-i.9") {client.println("-i.10")}
if (c == "-i.10") {client.println("-i.11")}
if (c == "-i.11") {client.println("-i.12")}
if (c == "-i.12") {client.println("-i.1")}
That is not working because the limitation on client.read().
Because I'm only an electrical engineer and not programmer I seek advice.
There is no code, because I don't know how to output full response ( '-i.X') with client.read () to something to compare with '-i.X' (x being a number between 1 and 12