How parse (and debug) YunClient command

Hi.

I would like to know how parse correctly my client variable:

YunClient client = server.accept();

The request is like this: action/speed Or: action/settings1/setting2/setting3/... (don't know how much yet)

I tried something but I'm not able to debug it, I don't know how display an integer variable in the console, the outptut is kind of weird actually when I try. (some kind of ASCII transform)

Could you help me to fix what I did wrong?

  // Format: COMMAND/SPEED
  String command = client.readStringUntil('/');  
  //Serial.println("QueryX:"+client.readString());  
  int speed = client.parseInt();

Complete source code: https://github.com/Vadorequest/AAD1/blob/master/Arduino/sketch_car/sketch_car.ino

I changed the code, I forgot to remove the '/', but it doesn't works well neither.

  // Format: COMMAND/SPEED
  String command = client.readStringUntil('/');  
  //Serial.println("QueryX:"+client.readString()); 
  
  client.read();
  int speed = client.parseInt();

The car speed increase and decrease but it's weird, really, the sound is weird, like if something was wrong. The speed is not was it should be, it's less, the minimum speed I sent is 70, the max is 255. So, I think there is still a problem but I'm not able to see the value (printLn doesn't works)

Hey Vado,

Did you try something like this : http://stackoverflow.com/questions/9072320/split-string-into-string-array

There is no easy way (like a method) to print an int? O_o

I'll try this.... Thanks.

To print a Int did you try

Console.println((String) yourIntvariable);

It doesn't but Serial.println((String) speed); does! Thank you!