Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonFilter problem #76

Open
phonicmouse opened this issue Dec 5, 2015 · 0 comments
Open

JsonFilter problem #76

phonicmouse opened this issue Dec 5, 2015 · 0 comments

Comments

@phonicmouse
Copy link

when i'm compiling this:

HTTPClient client("api.openweathermap.org", weatherApiServer);

    FILE* result = client.getURI("/data/2.5/weather?q=torino&appid=217fd2d8848ef3352b55a089f72a5e55");

    int returnCode = client.getLastReturnCode();
if (result != NULL) {
      int c;
      float tempK;
      float tempC;
      String response;

      while ((c = fgetc(result)) != EOF) {
        response += (char) c;
      }
      char* json_string;
      response.toCharArray(json_string, response.length());
      char** jsonFilter = {"main", "temp", "pressure", "humidity", NULL};
      aJsonObject* stream = aJson.parse(result, jsonFilter);
}

i get the following error:

Arduino:1.6.6 (Windows 10), Scheda:"Arduino/Genuino Uno"

C:\Users\Phonic Mouse\Documents\Arduino\ArduMeteoTwitter\ArduMeteo\ArduMeteo.ino: In function 'void loop()':

C:\Users\Phonic Mouse\Documents\Arduino\ArduMeteoTwitter\ArduMeteo\ArduMeteo.ino:60:65: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     HTTPClient client("api.openweathermap.org", weatherApiServer);

                                                                 ^

C:\Users\Phonic Mouse\Documents\Arduino\ArduMeteoTwitter\ArduMeteo\ArduMeteo.ino:62:101: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     FILE* result = client.getURI("/data/2.5/weather?q=torino&appid=217fd2d8848ef3352b55a089f72a5e55");

                                                                                                     ^

ArduMeteo:77: error: scalar object 'jsonFilter' requires one element in initializer

       char** jsonFilter = {"main", "temp", "pressure", "humidity", NULL};

                                                                        ^

exit status 1


scalar object 'jsonFilter' requires one element in initializer

@phonicmouse phonicmouse changed the title JsonFiler problem JsonFilter problem Dec 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant