Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ade2940

Browse files
committedOct 21, 2019
Providing empty functions for functions defined pure virtual in ESP8266::Client.h
1 parent 0ca9575 commit ade2940

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/MqttClient.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class MqttClient : public Client {
6767
// from Client
6868
virtual int connect(IPAddress ip, uint16_t port = 1883);
6969
virtual int connect(const char *host, uint16_t port = 1883);
70+
virtual int connect(const IPAddress& ip, uint16_t port) { }; /* ESP8266 core defines this pure virtual in Client.h */
7071
virtual size_t write(uint8_t);
7172
virtual size_t write(const uint8_t *buf, size_t size);
7273
virtual int available();
@@ -89,6 +90,9 @@ class MqttClient : public Client {
8990

9091
int connectError() const;
9192
int subscribeQoS() const;
93+
virtual bool flush(unsigned int maxWaitMs) { } /* ESP8266 core defines this pure virtual in Client.h */
94+
95+
virtual bool stop(unsigned int maxWaitMs) { } /* ESP8266 core defines this pure virtual in Client.h */
9296

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

9 commit comments

Comments
 (9)

aentinger commented on Nov 5, 2019

@aentinger
ContributorAuthor

Unfortunately necessary because Arduino Create uses 2.5.0.

JAndrassy commented on Nov 6, 2019

@JAndrassy

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

aentinger commented on Nov 7, 2019

@aentinger
ContributorAuthor

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

JAndrassy commented on Nov 7, 2019

@JAndrassy

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

aentinger commented on Nov 7, 2019

@aentinger
ContributorAuthor

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

JAndrassy commented on Nov 7, 2019

@JAndrassy

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 commented on Nov 11, 2019

@aentinger
ContributorAuthor

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 commented on Nov 14, 2019

@sandeepmistry
Contributor

@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.