Newbie - Searching characters (in returned web data)

Discussion about any of the included sketches (i.e. WebServer), or user-generated applications.

Newbie - Searching characters (in returned web data)

Postby bethesda » Sat Nov 06, 2010 2:53 pm

I've got SimpleClient example working, and it's retrieving weather temperature data from a web page I created. So the returned data is the HTTP headers, and then a few characters of numbers. I want to parse those numbers out. The code from SimpleClient:

Code: Select all
void printData(char* data, int len) {
  // Print the data returned by the server
  // Note that the data is not null-terminated, may be broken up into smaller packets, and
  // includes the HTTP header.
  while (len-- > 0) {
    Serial.print(*(data++));
  }
}


So how would I take 'data' which I believe is a character pointer, and convert it to something actually easily usable, like the String class here? http://arduino.cc/en/Reference/StringObject
Thanks!
bethesda
 
Posts: 6
Joined: Thu Nov 04, 2010 5:43 pm

Return to Sketches and Applications

Who is online

Users browsing this forum: No registered users and 1 guest