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

wifi_print(TCP...,string) only works with string allocated to wifi_buffer #173

Open
AndyLindsay opened this issue Jul 6, 2018 · 6 comments

Comments

@AndyLindsay
Copy link
Contributor

If you try to pass a different string, it is not populated with the response.

AndyLindsay added a commit that referenced this issue Jul 6, 2018
First step in addressing issue #173.
@AndyLindsay
Copy link
Contributor Author

Partially addressed with documentation and example code updates in v1.4.88 Update wifi_scan(TCP... docs

@AndyLindsay
Copy link
Contributor Author

Check how common content-length is in headers. If common, then add function to deliver only content.

@AndyLindsay
Copy link
Contributor Author

Hmmm, this actually looks pretty doable...

@zfi
Copy link

zfi commented Jul 6, 2018

A word of caution regarding character sets as it relates to the content-length header. If the character set is multi-byte, such as UTF-8, the value in the content-length will be under reported.

Details can be found here and here.

@AndyLindsay
Copy link
Contributor Author

AndyLindsay commented Jul 6, 2018 via email

AndyLindsay added a commit that referenced this issue Jul 10, 2018
…#173

Testing

int wifi_termShowStrAndNPCs(char *s);

int wifi_getNamedValue(char *strSource, char *strName, char *fmt, ...);
@AndyLindsay
Copy link
Contributor Author

AndyLindsay commented Jul 10, 2018

This should help: int wifi_getNamedValue(char *strSource, char *strName, char *fmt, ...);

Usage example on line 102 in Dev branch's Temperature from OpenWeatherMap.

    float temp = 0;
    wifi_getNamedValue(str, "temp", "%f", &temp);
    print("temp = %6.2f deg K\r", temp);

AndyLindsay added a commit that referenced this issue Jul 10, 2018
For #173, added putStrWithNpcVals and sscanAfterStr functions.  Temperature from OpenWeathermap updated to search for an exact match to the JSON attribute.
AndyLindsay added a commit that referenced this issue Jul 10, 2018
For #173, added putStrWithNpcVals and sscanAfterStr functions.  Temperature from OpenWeathermap updated to search for an exact match to the JSON attribute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants