Skip to content

Commit

Permalink
Providing empty functions for functions defined pure virtual in ESP82…
Browse files Browse the repository at this point in the history
…66::Client.h
  • Loading branch information
aentinger committed Oct 21, 2019
1 parent 0ca9575 commit ade2940
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/MqttClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class MqttClient : public Client {
// from Client
virtual int connect(IPAddress ip, uint16_t port = 1883);
virtual int connect(const char *host, uint16_t port = 1883);
virtual int connect(const IPAddress& ip, uint16_t port) { }; /* ESP8266 core defines this pure virtual in Client.h */
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buf, size_t size);
virtual int available();
Expand All @@ -89,6 +90,9 @@ class MqttClient : public Client {

int connectError() const;
int subscribeQoS() const;
virtual bool flush(unsigned int maxWaitMs) { } /* ESP8266 core defines this pure virtual in Client.h */

virtual bool stop(unsigned int maxWaitMs) { } /* ESP8266 core defines this pure virtual in Client.h */

private:
int connect(IPAddress ip, const char* host, uint16_t port);
Expand Down

9 comments on commit ade2940

@JAndrassy
Copy link

@JAndrassy JAndrassy commented on ade2940 Nov 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aentinger
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately necessary because Arduino Create uses 2.5.0.

@JAndrassy
Copy link

@JAndrassy JAndrassy commented on ade2940 Nov 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it doesn't compile for SAMD Arduino then. add some ifdefs

@aentinger
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are already at it would you mind to prepare a PR?

@JAndrassy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't use this library. I only helped with a question linked in my first comment

@aentinger
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you know for sure it doesn't compile for SAMD?

@JAndrassy
Copy link

@JAndrassy JAndrassy commented on ade2940 Nov 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uff, only now I see this is the official Arduino repository and the library is targeted for SAMD.

the esp8266 maintainers corrected the Client API on my hassle and here this.

so it is very easy to take the WiFiSimpleSender example, change the broker to IPAddress and get the error

@aentinger
Copy link
Contributor Author

@aentinger aentinger commented on ade2940 Nov 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for resolving the issue on ESP core side. I wish we could do without this change but unfortunately as I've outlined above we can't. @eclipse1985 .

@sandeepmistry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JAndrassy thank you for communicating your concerns above in: ade2940#commitcomment-35852164. I've created pull request #22 to address, we would appreciate your feedback on it.

Please sign in to comment.