Deleted extraneous code
This commit is contained in:
parent
67092945e6
commit
e65f9b446e
@ -534,35 +534,7 @@ uint8_t Adafruit_MQTT::publishPacket(uint8_t *packet, const char *topic,
|
||||
const char *data, uint8_t qos) {
|
||||
|
||||
return publishPacket(packet, topic, (uint8_t*)(data), strlen(data), qos);
|
||||
/*
|
||||
uint8_t *p = packet;
|
||||
uint16_t len;
|
||||
|
||||
p[0] = MQTT_CTRL_PUBLISH << 4 | qos << 1;
|
||||
// fill in packet[1] last
|
||||
p+=2;
|
||||
|
||||
// topic comes before packet identifier
|
||||
p = stringprint_P(p, topic);
|
||||
|
||||
// add packet identifier. used for checking PUBACK in QOS > 0
|
||||
if(qos > 0) {
|
||||
p[0] = (packet_id_counter >> 8) & 0xFF;
|
||||
p[1] = packet_id_counter & 0xFF;
|
||||
p+=2;
|
||||
|
||||
// increment the packet id
|
||||
packet_id_counter++;
|
||||
}
|
||||
|
||||
memmove(p, data, strlen(data));
|
||||
p+=strlen(data);
|
||||
len = p - packet;
|
||||
packet[1] = len-2; // don't include the 2 bytes of fixed header data
|
||||
DEBUG_PRINTLN(F("MQTT publish packet:"));
|
||||
DEBUG_PRINTBUFFER(buffer, len);
|
||||
return len;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user