Skip to content

Commit 218c253

Browse files
committed
Reset state to read type when receiving an empty payload with QoS 0
1 parent 849832b commit 218c253

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/MqttClient.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,10 @@ void MqttClient::poll()
547547

548548
if (_onMessage) {
549549
_onMessage(_rxLength);
550+
551+
if (_rxLength == 0) {
552+
_rxState = MQTT_CLIENT_RX_STATE_READ_TYPE;
553+
}
550554
}
551555
}
552556
}

0 commit comments

Comments
 (0)