add lwt topic

This commit is contained in:
technyon
2023-03-27 18:46:07 +02:00
parent 44ad2dd320
commit ddf70f5d8a
10 changed files with 51 additions and 5 deletions

View File

@@ -255,6 +255,18 @@ bool EthLan8720Device::mqttDisonnect(bool force)
}
}
void EthLan8720Device::setWill(const char *topic, uint8_t qos, bool retain, const char *payload)
{
if(_useEncryption)
{
_mqttClientSecure->setWill(topic, qos, retain, payload);
}
else
{
_mqttClient->setWill(topic, qos, retain, payload);
}
}
void EthLan8720Device::mqttSetCredentials(const char *username, const char *password)
{
if(_useEncryption)
@@ -329,3 +341,4 @@ void EthLan8720Device::disableMqtt()
_mqttEnabled = false;
}