mirror of https://github.com/nymea/nymea-mqtt
Allow clients with protocol version 3.1.0 to connect to the server
parent
44248e0223
commit
c2b6ad87f0
|
|
@ -34,6 +34,7 @@ namespace Mqtt {
|
|||
|
||||
enum Protocol {
|
||||
ProtocolUnknown = 0x00,
|
||||
Protocol310 = 0x03,
|
||||
Protocol311 = 0x04
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -280,8 +280,8 @@ void MqttServerPrivate::processPacket(const MqttPacket &packet, QTcpSocket *clie
|
|||
|
||||
MqttPacket response(MqttPacket::TypeConnack, packet.packetId());
|
||||
|
||||
if (packet.protocolLevel() != Mqtt::Protocol311) {
|
||||
qCWarning(dbgServer) << "This MQTT broker only supports Protocol version 3.1.1";
|
||||
if (packet.protocolLevel() != Mqtt::Protocol310 && packet.protocolLevel() != Mqtt::Protocol311) {
|
||||
qCWarning(dbgServer) << "This MQTT broker only supports Protocol version 3.1.0 and 3.1.1 but client is" << packet.protocolLevel();
|
||||
response.setConnectReturnCode(Mqtt::ConnectReturnCodeUnacceptableProtocolVersion);
|
||||
client->write(response.serialize());
|
||||
cleanupClient(client);
|
||||
|
|
|
|||
Loading…
Reference in New Issue