mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 19:58:57 +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.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -103,6 +104,16 @@ namespace MQTTnet
|
|||||||
return this;
|
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)
|
public MqttApplicationMessageBuilder WithRetainFlag(bool value = true)
|
||||||
{
|
{
|
||||||
_retain = value;
|
_retain = value;
|
||||||
|
|||||||
Reference in New Issue
Block a user