compile fix & #ifdef the MQTT version
This commit is contained in:
parent
9a11d83cf5
commit
286245ab62
@ -84,6 +84,7 @@ Adafruit_MQTT::Adafruit_MQTT(const char *server, uint16_t port,
|
||||
subscriptions[i] = 0;
|
||||
}
|
||||
|
||||
packet_id_counter = 0;
|
||||
}
|
||||
|
||||
Adafruit_MQTT::Adafruit_MQTT(const __FlashStringHelper *server,
|
||||
@ -103,6 +104,7 @@ Adafruit_MQTT::Adafruit_MQTT(const __FlashStringHelper *server,
|
||||
subscriptions[i] = 0;
|
||||
}
|
||||
|
||||
packet_id_counter = 0;
|
||||
}
|
||||
|
||||
int8_t Adafruit_MQTT::connect() {
|
||||
@ -355,10 +357,13 @@ uint8_t Adafruit_MQTT::connectPacket(uint8_t *packet) {
|
||||
p+=2;
|
||||
// fill in packet[1] last
|
||||
|
||||
if(MQTT_PROTOCOL_LEVEL == 3)
|
||||
#if MQTT_PROTOCOL_LEVEL == 3
|
||||
p = stringprint_P(p, PSTR("MQIsdp"));
|
||||
else
|
||||
#elif MQTT_PROTOCOL_LEVEL == 4
|
||||
p = stringprint_P(p, PSTR("MQTT"));
|
||||
#else
|
||||
#error "MQTT level not supported"
|
||||
#endif
|
||||
|
||||
p[0] = MQTT_PROTOCOL_LEVEL;
|
||||
p++;
|
||||
|
@ -201,7 +201,7 @@ class Adafruit_MQTT {
|
||||
uint8_t will_qos;
|
||||
uint8_t will_retain;
|
||||
uint8_t buffer[MAXBUFFERSIZE]; // one buffer, used for all incoming/outgoing
|
||||
uint16_t packet_id_counter = 0;
|
||||
uint16_t packet_id_counter;
|
||||
|
||||
private:
|
||||
Adafruit_MQTT_Subscribe *subscriptions[MAXSUBSCRIPTIONS];
|
||||
|
Loading…
Reference in New Issue
Block a user