mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-14 18:46:59 +00:00
[PubSubClient] Fix Publish_P return value
PR from [PubSubClient PR 600](https://github.com/knolleary/pubsubclient/pull/600) N.B. we had this fix already present in ESPeasy before update to 2.7
This commit is contained in:
@@ -445,7 +445,9 @@ boolean PubSubClient::publish_P(const char* topic, const uint8_t* payload, unsig
|
||||
|
||||
lastOutActivity = millis();
|
||||
|
||||
return rc == tlen + 4 + plength;
|
||||
// Header (1 byte) + llen + identifier (2 bytes) + topic len + payload len
|
||||
const int expectedLength = 1 + llen + 2 + tlen + plength;
|
||||
return (rc == expectedLength);
|
||||
}
|
||||
|
||||
boolean PubSubClient::beginPublish(const char* topic, unsigned int plength, boolean retained) {
|
||||
|
||||
Reference in New Issue
Block a user