Skip to content

Does not compile on ESP8266 when calling connect() with port #106

Open
@ferdinand0815

Description

@ferdinand0815

The library fails to compile on ESP8266 when calling connect() with a port, as in mqttClient.connect(mqttBrokerIp, mqttPort).

error: call of overloaded 'connect(IPAddress&, uint16_t&)' is ambiguous

ArduinoMqttClient/src/MqttClient.h:82:15: note: candidate: 'virtual int MqttClient::connect(IPAddress, uint16_t)'
   82 |   virtual int connect(IPAddress ip, uint16_t port = 1883);
      |               ^~~~~~~
/home/ffelder/Arduino/libraries/ArduinoMqttClient/src/MqttClient.h:85:15: note: candidate: 'virtual int MqttClient::connect(const IPAddress&, uint16_t)'
   85 |   virtual int connect(const IPAddress& ip, uint16_t port) { return 0; }; /* ESP8266 core defines this pure virtual in Client.h */
      |               ^~~~~~~

This has actually already been fixed quite some time ago in this pull request #33 by removing the ESP8266 specific code in MqttClient.h. I briefly tested the connect() using test.mosquitto.org, no idea about flush and stop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions