mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
Extend application message builder.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -103,6 +104,16 @@ namespace MQTTnet
|
||||
return this;
|
||||
}
|
||||
|
||||
public MqttApplicationMessageBuilder WithQualityOfServiceLevel(int qualityOfServiceLevel)
|
||||
{
|
||||
if (qualityOfServiceLevel < 0 || qualityOfServiceLevel > 2)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(qualityOfServiceLevel));
|
||||
}
|
||||
|
||||
return WithQualityOfServiceLevel((MqttQualityOfServiceLevel)qualityOfServiceLevel);
|
||||
}
|
||||
|
||||
public MqttApplicationMessageBuilder WithRetainFlag(bool value = true)
|
||||
{
|
||||
_retain = value;
|
||||
|
||||
Reference in New Issue
Block a user