I need help with Ethernet.h reading etc.

.....
........

EthernetClient client = server.available(); 
if (client)
{
   boolean currentLineIsBlank = true; 
   boolean sentHeader = false; 

   while (client.connected()) 
  {
    if (client.available()) 
   {
     if (!sentHeader) 
    {
       client.println("HTTP/1.1 200 OK");
       client.println("Content-Type: text/html");
       client.println();
       sentHeader = true; 
     }
    char c = client.read();

    if (c == '?')
   {
     int d = client.read() - 48;

     if (d == 0)
    {
      reset = true //watchdogtimer
    }
    else if ( d > 0 && d < 7)
   {
     interval = d * 5000;
    } 
   } 

  if (c == '\n' && currentLineIsBlank) 
 {
   client.println(Data);
   break;
 }

  if (c == '\n')
 {
   currentLineIsBlank = true;
 }
 else if (c != '\r')
 {
   currentLineIsBlank = false;
  }
 }
}
delay(1);
client.stop();
}

the code almost looks like this.
I did not quite get it.
Why was the d control used?
can you please help me?

The variable 'd' is based on the character after the '?' in a query. The ASCII value of the character '0' is 48 (decimal) and subtracting 48 from the value before storing it in 'd' give 0 for '0', 1 for '1', 2 for '2', up through 9 for '9'. If the character is not a decimal digit you will get other numbers. The server is using the digits 1 through 6 to calculate an interval.

int d = client.read() - 48;

Normally this would be written

int d = client.read() - '0';

Which makes what is going on a little clearer.

Thank you for your answers. I understand -48. ascii to int converted. but "?" when I did not send "?" why control? The ethernet client is just like the one above. Where do the values like "? 4? 6? 0" come from? I did not get it.

wijippo:
I understand -48. ascii to int converted. but “?” when I did not send “?” The ethernet client is just like the one above. Where do the values like “? 4? 6? 0” come from? I did not get it.

possibility 1: You are viewing the output using some sort of tool: the serial monitor, a text file editor, whatever. That tool is displaying a ‘?’ whenever it gets a character that it cant deal with.

possibility 2: Your code uses a function to convert strings into ASCII text. That function substitutes in a ‘?’ whenever the string contains a charafcter that is n on-ascii.

wijippo:
why control?

The ASCII character set was originally used to drive teletype machines. Those machines (and later, dot-matrix printers) used characters 1-31 for various printer controls - eg: selecting fonts, setting speeds, marking the beginning and end of transmission and so on. Hence, “control characters”. Character 1 was “control a”, charcter 2 was “control b” and so on. This is why the control key on your keyboard is called the control key. It used to work just like the shift key - holding it down and pressing the ‘g’ key would get you a control-g, aka character #7, which used to ring the bell on the teletype machine.

Most terminal programs will still sound a beep or something if you send them a control-g.

wijippo: I understand -48. ascii to int converted. but "?" when I did not send "?"

The web client puts a '?' in when you click on a button. Look at the HTML you are sending to the browser to see where the '1', '2', '3', etc after the '?' come from.