Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By lajolo
#26152 Hello, I am using this link as a reference for supported code in Arduino IDE:
https://github.com/sandeepmistry/esp8266-Arduino
and I would like to know if it is adequate.

For example, it is written:
WiFiServer, WiFiClient, and WiFiUDP behave mostly the same way as with WiFi shield library.

I have several examples with an ESP8266WebServer server that uses methods such as send, on and others that I do not find documented in the arduino wifi reference library for the Server class:
https://www.arduino.cc/en/Reference/WiFi

Is there a document and/or website where I can find some information about those methods?

Thanks!
Last edited by lajolo on Sun Aug 16, 2015 10:22 am, edited 1 time in total.
User avatar
By kolban
#26162 Howdy,
I too have been studying this area and hope to write up what I have learned ... however, in the meantime, depending on your skills ... you might be able to do what I did ... which was open up the source for these classes and look at the signatures of the methods provided. Make a list of those and then you have the exposed APIs.

If you have questions on a specific API function call, I think it would be more than fine to post a detailed question to this forum and good folks will try and answer.

Neil
User avatar
By lajolo
#26171 Hello,
thanks for your reply.

If you could provide some hints about how to access the code for one specific method, it would be great.

For example, the send method of the Server class?

Thanks!
User avatar
By martinayotte
#26173 The header file libraries/ESP8266WebServer/src/ESP8266WebServer.h shows those signatures as :
Code: Select all  void send(int code, const char* content_type = NULL, const String& content = String(""));
  void send(int code, char* content_type, const String& content);
  void send(int code, const String& content_type, const String& content);

And for example, the HelloServer.ino is using it in handleNotFound() :
Code: Select allString message = "File Not Found\n\n";
[...]
server.send(404, "text/plain", message);