mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 03:06:33 +00:00
PubSubClient: Add disconnect type option
This commit is contained in:
parent
765cecd4a3
commit
946f6fd74f
@ -610,11 +610,13 @@ boolean PubSubClient::unsubscribe(const char* topic) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void PubSubClient::disconnect() {
|
||||
void PubSubClient::disconnect(bool disconnect_package) {
|
||||
buffer[0] = MQTTDISCONNECT;
|
||||
buffer[1] = 0;
|
||||
if (_client != nullptr) {
|
||||
_client->write(buffer,2);
|
||||
if (disconnect_package) {
|
||||
_client->write(buffer,2);
|
||||
}
|
||||
_client->flush();
|
||||
_client->stop();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user