Dear Friends,
I'm using the Process class of the Bridge library to make a curl request and trying to read the result in a String Variable. My code is like the folowing;
Process p;
p.runShellCommand(curl_command);
while(p.running()); //Wait
String result="";
while (p.available()>0) {
char c=p.read();
result=result +c;
Serial.print (c);
}
The result of the curl command is a json string:
[{"id":"8","d":"2013-10-19 11:58:24","c":"roro","m":"on","com":"0","date_com":"0000-00-00 00:00:00"}]
The Rest service is working well (I tried the curl command from the linino command line).
The problem is that the while loop never ends. It reads, more or less
[{"id":"8","d":"2013-10-19 11:58:24","c":"roro","m":"on","com":"0","date_com... and then, a lot of strange ascii characters.
I taked the way of reading a Process result from the ShellCommand example. What I'm doing wrong?
Thanks in advance.
R.