Wisdom.Utils.Driver
1.2.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Wisdom.Utils.Driver --version 1.2.0
NuGet\Install-Package Wisdom.Utils.Driver -Version 1.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Wisdom.Utils.Driver" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Wisdom.Utils.Driver --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Wisdom.Utils.Driver, 1.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Wisdom.Utils.Driver as a Cake Addin #addin nuget:?package=Wisdom.Utils.Driver&version=1.2.0 // Install Wisdom.Utils.Driver as a Cake Tool #tool nuget:?package=Wisdom.Utils.Driver&version=1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
项目介绍
一个通讯框架,支持串口和网口,内置Modbus和Fins协议,旨在让开发者关注协议本身,而不必维护通讯的细节。
1. 抽象了通讯方式
不用编写通讯方面的代码,通过配置选择串口或者网口通讯,例如串口设备增加了串口服务器变成网口通讯的情况。
2. 封装了通讯流程
可指定超时时间、重试次数,自动处理发送和接收同步的问题,带有收发日志和事件上报。
3. 应答报文的完整性检查
可选择固定长度的应答、使用指定的长度字节来判断、以固定标志结尾、等待固定时间或者没有应答。
4. 校验方式
可选择校验和、异或校验、CRC16,支持自定义扩展。
5. 驱动与协议分离
一个驱动下可以使用不同的协议,例如读取和设置命令返回的报文格式不同的情况。
6. 内嵌常用协议
内置Modbus和Fins驱动。另外,依赖此框架开发的DLT645驱动是独立的项目,不在此项目中。
版本更新说明
[1.2.0]
- 网口通讯可指定本地端口。
- 网口通讯可指定Connect的超时时间,默认3秒。原来采用系统的超时时间比较长且不可控。
[1.1.1]
- 应答检查器传null的时候,原来的逻辑是收到任何一个包就返回给上层,改为一直收等到超时时间再一起返回给上层
- 修改OnReportMessage事件,改为传递byte类型
[1.1.0]
- 一个驱动可以使用多个协议,在Call函数内通过protocalName参数指定
- 网口连接改为使用同步方式,如果连接不上,则直接报错
- IMessage的Command属性,由单字节改为字节数组,兼容命令字节为多个的情况
- IMessage增加FirstAddress和FirstCommand属性
- IDriver增加OnReportMessage事件,在收发报文、建立连接、断开连接时会触发该事件
[1.0.9(未发布)]
- 重构应答检查器,分成长度检查器(ILenthChecker)和前导报文检查器(ILeadChecker)
- ILeadChecker支持循环检查(例如用于645规约,有的厂家只返回一个FE,之前的逻辑是要么没有,要么4个FE)
- 将应答检查器从IProtocal中拿到外面,在Driver的构造函数中传入
[1.0.8]
- 为了更好的兼容性,framework降至4.0
- 解决BUG:FixedEndChecker在使用多个字节作为结尾,并且结尾的字节分包到达时,没有合并判断的问题
- DataLengthChecker更名为VariableLengthChecker
- VariableLengthChecker兼容多个长度字节的情况,并且可以选择高位在前或者低位在前
[1.0.7]
- 解决BUG:代码混淆后,日志错位的问题
[1.0.6]
- 解决BUG:FixedEndChecker在使用1个字节作为结尾时,返回的报文不完整的问题
[1.0.5]
- 增加一种长度检查器(FixedEndChecker),用于以固定标志作为应答结尾的协议
- 使用空的长度检查器时,只要收到报文,就立即返回给上层,并停止接收(之前是一直等待到超时,并不返回上层)
- Call方法增加一个重载,可以不传地址和控制符,直接传字符串类型的数据域
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- Wisdom.Utils (>= 1.2.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Wisdom.Utils.Driver:
Package | Downloads |
---|---|
Wisdom.Drivers.Meters
电能表驱动,兼容645和698协议。 |
|
Wisdom.Utils.Driver.Server
Wisdom.Utils.Driver库的扩展包,驱动作为tcp服务端时使用 |
|
Wisdom.Drivers.Hipots
耐压仪驱动 |
|
Wisdom.Protocols.Dlt645
Dlt645协议 |
|
Wisdom.Protocols.Oop698
698协议 |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.1.5 | 2,942 | 5/22/2020 |
3.1.4 | 642 | 5/21/2020 |
3.1.3.1 | 642 | 5/15/2020 |
3.1.3 | 632 | 5/15/2020 |
3.1.2 | 1,170 | 4/16/2020 |
3.1.1 | 943 | 3/31/2020 |
3.1.0 | 525 | 3/30/2020 |
3.0.0 | 2,118 | 12/23/2019 |
3.0.0-rc1 | 617 | 12/12/2019 |
2.1.3 | 1,235 | 10/30/2019 |
2.1.2 | 2,208 | 9/23/2019 |
2.1.1 | 2,955 | 8/10/2019 |
2.1.0-rc1 | 1,063 | 7/17/2019 |
2.0.9 | 768 | 5/13/2019 |
2.0.8.1 | 635 | 4/24/2019 |
2.0.7.1 | 580 | 4/14/2019 |
2.0.5 | 623 | 4/3/2019 |
2.0.4.1 | 633 | 3/19/2019 |
1.3.1 | 630 | 3/5/2019 |
1.2.0 | 655 | 2/24/2019 |
1.1.1 | 1,029 | 3/20/2018 |
[1.2.0]
1. 网口通讯可指定本地端口。
2. 网口通讯可指定Connect的超时时间,默认3秒。原来采用系统的超时时间比较长且不可控。