Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
Thick-Common
Commits
27a325f8
Commit
27a325f8
authored
Aug 13, 2021
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
还在写 flyad2021 的内核
parent
7ff61276
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
2112 additions
and
1 deletion
+2112
-1
FlyADBase.sln
Project.FLY.FlyADBase/FlyADBase.sln
+14
-0
FlyAd2021.cs
Project.FLY.FlyADBase/FlyAd2021/FlyAd2021.cs
+426
-0
FlyAd2021.csproj
Project.FLY.FlyADBase/FlyAd2021/FlyAd2021.csproj
+71
-0
FlyAd2021Base.cs
Project.FLY.FlyADBase/FlyAd2021/FlyAd2021Base.cs
+1161
-0
IFlyAd2021Base.cs
Project.FLY.FlyADBase/FlyAd2021/Inc/IFlyAd2021Base.cs
+254
-0
PackEventArgs.cs
Project.FLY.FlyADBase/FlyAd2021/PackEventArgs.cs
+26
-0
AssemblyInfo.cs
Project.FLY.FlyADBase/FlyAd2021/Properties/AssemblyInfo.cs
+36
-0
ProtocolCommon.cs
Project.FLY.FlyADBase/FlyAd2021/ProtocolCommon.cs
+87
-0
CRC.cs
Project.FLY.Misc/MISC/CRC.cs
+37
-1
No files found.
Project.FLY.FlyADBase/FlyADBase.sln
View file @
27a325f8
...
...
@@ -44,6 +44,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLY.Simulation.Calender.GuR
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLY.Simulation.Calender.GuRuiShiYe.UI", "FLY.Simulation.Calender.GuRuiShiYe.UI\FLY.Simulation.Calender.GuRuiShiYe.UI.csproj", "{517847E4-5708-4ACE-BDF0-BB2C4495136D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlyAd2021", "FlyAd2021\FlyAd2021.csproj", "{9521A8F9-7310-49B3-A951-594EFE9D3EF0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
...
...
@@ -242,6 +244,18 @@ Global
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Release|x86.ActiveCfg = Release|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Release|x86.Build.0 = Release|Any CPU
{9521A8F9-7310-49B3-A951-594EFE9D3EF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9521A8F9-7310-49B3-A951-594EFE9D3EF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9521A8F9-7310-49B3-A951-594EFE9D3EF0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{9521A8F9-7310-49B3-A951-594EFE9D3EF0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{9521A8F9-7310-49B3-A951-594EFE9D3EF0}.Debug|x86.ActiveCfg = Debug|Any CPU
{9521A8F9-7310-49B3-A951-594EFE9D3EF0}.Debug|x86.Build.0 = Debug|Any CPU
{9521A8F9-7310-49B3-A951-594EFE9D3EF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9521A8F9-7310-49B3-A951-594EFE9D3EF0}.Release|Any CPU.Build.0 = Release|Any CPU
{9521A8F9-7310-49B3-A951-594EFE9D3EF0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{9521A8F9-7310-49B3-A951-594EFE9D3EF0}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{9521A8F9-7310-49B3-A951-594EFE9D3EF0}.Release|x86.ActiveCfg = Release|Any CPU
{9521A8F9-7310-49B3-A951-594EFE9D3EF0}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
Project.FLY.FlyADBase/FlyAd2021/FlyAd2021.cs
0 → 100644
View file @
27a325f8
This diff is collapsed.
Click to expand it.
Project.FLY.FlyADBase/FlyAd2021/FlyAd2021.csproj
0 → 100644
View file @
27a325f8
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"15.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Import
Project=
"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition=
"Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
/>
<PropertyGroup>
<Configuration
Condition=
" '$(Configuration)' == '' "
>
Debug
</Configuration>
<Platform
Condition=
" '$(Platform)' == '' "
>
AnyCPU
</Platform>
<ProjectGuid>
{9521A8F9-7310-49B3-A951-594EFE9D3EF0}
</ProjectGuid>
<OutputType>
Library
</OutputType>
<AppDesignerFolder>
Properties
</AppDesignerFolder>
<RootNamespace>
FlyAd2021
</RootNamespace>
<AssemblyName>
FlyAd2021
</AssemblyName>
<TargetFrameworkVersion>
v4.6.1
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<Deterministic>
true
</Deterministic>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<OutputPath>
bin\Debug\
</OutputPath>
<DefineConstants>
DEBUG;TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "
>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\Release\
</OutputPath>
<DefineConstants>
TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"System.Xml.Linq"
/>
<Reference
Include=
"System.Data.DataSetExtensions"
/>
<Reference
Include=
"Microsoft.CSharp"
/>
<Reference
Include=
"System.Data"
/>
<Reference
Include=
"System.Net.Http"
/>
<Reference
Include=
"System.Xml"
/>
<Reference
Include=
"WindowsBase"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"FlyAd2021Base.cs"
/>
<Compile
Include=
"FlyAd2021.cs"
/>
<Compile
Include=
"Inc\IFlyAd2021Base.cs"
/>
<Compile
Include=
"PackEventArgs.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"ProtocolCommon.cs"
/>
</ItemGroup>
<ItemGroup>
<ProjectReference
Include=
"..\..\Project.FLY.Misc\MISC\Misc.csproj"
>
<Project>
{5ee61ac6-5269-4f0f-b8fa-4334fe4a678f}
</Project>
<Name>
Misc
</Name>
</ProjectReference>
<ProjectReference
Include=
"..\FlyADBase\FlyADBase.csproj"
>
<Project>
{dd8a6858-1261-49f7-86be-5ac5c3a0ec34}
</Project>
<Name>
FlyADBase
</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference
Include=
"Newtonsoft.Json"
>
<Version>
12.0.3
</Version>
</PackageReference>
<PackageReference
Include=
"PropertyChanged.Fody"
>
<Version>
3.3.1
</Version>
</PackageReference>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
</Project>
\ No newline at end of file
Project.FLY.FlyADBase/FlyAd2021/FlyAd2021Base.cs
0 → 100644
View file @
27a325f8
This diff is collapsed.
Click to expand it.
Project.FLY.FlyADBase/FlyAd2021/Inc/IFlyAd2021Base.cs
0 → 100644
View file @
27a325f8
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
FlyAd2021.Inc
{
/// <summary>
/// 实现基本的AD盒2021版 基本实现
/// </summary>
public
interface
IFlyAd2021Base
:
INotifyPropertyChanged
{
#
region
测量速度
bool
IsMeasuring
{
get
;
}
/// <summary>
/// 通讯速度 byte/s
/// </summary>
double
CommSpeed
{
get
;
}
/// <summary>
/// 传输速度 单位 pack/s
/// </summary>
double
PackSpeed
{
get
;
}
/// <summary>
/// 开始测量速度
/// </summary>
void
StartMeasure
();
/// <summary>
///结束测量速度
/// </summary>
void
StopMeasure
();
#
endregion
/// <summary>
/// 包出错次数
/// </summary>
int
ErrCnt
{
get
;
}
/// <summary>
/// 连接成功;
/// 当命令多次发送失败,IsConnected = false
/// </summary>
bool
IsConnected
{
get
;
}
/// <summary>
/// 在接收事件中调用;
/// 全部接收事件 及 超时事件也是在这里触发
/// </summary>
/// <param name="recBuf"></param>
void
RecMsg
(
byte
[]
recBuf
);
/// <summary>
/// 获取 发送队列 第1条msg
/// </summary>
/// <returns></returns>
byte
[]
GetSendMsg
();
/// <summary>
/// 数据推送事件
/// </summary>
event
PushDataEventHandler
PushDataEvent
;
#
region
IOComm
IO
指令
[
CallBack
(
typeof
(
UInt16
))]
void
GetIn
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
[
CallBack
(
typeof
(
UInt16
))]
void
GetOut
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
[
CallBack
(
typeof
(
Int32
))]
void
GetEnc1
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
[
CallBack
(
typeof
(
Int32
))]
void
GetEnc2
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
[
CallBack
(
typeof
(
GetEncAll_Reponse
))]
void
GetEncAll
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
SetOutPorts
(
UInt16
mask
,
UInt16
value
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
#
endregion
#
region
RunComm
运行指令
SetRunParam
void
SetRunParamV
(
UInt32
velocity
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
SetRunParamSV
(
UInt32
sv
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
SetRunParamAccTime
(
UInt32
accTime
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
SetRunParamDecTime
(
UInt32
decTime
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
SetRunParamHSpd1
(
UInt32
homespd1
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
SetRunParamHSpd2
(
UInt32
homespd2
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
#
endregion
#
region
RunComm
运行指令
GetRunParam
void
GetRunParamV
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
GetRunParamSV
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
GetRunParamAccTime
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
GetRunParamDecTime
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
GetRunParamHSpd1
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
GetRunParamHSpd2
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
#
endregion
#
region
RunComm
运行指令
[
CallBack
(
typeof
(
GetRunResult_Reponse
))]
void
GetRunResult
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
Forw
(
Int32
serial
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
Backw
(
Int32
serial
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
Org
(
Int32
serial
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
RunTo
(
Int32
serial
,
int
targetPos
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
Stop
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
EStop
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
#
endregion
#
region
同步运行指令
void
SyncRun_SetHShift
(
int
hShift
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
SyncRun_SetVShift
(
int
vOShift
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
SyncRun_Start
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
SyncRun_Stop
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
void
SyncRun_Clear
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
/// <summary>
/// 同步扫描至;
/// D+0xE0+开始主轴位置+结束主轴位置+结束横向脉冲位置(逻辑位置)+脉冲开关(1B)+命令识标号(4B)
/// </summary>
/// <param name="pos2_begin"></param>
/// <param name="pos2_end"></param>
/// <param name="pos1lc"></param>
/// <param name="hasDataGrid"></param>
/// <param name="marker"></param>
void
SyncRun_RunAtLC
(
int
pos2_begin
,
int
pos2_end
,
int
pos1lc
,
UInt32
serial
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
/// <summary>
/// 位于队列头时运行,归零;
/// D+0xE1+命令识标号(4B)
/// </summary>
/// <param name="marker"></param>
void
SyncRun_Origin
(
UInt32
serial
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
/// <summary>
/// 位于队列头时运行,以速度运行至物理位置;
/// D+0xE2+横向脉冲位置(4B:int32,物理位置)+速度(4B:int32)+脉冲开关(1B)+命令识标号(4B)
/// </summary>
/// <param name="pos1"></param>
/// <param name="velocity"></param>
/// <param name="hasDataGrid"></param>
/// <param name="marker"></param>
void
SyncRun_RunTo
(
int
pos1
,
UInt32
velocity
,
UInt32
serial
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
/// <summary>
/// 位于队列头时运行,以速度运行至逻辑位置;
/// D+0xE3+横向脉冲位置(4B:int32,逻辑位置)+速度(4B:int32)+脉冲开关(1B)+命令识标号(4B)
/// </summary>
/// <param name="pos1lc"></param>
/// <param name="velocity"></param>
/// <param name="hasDataGrid"></param>
/// <param name="marker"></param>
void
SyncRun_RunToLC
(
int
pos1lc
,
UInt32
velocity
,
UInt32
serial
,
CallBackHandler
asyncDelegate
,
object
asyncContext
);
/// <summary>
/// 获取队列长度
/// </summary>
/// <param name="asyncDelegate"></param>
/// <param name="asyncContext"></param>
void
SyncRun_GetListCount
(
CallBackHandler
asyncDelegate
,
object
asyncContext
);
#
endregion
#
region
SysParamComm
系统参数指令
//[CallBack(typeof(UInt32))]
//void GetSysTick(CallBackHandler asyncDelegate, object asyncContext);
//void InitArea0()
#
endregion
#
region
GetSysParam
读运行参数
#
endregion
#
region
SetSysParam
设置运行参数
#
endregion
}
public
class
PushDataEventArgs
:
EventArgs
{
public
byte
SysTick
{
get
;
set
;
}
public
UInt16
AD
{
get
;
set
;
}
public
UInt16
?
ENC1
{
get
;
set
;
}
public
UInt16
?
ENC2
{
get
;
set
;
}
public
UInt16
?
In
{
get
;
set
;
}
public
UInt16
?
InChange
{
get
;
set
;
}
public
UInt16
?
Out
{
get
;
set
;
}
public
PushDataEventArgs
()
{
}
}
public
delegate
void
PushDataEventHandler
(
object
sender
,
PushDataEventArgs
e
);
/// <summary>
/// 异常不回复
/// </summary>
/// <param name="asyncContext"></param>
/// <param name="retData"></param>
public
delegate
void
CallBackHandler
(
object
asyncContext
,
object
retData
);
public
sealed
class
CallBackAttribute
:
Attribute
{
public
Type
RetType
;
public
CallBackAttribute
(
Type
type
)
{
RetType
=
type
;
}
}
public
class
GetEncAll_Reponse
{
public
int
pos1
;
public
int
pos2
;
}
public
class
GetRunResult_Reponse
{
public
byte
result
;
public
UInt32
serial
;
}
}
Project.FLY.FlyADBase/FlyAd2021/PackEventArgs.cs
0 → 100644
View file @
27a325f8
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
FlyAd2021
{
public
class
PackEventArgs
:
EventArgs
{
public
PackEventArgs
()
{
}
/// <summary>
/// 数据
/// </summary>
public
List
<
byte
>
Pack
{
get
;
set
;
}
/// <summary>
/// 开始时间点
/// </summary>
public
DateTime
Time
{
get
;
set
;
}
}
public
delegate
void
PackEventHandler
(
object
sender
,
PackEventArgs
e
);
}
Project.FLY.FlyADBase/FlyAd2021/Properties/AssemblyInfo.cs
0 → 100644
View file @
27a325f8
using
System.Reflection
;
using
System.Runtime.CompilerServices
;
using
System.Runtime.InteropServices
;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("FlyAd2021")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FlyAd2021")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("9521a8f9-7310-49b3-a951-594efe9d3ef0")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Project.FLY.FlyADBase/FlyAd2021/ProtocolCommon.cs
0 → 100644
View file @
27a325f8
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
FlyAd2021
{
public
static
class
ProtocolCommon
{
/// <summary>
/// 第0个byte是 7E
/// </summary>
/// <param name="pdu"></param>
/// <returns></returns>
public
static
bool
Pdu2Data
(
IEnumerable
<
byte
>
pdu
,
out
List
<
byte
>
datas
)
{
datas
=
new
List
<
byte
>();
for
(
int
i
=
1
;
i
<
pdu
.
Count
();
i
++)
{
byte
p
=
pdu
.
ElementAt
(
i
);
if
(
p
==
0x7D
)
{
if
(
i
+
1
<
pdu
.
Count
())
{
i
++;
p
=
pdu
.
ElementAt
(
i
);
//转义符
if
(
p
==
0x5E
)
{
datas
.
Add
(
0x7E
);
}
else
if
(
p
==
0x5D
)
{
datas
.
Add
(
0x7D
);
}
else
{
//异常,不能转义
return
false
;
}
}
else
{
//异常,没有转义信息
return
false
;
}
}
else
{
datas
.
Add
(
p
);
}
}
return
true
;
}
/// <summary>
/// 第0个byte是 7E
/// </summary>
/// <param name="pdu"></param>
/// <returns></returns>
public
static
bool
Data2Pdu
(
IEnumerable
<
byte
>
datas
,
out
List
<
byte
>
pdu
)
{
pdu
=
new
List
<
byte
>();
pdu
.
Add
(
0x7E
);
for
(
int
i
=
0
;
i
<
datas
.
Count
();
i
++)
{
byte
b
=
datas
.
ElementAt
(
i
);
if
(
b
==
0x7E
)
{
pdu
.
Add
(
0x7D
);
pdu
.
Add
(
0x5E
);
}
else
if
(
b
==
0x7D
)
{
pdu
.
Add
(
0x7D
);
pdu
.
Add
(
0x5D
);
}
else
{
pdu
.
Add
(
b
);
}
}
return
true
;
}
}
}
Project.FLY.Misc/MISC/CRC.cs
View file @
27a325f8
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Misc
...
...
@@ -157,7 +158,42 @@ namespace Misc
0x8A
,
0x4A
,
0x4E
,
0x8E
,
0x8F
,
0x4F
,
0x8D
,
0x4D
,
0x4C
,
0x8C
,
0x44
,
0x84
,
0x85
,
0x45
,
0x87
,
0x47
,
0x46
,
0x86
,
0x82
,
0x42
,
0x43
,
0x83
,
0x41
,
0x81
,
0x80
,
0x40
}
;
}
;
/* CRC8 字节值表 */
static
byte
[]
crc8_table
=
new
byte
[]
{
0x00
,
0x31
,
0x62
,
0x53
,
0xc4
,
0xf5
,
0xa6
,
0x97
,
0xb9
,
0x88
,
0xdb
,
0xea
,
0x7d
,
0x4c
,
0x1f
,
0x2e
,
0x43
,
0x72
,
0x21
,
0x10
,
0x87
,
0xb6
,
0xe5
,
0xd4
,
0xfa
,
0xcb
,
0x98
,
0xa9
,
0x3e
,
0x0f
,
0x5c
,
0x6d
,
0x86
,
0xb7
,
0xe4
,
0xd5
,
0x42
,
0x73
,
0x20
,
0x11
,
0x3f
,
0x0e
,
0x5d
,
0x6c
,
0xfb
,
0xca
,
0x99
,
0xa8
,
0xc5
,
0xf4
,
0xa7
,
0x96
,
0x01
,
0x30
,
0x63
,
0x52
,
0x7c
,
0x4d
,
0x1e
,
0x2f
,
0xb8
,
0x89
,
0xda
,
0xeb
,
0x3d
,
0x0c
,
0x5f
,
0x6e
,
0xf9
,
0xc8
,
0x9b
,
0xaa
,
0x84
,
0xb5
,
0xe6
,
0xd7
,
0x40
,
0x71
,
0x22
,
0x13
,
0x7e
,
0x4f
,
0x1c
,
0x2d
,
0xba
,
0x8b
,
0xd8
,
0xe9
,
0xc7
,
0xf6
,
0xa5
,
0x94
,
0x03
,
0x32
,
0x61
,
0x50
,
0xbb
,
0x8a
,
0xd9
,
0xe8
,
0x7f
,
0x4e
,
0x1d
,
0x2c
,
0x02
,
0x33
,
0x60
,
0x51
,
0xc6
,
0xf7
,
0xa4
,
0x95
,
0xf8
,
0xc9
,
0x9a
,
0xab
,
0x3c
,
0x0d
,
0x5e
,
0x6f
,
0x41
,
0x70
,
0x23
,
0x12
,
0x85
,
0xb4
,
0xe7
,
0xd6
,
0x7a
,
0x4b
,
0x18
,
0x29
,
0xbe
,
0x8f
,
0xdc
,
0xed
,
0xc3
,
0xf2
,
0xa1
,
0x90
,
0x07
,
0x36
,
0x65
,
0x54
,
0x39
,
0x08
,
0x5b
,
0x6a
,
0xfd
,
0xcc
,
0x9f
,
0xae
,
0x80
,
0xb1
,
0xe2
,
0xd3
,
0x44
,
0x75
,
0x26
,
0x17
,
0xfc
,
0xcd
,
0x9e
,
0xaf
,
0x38
,
0x09
,
0x5a
,
0x6b
,
0x45
,
0x74
,
0x27
,
0x16
,
0x81
,
0xb0
,
0xe3
,
0xd2
,
0xbf
,
0x8e
,
0xdd
,
0xec
,
0x7b
,
0x4a
,
0x19
,
0x28
,
0x06
,
0x37
,
0x64
,
0x55
,
0xc2
,
0xf3
,
0xa0
,
0x91
,
0x47
,
0x76
,
0x25
,
0x14
,
0x83
,
0xb2
,
0xe1
,
0xd0
,
0xfe
,
0xcf
,
0x9c
,
0xad
,
0x3a
,
0x0b
,
0x58
,
0x69
,
0x04
,
0x35
,
0x66
,
0x57
,
0xc0
,
0xf1
,
0xa2
,
0x93
,
0xbd
,
0x8c
,
0xdf
,
0xee
,
0x79
,
0x48
,
0x1b
,
0x2a
,
0xc1
,
0xf0
,
0xa3
,
0x92
,
0x05
,
0x34
,
0x67
,
0x56
,
0x78
,
0x49
,
0x1a
,
0x2b
,
0xbc
,
0x8d
,
0xde
,
0xef
,
0x82
,
0xb3
,
0xe0
,
0xd1
,
0x46
,
0x77
,
0x24
,
0x15
,
0x3b
,
0x0a
,
0x59
,
0x68
,
0xff
,
0xce
,
0x9d
,
0xac
};
public
static
byte
CRC8
(
IEnumerable
<
byte
>
datas
,
int
index
,
int
len
)
{
byte
crc
=
0x00
;
while
(
len
>
0
)
{
byte
d
=
datas
.
ElementAt
(
index
);
crc
=
crc8_table
[
crc
^
d
];
index
++;
len
--;
}
return
(
crc
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment