Skip to content

Removing default value assignment within connect function #31

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Since we have a different signature for ESP8266 2.5.0 core for the co…
…nnect function we need to provide two slightly different definitions dependending wether we compile for ESP8266 or Arduino
  • Loading branch information
aentinger committed Mar 23, 2020
commit 6f107d082fd2969c73bffec28129f0bf68893bbb
4 changes: 4 additions & 0 deletions src/MqttClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,11 @@ void MqttClient::poll()
}
}

#ifndef ESP8266
int MqttClient::connect(IPAddress ip, uint16_t port)
#else
int MqttClient::connect(const IPAddress& ip, uint16_t port)
#endif
{
return connect(ip, NULL, port);
}
Expand Down
7 changes: 4 additions & 3 deletions src/MqttClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ class MqttClient : public Client {
void poll();

// from Client
virtual int connect(IPAddress ip, uint16_t port);
virtual int connect(const char *host, uint16_t port);
#ifdef ESP8266
virtual int connect(const IPAddress& ip, uint16_t port) { return 0; }; /* ESP8266 core defines this pure virtual in Client.h */
#ifndef ESP8266
virtual int connect(IPAddress ip, uint16_t port);
#else
virtual int connect(const IPAddress& ip, uint16_t port); /* ESP8266 core 2.5.0 defines this pure virtual in Client.h */
#endif
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buf, size_t size);
Expand Down