Extend application message builder.

This commit is contained in:
Christian Kratky
2020-10-30 20:42:52 +01:00
parent f606a5996b
commit 3208045baa
@@ -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;