-
Notifications
You must be signed in to change notification settings - Fork 267
Adding ESP32 support and fix for ESP32 v 1.0.2 #95
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -219,6 +219,11 @@ class EthernetClient : public Client { | |
uint8_t status(); | ||
virtual int connect(IPAddress ip, uint16_t port); | ||
virtual int connect(const char *host, uint16_t port); | ||
// 20190421 https://kmpelectronics.eu/ Plamen Kovandjiev - We added support for ESP32. | ||
#ifdef ESP32 | ||
virtual int connect(IPAddress ip, uint16_t port, int timeout); | ||
virtual int connect(const char *host, uint16_t port, int timeout); | ||
#endif | ||
virtual int availableForWrite(void); | ||
virtual size_t write(uint8_t); | ||
virtual size_t write(const uint8_t *buf, size_t size); | ||
|
@@ -253,11 +258,18 @@ class EthernetClient : public Client { | |
class EthernetServer : public Server { | ||
private: | ||
uint16_t _port; | ||
// 20190421 https://kmpelectronics.eu/ Plamen Kovandjiev - We added support for ESP32. | ||
void init(); | ||
public: | ||
EthernetServer(uint16_t port) : _port(port) { } | ||
EthernetClient available(); | ||
EthernetClient accept(); | ||
// 20190421 https://kmpelectronics.eu/ Plamen Kovandjiev - We added support for ESP32. | ||
#ifdef ESP32 | ||
virtual void begin(uint16_t port = 0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related: #88 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, the ESP folks appear to have strayed from the Arduino API. Not good. |
||
#else | ||
virtual void begin(); | ||
#endif | ||
virtual size_t write(uint8_t); | ||
virtual size_t write(const uint8_t *buf, size_t size); | ||
virtual operator bool(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have a mechanism for setting the timeout:
https://www.arduino.cc/en/Reference/EthernetClientSetConnectionTimeout