mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-15 00:15:15 +08:00
Set MaximumQoS properly.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
using System;
|
||||
using MQTTnet.Packets;
|
||||
using MQTTnet.Protocol;
|
||||
using MQTTnet.Server;
|
||||
|
||||
namespace MQTTnet.Formatter
|
||||
@@ -25,6 +26,7 @@ namespace MQTTnet.Formatter
|
||||
SubscriptionIdentifiersAvailable = true,
|
||||
SharedSubscriptionAvailable = false,
|
||||
TopicAliasMaximum = ushort.MaxValue,
|
||||
MaximumQoS = MqttQualityOfServiceLevel.ExactlyOnce,
|
||||
WildcardSubscriptionAvailable = true,
|
||||
|
||||
AuthenticationMethod = validatingConnectionEventArgs.AuthenticationMethod,
|
||||
@@ -32,7 +34,11 @@ namespace MQTTnet.Formatter
|
||||
AssignedClientIdentifier = validatingConnectionEventArgs.AssignedClientIdentifier,
|
||||
ReasonString = validatingConnectionEventArgs.ReasonString,
|
||||
ServerReference = validatingConnectionEventArgs.ServerReference,
|
||||
UserProperties = validatingConnectionEventArgs.ResponseUserProperties
|
||||
UserProperties = validatingConnectionEventArgs.ResponseUserProperties,
|
||||
|
||||
ResponseInformation = null,
|
||||
MaximumPacketSize = 0, // Unlimited,
|
||||
ReceiveMaximum = 0 // Unlimited
|
||||
};
|
||||
|
||||
return connAckPacket;
|
||||
|
||||
@@ -72,11 +72,11 @@ namespace MQTTnet.Formatter.V5
|
||||
|
||||
if (value == MqttQualityOfServiceLevel.AtLeastOnce)
|
||||
{
|
||||
Write(MqttPropertyId.MaximumQoS, true);
|
||||
Write(MqttPropertyId.MaximumQoS, 0x1);
|
||||
}
|
||||
else
|
||||
{
|
||||
Write(MqttPropertyId.MaximumQoS, false);
|
||||
Write(MqttPropertyId.MaximumQoS, 0x0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user