mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-22 11:33:07 +08:00
Compare commits
3 Commits
10.11.117.
...
10.12.1.0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
21838bf4af | ||
![]() |
6090108597 | ||
![]() |
b47b9e6f43 |
@@ -1,9 +1,9 @@
|
||||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<PluginVersion>10.11.117</PluginVersion>
|
||||
<ProPluginVersion>10.11.117</ProPluginVersion>
|
||||
<DefaultVersion>10.11.117</DefaultVersion>
|
||||
<PluginVersion>10.12.1</PluginVersion>
|
||||
<ProPluginVersion>10.12.1</ProPluginVersion>
|
||||
<DefaultVersion>10.12.1</DefaultVersion>
|
||||
<AuthenticationVersion>10.11.6</AuthenticationVersion>
|
||||
<SourceGeneratorVersion>10.11.6</SourceGeneratorVersion>
|
||||
<NET8Version>8.0.21</NET8Version>
|
||||
|
@@ -8,6 +8,8 @@
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using PooledAwait;
|
||||
|
||||
using ThingsGateway.Foundation.Extension.String;
|
||||
|
||||
using TouchSocket.SerialPorts;
|
||||
@@ -26,65 +28,33 @@ public static class ChannelOptionsExtensions
|
||||
/// <param name="e">接收数据</param>
|
||||
/// <param name="funcs">事件</param>
|
||||
/// <returns></returns>
|
||||
internal static ValueTask OnChannelReceivedEvent(
|
||||
this IClientChannel clientChannel,
|
||||
ReceivedDataEventArgs e,
|
||||
ChannelReceivedEventHandler funcs)
|
||||
internal static ValueTask OnChannelReceivedEvent(this IClientChannel clientChannel, ReceivedDataEventArgs e, ChannelReceivedEventHandler funcs)
|
||||
{
|
||||
clientChannel.ThrowIfNull(nameof(IClientChannel));
|
||||
e.ThrowIfNull(nameof(ReceivedDataEventArgs));
|
||||
funcs.ThrowIfNull(nameof(ChannelReceivedEventHandler));
|
||||
|
||||
if (funcs.Count == 0) return EasyValueTask.CompletedTask;
|
||||
return OnChannelReceivedEvent(clientChannel, e, funcs);
|
||||
|
||||
return InvokeHandlersSequentially(clientChannel, e, funcs);
|
||||
}
|
||||
|
||||
private static ValueTask InvokeHandlersSequentially(
|
||||
IClientChannel clientChannel, ReceivedDataEventArgs e, ChannelReceivedEventHandler funcs)
|
||||
{
|
||||
var enumerator = new HandlerEnumerator(clientChannel, e, funcs);
|
||||
return enumerator.MoveNextAsync();
|
||||
}
|
||||
|
||||
private struct HandlerEnumerator
|
||||
{
|
||||
private readonly IClientChannel _channel;
|
||||
private readonly ReceivedDataEventArgs _e;
|
||||
private readonly ChannelReceivedEventHandler _funcs;
|
||||
private int _index;
|
||||
|
||||
public HandlerEnumerator(IClientChannel channel, ReceivedDataEventArgs e, ChannelReceivedEventHandler funcs)
|
||||
static async PooledValueTask OnChannelReceivedEvent(IClientChannel clientChannel, ReceivedDataEventArgs e, ChannelReceivedEventHandler funcs)
|
||||
{
|
||||
_channel = channel;
|
||||
_e = e;
|
||||
_funcs = funcs;
|
||||
_index = -1;
|
||||
}
|
||||
|
||||
public ValueTask MoveNextAsync()
|
||||
{
|
||||
_index++;
|
||||
if (_index >= _funcs.Count) return default;
|
||||
|
||||
var func = _funcs[_index];
|
||||
if (func == null) return MoveNextAsync();
|
||||
|
||||
bool isLast = _index == _funcs.Count - 1;
|
||||
var vt = func.Invoke(_channel, _e, isLast);
|
||||
if (vt.IsCompletedSuccessfully)
|
||||
if (funcs.Count > 0)
|
||||
{
|
||||
if (_e.Handled) return default;
|
||||
return MoveNextAsync();
|
||||
for (int i = 0; i < funcs.Count; i++)
|
||||
{
|
||||
var func = funcs[i];
|
||||
if (func == null) continue;
|
||||
var taskResult= func.Invoke(clientChannel, e, i == funcs.Count - 1);
|
||||
if(!taskResult.IsCompletedSuccessfully)
|
||||
{
|
||||
await taskResult.ConfigureAwait(false);
|
||||
}
|
||||
if (e.Handled)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return Awaited(vt);
|
||||
}
|
||||
|
||||
private async ValueTask Awaited(ValueTask vt)
|
||||
{
|
||||
await vt.ConfigureAwait(false);
|
||||
if (!_e.Handled)
|
||||
await MoveNextAsync().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -43,6 +43,16 @@ public struct OperResult<T> : IOperResult<T>
|
||||
Exception = operResult.Exception;
|
||||
ErrorType = operResult.ErrorType;
|
||||
}
|
||||
/// <summary>
|
||||
/// 从另一个操作对象中赋值信息
|
||||
/// </summary>
|
||||
public OperResult(OperResult operResult)
|
||||
{
|
||||
OperCode = operResult.OperCode;
|
||||
ErrorMessage = operResult.ErrorMessage;
|
||||
Exception = operResult.Exception;
|
||||
ErrorType = operResult.ErrorType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 传入错误信息
|
||||
@@ -162,7 +172,13 @@ public struct OperResult<T, T2> : IOperResult<T, T2>
|
||||
Exception = operResult.Exception;
|
||||
ErrorType = operResult.ErrorType;
|
||||
}
|
||||
|
||||
public OperResult(OperResult operResult)
|
||||
{
|
||||
OperCode = operResult.OperCode;
|
||||
ErrorMessage = operResult.ErrorMessage;
|
||||
Exception = operResult.Exception;
|
||||
ErrorType = operResult.ErrorType;
|
||||
}
|
||||
/// <summary>
|
||||
/// 传入错误信息
|
||||
/// </summary>
|
||||
@@ -275,7 +291,13 @@ public struct OperResult<T, T2, T3> : IOperResult<T, T2, T3>
|
||||
Exception = operResult.Exception;
|
||||
ErrorType = operResult.ErrorType;
|
||||
}
|
||||
|
||||
public OperResult(OperResult operResult)
|
||||
{
|
||||
OperCode = operResult.OperCode;
|
||||
ErrorMessage = operResult.ErrorMessage;
|
||||
Exception = operResult.Exception;
|
||||
ErrorType = operResult.ErrorType;
|
||||
}
|
||||
/// <summary>
|
||||
/// 传入错误信息
|
||||
/// </summary>
|
||||
@@ -389,7 +411,13 @@ public struct OperResult : IOperResult
|
||||
Exception = operResult.Exception;
|
||||
ErrorType = operResult.ErrorType;
|
||||
}
|
||||
|
||||
public OperResult(OperResult operResult)
|
||||
{
|
||||
OperCode = operResult.OperCode;
|
||||
ErrorMessage = operResult.ErrorMessage;
|
||||
Exception = operResult.Exception;
|
||||
ErrorType = operResult.ErrorType;
|
||||
}
|
||||
/// <summary>
|
||||
/// 传入错误信息
|
||||
/// </summary>
|
||||
|
@@ -380,7 +380,7 @@ public abstract partial class CollectBase : DriverBase
|
||||
if (cancellationToken.IsCancellationRequested) return;
|
||||
CancellationToken readToken = default;
|
||||
var readerLockTask = @this.ReadWriteLock.ReaderLockAsync(cancellationToken);
|
||||
if (!readerLockTask.IsCompleted)
|
||||
if (!readerLockTask.IsCompletedSuccessfully)
|
||||
{
|
||||
readToken = await readerLockTask.ConfigureAwait(false);
|
||||
}
|
||||
@@ -403,7 +403,7 @@ public abstract partial class CollectBase : DriverBase
|
||||
|
||||
OperResult<ReadOnlyMemory<byte>> readResult = default;
|
||||
var readTask = @this.ReadSourceAsync(variableSourceRead, allToken);
|
||||
if (!readTask.IsCompleted)
|
||||
if (!readTask.IsCompletedSuccessfully)
|
||||
{
|
||||
readResult = await readTask.ConfigureAwait(false);
|
||||
}
|
||||
@@ -435,7 +435,7 @@ public abstract partial class CollectBase : DriverBase
|
||||
//if (LogMessage?.LogLevel <= TouchSocket.Core.LogLevel.Trace)
|
||||
// LogMessage?.Trace(string.Format("{0} - Collecting [{1} - {2}]", DeviceName, variableSourceRead?.RegisterAddress, variableSourceRead?.Length));
|
||||
var readTask1 = @this.ReadSourceAsync(variableSourceRead, allToken);
|
||||
if (!readTask1.IsCompleted)
|
||||
if (!readTask1.IsCompletedSuccessfully)
|
||||
{
|
||||
readResult = await readTask1.ConfigureAwait(false);
|
||||
}
|
||||
@@ -490,195 +490,6 @@ public abstract partial class CollectBase : DriverBase
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// private ValueTask ReadVariableSource(object? state, CancellationToken cancellationToken)
|
||||
// {
|
||||
// var enumerator = new ReadVariableSourceEnumerator(this, state, cancellationToken);
|
||||
// return enumerator.MoveNextAsync();
|
||||
// }
|
||||
|
||||
// private struct ReadVariableSourceEnumerator
|
||||
// {
|
||||
// private readonly CollectBase _owner;
|
||||
// private readonly object? _state;
|
||||
// private readonly CancellationToken _cancellationToken;
|
||||
|
||||
// private VariableSourceRead _variableSourceRead;
|
||||
// private CancellationToken _readToken;
|
||||
// private CancellationToken _allToken;
|
||||
// private OperResult<ReadOnlyMemory<byte>> _readResult;
|
||||
// private int _readErrorCount;
|
||||
// private ValueTask<CancellationToken> _readerLockTask;
|
||||
// private ValueTask<OperResult<ReadOnlyMemory<byte>>> _readTask;
|
||||
// private int _step;
|
||||
|
||||
// public ReadVariableSourceEnumerator(CollectBase owner, object? state, CancellationToken cancellationToken)
|
||||
// {
|
||||
// _owner = owner;
|
||||
// _state = state;
|
||||
// _cancellationToken = cancellationToken;
|
||||
|
||||
// _variableSourceRead = default!;
|
||||
// _readToken = default;
|
||||
// _allToken = default;
|
||||
// _readResult = default;
|
||||
// _readErrorCount = 0;
|
||||
// _readerLockTask = default;
|
||||
// _readTask = default;
|
||||
// _step = 0;
|
||||
// }
|
||||
|
||||
// public ValueTask MoveNextAsync()
|
||||
// {
|
||||
// switch (_step)
|
||||
// {
|
||||
// case 0:
|
||||
// if (_state is not VariableSourceRead vsr) return default;
|
||||
// _variableSourceRead = vsr;
|
||||
|
||||
// if (_owner.Pause) return default;
|
||||
// if (_cancellationToken.IsCancellationRequested) return default;
|
||||
|
||||
//#pragma warning disable CA2012 // 正确使用 ValueTask
|
||||
// _readerLockTask = _owner.ReadWriteLock.ReaderLockAsync(_cancellationToken);
|
||||
//#pragma warning restore CA2012 // 正确使用 ValueTask
|
||||
// if (!_readerLockTask.IsCompleted)
|
||||
// {
|
||||
// _step = 1;
|
||||
// return AwaitReaderLock();
|
||||
// }
|
||||
// _readToken = _readerLockTask.Result;
|
||||
// goto case 2;
|
||||
|
||||
// case 1:
|
||||
// _readToken = _readerLockTask.Result;
|
||||
// goto case 2;
|
||||
|
||||
// case 2:
|
||||
// if (_readToken.IsCancellationRequested)
|
||||
// {
|
||||
// return _owner.ReadVariableSource(_state, _cancellationToken);
|
||||
// }
|
||||
|
||||
// var allTokenSource = _owner._linkedCtsCache.GetLinkedTokenSource(_cancellationToken, _readToken);
|
||||
// _allToken = allTokenSource.Token;
|
||||
|
||||
//#pragma warning disable CA2012 // 正确使用 ValueTask
|
||||
// _readTask = _owner.ReadSourceAsync(_variableSourceRead, _allToken);
|
||||
//#pragma warning restore CA2012 // 正确使用 ValueTask
|
||||
// if (!_readTask.IsCompleted)
|
||||
// {
|
||||
// _step = 3;
|
||||
// return AwaitRead();
|
||||
// }
|
||||
// _readResult = _readTask.Result;
|
||||
// goto case 4;
|
||||
|
||||
// case 3:
|
||||
// _readResult = _readTask.Result;
|
||||
// goto case 4;
|
||||
|
||||
// case 4:
|
||||
// while (!_readResult.IsSuccess && _readErrorCount < _owner.CollectProperties.RetryCount)
|
||||
// {
|
||||
// if (_owner.Pause) return default;
|
||||
// if (_cancellationToken.IsCancellationRequested) return default;
|
||||
|
||||
// if (_readToken.IsCancellationRequested)
|
||||
// {
|
||||
// return _owner.ReadVariableSource(_state, _cancellationToken);
|
||||
// }
|
||||
|
||||
// _readErrorCount++;
|
||||
// if (_owner.LogMessage?.LogLevel <= TouchSocket.Core.LogLevel.Trace)
|
||||
// _owner.LogMessage?.Trace(string.Format("{0} - Collection [{1} - {2}] failed - {3}",
|
||||
// _owner.DeviceName, _variableSourceRead?.RegisterAddress, _variableSourceRead?.Length, _readResult.ErrorMessage));
|
||||
|
||||
//#pragma warning disable CA2012 // 正确使用 ValueTask
|
||||
// _readTask = _owner.ReadSourceAsync(_variableSourceRead, _allToken);
|
||||
//#pragma warning restore CA2012 // 正确使用 ValueTask
|
||||
// if (!_readTask.IsCompleted)
|
||||
// {
|
||||
// _step = 5;
|
||||
// return AwaitReadRetry();
|
||||
// }
|
||||
// _readResult = _readTask.Result;
|
||||
// }
|
||||
|
||||
// goto case 6;
|
||||
|
||||
// case 5:
|
||||
// _readResult = _readTask.Result;
|
||||
// _step = 4;
|
||||
// return MoveNextAsync();
|
||||
|
||||
// case 6:
|
||||
// if (_readResult.IsSuccess)
|
||||
// {
|
||||
// if (_owner.LogMessage?.LogLevel <= TouchSocket.Core.LogLevel.Trace)
|
||||
// _owner.LogMessage?.Trace(string.Format("{0} - Collection [{1} - {2}] data succeeded {3}",
|
||||
// _owner.DeviceName, _variableSourceRead?.RegisterAddress, _variableSourceRead?.Length, _readResult.Content.Span.ToHexString(' ')));
|
||||
|
||||
// _owner.CurrentDevice.SetDeviceStatus(TimerX.Now, null);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (_cancellationToken.IsCancellationRequested) return default;
|
||||
// if (_readToken.IsCancellationRequested)
|
||||
// {
|
||||
// return _owner.ReadVariableSource(_state, _cancellationToken);
|
||||
// }
|
||||
|
||||
// if (_variableSourceRead.LastErrorMessage != _readResult.ErrorMessage)
|
||||
// {
|
||||
// if (!_cancellationToken.IsCancellationRequested)
|
||||
// _owner.LogMessage?.LogWarning(_readResult.Exception, string.Format(AppResource.CollectFail, _owner.DeviceName,
|
||||
// _variableSourceRead?.RegisterAddress, _variableSourceRead?.Length, _readResult.ErrorMessage));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (!_cancellationToken.IsCancellationRequested && _owner.LogMessage?.LogLevel <= TouchSocket.Core.LogLevel.Trace)
|
||||
// _owner.LogMessage?.Trace(string.Format("{0} - Collection [{1} - {2}] data failed - {3}",
|
||||
// _owner.DeviceName, _variableSourceRead?.RegisterAddress, _variableSourceRead?.Length, _readResult.ErrorMessage));
|
||||
// }
|
||||
|
||||
// _variableSourceRead.LastErrorMessage = _readResult.ErrorMessage;
|
||||
// _owner.CurrentDevice.SetDeviceStatus(TimerX.Now, null, _readResult.ErrorMessage);
|
||||
// var time = DateTime.Now;
|
||||
// foreach (var item in _variableSourceRead.VariableRuntimes)
|
||||
// {
|
||||
// item.SetValue(null, time, isOnline: false);
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
|
||||
// return default;
|
||||
// }
|
||||
|
||||
// private async ValueTask AwaitReaderLock()
|
||||
// {
|
||||
// await _readerLockTask.ConfigureAwait(false);
|
||||
// _step = 1;
|
||||
// await MoveNextAsync().ConfigureAwait(false);
|
||||
// }
|
||||
|
||||
// private async ValueTask AwaitRead()
|
||||
// {
|
||||
// await _readTask.ConfigureAwait(false);
|
||||
// _step = 3;
|
||||
// await MoveNextAsync().ConfigureAwait(false);
|
||||
// }
|
||||
|
||||
// private async ValueTask AwaitReadRetry()
|
||||
// {
|
||||
// await _readTask.ConfigureAwait(false);
|
||||
// _step = 5;
|
||||
// await MoveNextAsync().ConfigureAwait(false);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
@@ -172,7 +172,7 @@ public abstract class CollectFoundationBase : CollectBase
|
||||
// 从协议读取数据
|
||||
OperResult<ReadOnlyMemory<byte>> read = default;
|
||||
var readTask = @this.FoundationDevice.ReadAsync(variableSourceRead.AddressObject, cancellationToken);
|
||||
if (!readTask.IsCompleted)
|
||||
if (!readTask.IsCompletedSuccessfully)
|
||||
{
|
||||
read = await readTask.ConfigureAwait(false);
|
||||
}
|
||||
@@ -200,116 +200,6 @@ public abstract class CollectFoundationBase : CollectBase
|
||||
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// 采集驱动读取,读取成功后直接赋值变量,失败不做处理,注意非通用设备需重写
|
||||
///// </summary>
|
||||
// protected override ValueTask<OperResult<ReadOnlyMemory<byte>>> ReadSourceAsync(VariableSourceRead variableSourceRead, CancellationToken cancellationToken)
|
||||
// {
|
||||
// if (cancellationToken.IsCancellationRequested)
|
||||
// return new ValueTask<OperResult<ReadOnlyMemory<byte>>>( new OperResult<ReadOnlyMemory<byte>>(new OperationCanceledException()));
|
||||
|
||||
// // 值类型状态机
|
||||
// var stateMachine = new ReadSourceStateMachine(this, variableSourceRead, cancellationToken);
|
||||
// return stateMachine.MoveNextAsync();
|
||||
// }
|
||||
|
||||
// private struct ReadSourceStateMachine
|
||||
// {
|
||||
// private readonly VariableSourceRead _variableSourceRead;
|
||||
// private readonly CancellationToken _cancellationToken;
|
||||
// private readonly CollectFoundationBase _owner;
|
||||
// private OperResult<ReadOnlyMemory<byte>> _result;
|
||||
// private ValueTask<OperResult<ReadOnlyMemory<byte>>> _readTask;
|
||||
|
||||
// public ReadSourceStateMachine(CollectFoundationBase owner, VariableSourceRead variableSourceRead, CancellationToken cancellationToken)
|
||||
// {
|
||||
// _owner = owner;
|
||||
// _variableSourceRead = variableSourceRead;
|
||||
// _cancellationToken = cancellationToken;
|
||||
// _result = default;
|
||||
// State = 0;
|
||||
// }
|
||||
|
||||
// public int State { get; private set; }
|
||||
|
||||
// public ValueTask<OperResult<ReadOnlyMemory<byte>>> MoveNextAsync()
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// switch (State)
|
||||
// {
|
||||
// case 0:
|
||||
// // 异步读取
|
||||
// if (_cancellationToken.IsCancellationRequested)
|
||||
// {
|
||||
// _result = new OperResult<ReadOnlyMemory<byte>>(new OperationCanceledException());
|
||||
// return new ValueTask<OperResult<ReadOnlyMemory<byte>>>(_result);
|
||||
// }
|
||||
|
||||
//#pragma warning disable CA2012 // 正确使用 ValueTask
|
||||
// _readTask = _owner.FoundationDevice.ReadAsync(_variableSourceRead.AddressObject, _cancellationToken);
|
||||
//#pragma warning restore CA2012 // 正确使用 ValueTask
|
||||
|
||||
// // 检查是否任务已完成
|
||||
// if (_readTask.IsCompleted)
|
||||
// {
|
||||
// _result = _readTask.Result;
|
||||
// State = 1;
|
||||
// return MoveNextAsync();
|
||||
// }
|
||||
|
||||
// // 如果任务尚未完成,继续等待
|
||||
// State = 2;
|
||||
// return Awaited(_readTask);
|
||||
|
||||
// case 1:
|
||||
// // 解析结构化内容
|
||||
// if (_result.IsSuccess)
|
||||
// {
|
||||
// var parsedResult = _variableSourceRead.VariableRuntimes.PraseStructContent(_owner.FoundationDevice, _result.Content.Span, false);
|
||||
// return new ValueTask<OperResult<ReadOnlyMemory<byte>>>(new OperResult<ReadOnlyMemory<byte>>(parsedResult));
|
||||
// }
|
||||
|
||||
// return new ValueTask<OperResult<ReadOnlyMemory<byte>>>(_result);
|
||||
|
||||
// case 2:
|
||||
// // 完成任务后,解析内容
|
||||
// _result = _readTask.Result;
|
||||
|
||||
// if (_result.IsSuccess)
|
||||
// {
|
||||
// var parsedResult = _variableSourceRead.VariableRuntimes.PraseStructContent(_owner.FoundationDevice, _result.Content.Span, false);
|
||||
// return new ValueTask<OperResult<ReadOnlyMemory<byte>>>(new OperResult<ReadOnlyMemory<byte>>(parsedResult));
|
||||
// }
|
||||
|
||||
// return new ValueTask<OperResult<ReadOnlyMemory<byte>>>(_result);
|
||||
|
||||
// default:
|
||||
// throw new InvalidOperationException("Unexpected state.");
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// return new ValueTask<OperResult<ReadOnlyMemory<byte>>>(new OperResult<ReadOnlyMemory<byte>>(ex));
|
||||
// }
|
||||
// }
|
||||
|
||||
// private async ValueTask<OperResult<ReadOnlyMemory<byte>>> Awaited(ValueTask<OperResult<ReadOnlyMemory<byte>>> vt)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
|
||||
|
||||
// await vt.ConfigureAwait(false);
|
||||
// return await MoveNextAsync().ConfigureAwait(false);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// return new OperResult<ReadOnlyMemory<byte>>(ex);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// 批量写入变量值,需返回变量名称/结果,注意非通用设备需重写
|
||||
/// </summary>
|
||||
|
@@ -1,14 +1,4 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||
// 使用文档:https://thingsgateway.cn/
|
||||
// QQ群:605534569
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ThingsGateway.Foundation.Modbus;
|
||||
namespace ThingsGateway.Foundation.Modbus;
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
|
@@ -558,7 +558,7 @@ public class ModbusSlave : DeviceBase, IModbusAddress
|
||||
}
|
||||
}
|
||||
|
||||
private static bool TryParseRequest(object requestInfo, out ModbusRequest modbusRequest, out ReadOnlySequence<byte> sequences, out bool modbusRtu)
|
||||
private static bool TryParseRequest(IRequestInfo requestInfo, out ModbusRequest modbusRequest, out ReadOnlySequence<byte> sequences, out bool modbusRtu)
|
||||
{
|
||||
modbusRequest = default;
|
||||
sequences = default;
|
||||
|
@@ -10,7 +10,7 @@
|
||||
},
|
||||
|
||||
"RemoteServerManagement": {
|
||||
"Enable": true,
|
||||
"Enable": false,
|
||||
"Name": "ThingsGateway",
|
||||
"ServerUri": "0.0.0.0:8399",
|
||||
"VerifyToken": "ThingsGateway",
|
||||
|
Reference in New Issue
Block a user