From e4e503c97b5fedb651784382e75e4b4744811bbd Mon Sep 17 00:00:00 2001 From: Diego <2248356998@qq.com> Date: Thu, 3 Jul 2025 12:43:51 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E6=B7=BB=E5=8A=A0nuget.config?= =?UTF-8?q?=EF=BC=8C=E8=87=AA=E5=AE=9A=E4=B9=89nuget=E6=BA=90=EF=BC=8C?= =?UTF-8?q?=E6=96=B9=E4=BE=BF=E6=9C=AC=E5=9C=B0=E8=B0=83=E8=AF=95=E8=87=AA?= =?UTF-8?q?=E8=A1=8C=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Directory.Build.props | 2 +- src/NuGet.Config | 6 ++++++ .../SiemensS7Test.cs | 10 ++++++--- .../MqttClient/MqttClient.cs | 21 ++++++++++++++----- src/Version.props | 2 +- 5 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 src/NuGet.Config diff --git a/src/Directory.Build.props b/src/Directory.Build.props index e45f4a2dd..20ad19492 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,7 +1,7 @@ - 10.9.14 + 10.9.15 10.9.14 2.9.5 10.9.5 diff --git a/src/NuGet.Config b/src/NuGet.Config new file mode 100644 index 000000000..427555890 --- /dev/null +++ b/src/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/Plugin/ThingsGateway.Foundation.Test/SiemensS7Test.cs b/src/Plugin/ThingsGateway.Foundation.Test/SiemensS7Test.cs index e37ae4164..210ff2883 100644 --- a/src/Plugin/ThingsGateway.Foundation.Test/SiemensS7Test.cs +++ b/src/Plugin/ThingsGateway.Foundation.Test/SiemensS7Test.cs @@ -10,6 +10,8 @@ using ThingsGateway.Foundation.Extension.String; using ThingsGateway.Foundation.SiemensS7; +using ThingsGateway.NewLife.Extension; +using ThingsGateway.NewLife.Reflection; using TouchSocket.Core; @@ -20,7 +22,7 @@ public class SiemensS7Test [Theory] [InlineData("M100", true, "03 00 00 1B 02 F0 80 32 03 00 00 00 03 00 02 00 06 00 00 04 01 FF 04 00 10 00 00")] - [InlineData("M100", false, "03 00 00 16 02 F0 80 32 03 00 00 00 04 00 02 00 01 00 00 05 01 FF", "1", DataTypeEnum.UInt16)] + [InlineData("M100", false, "03 00 00 16 02 F0 80 32 03 00 00 00 03 00 02 00 01 00 00 05 01 FF", "1", DataTypeEnum.UInt16)] public async Task SiemensS7_ReadWrite_OK(string address, bool read, string data, string writeData = null, DataTypeEnum dataTypeEnum = DataTypeEnum.UInt16) { byte[] bytes = data.HexStringToBytes(); @@ -32,7 +34,7 @@ public class SiemensS7Test siemensS7Master.InitChannel(siemensS7Channel); await siemensS7Channel.SetupAsync(siemensS7Channel.Config); var adapter = siemensS7Channel.ReadOnlyDataHandlingAdapter as SingleStreamDataHandlingAdapter; - + await siemensS7Master.ConnectAsync(CancellationToken.None); var task1 = Task.Run(async () => { if (read) @@ -47,9 +49,11 @@ public class SiemensS7Test } }); - await Task.Delay(500); + await Task.Delay(100); + bytes[12] = (byte)(((IClientChannel)(siemensS7Master.Channel)).WaitHandlePool.GetValue("m_currentSign").ToInt()-1); var task2 = Task.Run(async () => { + await Task.Delay(100).ConfigureAwait(false); foreach (var item in bytes) { var data = new ByteBlock([item]); diff --git a/src/Plugin/ThingsGateway.Plugin.Mqtt/MqttClient/MqttClient.cs b/src/Plugin/ThingsGateway.Plugin.Mqtt/MqttClient/MqttClient.cs index fbf911f66..2b9f033cc 100644 --- a/src/Plugin/ThingsGateway.Plugin.Mqtt/MqttClient/MqttClient.cs +++ b/src/Plugin/ThingsGateway.Plugin.Mqtt/MqttClient/MqttClient.cs @@ -118,11 +118,22 @@ public partial class MqttClient : BusinessBaseWithCacheIntervalScript - { - f.WithTopic(string.Format(null, RpcTopic, _driverPropertys.RpcWriteTopic)); - }); + if(!_driverPropertys.BigTextScriptRpc.IsNullOrEmpty()) + { + mqttClientSubscribeOptionsBuilder = mqttClientSubscribeOptionsBuilder.WithTopicFilter( + f => + { + f.WithTopic(_driverPropertys.RpcWriteTopic); + }); + } + else + { + mqttClientSubscribeOptionsBuilder = mqttClientSubscribeOptionsBuilder.WithTopicFilter( + f => + { + f.WithTopic(string.Format(null, RpcTopic, _driverPropertys.RpcWriteTopic)); + }); + } } } if (!_driverPropertys.RpcQuestTopic.IsNullOrWhiteSpace()) diff --git a/src/Version.props b/src/Version.props index d45c6fdec..4bc8ed859 100644 --- a/src/Version.props +++ b/src/Version.props @@ -1,6 +1,6 @@ - 10.9.14 + 10.9.15