@@ -0,0 +1,35 @@ | |||||
<Project Sdk="Microsoft.NET.Sdk"> | |||||
<PropertyGroup> | |||||
<TargetFramework>netstandard2.0</TargetFramework> | |||||
<LangVersion>latest</LangVersion> | |||||
<Copyright>Copyright 2018.</Copyright> | |||||
<Authors>SmallChi</Authors> | |||||
<PackageId>JTNewEnergy</PackageId> | |||||
<Product>JTNewEnergy</Product> | |||||
<Description>JTNewEnergy协议、GBNewEnergy协议、电动汽车远程服务与管理系统平台数据交换</Description> | |||||
<PackageReleaseNotes>JTNewEnergy协议、GBNewEnergy协议、电动汽车远程服务与管理系统平台数据交换</PackageReleaseNotes> | |||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> | |||||
<RepositoryUrl>https://github.com/SmallChi/JTNewEnergy</RepositoryUrl> | |||||
<PackageProjectUrl>https://github.com/SmallChi/JTNewEnergy</PackageProjectUrl> | |||||
<PackageLicenseUrl>https://github.com/SmallChi/JTNewEnergy/blob/master/LICENSE</PackageLicenseUrl> | |||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | |||||
<Version>1.0.0</Version> | |||||
</PropertyGroup> | |||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | |||||
<DocumentationFile>D:\My Project\JTNewEnergy\src\JTNE.Protocol\JTNE.Protocol.xml</DocumentationFile> | |||||
</PropertyGroup> | |||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | |||||
<DocumentationFile>D:\My Project\JTNewEnergy\src\JTNE.Protocol\JTNE.Protocol.xml</DocumentationFile> | |||||
</PropertyGroup> | |||||
<ItemGroup> | |||||
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" /> | |||||
<PackageReference Include="System.Buffers" Version="4.5.0" /> | |||||
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" /> | |||||
<PackageReference Include="System.Memory" Version="4.5.2" /> | |||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" /> | |||||
</ItemGroup> | |||||
</Project> |
@@ -0,0 +1,56 @@ | |||||
<?xml version="1.0"?> | |||||
<doc> | |||||
<assembly> | |||||
<name>JTNE.Protocol</name> | |||||
</assembly> | |||||
<members> | |||||
<member name="T:JTNE.Protocol.JTNEPackage"> | |||||
<summary> | |||||
新能源包 | |||||
</summary> | |||||
</member> | |||||
<member name="F:JTNE.Protocol.JTNEPackage.HeaderFixedByteLength"> | |||||
<summary> | |||||
固定为24个字节长度 | |||||
</summary> | |||||
</member> | |||||
<member name="P:JTNE.Protocol.JTNEPackage.BeginFlag"> | |||||
<summary> | |||||
起始符 | |||||
0x23 | |||||
</summary> | |||||
</member> | |||||
<member name="P:JTNE.Protocol.JTNEPackage.MsgId"> | |||||
<summary> | |||||
命令标识 | |||||
</summary> | |||||
</member> | |||||
<member name="P:JTNE.Protocol.JTNEPackage.AskId"> | |||||
<summary> | |||||
应答标志 | |||||
</summary> | |||||
</member> | |||||
<member name="P:JTNE.Protocol.JTNEPackage.VIN"> | |||||
<summary> | |||||
车辆识别码 | |||||
</summary> | |||||
</member> | |||||
<member name="P:JTNE.Protocol.JTNEPackage.EncryptMethod"> | |||||
<summary> | |||||
数据加密方式 | |||||
0x01:数据不加密;0x02:数据经过 RSA 算法加密;0x03:数据经过 AES128 位算法加密;“0xFE”表示异常,“0xFF”表示无效 | |||||
</summary> | |||||
</member> | |||||
<member name="P:JTNE.Protocol.JTNEPackage.DataUnitLength"> | |||||
<summary> | |||||
数据单元长度是数据单元的总字节数,有效值范围:0-65531 | |||||
</summary> | |||||
</member> | |||||
<member name="P:JTNE.Protocol.JTNEPackage.BCCCode"> | |||||
<summary> | |||||
采用BCC(异或检验)法,校验范围从命令单元的第一个字节开始,同后一个字节异或,直到校验码前一个字节为止, | |||||
校验码占用一个字节,当数据单元存在加密时,应先加密后检验,先校验后解密 | |||||
</summary> | |||||
</member> | |||||
</members> | |||||
</doc> |
@@ -0,0 +1,51 @@ | |||||
using System; | |||||
using System.IO; | |||||
namespace JTNE.Protocol | |||||
{ | |||||
/// <summary> | |||||
/// 新能源包 | |||||
/// </summary> | |||||
public class JTNEPackage | |||||
{ | |||||
/// <summary> | |||||
/// 固定为24个字节长度 | |||||
/// </summary> | |||||
public const int HeaderFixedByteLength = 24; | |||||
/// <summary> | |||||
/// 起始符 | |||||
/// 0x23 | |||||
/// </summary> | |||||
public string BeginFlag { get; set; } = "##"; | |||||
/// <summary> | |||||
/// 命令标识 | |||||
/// </summary> | |||||
public byte MsgId { get; set; } | |||||
/// <summary> | |||||
/// 应答标志 | |||||
/// </summary> | |||||
public byte AskId { get; set; } | |||||
/// <summary> | |||||
/// 车辆识别码 | |||||
/// </summary> | |||||
public string VIN { get; set; } | |||||
/// <summary> | |||||
/// 数据加密方式 | |||||
/// 0x01:数据不加密;0x02:数据经过 RSA 算法加密;0x03:数据经过 AES128 位算法加密;“0xFE”表示异常,“0xFF”表示无效 | |||||
/// </summary> | |||||
public byte EncryptMethod { get; set; } | |||||
/// <summary> | |||||
/// 数据单元长度是数据单元的总字节数,有效值范围:0-65531 | |||||
/// </summary> | |||||
public ushort DataUnitLength { get; set; } | |||||
///// <summary> | |||||
///// 数据体 | |||||
///// </summary> | |||||
//public NEBodies Bodies { get; protected set; } | |||||
/// <summary> | |||||
/// 采用BCC(异或检验)法,校验范围从命令单元的第一个字节开始,同后一个字节异或,直到校验码前一个字节为止, | |||||
/// 校验码占用一个字节,当数据单元存在加密时,应先加密后检验,先校验后解密 | |||||
/// </summary> | |||||
public byte BCCCode { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,25 @@ | |||||
| |||||
Microsoft Visual Studio Solution File, Format Version 12.00 | |||||
# Visual Studio Version 16 | |||||
VisualStudioVersion = 16.0.28407.52 | |||||
MinimumVisualStudioVersion = 10.0.40219.1 | |||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JTNE.Protocol", "JTNE.Protocol\JTNE.Protocol.csproj", "{5B164F58-141D-474E-A82E-672A1C252029}" | |||||
EndProject | |||||
Global | |||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||||
Debug|Any CPU = Debug|Any CPU | |||||
Release|Any CPU = Release|Any CPU | |||||
EndGlobalSection | |||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | |||||
{5B164F58-141D-474E-A82E-672A1C252029}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
{5B164F58-141D-474E-A82E-672A1C252029}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
{5B164F58-141D-474E-A82E-672A1C252029}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
{5B164F58-141D-474E-A82E-672A1C252029}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
EndGlobalSection | |||||
GlobalSection(SolutionProperties) = preSolution | |||||
HideSolutionNode = FALSE | |||||
EndGlobalSection | |||||
GlobalSection(ExtensibilityGlobals) = postSolution | |||||
SolutionGuid = {E7AF20B3-4327-4DF7-B503-9FE08AA92A75} | |||||
EndGlobalSection | |||||
EndGlobal |