Add some comments

This commit is contained in:
Unknown 2017-11-16 11:45:33 -08:00
parent dddfffbe0c
commit 4fa0226cce

View File

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