flyingeinstein / Restfully

Arduino library for making Rest compliant APIs on the ESP8266 with embedded Uri arguments
MIT License
9 stars 2 forks source link

Missing `stdio`? #1

Open tooluser opened 5 years ago

tooluser commented 5 years ago

When I built against this, I had to peg to the older ArduinoJSON (as you noted) - but was still getting errors about an unavailable sprintf. I had to add:

#include <stdio.h>

in Rest.h. I'm happy to submit a PR. ;-)

This is absolutely brilliant, btw. I was going to mail you to say so before. Perfectly what I was looking for, and I was using it to explain last night to my wife how brilliant the internet was.

Thanks for writing it, and writing it so elegantly!

guru-florida commented 5 years ago

Thanks! Sorry for the delay, I didnt see the notice from github.

I did have some issues with stdio include. I am compiling on windows and mac gdb, and on Arduino platform and it seems to differ on each platform. I think I have this solved in a branch.

I am glad it worked out for you and honestly somewhat surprised. :) I am in the middle of some changes at the moment and the master branch can produce some pretty cryptic errors if callback functions arent just right. Mostly, the use of .on(, GET(func), PUT(func)) was causing all sorts of C++ issues and cryptic error messages if function signatures weren't perfect.

For ease of use, I've changed to .on().GET(func).PUT(func) kind of syntax but changes are still in a branch. In the new format the on() method returns a url node reference and then the .GET() and .PUT(), etc, are just chained function calling. The compiler no longer has to deduce arguments in a pseudo-magic way so even if you make an error in your callback types you'll get a more sensical error to point you in the right direction. The implementation was simpler too.

I'll update here when I commit the branch changes.

guru-florida commented 5 years ago

Hi @tooluser I've committed a big update with improved features. Also updated README