-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Labels
conclusion: resolvedIssue was resolvedIssue was resolvedtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
Compiler warnings when compiled with Ardunio, esp32 v3.1.0 and All warning enabled
The MqttClient class should provide implementation for the pure functions of the Client class
int Client::connect(IPAddress ip, uint16_t port, int32_t timeout) = 0;
int Client::connect(const char *host, uint16_t port, int32_t timeout) = 0;
probably something like this in addition to the existing interface:
int MqttClient::connect(IPAddress ip, uint16_t port, int32_t timeout)
{
return connect(ip, NULL, port, timeout);
}
int MqttClient::connect(const char *host, uint16_t port, int32_t timeout)
{
return connect((uint32_t)0, host, port, timeout);
}
int MqttClient::connect(IPAddress ip, const char* host, uint16_t port, int32_t timeout)
{
if (clientConnected()) {
_client->stop();
}
_rxState = MQTT_CLIENT_RX_STATE_READ_TYPE;
_connected = false;
_txPacketId = 0x0000;
if (host) {
if (!_client->connect(host, port, timeout)) {
_connectError = MQTT_CONNECTION_REFUSED;
return 0;
}
} else {
if (!_client->connect(ip, port, timeout)) {
_connectError = MQTT_CONNECTION_REFUSED;
return 0;
}
}
Metadata
Metadata
Assignees
Labels
conclusion: resolvedIssue was resolvedIssue was resolvedtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project