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