Merge pull request #600 from sensidev/master
Fix publish_P return value
This commit is contained in:
commit
8a5b51803d
@ -423,6 +423,7 @@ boolean PubSubClient::publish_P(const char* topic, const uint8_t* payload, unsig
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
uint8_t header;
|
uint8_t header;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
|
int expectedLength;
|
||||||
|
|
||||||
if (!connected()) {
|
if (!connected()) {
|
||||||
return false;
|
return false;
|
||||||
@ -456,7 +457,9 @@ boolean PubSubClient::publish_P(const char* topic, const uint8_t* payload, unsig
|
|||||||
|
|
||||||
lastOutActivity = millis();
|
lastOutActivity = millis();
|
||||||
|
|
||||||
return rc == tlen + 4 + plength;
|
expectedLength = 1 + llen + 2 + tlen + plength;
|
||||||
|
|
||||||
|
return (rc == expectedLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean PubSubClient::beginPublish(const char* topic, unsigned int plength, boolean retained) {
|
boolean PubSubClient::beginPublish(const char* topic, unsigned int plength, boolean retained) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user