switch to MQTT 3.1.1 by default

This commit is contained in:
ladyada 2015-10-20 23:51:03 -04:00
parent 9fa0c54fce
commit 15713af468
2 changed files with 8 additions and 1 deletions

View File

@ -287,7 +287,13 @@ uint8_t Adafruit_MQTT::connectPacket(uint8_t *packet) {
p+=2; p+=2;
// fill in packet[1] last // fill in packet[1] last
#if (MQTT_PROTOCOL_LEVEL == 4)
p = stringprint_P(p, PSTR("MQTT"));
#elif (MQTT_PROTOCOL_LEVEL == 3)
p = stringprint_P(p, PSTR("MQIsdp")); p = stringprint_P(p, PSTR("MQIsdp"));
#else
#error "No MQTT version selected!"
#endif
p[0] = MQTT_PROTOCOL_LEVEL; p[0] = MQTT_PROTOCOL_LEVEL;
p++; p++;

View File

@ -45,7 +45,8 @@
#define DEBUG_PRINTBUFFER(buffer, len) {} #define DEBUG_PRINTBUFFER(buffer, len) {}
#endif #endif
#define MQTT_PROTOCOL_LEVEL 3 // Use 3 (MQTT 3.0) or 4 (MQTT 3.1.1)
#define MQTT_PROTOCOL_LEVEL 4
#define MQTT_CTRL_CONNECT 0x01 #define MQTT_CTRL_CONNECT 0x01
#define MQTT_CTRL_CONNECTACK 0x02 #define MQTT_CTRL_CONNECTACK 0x02