From dd1f802390cf0f6139fc4f80457e373bb4e09a95 Mon Sep 17 00:00:00 2001 From: iioter <535915157@qq.com> Date: Wed, 9 Nov 2022 09:48:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3thingsboard=20PubAck=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plugins/Plugin/MyMqttClient.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Plugin/MyMqttClient.cs b/Plugins/Plugin/MyMqttClient.cs index 79d5f83..9d5c167 100644 --- a/Plugins/Plugin/MyMqttClient.cs +++ b/Plugins/Plugin/MyMqttClient.cs @@ -264,7 +264,7 @@ namespace Plugin await Client.PublishAsync(new MqttApplicationMessageBuilder() .WithTopic(_tbRpcTopic) .WithPayload(JsonConvert.SerializeObject(tBRpcResponse)) - .WithQualityOfServiceLevel(MqttQualityOfServiceLevel.ExactlyOnce).Build()); + .WithQualityOfServiceLevel(MqttQualityOfServiceLevel.AtMostOnce).Build()); } private async Task ResponseTcRpcAsync(TCRpcRequest tCRpcResponse) @@ -320,7 +320,7 @@ namespace Plugin { if (Client.IsConnected) return Client.PublishAsync(new MqttApplicationMessageBuilder() - .WithTopic($"devices/{deviceName}/attributes").WithPayload(JsonConvert.SerializeObject(obj)) + .WithTopic($"devices/{deviceName}/attributes").WithPayload(JsonConvert.SerializeObject(obj)).WithQualityOfServiceLevel(MqttQualityOfServiceLevel.AtMostOnce) .Build()); } catch (Exception ex) @@ -522,7 +522,7 @@ namespace Plugin case IoTPlatformType.ThingsBoard: await Client.PublishAsync(new MqttApplicationMessageBuilder().WithTopic("v1/gateway/telemetry") .WithPayload(JsonConvert.SerializeObject(sendModel)) - .WithQualityOfServiceLevel(MqttQualityOfServiceLevel.ExactlyOnce).Build()); + .WithQualityOfServiceLevel(MqttQualityOfServiceLevel.AtMostOnce).Build()); break; case IoTPlatformType.IoTSharp: foreach (var payload in sendModel[device.DeviceName])