Merge pull request #361 from eykamp/comments

Add some comments
This commit is contained in:
Nick O'Leary 2019-11-25 11:28:00 +00:00 committed by GitHub
commit b1cb57208c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -393,10 +393,14 @@ boolean PubSubClient::publish(const char* topic, const uint8_t* payload, unsigne
// Leave room in the buffer for header and variable length field
uint16_t length = MQTT_MAX_HEADER_SIZE;
length = writeString(topic,buffer,length);
// Add payload
uint16_t i;
for (i=0;i<plength;i++) {
buffer[length++] = payload[i];
}
// Write the header
uint8_t header = MQTTPUBLISH;
if (retained) {
header |= 1;