Skip to content

Commit

Permalink
v2.4.5
Browse files Browse the repository at this point in the history
修复0x200报警标志对象解析错误
  • Loading branch information
SmallChi committed Dec 7, 2023
1 parent 2f88887 commit 4234c83
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Info.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageProjectUrl>https://github.com/SmallChi/JT808</PackageProjectUrl>
<licenseUrl>https://github.com/SmallChi/JT808/blob/master/LICENSE</licenseUrl>
<license>https://github.com/SmallChi/JT808/blob/master/LICENSE</license>
<Version>2.6.4</Version>
<Version>2.6.5</Version>
<ImplicitUsings>enable</ImplicitUsings>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
Expand Down
8 changes: 8 additions & 0 deletions src/JT808.Protocol.Test/MessageBody/JT808_0x0200Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,14 @@ public void Test8_1()
var json = JT808Serializer1.Analyze(bodys);
}


[Fact]
public void Test8_2()
{
var bytes = "7E020000670440054300360D0700000000000C01030158A18406C96FE0000F0000012423120709365201040000000C30011731010CEB06000400CE06D62B04000000005110FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF58100FFF0FFF0FFF0FFF0FFF0FFF0FFF0FFF55080000000000099066520103287E".ToHexBytes();
var package = JT808Serializer1.Analyze(bytes);
}

[Fact]
public void Test_all_attcahids()
{
Expand Down
2 changes: 1 addition & 1 deletion src/JT808.Protocol/MessageBody/JT808_0x0200.cs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJ
writer.WriteString($"[{StatusFlagBits[19]}]bit12", StatusFlagBits[19] == '0' ? "车门解锁" : "车门加锁");
writer.WriteString($"[{StatusFlagBits[20]}]bit11", StatusFlagBits[20] == '0' ? "车辆电路正常" : "车辆电路断开");
writer.WriteString($"[{StatusFlagBits[21]}]bit10", StatusFlagBits[21] == '0' ? "车辆油路正常" : "车辆油路断开");
var bit8And9 = StatusFlagBits.Slice(22, 2).ToString();
var bit8And9 = string.Join("",StatusFlagBits.Slice(22, 2).ToArray().Reverse());
switch (bit8And9)
{
case "00":
Expand Down

0 comments on commit 4234c83

Please sign in to comment.