@@ -17,7 +17,3 @@ jobs: | |||
run: dotnet --info | |||
- name: dotnet restore | |||
run: dotnet restore ./src/JT1078.sln | |||
- name: dotnet JT809.Protocol.Extensions.JT1078.Test build | |||
run: dotnet build ./src/JT809.Protocol.Extensions.JT1078.Test/JT809.Protocol.Extensions.JT1078.Test.csproj | |||
- name: dotnet JT809.Protocol.Extensions.JT1078.Test test | |||
run: dotnet test ./src/JT809.Protocol.Extensions.JT1078.Test/JT809.Protocol.Extensions.JT1078.Test.csproj |
@@ -20,7 +20,6 @@ | |||
| Install-Package JT1078.Flv |  |  | | |||
| Install-Package JT1078.Hls |  |  | | |||
| Install-Package JT1078.FMp4 |  |  | | |||
| Install-Package JT809.Protocol.Extensions.JT1078 |  |  | | |||
## <span id="1078">基于JT1078音视频流数据的RTP协议</span> | |||
@@ -213,56 +212,3 @@ Platform=AnyCpu Server=False Toolchain=.NET Core 3.1 | |||
| **EXPGolombReader** | **100000** | **11,687.72 us** | **162.828 us** | **152.309 us** | **1515.6250** | **-** | **-** | **9375 KB** | | |||
| H264Decoder | 100000 | 1,192,549.87 us | 7,656.632 us | 7,162.018 us | 128000.0000 | 3000.0000 | - | 786718.75 KB | | |||
| FlvEncoder | 100000 | 216,951.31 us | 3,513.653 us | 2,934.059 us | 249333.3333 | - | - | 1528906.66 KB | | |||
## <span id="809ext">基于JT809扩展的JT1078消息协议</span> | |||
### JT809扩展协议消息对照表 | |||
#### 主链路动态信息交换消息 | |||
| 序号 | 消息ID | 完成情况 | 测试情况 | 消息体名称 | | |||
| :---: | :-----------: | :------: | :------: | :----------------------------: | | |||
| 1 | 0x1700 | √ | √ | 主链路时效口令交互消息 | | |||
| 2 | 0x1700_0x1701 | √ | √ | 时效口令上报消息(有疑问:数据体有问题) | | |||
| 3 | 0x1700_0x1702 | √ | √ | 时效口令请求消息 | | |||
| 4 | 0x1800 | √ | √ | 主链路实时音视频交互消息 | | |||
| 5 | 0x1800_0x1801 | √ | √ | 实时音视频请求应答消息 | | |||
| 6 | 0x1800_0x1802 | √ | √ | 主动请求停止实时音视频传输应答消息 | | |||
| 7 | 0x1900 | √ | √ | 主链路远程录像检索 | | |||
| 8 | 0x1900_0x1901 | √ | √ | 主动上传音视频资源目录信息消息 | | |||
| 9 | 0x1900_0x1902 | √ | √ | 查询音视频资源目录应答消息 | | |||
| 10 | 0x1A00 | √ | √ | 主链路远程录像回放交互消息 | | |||
| 11 | 0x1A00_0x1A01 | √ | √ | 远程录像回放请求应答消息 | | |||
| 12 | 0x1A00_0x1A02 | √ | √ | 远程录像回放控制应答消息 | | |||
| 13 | 0x1B00 | √ | √ | 主链路远程录像下载交互消息 | | |||
| 14 | 0x1B00_0x1B01 | √ | √ | 远程录像下载请求应答消息 | | |||
| 15 | 0x1B00_0x1B02 | √ | √ | 远程录像下载通知消息 | | |||
| 16 | 0x1B00_0x1B03 | √ | √ | 远程录像下载控制应答消息 | | |||
#### 从链路动态信息交换消息 | |||
| 序号 | 消息ID | 完成情况 | 测试情况 | 消息体名称 | | |||
| :---: | :-----------: | :------: | :------: | :----------------------------: | | |||
| 17 | 0x9700 | √ | √ | 从链路时效口令交互消息 | | |||
| 18 | 0x9700_0x9702 | √ | √ | 时效口令请求应答消息(有疑问:应该有应答结果) | | |||
| 19 | 0x9800 | √ | √ | 从链路实时音视频交互信息 | | |||
| 20 | 0x9800_0x9801 | √ | √ | 实时音视频请求消息 | | |||
| 21 | 0x9800_0x9802 | √ | √ | 主动请求停止实时音视频传输消息 | | |||
| 22 | 0x9900 | √ | √ | 从链路远程录像检索交互消息 | | |||
| 23 | 0x9900_0x9901 | √ | √ | 主动上传音视频资源目录信息应答消息 | | |||
| 24 | 0x9900_0x9902 | √ | √ | 查询音视频资源目录请求消息 | | |||
| 25 | 0x9A00 | √ | √ | 从链路远程录像回放交互消息 | | |||
| 26 | 0x9A00_0x9A01 | √ | √ | 远程录像回放请求消息 | | |||
| 27 | 0x9A00_0x9A02 | √ | √ | 远程录像回放控制消息 | | |||
| 28 | 0x9B00 | √ | √ | 从链路远程录像下载交互消息 | | |||
| 29 | 0x9B00_0x9B01 | √ | √ | 远程录像下载请求消息 | | |||
| 30 | 0x9B00_0x9B02 | √ | √ | 远程录像下载完成通知应答消息 | | |||
| 31 | 0x9B00_0x9B03 | √ | √ | 远程录像下载控制消息 | | |||
### 使用方法 | |||
```dotnet | |||
IServiceCollection serviceDescriptors1 = new ServiceCollection(); | |||
serviceDescriptors1.AddJT809Configure() | |||
.AddJT1078Configure(); | |||
``` |
@@ -3,12 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 | |||
# Visual Studio Version 16 | |||
VisualStudioVersion = 16.0.29020.237 | |||
MinimumVisualStudioVersion = 10.0.40219.1 | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT809.Protocol.Extensions.JT1078", "JT809.Protocol.Extensions.JT1078\JT809.Protocol.Extensions.JT1078.csproj", "{2F987285-EB7A-4934-909E-50E42A2D1140}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT1078.Protocol", "JT1078.Protocol\JT1078.Protocol.csproj", "{60CAC24B-7317-48BF-9DBF-7F3ECA3689A4}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT809.Protocol.Extensions.JT1078.Test", "JT809.Protocol.Extensions.JT1078.Test\JT809.Protocol.Extensions.JT1078.Test.csproj", "{E9FF2716-EF30-4180-879B-E8AB979ACFF3}" | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT1078.Protocol.Test", "JT1078.Protocol.Test\JT1078.Protocol.Test.csproj", "{9ADD82F9-E0B2-4263-8573-151F673BB33F}" | |||
EndProject | |||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{0655AF84-E578-409F-AB0E-B47E0D2F6814}" | |||
@@ -48,18 +44,6 @@ Global | |||
Release|x86 = Release|x86 | |||
EndGlobalSection | |||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | |||
{2F987285-EB7A-4934-909E-50E42A2D1140}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{2F987285-EB7A-4934-909E-50E42A2D1140}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{2F987285-EB7A-4934-909E-50E42A2D1140}.Debug|x64.ActiveCfg = Debug|Any CPU | |||
{2F987285-EB7A-4934-909E-50E42A2D1140}.Debug|x64.Build.0 = Debug|Any CPU | |||
{2F987285-EB7A-4934-909E-50E42A2D1140}.Debug|x86.ActiveCfg = Debug|Any CPU | |||
{2F987285-EB7A-4934-909E-50E42A2D1140}.Debug|x86.Build.0 = Debug|Any CPU | |||
{2F987285-EB7A-4934-909E-50E42A2D1140}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{2F987285-EB7A-4934-909E-50E42A2D1140}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{2F987285-EB7A-4934-909E-50E42A2D1140}.Release|x64.ActiveCfg = Release|Any CPU | |||
{2F987285-EB7A-4934-909E-50E42A2D1140}.Release|x64.Build.0 = Release|Any CPU | |||
{2F987285-EB7A-4934-909E-50E42A2D1140}.Release|x86.ActiveCfg = Release|Any CPU | |||
{2F987285-EB7A-4934-909E-50E42A2D1140}.Release|x86.Build.0 = Release|Any CPU | |||
{60CAC24B-7317-48BF-9DBF-7F3ECA3689A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{60CAC24B-7317-48BF-9DBF-7F3ECA3689A4}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{60CAC24B-7317-48BF-9DBF-7F3ECA3689A4}.Debug|x64.ActiveCfg = Debug|Any CPU | |||
@@ -72,18 +56,6 @@ Global | |||
{60CAC24B-7317-48BF-9DBF-7F3ECA3689A4}.Release|x64.Build.0 = Release|Any CPU | |||
{60CAC24B-7317-48BF-9DBF-7F3ECA3689A4}.Release|x86.ActiveCfg = Release|Any CPU | |||
{60CAC24B-7317-48BF-9DBF-7F3ECA3689A4}.Release|x86.Build.0 = Release|Any CPU | |||
{E9FF2716-EF30-4180-879B-E8AB979ACFF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{E9FF2716-EF30-4180-879B-E8AB979ACFF3}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{E9FF2716-EF30-4180-879B-E8AB979ACFF3}.Debug|x64.ActiveCfg = Debug|Any CPU | |||
{E9FF2716-EF30-4180-879B-E8AB979ACFF3}.Debug|x64.Build.0 = Debug|Any CPU | |||
{E9FF2716-EF30-4180-879B-E8AB979ACFF3}.Debug|x86.ActiveCfg = Debug|Any CPU | |||
{E9FF2716-EF30-4180-879B-E8AB979ACFF3}.Debug|x86.Build.0 = Debug|Any CPU | |||
{E9FF2716-EF30-4180-879B-E8AB979ACFF3}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{E9FF2716-EF30-4180-879B-E8AB979ACFF3}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{E9FF2716-EF30-4180-879B-E8AB979ACFF3}.Release|x64.ActiveCfg = Release|Any CPU | |||
{E9FF2716-EF30-4180-879B-E8AB979ACFF3}.Release|x64.Build.0 = Release|Any CPU | |||
{E9FF2716-EF30-4180-879B-E8AB979ACFF3}.Release|x86.ActiveCfg = Release|Any CPU | |||
{E9FF2716-EF30-4180-879B-E8AB979ACFF3}.Release|x86.Build.0 = Release|Any CPU | |||
{9ADD82F9-E0B2-4263-8573-151F673BB33F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{9ADD82F9-E0B2-4263-8573-151F673BB33F}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{9ADD82F9-E0B2-4263-8573-151F673BB33F}.Debug|x64.ActiveCfg = Debug|Any CPU | |||
@@ -209,7 +181,6 @@ Global | |||
HideSolutionNode = FALSE | |||
EndGlobalSection | |||
GlobalSection(NestedProjects) = preSolution | |||
{E9FF2716-EF30-4180-879B-E8AB979ACFF3} = {0655AF84-E578-409F-AB0E-B47E0D2F6814} | |||
{9ADD82F9-E0B2-4263-8573-151F673BB33F} = {0655AF84-E578-409F-AB0E-B47E0D2F6814} | |||
{77402142-54E5-4E64-8F9E-BCAAC2CD0E8D} = {807ADB1F-FED4-4A56-82D2-F08F1FB7C886} | |||
{D13FE092-1D11-4545-A322-9F06BCDAC0FD} = {0655AF84-E578-409F-AB0E-B47E0D2F6814} | |||
@@ -1,21 +0,0 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFramework>net5.0</TargetFramework> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" /> | |||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" /> | |||
<PackageReference Include="xunit" Version="2.4.1" /> | |||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> | |||
<PrivateAssets>all</PrivateAssets> | |||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | |||
</PackageReference> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\JT809.Protocol.Extensions.JT1078\JT809.Protocol.Extensions.JT1078.csproj" /> | |||
</ItemGroup> | |||
</Project> |
@@ -1,88 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using System; | |||
using System.Linq; | |||
using System.Collections.Generic; | |||
using Xunit; | |||
namespace JT809.Protocol.Extensions.JT1078.Test | |||
{ | |||
public class JT809_JT1078_0x1700Test | |||
{ | |||
JT809Serializer JT809Serializer; | |||
public JT809_JT1078_0x1700Test() | |||
{ | |||
IServiceCollection serviceDescriptors1 = new ServiceCollection(); | |||
serviceDescriptors1 | |||
.AddJT809Configure() | |||
.AddJT1078Configure(); | |||
var ServiceProvider1 = serviceDescriptors1.BuildServiceProvider(); | |||
var defaultConfig = ServiceProvider1.GetRequiredService<IJT809Config>(); | |||
JT809Serializer = defaultConfig.GetSerializer(); | |||
} | |||
[Fact] | |||
public void Test1() | |||
{ | |||
var PlateFormIds = "01234567890"; | |||
var AuthorizeCode1s = "0123456789012345678901234567890123456789012345678901234567890123"; | |||
var AuthorizeCode2s = "0123456789012345678901234567890123456789012345678901234567890123"; | |||
JT809_JT1078_0x1700 jT809_JT1078_0x1700 = new JT809_JT1078_0x1700() | |||
{ | |||
VehicleNo="粤B12345", | |||
VehicleColor= Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType= (ushort)JT809_JT1078_SubBusinessType.时效口令上报消息, | |||
SubBodies= new JT809_JT1078_0x1700_0x1701() { | |||
PlateFormId= PlateFormIds, | |||
AuthorizeCode1= AuthorizeCode1s, | |||
AuthorizeCode2= AuthorizeCode2s | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x1700).ToHexString(); | |||
Assert.Equal("D4C1423132333435000000000000000000000000000217010000008B30313233343536373839303031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323330313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233", hex); | |||
} | |||
[Fact] | |||
public void Test2() | |||
{ | |||
var PlateFormIds = "01234567890"; | |||
var AuthorizeCode1s = "0123456789012345678901234567890123456789012345678901234567890123"; | |||
var AuthorizeCode2s = "0123456789012345678901234567890123456789012345678901234567890123"; | |||
var jT809_JT1078_0x1700 = JT809Serializer.Deserialize<JT809_JT1078_0x1700>("D4C1423132333435000000000000000000000000000217010000008B30313233343536373839303031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323330313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x1700.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x1700.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.时效口令上报消息, jT809_JT1078_0x1700.SubBusinessType); | |||
var jT809_JT1078_0x1700_0x1701 = jT809_JT1078_0x1700.SubBodies as JT809_JT1078_0x1700_0x1701; | |||
Assert.Equal(PlateFormIds, jT809_JT1078_0x1700_0x1701.PlateFormId); | |||
Assert.Equal(AuthorizeCode1s, jT809_JT1078_0x1700_0x1701.AuthorizeCode1); | |||
Assert.Equal(AuthorizeCode2s, jT809_JT1078_0x1700_0x1701.AuthorizeCode2); | |||
} | |||
[Fact] | |||
public void Test3() | |||
{ | |||
JT809_JT1078_0x1700 jT809_JT1078_0x1700 = new JT809_JT1078_0x1700() | |||
{ | |||
VehicleNo = "粤B12345", | |||
VehicleColor = Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType = (ushort)JT809_JT1078_SubBusinessType.时效口令请求消息, | |||
SubBodies = new JT809_JT1078_0x1700_0x1702() | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x1700).ToHexString(); | |||
Assert.Equal("D4C14231323334350000000000000000000000000002170200000000", hex); | |||
} | |||
[Fact] | |||
public void Test4() | |||
{ | |||
var jT809_JT1078_0x1700 = JT809Serializer.Deserialize<JT809_JT1078_0x1700>("D4C14231323334350000000000000000000000000002170200000000".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x1700.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x1700.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.时效口令请求消息, jT809_JT1078_0x1700.SubBusinessType); | |||
} | |||
} | |||
} |
@@ -1,85 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using System; | |||
using System.Linq; | |||
using System.Collections.Generic; | |||
using Xunit; | |||
namespace JT809.Protocol.Extensions.JT1078.Test | |||
{ | |||
public class JT809_JT1078_0x1800Test | |||
{ | |||
JT809Serializer JT809Serializer; | |||
public JT809_JT1078_0x1800Test() | |||
{ | |||
IServiceCollection serviceDescriptors1 = new ServiceCollection(); | |||
serviceDescriptors1 | |||
.AddJT809Configure() | |||
.AddJT1078Configure(); | |||
var ServiceProvider1 = serviceDescriptors1.BuildServiceProvider(); | |||
var defaultConfig = ServiceProvider1.GetRequiredService<IJT809Config>(); | |||
JT809Serializer = defaultConfig.GetSerializer(); | |||
} | |||
[Fact] | |||
public void Test1() | |||
{ | |||
JT809_JT1078_0x1800 jT809_JT1078_0x1800 = new JT809_JT1078_0x1800() | |||
{ | |||
VehicleNo="粤B12345", | |||
VehicleColor= Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType= (ushort)JT809_JT1078_SubBusinessType.实时音视频请求应答消息, | |||
SubBodies= new JT809_JT1078_0x1800_0x1801() { | |||
ServerIp="127.0.0.1", | |||
ServerPort=8080, | |||
Result= JT809_JT1078_0x1800_0x1801_Result.失败 | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x1800).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000021801000000230100000000000000000000000000000000000000000000003132372E302E302E311F90", hex); | |||
} | |||
[Fact] | |||
public void Test2() | |||
{ | |||
var jT809_JT1078_0x1800 = JT809Serializer.Deserialize<JT809_JT1078_0x1800>("D4C142313233343500000000000000000000000000021801000000230100000000000000000000000000000000000000000000003132372E302E302E311F90".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x1800.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x1800.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.实时音视频请求应答消息, jT809_JT1078_0x1800.SubBusinessType); | |||
var jT809_JT1078_0x1800_0x1801 = jT809_JT1078_0x1800.SubBodies as JT809_JT1078_0x1800_0x1801; | |||
Assert.Equal("127.0.0.1", jT809_JT1078_0x1800_0x1801.ServerIp); | |||
Assert.Equal(8080, jT809_JT1078_0x1800_0x1801.ServerPort); | |||
Assert.Equal(1, (byte)jT809_JT1078_0x1800_0x1801.Result); | |||
} | |||
[Fact] | |||
public void Test3() | |||
{ | |||
JT809_JT1078_0x1800 jT809_JT1078_0x1800 = new JT809_JT1078_0x1800() | |||
{ | |||
VehicleNo = "粤B12345", | |||
VehicleColor = Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType = (ushort)JT809_JT1078_SubBusinessType.主动请求停止实时音视频传输应答消息, | |||
SubBodies = new JT809_JT1078_0x1800_0x1802() { | |||
Result= JT809_JT1078_0x1800_0x1802_Result.失败 | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x1800).ToHexString(); | |||
Assert.Equal("D4C1423132333435000000000000000000000000000218020000000101", hex); | |||
} | |||
[Fact] | |||
public void Test4() | |||
{ | |||
var jT809_JT1078_0x1800 = JT809Serializer.Deserialize<JT809_JT1078_0x1800>("D4C1423132333435000000000000000000000000000218020000000101".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x1800.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x1800.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.主动请求停止实时音视频传输应答消息, jT809_JT1078_0x1800.SubBusinessType); | |||
var jT809_JT1078_0x1800_0x1802 = jT809_JT1078_0x1800.SubBodies as JT809_JT1078_0x1800_0x1802; | |||
Assert.Equal(1, (byte)jT809_JT1078_0x1800_0x1802.Result); | |||
} | |||
} | |||
} |
@@ -1,174 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using System; | |||
using System.Linq; | |||
using System.Collections.Generic; | |||
using Xunit; | |||
using Newtonsoft.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.Test | |||
{ | |||
public class JT809_JT1078_0x1900Test | |||
{ | |||
JT809Serializer JT809Serializer; | |||
public JT809_JT1078_0x1900Test() | |||
{ | |||
IServiceCollection serviceDescriptors1 = new ServiceCollection(); | |||
serviceDescriptors1 | |||
.AddJT809Configure() | |||
.AddJT1078Configure(); | |||
var ServiceProvider1 = serviceDescriptors1.BuildServiceProvider(); | |||
var defaultConfig = ServiceProvider1.GetRequiredService<IJT809Config>(); | |||
JT809Serializer = defaultConfig.GetSerializer(); | |||
Newtonsoft.Json.JsonConvert.DefaultSettings = new Func<JsonSerializerSettings>(() => | |||
{ | |||
//日期类型默认格式化处理 | |||
return new Newtonsoft.Json.JsonSerializerSettings | |||
{ | |||
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.MicrosoftDateFormat, | |||
DateFormatString = "yyyy-MM-dd HH:mm:ss" | |||
}; | |||
}); | |||
} | |||
public object jT809_JT1078_0x1800 { get; private set; } | |||
[Fact] | |||
public void Test1() | |||
{ | |||
JT809_JT1078_0x1900 jT809_JT1078_0x1900 = new JT809_JT1078_0x1900() | |||
{ | |||
VehicleNo="粤B12345", | |||
VehicleColor= Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType= (ushort)JT809_JT1078_SubBusinessType.主动上传音视频资源目录信息消息, | |||
SubBodies= new JT809_JT1078_0x1900_0x1901() { | |||
ItemNum=2, | |||
ItemList=new List<JT809_JT1078_0x1900_Record> { | |||
new JT809_JT1078_0x1900_Record{ | |||
AlarmType=1, | |||
AVItemType=2, | |||
ChannelId=3, | |||
FileSize=4, | |||
MemType=5, | |||
StartTime=Convert.ToDateTime("2019-07-15 10:10:10"), | |||
EndTime=Convert.ToDateTime("2019-07-16 10:10:10"), | |||
StreamType=6 | |||
}, | |||
new JT809_JT1078_0x1900_Record{ | |||
AlarmType=11, | |||
AVItemType=21, | |||
ChannelId=31, | |||
FileSize=41, | |||
MemType=51, | |||
StartTime=Convert.ToDateTime("2019-06-15 10:10:10"), | |||
EndTime=Convert.ToDateTime("2019-06-16 10:10:10"), | |||
StreamType=61 | |||
} | |||
} | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x1900).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000021901000000440000000203000000005D2BE082000000005D2D32020000000000000001020605000000041F000000005D045382000000005D05A502000000000000000B153D3300000029", hex); | |||
} | |||
[Fact] | |||
public void Test2() | |||
{ | |||
var jT809_JT1078_0x1900 = JT809Serializer.Deserialize<JT809_JT1078_0x1900>("D4C142313233343500000000000000000000000000021901000000440000000203000000005D2BE082000000005D2D32020000000000000001020605000000041F000000005D045382000000005D05A502000000000000000B153D3300000029".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x1900.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x1900.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.主动上传音视频资源目录信息消息, jT809_JT1078_0x1900.SubBusinessType); | |||
var jT809_JT1078_0x1900_0x1901 = jT809_JT1078_0x1900.SubBodies as JT809_JT1078_0x1900_0x1901; | |||
Assert.Equal(2u, jT809_JT1078_0x1900_0x1901.ItemNum); | |||
Assert.Equal(1u, jT809_JT1078_0x1900_0x1901.ItemList[0].AlarmType); | |||
Assert.Equal(2, jT809_JT1078_0x1900_0x1901.ItemList[0].AVItemType); | |||
Assert.Equal(3, jT809_JT1078_0x1900_0x1901.ItemList[0].ChannelId); | |||
Assert.Equal(4u, jT809_JT1078_0x1900_0x1901.ItemList[0].FileSize); | |||
Assert.Equal(5, jT809_JT1078_0x1900_0x1901.ItemList[0].MemType); | |||
Assert.Equal(Convert.ToDateTime("2019-07-15 10:10:10"), jT809_JT1078_0x1900_0x1901.ItemList[0].StartTime); | |||
Assert.Equal(Convert.ToDateTime("2019-07-16 10:10:10"), jT809_JT1078_0x1900_0x1901.ItemList[0].EndTime); | |||
Assert.Equal(6, jT809_JT1078_0x1900_0x1901.ItemList[0].StreamType); | |||
Assert.Equal(11u, jT809_JT1078_0x1900_0x1901.ItemList[1].AlarmType); | |||
Assert.Equal(21, jT809_JT1078_0x1900_0x1901.ItemList[1].AVItemType); | |||
Assert.Equal(31, jT809_JT1078_0x1900_0x1901.ItemList[1].ChannelId); | |||
Assert.Equal(41u, jT809_JT1078_0x1900_0x1901.ItemList[1].FileSize); | |||
Assert.Equal(51, jT809_JT1078_0x1900_0x1901.ItemList[1].MemType); | |||
Assert.Equal(Convert.ToDateTime("2019-06-15 10:10:10"), jT809_JT1078_0x1900_0x1901.ItemList[1].StartTime); | |||
Assert.Equal(Convert.ToDateTime("2019-06-16 10:10:10"), jT809_JT1078_0x1900_0x1901.ItemList[1].EndTime); | |||
Assert.Equal(61, jT809_JT1078_0x1900_0x1901.ItemList[1].StreamType); | |||
} | |||
[Fact] | |||
public void Test3() | |||
{ | |||
JT809_JT1078_0x1900 jT809_JT1078_0x1900 = new JT809_JT1078_0x1900() | |||
{ | |||
VehicleNo = "粤B12345", | |||
VehicleColor = Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType = (ushort)JT809_JT1078_SubBusinessType.查询音视频资源目录应答消息, | |||
SubBodies = new JT809_JT1078_0x1900_0x1902() { | |||
Result= JT809_JT1078_0x1900_0x1902_Result.失败, | |||
ItemNum=2, | |||
ItemList = new List<JT809_JT1078_0x1900_Record> { | |||
new JT809_JT1078_0x1900_Record{ | |||
AlarmType=1, | |||
AVItemType=2, | |||
ChannelId=3, | |||
FileSize=4, | |||
MemType=5, | |||
StartTime=Convert.ToDateTime("2019-07-15 10:10:10"), | |||
EndTime=Convert.ToDateTime("2019-07-16 10:10:10"), | |||
StreamType=6 | |||
}, | |||
new JT809_JT1078_0x1900_Record{ | |||
AlarmType=11, | |||
AVItemType=21, | |||
ChannelId=31, | |||
FileSize=41, | |||
MemType=51, | |||
StartTime=Convert.ToDateTime("2019-06-15 10:10:10"), | |||
EndTime=Convert.ToDateTime("2019-06-16 10:10:10"), | |||
StreamType=61 | |||
} | |||
} | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x1900).ToHexString(); | |||
Assert.Equal("D4C14231323334350000000000000000000000000002190200000045010000000203000000005D2BE082000000005D2D32020000000000000001020605000000041F000000005D045382000000005D05A502000000000000000B153D3300000029", hex); | |||
} | |||
[Fact] | |||
public void Test4() | |||
{ | |||
var jT809_JT1078_0x1900 = JT809Serializer.Deserialize<JT809_JT1078_0x1900>("D4C14231323334350000000000000000000000000002190200000045010000000203000000005D2BE082000000005D2D32020000000000000001020605000000041F000000005D045382000000005D05A502000000000000000B153D3300000029".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x1900.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x1900.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.查询音视频资源目录应答消息, jT809_JT1078_0x1900.SubBusinessType); | |||
var jT809_JT1078_0x1900_0x1902 = jT809_JT1078_0x1900.SubBodies as JT809_JT1078_0x1900_0x1902; | |||
Assert.Equal(2u, jT809_JT1078_0x1900_0x1902.ItemNum); | |||
Assert.Equal(1, (byte)jT809_JT1078_0x1900_0x1902.Result); | |||
Assert.Equal(1u, jT809_JT1078_0x1900_0x1902.ItemList[0].AlarmType); | |||
Assert.Equal(2, jT809_JT1078_0x1900_0x1902.ItemList[0].AVItemType); | |||
Assert.Equal(3, jT809_JT1078_0x1900_0x1902.ItemList[0].ChannelId); | |||
Assert.Equal(4u, jT809_JT1078_0x1900_0x1902.ItemList[0].FileSize); | |||
Assert.Equal(5, jT809_JT1078_0x1900_0x1902.ItemList[0].MemType); | |||
Assert.Equal(Convert.ToDateTime("2019-07-15 10:10:10"), jT809_JT1078_0x1900_0x1902.ItemList[0].StartTime); | |||
Assert.Equal(Convert.ToDateTime("2019-07-16 10:10:10"), jT809_JT1078_0x1900_0x1902.ItemList[0].EndTime); | |||
Assert.Equal(6, jT809_JT1078_0x1900_0x1902.ItemList[0].StreamType); | |||
Assert.Equal(11u, jT809_JT1078_0x1900_0x1902.ItemList[1].AlarmType); | |||
Assert.Equal(21, jT809_JT1078_0x1900_0x1902.ItemList[1].AVItemType); | |||
Assert.Equal(31, jT809_JT1078_0x1900_0x1902.ItemList[1].ChannelId); | |||
Assert.Equal(41u, jT809_JT1078_0x1900_0x1902.ItemList[1].FileSize); | |||
Assert.Equal(51, jT809_JT1078_0x1900_0x1902.ItemList[1].MemType); | |||
Assert.Equal(Convert.ToDateTime("2019-06-15 10:10:10"), jT809_JT1078_0x1900_0x1902.ItemList[1].StartTime); | |||
Assert.Equal(Convert.ToDateTime("2019-06-16 10:10:10"), jT809_JT1078_0x1900_0x1902.ItemList[1].EndTime); | |||
Assert.Equal(61, jT809_JT1078_0x1900_0x1902.ItemList[1].StreamType); | |||
} | |||
} | |||
} |
@@ -1,97 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using System; | |||
using System.Linq; | |||
using System.Collections.Generic; | |||
using Xunit; | |||
using Newtonsoft.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.Test | |||
{ | |||
public class JT809_JT1078_0x1A00Test | |||
{ | |||
JT809Serializer JT809Serializer; | |||
public JT809_JT1078_0x1A00Test() | |||
{ | |||
IServiceCollection serviceDescriptors1 = new ServiceCollection(); | |||
serviceDescriptors1 | |||
.AddJT809Configure() | |||
.AddJT1078Configure(); | |||
var ServiceProvider1 = serviceDescriptors1.BuildServiceProvider(); | |||
var defaultConfig = ServiceProvider1.GetRequiredService<IJT809Config>(); | |||
JT809Serializer = defaultConfig.GetSerializer(); | |||
Newtonsoft.Json.JsonConvert.DefaultSettings = new Func<JsonSerializerSettings>(() => | |||
{ | |||
//日期类型默认格式化处理 | |||
return new Newtonsoft.Json.JsonSerializerSettings | |||
{ | |||
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.MicrosoftDateFormat, | |||
DateFormatString = "yyyy-MM-dd HH:mm:ss" | |||
}; | |||
}); | |||
} | |||
[Fact] | |||
public void Test1() | |||
{ | |||
JT809_JT1078_0x1A00 jT809_JT1078_0x1A00 = new JT809_JT1078_0x1A00() | |||
{ | |||
VehicleNo="粤B12345", | |||
VehicleColor= Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType= (ushort)JT809_JT1078_SubBusinessType.远程录像回放请求应答消息, | |||
SubBodies= new JT809_JT1078_0x1A00_0x1A01() | |||
{ | |||
Result= JT809_JT1078_0x1A00_0x1A01_Result.失败, | |||
ServerIp="127.0.0.1", | |||
ServerPort=8080 | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x1A00).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000021A010000002300000000000000000000000000000000000000000000003132372E302E302E311F9001", hex); | |||
} | |||
[Fact] | |||
public void Test2() | |||
{ | |||
var jT809_JT1078_0x1A00 = JT809Serializer.Deserialize<JT809_JT1078_0x1A00>("D4C142313233343500000000000000000000000000021A010000002300000000000000000000000000000000000000000000003132372E302E302E311F9001".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x1A00.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x1A00.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.远程录像回放请求应答消息, jT809_JT1078_0x1A00.SubBusinessType); | |||
var jT809_JT1078_0x1A00_0x1A01 = jT809_JT1078_0x1A00.SubBodies as JT809_JT1078_0x1A00_0x1A01; | |||
Assert.Equal(1, (byte)jT809_JT1078_0x1A00_0x1A01.Result); | |||
Assert.Equal("127.0.0.1", jT809_JT1078_0x1A00_0x1A01.ServerIp); | |||
Assert.Equal(8080, jT809_JT1078_0x1A00_0x1A01.ServerPort); | |||
} | |||
[Fact] | |||
public void Test3() | |||
{ | |||
JT809_JT1078_0x1A00 jT809_JT1078_0x1A00 = new JT809_JT1078_0x1A00() | |||
{ | |||
VehicleNo = "粤B12345", | |||
VehicleColor = Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType = (ushort)JT809_JT1078_SubBusinessType.远程录像回放控制应答消息, | |||
SubBodies = new JT809_JT1078_0x1A00_0x1A02() { | |||
Result= JT809_JT1078_0x1A00_0x1A02_Result.失败 | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x1A00).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000021A020000000101", hex); | |||
} | |||
[Fact] | |||
public void Test4() | |||
{ | |||
var jT809_JT1078_0x1A00 = JT809Serializer.Deserialize<JT809_JT1078_0x1A00>("D4C142313233343500000000000000000000000000021A020000000101".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x1A00.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x1A00.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.远程录像回放控制应答消息, jT809_JT1078_0x1A00.SubBusinessType); | |||
var jT809_JT1078_0x1A00_0x1A02 = jT809_JT1078_0x1A00.SubBodies as JT809_JT1078_0x1A00_0x1A02; | |||
Assert.Equal(1, (byte)jT809_JT1078_0x1A00_0x1A02.Result); | |||
} | |||
} | |||
} |
@@ -1,135 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using System; | |||
using System.Linq; | |||
using System.Collections.Generic; | |||
using Xunit; | |||
using Newtonsoft.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.Test | |||
{ | |||
public class JT809_JT1078_0x1B00Test | |||
{ | |||
JT809Serializer JT809Serializer; | |||
public JT809_JT1078_0x1B00Test() | |||
{ | |||
IServiceCollection serviceDescriptors1 = new ServiceCollection(); | |||
serviceDescriptors1 | |||
.AddJT809Configure() | |||
.AddJT1078Configure(); | |||
var ServiceProvider1 = serviceDescriptors1.BuildServiceProvider(); | |||
var defaultConfig = ServiceProvider1.GetRequiredService<IJT809Config>(); | |||
JT809Serializer = defaultConfig.GetSerializer(); | |||
Newtonsoft.Json.JsonConvert.DefaultSettings = new Func<JsonSerializerSettings>(() => | |||
{ | |||
//日期类型默认格式化处理 | |||
return new Newtonsoft.Json.JsonSerializerSettings | |||
{ | |||
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.MicrosoftDateFormat, | |||
DateFormatString = "yyyy-MM-dd HH:mm:ss" | |||
}; | |||
}); | |||
} | |||
[Fact] | |||
public void Test1() | |||
{ | |||
JT809_JT1078_0x1B00 jT809_JT1078_0x1B00 = new JT809_JT1078_0x1B00() | |||
{ | |||
VehicleNo="粤B12345", | |||
VehicleColor= Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType= (ushort)JT809_JT1078_SubBusinessType.远程录像下载请求应答消息, | |||
SubBodies= new JT809_JT1078_0x1B00_0x1B01() | |||
{ | |||
Result= JT809_JT1078_0x1B00_0x1B01_Result.失败, | |||
SessionId=2 | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x1B00).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000021B0100000003010002", hex); | |||
} | |||
[Fact] | |||
public void Test2() | |||
{ | |||
var jT809_JT1078_0x1B00 = JT809Serializer.Deserialize<JT809_JT1078_0x1B00>("D4C142313233343500000000000000000000000000021B0100000003010002".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x1B00.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x1B00.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.远程录像下载请求应答消息, jT809_JT1078_0x1B00.SubBusinessType); | |||
var jT809_JT1078_0x1B00_0x1B01 = jT809_JT1078_0x1B00.SubBodies as JT809_JT1078_0x1B00_0x1B01; | |||
Assert.Equal(1, (byte)jT809_JT1078_0x1B00_0x1B01.Result); | |||
Assert.Equal(2, (byte)jT809_JT1078_0x1B00_0x1B01.SessionId); | |||
} | |||
[Fact] | |||
public void Test3() | |||
{ | |||
JT809_JT1078_0x1B00 jT809_JT1078_0x1B00 = new JT809_JT1078_0x1B00() | |||
{ | |||
VehicleNo = "粤B12345", | |||
VehicleColor = Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType = (ushort)JT809_JT1078_SubBusinessType.远程录像下载通知消息, | |||
SubBodies = new JT809_JT1078_0x1B00_0x1B02() { | |||
Result= JT809_JT1078_0x1B00_0x1B02_Result.失败, | |||
UserName="tk", | |||
SessionId=2, | |||
ServerIp="127.0.0.1", | |||
FilePath="D://123/456", | |||
Password="tk123456", | |||
TcpPort=8080 | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x1B00).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000021B020000013401000200000000000000000000000000000000000000000000003132372E302E302E311F900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000746B0000000000000000000000000000746B313233343536000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000443A2F2F3132332F343536", hex); | |||
} | |||
[Fact] | |||
public void Test4() | |||
{ | |||
var jT809_JT1078_0x1B00 = JT809Serializer.Deserialize<JT809_JT1078_0x1B00>("D4C142313233343500000000000000000000000000021B020000013401000200000000000000000000000000000000000000000000003132372E302E302E311F900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000746B0000000000000000000000000000746B313233343536000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000443A2F2F3132332F343536".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x1B00.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x1B00.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.远程录像下载通知消息, jT809_JT1078_0x1B00.SubBusinessType); | |||
var jT809_JT1078_0x1B00_0x1B02 = jT809_JT1078_0x1B00.SubBodies as JT809_JT1078_0x1B00_0x1B02; | |||
Assert.Equal(1, (byte)jT809_JT1078_0x1B00_0x1B02.Result); | |||
Assert.Equal("tk", jT809_JT1078_0x1B00_0x1B02.UserName); | |||
Assert.Equal(2, jT809_JT1078_0x1B00_0x1B02.SessionId); | |||
Assert.Equal("127.0.0.1", jT809_JT1078_0x1B00_0x1B02.ServerIp); | |||
Assert.Equal("D://123/456", jT809_JT1078_0x1B00_0x1B02.FilePath); | |||
Assert.Equal("tk123456", jT809_JT1078_0x1B00_0x1B02.Password); | |||
Assert.Equal(8080, jT809_JT1078_0x1B00_0x1B02.TcpPort); | |||
} | |||
[Fact] | |||
public void Test5() | |||
{ | |||
JT809_JT1078_0x1B00 jT809_JT1078_0x1B00 = new JT809_JT1078_0x1B00() | |||
{ | |||
VehicleNo = "粤B12345", | |||
VehicleColor = Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType = (ushort)JT809_JT1078_SubBusinessType.远程录像下载控制应答消息, | |||
SubBodies = new JT809_JT1078_0x1B00_0x1B03() | |||
{ | |||
Result = JT809_JT1078_0x1B00_0x1B03_Result.失败 | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x1B00).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000021B030000000101", hex); | |||
} | |||
[Fact] | |||
public void Test6() | |||
{ | |||
var jT809_JT1078_0x1B00 = JT809Serializer.Deserialize<JT809_JT1078_0x1B00>("D4C142313233343500000000000000000000000000021B030000000101".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x1B00.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x1B00.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.远程录像下载控制应答消息, jT809_JT1078_0x1B00.SubBusinessType); | |||
var jT809_JT1078_0x1B00_0x1B03 = jT809_JT1078_0x1B00.SubBodies as JT809_JT1078_0x1B00_0x1B03; | |||
Assert.Equal(1, (byte)jT809_JT1078_0x1B00_0x1B03.Result); | |||
} | |||
} | |||
} |
@@ -1,50 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using System; | |||
using System.Linq; | |||
using System.Collections.Generic; | |||
using Xunit; | |||
namespace JT809.Protocol.Extensions.JT1078.Test | |||
{ | |||
public class JT809_JT1078_0x9700Test | |||
{ | |||
JT809Serializer JT809Serializer; | |||
public JT809_JT1078_0x9700Test() | |||
{ | |||
IServiceCollection serviceDescriptors1 = new ServiceCollection(); | |||
serviceDescriptors1 | |||
.AddJT809Configure() | |||
.AddJT1078Configure(); | |||
var ServiceProvider1 = serviceDescriptors1.BuildServiceProvider(); | |||
var defaultConfig = ServiceProvider1.GetRequiredService<IJT809Config>(); | |||
JT809Serializer = defaultConfig.GetSerializer(); | |||
} | |||
[Fact] | |||
public void Test1() | |||
{ | |||
JT809_JT1078_0x9700 jT809_JT1078_0x9700 = new JT809_JT1078_0x9700() | |||
{ | |||
VehicleNo="粤B12345", | |||
VehicleColor= Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType= (ushort)JT809_JT1078_SubBusinessType.时效口令请求应答消息, | |||
SubBodies= new JT809_JT1078_0x9700_0x9702() | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x9700).ToHexString(); | |||
Assert.Equal("D4C14231323334350000000000000000000000000002970200000000", hex); | |||
} | |||
[Fact] | |||
public void Test2() | |||
{ | |||
var jT809_JT1078_0x9700 = JT809Serializer.Deserialize<JT809_JT1078_0x9700>("D4C14231323334350000000000000000000000000002970200000000".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x9700.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x9700.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.时效口令请求应答消息, jT809_JT1078_0x9700.SubBusinessType); | |||
} | |||
} | |||
} |
@@ -1,93 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using System; | |||
using System.Linq; | |||
using System.Collections.Generic; | |||
using Xunit; | |||
namespace JT809.Protocol.Extensions.JT1078.Test | |||
{ | |||
public class JT809_JT1078_0x9800Test | |||
{ | |||
JT809Serializer JT809Serializer; | |||
public JT809_JT1078_0x9800Test() | |||
{ | |||
IServiceCollection serviceDescriptors1 = new ServiceCollection(); | |||
serviceDescriptors1 | |||
.AddJT809Configure() | |||
.AddJT1078Configure(); | |||
var ServiceProvider1 = serviceDescriptors1.BuildServiceProvider(); | |||
var defaultConfig = ServiceProvider1.GetRequiredService<IJT809Config>(); | |||
JT809Serializer = defaultConfig.GetSerializer(); | |||
} | |||
[Fact] | |||
public void Test1() | |||
{ | |||
var GnssDatas = Enumerable.Range(0, 36).Select(m => (byte)m).ToArray(); | |||
var AuthorizeCodes = "0123456789012345678901234567890123456789012345678901234567890123"; | |||
JT809_JT1078_0x9800 jT809_JT1078_0x9800 = new JT809_JT1078_0x9800() | |||
{ | |||
VehicleNo="粤B12345", | |||
VehicleColor= Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType= (ushort)JT809_JT1078_SubBusinessType.实时音视频请求消息, | |||
SubBodies= new JT809_JT1078_0x9800_0x9801() { | |||
AVitemType=1, | |||
ChannelId=2, | |||
GnssData= GnssDatas, | |||
AuthorizeCode= AuthorizeCodes | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x9800).ToHexString(); | |||
Assert.Equal("D4C14231323334350000000000000000000000000002980100000066020130313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223", hex); | |||
} | |||
[Fact] | |||
public void Test2() | |||
{ | |||
var GnssDatas = Enumerable.Range(0, 36).Select(m => (byte)m).ToArray(); | |||
var AuthorizeCodes = "0123456789012345678901234567890123456789012345678901234567890123"; | |||
var jT809_JT1078_0x9800 = JT809Serializer.Deserialize<JT809_JT1078_0x9800>("D4C14231323334350000000000000000000000000002980100000066020130313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x9800.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x9800.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.实时音视频请求消息, jT809_JT1078_0x9800.SubBusinessType); | |||
var jT809_JT1078_0x9800_0x9801 = jT809_JT1078_0x9800.SubBodies as JT809_JT1078_0x9800_0x9801; | |||
Assert.Equal(1, jT809_JT1078_0x9800_0x9801.AVitemType); | |||
Assert.Equal(2, jT809_JT1078_0x9800_0x9801.ChannelId); | |||
Assert.Equal(GnssDatas, jT809_JT1078_0x9800_0x9801.GnssData); | |||
Assert.Equal(AuthorizeCodes, jT809_JT1078_0x9800_0x9801.AuthorizeCode); | |||
} | |||
[Fact] | |||
public void Test3() | |||
{ | |||
JT809_JT1078_0x9800 jT809_JT1078_0x9800 = new JT809_JT1078_0x9800() | |||
{ | |||
VehicleNo = "粤B12345", | |||
VehicleColor = Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType = (ushort)JT809_JT1078_SubBusinessType.主动请求停止实时音视频传输消息, | |||
SubBodies = new JT809_JT1078_0x9800_0x9802() { | |||
ChannelId=1, | |||
AVitemType=2 | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x9800).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000029802000000020102", hex); | |||
} | |||
[Fact] | |||
public void Test4() | |||
{ | |||
var jT809_JT1078_0x9800 = JT809Serializer.Deserialize<JT809_JT1078_0x9800>("D4C142313233343500000000000000000000000000029802000000020102".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x9800.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x9800.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.主动请求停止实时音视频传输消息, jT809_JT1078_0x9800.SubBusinessType); | |||
var jT809_JT1078_0x9800_0x9802 = jT809_JT1078_0x9800.SubBodies as JT809_JT1078_0x9800_0x9802; | |||
Assert.Equal(1, jT809_JT1078_0x9800_0x9802.ChannelId); | |||
Assert.Equal(2, jT809_JT1078_0x9800_0x9802.AVitemType); | |||
} | |||
} | |||
} |
@@ -1,114 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using System; | |||
using System.Linq; | |||
using System.Collections.Generic; | |||
using Xunit; | |||
using Newtonsoft.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.Test | |||
{ | |||
public class JT809_JT1078_0x9900Test | |||
{ | |||
JT809Serializer JT809Serializer; | |||
public JT809_JT1078_0x9900Test() | |||
{ | |||
IServiceCollection serviceDescriptors1 = new ServiceCollection(); | |||
serviceDescriptors1 | |||
.AddJT809Configure() | |||
.AddJT1078Configure(); | |||
var ServiceProvider1 = serviceDescriptors1.BuildServiceProvider(); | |||
var defaultConfig = ServiceProvider1.GetRequiredService<IJT809Config>(); | |||
JT809Serializer = defaultConfig.GetSerializer(); | |||
Newtonsoft.Json.JsonConvert.DefaultSettings = new Func<JsonSerializerSettings>(() => | |||
{ | |||
//日期类型默认格式化处理 | |||
return new Newtonsoft.Json.JsonSerializerSettings | |||
{ | |||
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.MicrosoftDateFormat, | |||
DateFormatString = "yyyy-MM-dd HH:mm:ss" | |||
}; | |||
}); | |||
} | |||
[Fact] | |||
public void Test1() | |||
{ | |||
JT809_JT1078_0x9900 jT809_JT1078_0x9900 = new JT809_JT1078_0x9900() | |||
{ | |||
VehicleNo="粤B12345", | |||
VehicleColor= Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType= (ushort)JT809_JT1078_SubBusinessType.主动上传音视频资源目录信息应答消息, | |||
SubBodies= new JT809_JT1078_0x9900_0x9901() { | |||
Result= JT809_JT1078_0x9900_0x9901_Result.失败, | |||
ItemNumber=2 | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x9900).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000029901000000020102", hex); | |||
} | |||
[Fact] | |||
public void Test2() | |||
{ | |||
var jT809_JT1078_0x9900 = JT809Serializer.Deserialize<JT809_JT1078_0x9900>("D4C142313233343500000000000000000000000000029901000000020102".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x9900.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x9900.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.主动上传音视频资源目录信息应答消息, jT809_JT1078_0x9900.SubBusinessType); | |||
var jT809_JT1078_0x9900_0x9901 = jT809_JT1078_0x9900.SubBodies as JT809_JT1078_0x9900_0x9901; | |||
Assert.Equal(1, (byte)jT809_JT1078_0x9900_0x9901.Result); | |||
Assert.Equal(2, (byte)jT809_JT1078_0x9900_0x9901.ItemNumber); | |||
} | |||
[Fact] | |||
public void Test3() | |||
{ | |||
var GnssDatas = Enumerable.Range(0, 36).Select(m => (byte)m).ToArray(); | |||
var AuthorizeCodes = "0123456789012345678901234567890123456789012345678901234567890123"; | |||
JT809_JT1078_0x9900 jT809_JT1078_0x9900 = new JT809_JT1078_0x9900() | |||
{ | |||
VehicleNo = "粤B12345", | |||
VehicleColor = Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType = (ushort)JT809_JT1078_SubBusinessType.查询音视频资源目录请求消息, | |||
SubBodies = new JT809_JT1078_0x9900_0x9902() { | |||
ChannelId = 1, | |||
AlarmType = 2, | |||
AVItemType = 3, | |||
MemType = 4, | |||
StartTime = Convert.ToDateTime("2017-07-15 10:10:10"), | |||
EndTime = Convert.ToDateTime("2017-07-16 10:10:10"), | |||
StreamType =5, | |||
AuthorizeCode= AuthorizeCodes, | |||
GnssData= GnssDatas | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x9900).ToHexString(); | |||
Assert.Equal("D4C1423132333435000000000000000000000000000299020000008001000000005969798200000000596ACB02000000000000000203050430313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223", hex); | |||
} | |||
[Fact] | |||
public void Test4() | |||
{ | |||
var GnssDatas = Enumerable.Range(0, 36).Select(m => (byte)m).ToArray(); | |||
var AuthorizeCodes = "0123456789012345678901234567890123456789012345678901234567890123"; | |||
var jT809_JT1078_0x9900 = JT809Serializer.Deserialize<JT809_JT1078_0x9900>("D4C1423132333435000000000000000000000000000299020000008001000000005969798200000000596ACB02000000000000000203050430313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x9900.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x9900.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.查询音视频资源目录请求消息, jT809_JT1078_0x9900.SubBusinessType); | |||
var jT809_JT1078_0x9900_0x9902 = jT809_JT1078_0x9900.SubBodies as JT809_JT1078_0x9900_0x9902; | |||
Assert.Equal(1, jT809_JT1078_0x9900_0x9902.ChannelId); | |||
Assert.Equal(2u, jT809_JT1078_0x9900_0x9902.AlarmType); | |||
Assert.Equal(3, jT809_JT1078_0x9900_0x9902.AVItemType); | |||
Assert.Equal(4, jT809_JT1078_0x9900_0x9902.MemType); | |||
Assert.Equal(Convert.ToDateTime("2017-07-15 10:10:10"), jT809_JT1078_0x9900_0x9902.StartTime); | |||
Assert.Equal(Convert.ToDateTime("2017-07-16 10:10:10"), jT809_JT1078_0x9900_0x9902.EndTime); | |||
Assert.Equal(5, jT809_JT1078_0x9900_0x9902.StreamType); | |||
Assert.Equal(AuthorizeCodes, jT809_JT1078_0x9900_0x9902.AuthorizeCode); | |||
Assert.Equal(GnssDatas, jT809_JT1078_0x9900_0x9902.GnssData); | |||
} | |||
} | |||
} |
@@ -1,116 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using System; | |||
using System.Linq; | |||
using System.Collections.Generic; | |||
using Xunit; | |||
using Newtonsoft.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.Test | |||
{ | |||
public class JT809_JT1078_0x9A00Test | |||
{ | |||
JT809Serializer JT809Serializer; | |||
public JT809_JT1078_0x9A00Test() | |||
{ | |||
IServiceCollection serviceDescriptors1 = new ServiceCollection(); | |||
serviceDescriptors1 | |||
.AddJT809Configure() | |||
.AddJT1078Configure(); | |||
var ServiceProvider1 = serviceDescriptors1.BuildServiceProvider(); | |||
var defaultConfig = ServiceProvider1.GetRequiredService<IJT809Config>(); | |||
JT809Serializer = defaultConfig.GetSerializer(); | |||
Newtonsoft.Json.JsonConvert.DefaultSettings = new Func<JsonSerializerSettings>(() => | |||
{ | |||
//日期类型默认格式化处理 | |||
return new Newtonsoft.Json.JsonSerializerSettings | |||
{ | |||
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.MicrosoftDateFormat, | |||
DateFormatString = "yyyy-MM-dd HH:mm:ss" | |||
}; | |||
}); | |||
} | |||
[Fact] | |||
public void Test1() | |||
{ | |||
var GnssDatas = Enumerable.Range(0, 36).Select(m => (byte)m).ToArray(); | |||
var AuthorizeCodes = "0123456789012345678901234567890123456789012345678901234567890123"; | |||
JT809_JT1078_0x9A00 jT809_JT1078_0x9A00 = new JT809_JT1078_0x9A00() | |||
{ | |||
VehicleNo = "粤B12345", | |||
VehicleColor = Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType = (ushort)JT809_JT1078_SubBusinessType.远程录像回放请求消息, | |||
SubBodies = new JT809_JT1078_0x9A00_0x9A01() { | |||
AuthorizeCode = AuthorizeCodes, | |||
GnssData = GnssDatas, | |||
AVItemType = 1, | |||
ChannelId = 2, | |||
MemType = 3, | |||
StreamType = 4, | |||
PlayBackStartTime = Convert.ToDateTime("2017-07-16 10:10:10"), | |||
PlayBackEndTime = Convert.ToDateTime("2017-07-17 10:10:10") | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x9A00).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000029A01000000780201040300000000596ACB0200000000596C1C8230313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223", hex); | |||
} | |||
[Fact] | |||
public void Test2() | |||
{ | |||
var GnssDatas = Enumerable.Range(0, 36).Select(m => (byte)m).ToArray(); | |||
var AuthorizeCodes = "0123456789012345678901234567890123456789012345678901234567890123"; | |||
var jT809_JT1078_0x9A00 = JT809Serializer.Deserialize<JT809_JT1078_0x9A00>("D4C142313233343500000000000000000000000000029A01000000780201040300000000596ACB0200000000596C1C8230313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x9A00.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x9A00.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.远程录像回放请求消息, jT809_JT1078_0x9A00.SubBusinessType); | |||
var jT809_JT1078_0x9A00_0x9A01 = jT809_JT1078_0x9A00.SubBodies as JT809_JT1078_0x9A00_0x9A01; | |||
Assert.Equal(AuthorizeCodes, jT809_JT1078_0x9A00_0x9A01.AuthorizeCode); | |||
Assert.Equal(GnssDatas, jT809_JT1078_0x9A00_0x9A01.GnssData); | |||
Assert.Equal(1,jT809_JT1078_0x9A00_0x9A01.AVItemType); | |||
Assert.Equal(2,jT809_JT1078_0x9A00_0x9A01.ChannelId); | |||
Assert.Equal(3,jT809_JT1078_0x9A00_0x9A01.MemType); | |||
Assert.Equal(4,jT809_JT1078_0x9A00_0x9A01.StreamType); | |||
Assert.Equal(Convert.ToDateTime("2017-07-16 10:10:10"), jT809_JT1078_0x9A00_0x9A01.PlayBackStartTime); | |||
Assert.Equal(Convert.ToDateTime("2017-07-17 10:10:10"), jT809_JT1078_0x9A00_0x9A01.PlayBackEndTime); | |||
} | |||
[Fact] | |||
public void Test3() | |||
{ | |||
var GnssDatas = Enumerable.Range(0, 36).Select(m => (byte)m).ToArray(); | |||
var AuthorizeCodes = Enumerable.Range(0, 64).Select(m => (byte)m).ToArray(); | |||
JT809_JT1078_0x9A00 jT809_JT1078_0x9A00 = new JT809_JT1078_0x9A00() | |||
{ | |||
VehicleNo = "粤B12345", | |||
VehicleColor = Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType = (ushort)JT809_JT1078_SubBusinessType.远程录像回放控制消息, | |||
SubBodies = new JT809_JT1078_0x9A00_0x9A02() { | |||
ControlType= ControlType.暂停回放, | |||
DateTime= Convert.ToDateTime("2017-07-17 10:10:10"), | |||
FastTime= FastTime._1倍 | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x9A00).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000029A020000000A010100000000596C1C82", hex); | |||
} | |||
[Fact] | |||
public void Test4() | |||
{ | |||
var jT809_JT1078_0x9A00 = JT809Serializer.Deserialize<JT809_JT1078_0x9A00>("D4C142313233343500000000000000000000000000029A020000000A010100000000596C1C82".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x9A00.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x9A00.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.远程录像回放控制消息, jT809_JT1078_0x9A00.SubBusinessType); | |||
var jT809_JT1078_0x9A00_0x9A02 = jT809_JT1078_0x9A00.SubBodies as JT809_JT1078_0x9A00_0x9A02; | |||
Assert.Equal(1, (byte)jT809_JT1078_0x9A00_0x9A02.ControlType); | |||
Assert.Equal(Convert.ToDateTime("2017-07-17 10:10:10"), jT809_JT1078_0x9A00_0x9A02.DateTime); | |||
Assert.Equal(1, (byte)jT809_JT1078_0x9A00_0x9A02.FastTime); | |||
} | |||
} | |||
} |
@@ -1,145 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using System; | |||
using System.Linq; | |||
using System.Collections.Generic; | |||
using Xunit; | |||
using Newtonsoft.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.Test | |||
{ | |||
public class JT809_JT1078_0x9B00Test | |||
{ | |||
JT809Serializer JT809Serializer; | |||
public JT809_JT1078_0x9B00Test() | |||
{ | |||
IServiceCollection serviceDescriptors1 = new ServiceCollection(); | |||
serviceDescriptors1 | |||
.AddJT809Configure() | |||
.AddJT1078Configure(); | |||
var ServiceProvider1 = serviceDescriptors1.BuildServiceProvider(); | |||
var defaultConfig = ServiceProvider1.GetRequiredService<IJT809Config>(); | |||
JT809Serializer = defaultConfig.GetSerializer(); | |||
Newtonsoft.Json.JsonConvert.DefaultSettings = new Func<JsonSerializerSettings>(() => | |||
{ | |||
//日期类型默认格式化处理 | |||
return new Newtonsoft.Json.JsonSerializerSettings | |||
{ | |||
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.MicrosoftDateFormat, | |||
DateFormatString = "yyyy-MM-dd HH:mm:ss" | |||
}; | |||
}); | |||
} | |||
[Fact] | |||
public void Test1() | |||
{ | |||
var GnssDatas = Enumerable.Range(0, 36).Select(m => (byte)m).ToArray(); | |||
var AuthorizeCodes = "0123456789012345678901234567890123456789012345678901234567890123"; | |||
JT809_JT1078_0x9B00 jT809_JT1078_0x9B00 = new JT809_JT1078_0x9B00() | |||
{ | |||
VehicleNo = "粤B12345", | |||
VehicleColor = Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType = (ushort)JT809_JT1078_SubBusinessType.远程录像下载请求消息, | |||
SubBodies = new JT809_JT1078_0x9B00_0x9B01() { | |||
AuthorizeCode = AuthorizeCodes, | |||
GnssData = GnssDatas, | |||
AVItemType = 1, | |||
ChannelId = 2, | |||
MemType = 3, | |||
StreamType = 4, | |||
StartTime = Convert.ToDateTime("2017-07-16 10:10:10"), | |||
EndTime = Convert.ToDateTime("2017-07-17 10:10:10"), | |||
AlarmType=5, | |||
FileSize=6 | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x9B00).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000029B01000000840200000000596ACB0200000000596C1C8200000000000000050104030000000630313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223", hex); | |||
} | |||
[Fact] | |||
public void Test2() | |||
{ | |||
var GnssDatas = Enumerable.Range(0, 36).Select(m => (byte)m).ToArray(); | |||
var AuthorizeCodes = "0123456789012345678901234567890123456789012345678901234567890123"; | |||
var jT809_JT1078_0x9B00 = JT809Serializer.Deserialize<JT809_JT1078_0x9B00>("D4C142313233343500000000000000000000000000029B01000000840200000000596ACB0200000000596C1C8200000000000000050104030000000630313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x9B00.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x9B00.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.远程录像下载请求消息, jT809_JT1078_0x9B00.SubBusinessType); | |||
var jT809_JT1078_0x9B00_0x9B01 = jT809_JT1078_0x9B00.SubBodies as JT809_JT1078_0x9B00_0x9B01; | |||
Assert.Equal(AuthorizeCodes, jT809_JT1078_0x9B00_0x9B01.AuthorizeCode); | |||
Assert.Equal(GnssDatas, jT809_JT1078_0x9B00_0x9B01.GnssData); | |||
Assert.Equal(1, jT809_JT1078_0x9B00_0x9B01.AVItemType); | |||
Assert.Equal(2, jT809_JT1078_0x9B00_0x9B01.ChannelId); | |||
Assert.Equal(3, jT809_JT1078_0x9B00_0x9B01.MemType); | |||
Assert.Equal(4, jT809_JT1078_0x9B00_0x9B01.StreamType); | |||
Assert.Equal(Convert.ToDateTime("2017-07-16 10:10:10"), jT809_JT1078_0x9B00_0x9B01.StartTime); | |||
Assert.Equal(Convert.ToDateTime("2017-07-17 10:10:10"), jT809_JT1078_0x9B00_0x9B01.EndTime); | |||
Assert.Equal(5u, jT809_JT1078_0x9B00_0x9B01.AlarmType); | |||
Assert.Equal(6u, jT809_JT1078_0x9B00_0x9B01.FileSize); | |||
} | |||
[Fact] | |||
public void Test3() | |||
{ | |||
JT809_JT1078_0x9B00 jT809_JT1078_0x9B00 = new JT809_JT1078_0x9B00() | |||
{ | |||
VehicleNo = "粤B12345", | |||
VehicleColor = Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType = (ushort)JT809_JT1078_SubBusinessType.远程录像下载完成通知应答消息, | |||
SubBodies = new JT809_JT1078_0x9B00_0x9B02() { | |||
Result= JT809_JT1078_0x9B00_0x9B02_Result.失败, | |||
SessionId=2 | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x9B00).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000029B0200000003010002", hex); | |||
} | |||
[Fact] | |||
public void Test4() | |||
{ | |||
var jT809_JT1078_0x9B00 = JT809Serializer.Deserialize<JT809_JT1078_0x9B00>("D4C142313233343500000000000000000000000000029B0200000003010002".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x9B00.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x9B00.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.远程录像下载完成通知应答消息, jT809_JT1078_0x9B00.SubBusinessType); | |||
var jT809_JT1078_0x9B00_0x9B02 = jT809_JT1078_0x9B00.SubBodies as JT809_JT1078_0x9B00_0x9B02; | |||
Assert.Equal(1, (byte)jT809_JT1078_0x9B00_0x9B02.Result); | |||
Assert.Equal(2, (byte)jT809_JT1078_0x9B00_0x9B02.SessionId); | |||
} | |||
[Fact] | |||
public void Test5() | |||
{ | |||
JT809_JT1078_0x9B00 jT809_JT1078_0x9B00 = new JT809_JT1078_0x9B00() | |||
{ | |||
VehicleNo = "粤B12345", | |||
VehicleColor = Protocol.Enums.JT809VehicleColorType.黄色, | |||
SubBusinessType = (ushort)JT809_JT1078_SubBusinessType.远程录像下载控制消息, | |||
SubBodies = new JT809_JT1078_0x9B00_0x9B03() | |||
{ | |||
Type= JT809_JT1078_0x9B00_0x9B03_Type.继续, | |||
SessionId = 2 | |||
} | |||
}; | |||
var hex = JT809Serializer.Serialize(jT809_JT1078_0x9B00).ToHexString(); | |||
Assert.Equal("D4C142313233343500000000000000000000000000029B0300000003000201", hex); | |||
} | |||
[Fact] | |||
public void Test6() | |||
{ | |||
var jT809_JT1078_0x9B00 = JT809Serializer.Deserialize<JT809_JT1078_0x9B00>("D4C142313233343500000000000000000000000000029B0300000003000201".ToHexBytes()); | |||
Assert.Equal("粤B12345", jT809_JT1078_0x9B00.VehicleNo); | |||
Assert.Equal(Protocol.Enums.JT809VehicleColorType.黄色, jT809_JT1078_0x9B00.VehicleColor); | |||
Assert.Equal((ushort)JT809_JT1078_SubBusinessType.远程录像下载控制消息, jT809_JT1078_0x9B00.SubBusinessType); | |||
var jT809_JT1078_0x9B00_0x9B03 = jT809_JT1078_0x9B00.SubBodies as JT809_JT1078_0x9B00_0x9B03; | |||
Assert.Equal(1, (byte)jT809_JT1078_0x9B00_0x9B03.Type); | |||
Assert.Equal(2, (byte)jT809_JT1078_0x9B00_0x9B03.SessionId); | |||
} | |||
} | |||
} |
@@ -1,101 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using Microsoft.Extensions.DependencyInjection; | |||
using Newtonsoft.Json; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using Xunit; | |||
namespace JT809.Protocol.Extensions.JT1078.Test | |||
{ | |||
public class JT809_JT1078_AnalyzeTest | |||
{ | |||
JT809Serializer JT809Serializer; | |||
public JT809_JT1078_AnalyzeTest() | |||
{ | |||
IServiceCollection serviceDescriptors1 = new ServiceCollection(); | |||
serviceDescriptors1 | |||
.AddJT809Configure() | |||
.AddJT1078Configure(); | |||
var ServiceProvider1 = serviceDescriptors1.BuildServiceProvider(); | |||
var defaultConfig = ServiceProvider1.GetRequiredService<IJT809Config>(); | |||
JT809Serializer = defaultConfig.GetSerializer(); | |||
Newtonsoft.Json.JsonConvert.DefaultSettings = new Func<JsonSerializerSettings>(() => | |||
{ | |||
//日期类型默认格式化处理 | |||
return new Newtonsoft.Json.JsonSerializerSettings | |||
{ | |||
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.MicrosoftDateFormat, | |||
DateFormatString = "yyyy-MM-dd HH:mm:ss" | |||
}; | |||
}); | |||
} | |||
[Fact] | |||
public void Analyze() | |||
{ | |||
var hex = "D4C1423132333435000000000000000000000000000217010000008B30313233343536373839303031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323330313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233".ToHexBytes(); | |||
var json = JT809Serializer.Analyze<JT809_JT1078_0x1700>(hex); | |||
hex = "D4C14231323334350000000000000000000000000002170200000000".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x1700>(hex); | |||
hex = "D4C142313233343500000000000000000000000000021801000000230100000000000000000000000000000000000000000000003132372E302E302E311F90".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x1800>(hex); | |||
hex = "D4C1423132333435000000000000000000000000000218020000000101".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x1800>(hex); | |||
hex = "D4C142313233343500000000000000000000000000021901000000440000000203000000005D2BE082000000005D2D32020000000000000001020605000000041F000000005D045382000000005D05A502000000000000000B153D3300000029".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x1900>(hex); | |||
hex = "D4C14231323334350000000000000000000000000002190200000045010000000203000000005D2BE082000000005D2D32020000000000000001020605000000041F000000005D045382000000005D05A502000000000000000B153D3300000029".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x1900>(hex); | |||
hex = "D4C142313233343500000000000000000000000000021A010000002300000000000000000000000000000000000000000000003132372E302E302E311F9001".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x1A00>(hex); | |||
hex = "D4C142313233343500000000000000000000000000021A020000000101".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x1A00>(hex); | |||
hex = "D4C142313233343500000000000000000000000000021B0100000003010002".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x1B00>(hex); | |||
hex = "D4C142313233343500000000000000000000000000021B020000013401000200000000000000000000000000000000000000000000003132372E302E302E311F900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000746B0000000000000000000000000000746B313233343536000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000443A2F2F3132332F343536".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x1B00>(hex); | |||
hex = "D4C142313233343500000000000000000000000000021B030000000101".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x1B00>(hex); | |||
hex = "D4C14231323334350000000000000000000000000002970200000000".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x9700>(hex); | |||
hex = "D4C14231323334350000000000000000000000000002980100000066020130313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x9800>(hex); | |||
hex = "D4C142313233343500000000000000000000000000029802000000020102".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x9800>(hex); | |||
hex = "D4C142313233343500000000000000000000000000029901000000020102".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x9900>(hex); | |||
hex = "D4C1423132333435000000000000000000000000000299020000008001000000005969798200000000596ACB02000000000000000203050430313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x9900>(hex); | |||
hex = "D4C142313233343500000000000000000000000000029A01000000780201040300000000596ACB0200000000596C1C8230313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x9A00>(hex); | |||
hex = "D4C142313233343500000000000000000000000000029A020000000A010100000000596C1C82".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x9A00>(hex); | |||
hex = "D4C142313233343500000000000000000000000000029B01000000840200000000596ACB0200000000596C1C8200000000000000050104030000000630313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x9B00>(hex); | |||
hex = "D4C142313233343500000000000000000000000000029B0200000003010002".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x9B00>(hex); | |||
hex = "D4C142313233343500000000000000000000000000029B0300000003000201".ToHexBytes(); | |||
json = JT809Serializer.Analyze<JT809_JT1078_0x9B00>(hex); | |||
} | |||
} | |||
} |
@@ -1,20 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Reflection; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078 | |||
{ | |||
public static class DependencyInjectionExtensions | |||
{ | |||
public static IJT809Builder AddJT1078Configure(this IJT809Builder iJT809Builder) | |||
{ | |||
iJT809Builder.Config.Register(Assembly.GetExecutingAssembly()); | |||
iJT809Builder.Config.BusinessTypeFactory.Register(Assembly.GetExecutingAssembly()); | |||
iJT809Builder.Config.SubBusinessTypeFactory.Register(Assembly.GetExecutingAssembly()); | |||
return iJT809Builder; | |||
} | |||
} | |||
} |
@@ -1,20 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
/// <summary> | |||
/// 控制类型 | |||
/// </summary> | |||
public enum ControlType:byte | |||
{ | |||
正常回放=0x00, | |||
暂停回放 = 0x01, | |||
结束回放 = 0x02, | |||
快进回放 = 0x03, | |||
关键帧快退回放 = 0x04, | |||
拖动回放 = 0x05, | |||
关键帧播放 = 0x06, | |||
} | |||
} |
@@ -1,16 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum FastTime : byte | |||
{ | |||
无效 = 0x00, | |||
_1倍 = 0x01, | |||
_2倍 = 0x02, | |||
_4倍 = 0x03, | |||
_8倍 = 0x04, | |||
_16倍 = 0x05, | |||
} | |||
} |
@@ -1,16 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum JT809_JT1078_0x1800_0x1801_Result:byte | |||
{ | |||
成功=0x00, | |||
失败 = 0x01, | |||
不支持 = 0x02, | |||
会话结束 = 0x03, | |||
时效口令错误 = 0x04, | |||
不满足跨域条件 = 0x05, | |||
} | |||
} |
@@ -1,14 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum JT809_JT1078_0x1800_0x1802_Result:byte | |||
{ | |||
成功 = 0x00, | |||
失败 = 0x01, | |||
不支持 = 0x02, | |||
会话结束 = 0x03, | |||
} | |||
} |
@@ -1,16 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum JT809_JT1078_0x1900_0x1902_Result:byte | |||
{ | |||
成功 = 0x00, | |||
失败 = 0x01, | |||
不支持 = 0x02, | |||
会话结束 = 0x03, | |||
时效口令错误 = 0x04, | |||
不满足跨域条件 = 0x05, | |||
} | |||
} |
@@ -1,16 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum JT809_JT1078_0x1A00_0x1A01_Result:byte | |||
{ | |||
成功 = 0x00, | |||
失败 = 0x01, | |||
不支持 = 0x02, | |||
会话结束 = 0x03, | |||
时效口令错误 = 0x04, | |||
不满足跨域条件 = 0x05, | |||
} | |||
} |
@@ -1,14 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum JT809_JT1078_0x1A00_0x1A02_Result:byte | |||
{ | |||
成功 = 0x00, | |||
失败 = 0x01, | |||
不支持 = 0x02, | |||
会话结束 = 0x03, | |||
} | |||
} |
@@ -1,16 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum JT809_JT1078_0x1B00_0x1B01_Result:byte | |||
{ | |||
成功 = 0x00, | |||
失败 = 0x01, | |||
不支持 = 0x02, | |||
会话结束 = 0x03, | |||
时效口令错误 = 0x04, | |||
不满足跨域条件 = 0x05, | |||
} | |||
} |
@@ -1,12 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum JT809_JT1078_0x1B00_0x1B02_Result:byte | |||
{ | |||
成功 = 0x00, | |||
失败 = 0x01, | |||
} | |||
} |
@@ -1,14 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum JT809_JT1078_0x1B00_0x1B03_Result:byte | |||
{ | |||
成功 = 0x00, | |||
失败 = 0x01, | |||
不支持 = 0x02, | |||
会话结束 = 0x03, | |||
} | |||
} |
@@ -1,14 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum JT809_JT1078_0x9900_0x9901_Result:byte | |||
{ | |||
成功 = 0x00, | |||
失败 = 0x01, | |||
不支持 = 0x02, | |||
会话结束 = 0x03, | |||
} | |||
} |
@@ -1,14 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum JT809_JT1078_0x9B00_0x9B02_Result:byte | |||
{ | |||
成功=0x00, | |||
失败 = 0x01, | |||
不支持 = 0x02, | |||
会话结束 = 0x03, | |||
} | |||
} |
@@ -1,13 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum JT809_JT1078_0x9B00_0x9B03_Type:byte | |||
{ | |||
暂停=0x00, | |||
继续 = 0x01, | |||
取消 = 0x02, | |||
} | |||
} |
@@ -1,93 +0,0 @@ | |||
using JT809.Protocol.Attributes; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum JT809_JT1078_BusinessType : ushort | |||
{ | |||
///<summary> | |||
///主链路时效口令业务类 | |||
///UP_AUTHORIZE_MSG | |||
///</summary> | |||
[Description("主链路时效口令业务类")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1700))] | |||
[JT809BusinessTypeDescription("UP_AUTHORIZE_MSG", "主链路时效口令业务类")] | |||
主链路时效口令业务类 = 0x1700, | |||
///<summary> | |||
///从链路时效口令业务类 | |||
///DOWN_AUTHORIZE_MSG | |||
///</summary> | |||
[Description("从链路时效口令业务类")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9700))] | |||
[JT809BusinessTypeDescription("DOWN_AUTHORIZE_MSG", "从链路时效口令业务类")] | |||
从链路时效口令业务类 = 0x9700, | |||
///<summary> | |||
///主链路实时音视频业务类 | |||
///UP_REALVIDEO_MSG | |||
///</summary> | |||
[Description("主链路实时音视频业务类")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1800))] | |||
[JT809BusinessTypeDescription("UP_REALVIDEO_MSG", "主链路实时音视频业务类")] | |||
主链路实时音视频业务类 = 0x1800, | |||
///<summary> | |||
///从链路实时音视频业务类 | |||
///DOWN_REALVIDEO_MSG | |||
///</summary> | |||
[Description("从链路实时音视频业务类")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9800))] | |||
[JT809BusinessTypeDescription("DOWN_REALVIDEO_MSG", "从链路实时音视频业务类")] | |||
从链路实时音视频业务类 = 0x9800, | |||
///<summary> | |||
///主链路远程录像检索业务类 | |||
///UP_SEARCH_MSG | |||
///</summary> | |||
[Description("主链路远程录像检索业务类")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1900))] | |||
[JT809BusinessTypeDescription("UP_SEARCH_MSG", "主链路远程录像检索业务类")] | |||
主链路远程录像检索业务类 = 0x1900, | |||
///<summary> | |||
///从链路远程录像检索业务类 | |||
///DOWN_SEARCH_MSG | |||
///</summary> | |||
[Description("从链路远程录像检索业务类")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9900))] | |||
[JT809BusinessTypeDescription("DOWN_SEARCH_MSG", "从链路远程录像检索业务类")] | |||
从链路远程录像检索业务类 = 0x9900, | |||
///<summary> | |||
///主链路远程录像回放业务类 | |||
///UP_PLAYBACK_MSG | |||
///</summary> | |||
[Description("主链路远程录像回放业务类")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1A00))] | |||
[JT809BusinessTypeDescription("UP_PLAYBACK_MSG", "主链路远程录像回放业务类")] | |||
主链路远程录像回放业务类 = 0x1A00, | |||
///<summary> | |||
///从链路远程录像回放业务类 | |||
///DOWN_PLAYBACK_MSG | |||
///</summary> | |||
[Description("从链路远程录像回放业务类")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9A00))] | |||
[JT809BusinessTypeDescription("DOWN_PLAYBACK_MSG", "从链路远程录像回放业务类")] | |||
从链路远程录像回放业务类 = 0x9A00, | |||
///<summary> | |||
///主链路远程录像下载业务类 | |||
///UP_DOWNLOAD_MSG | |||
///</summary> | |||
[Description("主链路远程录像下载业务类")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1B00))] | |||
[JT809BusinessTypeDescription("UP_DOWNLOAD_MSG", "主链路远程录像下载业务类")] | |||
主链路远程录像下载业务类 = 0x1B00, | |||
///<summary> | |||
///从链路远程录像下载业务类 | |||
///DOWN_DOWNLOAD_MSG | |||
///</summary> | |||
[Description("从链路远程录像下载业务类")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9B00))] | |||
[JT809BusinessTypeDescription("DOWN_DOWNLOAD_MSG", "从链路远程录像下载业务类")] | |||
从链路远程录像下载业务类 = 0x9B00, | |||
} | |||
} |
@@ -1,181 +0,0 @@ | |||
using JT809.Protocol.Attributes; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.ComponentModel; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Enums | |||
{ | |||
public enum JT809_JT1078_SubBusinessType : ushort | |||
{ | |||
///<summary> | |||
///时效口令上报消息 | |||
///UP_AUTHRIZE_MSG_STARTUP | |||
///</summary> | |||
[Description("时效口令上报消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1700_0x1701))] | |||
[JT809BusinessTypeDescription("UP_AUTHRIZE_MSG_STARTUP", "时效口令上报消息")] | |||
时效口令上报消息 = 0x1701, | |||
///<summary> | |||
///时效口令请求消息 | |||
///UP_AUTHRIZE_MSG_STARTUP_REQ | |||
///</summary> | |||
[Description("时效口令请求消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1700_0x1702))] | |||
[JT809BusinessTypeDescription("UP_AUTHRIZE_MSG_STARTUP_REQ", "时效口令请求消息")] | |||
时效口令请求消息 = 0x1702, | |||
///<summary> | |||
///时效口令请求应答消息 | |||
///DOWN_AUTHRIZE_MSG_STARTUP_REQ_ACK | |||
///</summary> | |||
[Description("时效口令请求应答消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9700_0x9702))] | |||
[JT809BusinessTypeDescription("DOWN_AUTHRIZE_MSG_STARTUP_REQ_ACK", "时效口令请求应答消息")] | |||
时效口令请求应答消息 = 0x9702, | |||
///<summary> | |||
///实时音视频请求应答消息 | |||
///UP_REALVIDEO_MSG_STARTUP_ACK | |||
///</summary> | |||
[Description("实时音视频请求应答消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1800_0x1801))] | |||
[JT809BusinessTypeDescription("UP_REALVIDEO_MSG_STARTUP_ACK", "实时音视频请求应答消息")] | |||
实时音视频请求应答消息 = 0x1801, | |||
///<summary> | |||
///主动请求停止实时音视频传输应答消息 | |||
///UP_REALVIDEO_MSG_END_ACK | |||
///</summary> | |||
[Description("主动请求停止实时音视频传输应答消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1800_0x1802))] | |||
[JT809BusinessTypeDescription("UP_REALVIDEO_MSG_END_ACK", "主动请求停止实时音视频传输应答消息")] | |||
主动请求停止实时音视频传输应答消息 = 0x1802, | |||
///<summary> | |||
///实时音视频请求消息 | |||
///DOWN_REALVIDEO_MSG_STARTUP | |||
///</summary> | |||
[Description("实时音视频请求消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9800_0x9801))] | |||
[JT809BusinessTypeDescription("DOWN_REALVIDEO_MSG_STARTUP", "实时音视频请求消息")] | |||
实时音视频请求消息 = 0x9801, | |||
///<summary> | |||
///主动请求停止实时音视频传输消息 | |||
///DOWN_REALVIDEO_MSG_END | |||
///</summary> | |||
[Description("主动请求停止实时音视频传输消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9800_0x9802))] | |||
[JT809BusinessTypeDescription("DOWN_REALVIDEO_MSG_END", "主动请求停止实时音视频传输消息")] | |||
主动请求停止实时音视频传输消息 = 0x9802, | |||
///<summary> | |||
///主动上传音视频资源目录信息消息 | |||
///UP_FILELIST_MSG | |||
///</summary> | |||
[Description("主动上传音视频资源目录信息消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1900_0x1901))] | |||
[JT809BusinessTypeDescription("UP_FILELIST_MSG", "主动上传音视频资源目录信息消息")] | |||
主动上传音视频资源目录信息消息 = 0x1901, | |||
///<summary> | |||
///查询音视频资源目录应答消息 | |||
///UP_REALVIDEO_FILELIST_REQ_ACK | |||
///</summary> | |||
[Description("查询音视频资源目录应答消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1900_0x1902))] | |||
[JT809BusinessTypeDescription("UP_REALVIDEO_FILELIST_REQ_ACK", "查询音视频资源目录应答消息")] | |||
查询音视频资源目录应答消息 = 0x1902, | |||
///<summary> | |||
///主动上传音视频资源目录信息应答消息 | |||
///DOWN_FILELIST_MSG_ACK | |||
///</summary> | |||
[Description("主动上传音视频资源目录信息应答消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9900_0x9901))] | |||
[JT809BusinessTypeDescription("DOWN_FILELIST_MSG_ACK", "主动上传音视频资源目录信息应答消息")] | |||
主动上传音视频资源目录信息应答消息 = 0x9901, | |||
///<summary> | |||
/// 查询音视频资源目录请求消息 | |||
///DOWN_REALVIDEO_FILELIST_REQ | |||
///</summary> | |||
[Description("查询音视频资源目录请求消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9900_0x9902))] | |||
[JT809BusinessTypeDescription("DOWN_REALVIDEO_FILELIST_REQ", "查询音视频资源目录请求消息")] | |||
查询音视频资源目录请求消息 = 0x9902, | |||
///<summary> | |||
///远程录像回放请求应答消息 | |||
///UP_PLAYBACK_MSG_STARTUP_ACK | |||
///</summary> | |||
[Description("远程录像回放请求应答消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1A00_0x1A01))] | |||
[JT809BusinessTypeDescription("UP_PLAYBACK_MSG_STARTUP_ACK", "远程录像回放请求应答消息")] | |||
远程录像回放请求应答消息 = 0x1A01, | |||
///<summary> | |||
///远程录像回放控制应答消息 | |||
///UP_PLAYBACK_MSG_CONTROL_ACK | |||
///</summary> | |||
[Description("远程录像回放控制应答消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1A00_0x1A02))] | |||
[JT809BusinessTypeDescription("UP_PLAYBACK_MSG_CONTROL_ACK", "远程录像回放控制应答消息")] | |||
远程录像回放控制应答消息 = 0x1A02, | |||
///<summary> | |||
///远程录像回放请求消息 | |||
///DOWN_PLAYBACK_MSG_STARTUP | |||
///</summary> | |||
[Description("远程录像回放请求消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9A00_0x9A01))] | |||
[JT809BusinessTypeDescription("DOWN_PLAYBACK_MSG_STARTUP", "远程录像回放请求消息")] | |||
远程录像回放请求消息 = 0x9A01, | |||
///<summary> | |||
///远程录像回放控制消息 | |||
///DOWN_PLAYBACK_MSG_CONTROL | |||
///</summary> | |||
[Description("远程录像回放控制消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9A00_0x9A02))] | |||
[JT809BusinessTypeDescription("DOWN_PLAYBACK_MSG_CONTROL", "远程录像回放控制消息")] | |||
远程录像回放控制消息 = 0x9A02, | |||
///<summary> | |||
///远程录像下载请求应答消息 | |||
///UP_DOWNLOAD_MSG_STARTUP_ACK | |||
///</summary> | |||
[Description("远程录像下载请求应答消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1B00_0x1B01))] | |||
[JT809BusinessTypeDescription("UP_DOWNLOAD_MSG_STARTUP_ACK", "远程录像下载请求应答消息")] | |||
远程录像下载请求应答消息 = 0x1B01, | |||
///<summary> | |||
///远程录像下载通知消息 | |||
///UP_DOWNLOAD_MSG_END_INFORM | |||
///</summary> | |||
[Description("远程录像下载通知消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1B00_0x1B02))] | |||
[JT809BusinessTypeDescription("UP_DOWNLOAD_MSG_END_INFORM", "远程录像下载通知消息")] | |||
远程录像下载通知消息 = 0x1B02, | |||
///<summary> | |||
///远程录像下载控制应答消息 | |||
///UP_DOWNLOAD_MSG_CONTROL_ACK | |||
///</summary> | |||
[Description("远程录像下载控制应答消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x1B00_0x1B03))] | |||
[JT809BusinessTypeDescription("UP_DOWNLOAD_MSG_CONTROL_ACK", "远程录像下载控制应答消息")] | |||
远程录像下载控制应答消息 = 0x1B03, | |||
///<summary> | |||
///远程录像下载请求消息 | |||
///DOWN_DOWNLOAD_MSG_STARTUP | |||
///</summary> | |||
[Description("远程录像下载请求消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9B00_0x9B01))] | |||
[JT809BusinessTypeDescription("DOWN_DOWNLOAD_MSG_STARTUP", "远程录像下载请求消息")] | |||
远程录像下载请求消息 = 0x9B01, | |||
///<summary> | |||
///远程录像下载完成通知应答消息 | |||
///UP_DWONLOAD_MSG_END_INFORM_ACK | |||
///</summary> | |||
[Description("远程录像下载完成通知应答消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9B00_0x9B02))] | |||
[JT809BusinessTypeDescription("UP_DWONLOAD_MSG_END_INFORM_ACK", "远程录像下载完成通知应答消息")] | |||
远程录像下载完成通知应答消息 = 0x9B02, | |||
///<summary> | |||
///远程录像下载控制消息 | |||
///DWON_DOWNLOAD_MSG_CONTROL | |||
///</summary> | |||
[Description("远程录像下载控制消息")] | |||
[JT809BodiesType(typeof(JT809_JT1078_0x9B00_0x9B03))] | |||
[JT809BusinessTypeDescription("DWON_DOWNLOAD_MSG_CONTROL", "远程录像下载控制消息")] | |||
远程录像下载控制消息 = 0x9B03, | |||
} | |||
} |
@@ -1,12 +0,0 @@ | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Extensions | |||
{ | |||
public static class JT809MessagePackReaderExtentsion | |||
{ | |||
} | |||
} |
@@ -1,27 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Extensions.JT1078.MessageBody; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.Formatters | |||
{ | |||
public class JT809_JT1078_0x9B00_0x9B03_Formatter : IJT809MessagePackFormatter<JT809_JT1078_0x9B00_0x9B03> | |||
{ | |||
public JT809_JT1078_0x9B00_0x9B03 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9B00_0x9B03 jT808_JT1078_0x9B00_0x9B03 = new JT809_JT1078_0x9B00_0x9B03(); | |||
jT808_JT1078_0x9B00_0x9B03.SessionId = reader.ReadUInt16(); | |||
jT808_JT1078_0x9B00_0x9B03.Type = (JT809_JT1078_0x9B00_0x9B03_Type)reader.ReadByte(); | |||
return jT808_JT1078_0x9B00_0x9B03; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9B00_0x9B03 value, IJT809Config config) | |||
{ | |||
writer.WriteUInt16(value.SessionId); | |||
writer.WriteByte((byte)value.Type); | |||
} | |||
} | |||
} |
@@ -1,34 +0,0 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;</TargetFrameworks> | |||
<LangVersion>8.0</LangVersion> | |||
<Copyright>Copyright 2019.</Copyright> | |||
<Authors>SmallChi(Koike)</Authors> | |||
<PackageId>JT809.Protocol.Extensions.JT1078</PackageId> | |||
<Product>JT809.Protocol.Extensions.JT1078</Product> | |||
<Description>基于JT809协议、GB809协议扩展的视频消息协议</Description> | |||
<PackageReleaseNotes>基于JT809协议、GB809协议扩展的视频消息协议</PackageReleaseNotes> | |||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | |||
<RepositoryUrl>https://github.com/SmallChi/JT1078</RepositoryUrl> | |||
<PackageProjectUrl>https://github.com/SmallChi/JT1078</PackageProjectUrl> | |||
<licenseUrl>https://github.com/SmallChi/JT1078/blob/master/LICENSE</licenseUrl> | |||
<license>https://github.com/SmallChi/JT1078/blob/master/LICENSE</license> | |||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | |||
<Version>2.2.0</Version> | |||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | |||
<DocumentationFile>JT809.Protocol.Extensions.JT1078.xml</DocumentationFile> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<None Include="..\..\LICENSE"> | |||
<Pack>True</Pack> | |||
<PackagePath></PackagePath> | |||
</None> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<PackageReference Include="JT809" Version="2.2.0" /> | |||
</ItemGroup> | |||
</Project> |
@@ -1,751 +0,0 @@ | |||
<?xml version="1.0"?> | |||
<doc> | |||
<assembly> | |||
<name>JT809.Protocol.Extensions.JT1078</name> | |||
</assembly> | |||
<members> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.Enums.ControlType"> | |||
<summary> | |||
控制类型 | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_BusinessType.主链路时效口令业务类"> | |||
<summary> | |||
主链路时效口令业务类 | |||
UP_AUTHORIZE_MSG | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_BusinessType.从链路时效口令业务类"> | |||
<summary> | |||
从链路时效口令业务类 | |||
DOWN_AUTHORIZE_MSG | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_BusinessType.主链路实时音视频业务类"> | |||
<summary> | |||
主链路实时音视频业务类 | |||
UP_REALVIDEO_MSG | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_BusinessType.从链路实时音视频业务类"> | |||
<summary> | |||
从链路实时音视频业务类 | |||
DOWN_REALVIDEO_MSG | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_BusinessType.主链路远程录像检索业务类"> | |||
<summary> | |||
主链路远程录像检索业务类 | |||
UP_SEARCH_MSG | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_BusinessType.从链路远程录像检索业务类"> | |||
<summary> | |||
从链路远程录像检索业务类 | |||
DOWN_SEARCH_MSG | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_BusinessType.主链路远程录像回放业务类"> | |||
<summary> | |||
主链路远程录像回放业务类 | |||
UP_PLAYBACK_MSG | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_BusinessType.从链路远程录像回放业务类"> | |||
<summary> | |||
从链路远程录像回放业务类 | |||
DOWN_PLAYBACK_MSG | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_BusinessType.主链路远程录像下载业务类"> | |||
<summary> | |||
主链路远程录像下载业务类 | |||
UP_DOWNLOAD_MSG | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_BusinessType.从链路远程录像下载业务类"> | |||
<summary> | |||
从链路远程录像下载业务类 | |||
DOWN_DOWNLOAD_MSG | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.时效口令上报消息"> | |||
<summary> | |||
时效口令上报消息 | |||
UP_AUTHRIZE_MSG_STARTUP | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.时效口令请求消息"> | |||
<summary> | |||
时效口令请求消息 | |||
UP_AUTHRIZE_MSG_STARTUP_REQ | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.时效口令请求应答消息"> | |||
<summary> | |||
时效口令请求应答消息 | |||
DOWN_AUTHRIZE_MSG_STARTUP_REQ_ACK | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.实时音视频请求应答消息"> | |||
<summary> | |||
实时音视频请求应答消息 | |||
UP_REALVIDEO_MSG_STARTUP_ACK | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.主动请求停止实时音视频传输应答消息"> | |||
<summary> | |||
主动请求停止实时音视频传输应答消息 | |||
UP_REALVIDEO_MSG_END_ACK | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.实时音视频请求消息"> | |||
<summary> | |||
实时音视频请求消息 | |||
DOWN_REALVIDEO_MSG_STARTUP | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.主动请求停止实时音视频传输消息"> | |||
<summary> | |||
主动请求停止实时音视频传输消息 | |||
DOWN_REALVIDEO_MSG_END | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.主动上传音视频资源目录信息消息"> | |||
<summary> | |||
主动上传音视频资源目录信息消息 | |||
UP_FILELIST_MSG | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.查询音视频资源目录应答消息"> | |||
<summary> | |||
查询音视频资源目录应答消息 | |||
UP_REALVIDEO_FILELIST_REQ_ACK | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.主动上传音视频资源目录信息应答消息"> | |||
<summary> | |||
主动上传音视频资源目录信息应答消息 | |||
DOWN_FILELIST_MSG_ACK | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.查询音视频资源目录请求消息"> | |||
<summary> | |||
查询音视频资源目录请求消息 | |||
DOWN_REALVIDEO_FILELIST_REQ | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.远程录像回放请求应答消息"> | |||
<summary> | |||
远程录像回放请求应答消息 | |||
UP_PLAYBACK_MSG_STARTUP_ACK | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.远程录像回放控制应答消息"> | |||
<summary> | |||
远程录像回放控制应答消息 | |||
UP_PLAYBACK_MSG_CONTROL_ACK | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.远程录像回放请求消息"> | |||
<summary> | |||
远程录像回放请求消息 | |||
DOWN_PLAYBACK_MSG_STARTUP | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.远程录像回放控制消息"> | |||
<summary> | |||
远程录像回放控制消息 | |||
DOWN_PLAYBACK_MSG_CONTROL | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.远程录像下载请求应答消息"> | |||
<summary> | |||
远程录像下载请求应答消息 | |||
UP_DOWNLOAD_MSG_STARTUP_ACK | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.远程录像下载通知消息"> | |||
<summary> | |||
远程录像下载通知消息 | |||
UP_DOWNLOAD_MSG_END_INFORM | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.远程录像下载控制应答消息"> | |||
<summary> | |||
远程录像下载控制应答消息 | |||
UP_DOWNLOAD_MSG_CONTROL_ACK | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.远程录像下载请求消息"> | |||
<summary> | |||
远程录像下载请求消息 | |||
DOWN_DOWNLOAD_MSG_STARTUP | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.远程录像下载完成通知应答消息"> | |||
<summary> | |||
远程录像下载完成通知应答消息 | |||
UP_DWONLOAD_MSG_END_INFORM_ACK | |||
</summary> | |||
</member> | |||
<member name="F:JT809.Protocol.Extensions.JT1078.Enums.JT809_JT1078_SubBusinessType.远程录像下载控制消息"> | |||
<summary> | |||
远程录像下载控制消息 | |||
DWON_DOWNLOAD_MSG_CONTROL | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1700"> | |||
<summary> | |||
主链路时效口令交互消息 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1700_0x1701"> | |||
<summary> | |||
时效口令上报消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1700_0x1701.PlateFormId"> | |||
<summary> | |||
企业视频监控平台唯一编码,平台所属企业行政区域代码+平台公共编号 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1700_0x1701.AuthorizeCode1"> | |||
<summary> | |||
归属地区政府平台使用的时效口令 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1700_0x1701.AuthorizeCode2"> | |||
<summary> | |||
跨域地区政府平台使用的时效口令 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1700_0x1702"> | |||
<summary> | |||
时效口令请求消息 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1800"> | |||
<summary> | |||
主链路实时音视频交互消息 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1800_0x1801"> | |||
<summary> | |||
实时音视频请求应答消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1800_0x1801.Result"> | |||
<summary> | |||
应答结果 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1800_0x1801.ServerIp"> | |||
<summary> | |||
企业视频服务器ip地址 | |||
32 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1800_0x1801.ServerPort"> | |||
<summary> | |||
企业视频服务器端口号 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1800_0x1802"> | |||
<summary> | |||
主动请求停止实时音视频传输应答消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1800_0x1802.Result"> | |||
<summary> | |||
应答结果 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900"> | |||
<summary> | |||
主链路远程录像检索交互消息 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_0x1901"> | |||
<summary> | |||
主动上传音视频资源目录信息消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_0x1901.ItemNum"> | |||
<summary> | |||
资源目录项数目 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_0x1901.ItemList"> | |||
<summary> | |||
资源目录项列表 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_0x1902"> | |||
<summary> | |||
查询音视频资源目录应答消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_0x1902.Result"> | |||
<summary> | |||
应答结果 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_0x1902.ItemNum"> | |||
<summary> | |||
资源目录项数目 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_0x1902.ItemList"> | |||
<summary> | |||
资源目录项列表 | |||
与JT808_JT1078_0x1900_0x1901共用同一个子类 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_Record"> | |||
<summary> | |||
上传音视频资源目录项 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_Record.ChannelId"> | |||
<summary> | |||
逻辑通道号 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_Record.StartTime"> | |||
<summary> | |||
UTC时间 开始 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_Record.EndTime"> | |||
<summary> | |||
UTC时间 结束 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_Record.AlarmType"> | |||
<summary> | |||
报警标志物 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_Record.AVItemType"> | |||
<summary> | |||
音视频类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_Record.StreamType"> | |||
<summary> | |||
码流类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_Record.MemType"> | |||
<summary> | |||
存储器类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1900_Record.FileSize"> | |||
<summary> | |||
文件大小 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1A00"> | |||
<summary> | |||
主链路远程录像回放交互消息 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1A00_0x1A01"> | |||
<summary> | |||
远程录像回放请求应答消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1A00_0x1A01.ServerIp"> | |||
<summary> | |||
企业视频服务器ip地址 | |||
32 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1A00_0x1A01.ServerPort"> | |||
<summary> | |||
企业视频服务器端口号 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1A00_0x1A01.Result"> | |||
<summary> | |||
应答结果 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1A00_0x1A02"> | |||
<summary> | |||
远程录像回放控制应答消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1A00_0x1A02.Result"> | |||
<summary> | |||
应答结果 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00"> | |||
<summary> | |||
主链路远程录像下载交互消息 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00_0x1B01"> | |||
<summary> | |||
远程录像下载请求应答消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00_0x1B01.Result"> | |||
<summary> | |||
应答结果 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00_0x1B01.SessionId"> | |||
<summary> | |||
对应平台文件上传消息的流水号 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00_0x1B02"> | |||
<summary> | |||
远程录像下载通知消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00_0x1B02.Result"> | |||
<summary> | |||
应答结果 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00_0x1B02.SessionId"> | |||
<summary> | |||
对应平台文件上传消息的流水号 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00_0x1B02.ServerIp"> | |||
<summary> | |||
FTP服务器ip地址 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00_0x1B02.TcpPort"> | |||
<summary> | |||
FTP服务器端口 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00_0x1B02.UserName"> | |||
<summary> | |||
FTP用户名 | |||
49 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00_0x1B02.Password"> | |||
<summary> | |||
FTP密码 | |||
22 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00_0x1B02.FilePath"> | |||
<summary> | |||
文件存储路径 | |||
200 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00_0x1B03"> | |||
<summary> | |||
远程录像下载控制应答消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x1B00_0x1B03.Result"> | |||
<summary> | |||
应答结果 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9700"> | |||
<summary> | |||
从链路时效口令交互消息 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9700_0x9702"> | |||
<summary> | |||
时效口令请求应答消息 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9800"> | |||
<summary> | |||
从链路实时音视频交互信息 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9800_0x9801"> | |||
<summary> | |||
实时音视频请求消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9800_0x9801.ChannelId"> | |||
<summary> | |||
逻辑通道号 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9800_0x9801.AVitemType"> | |||
<summary> | |||
音视频类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9800_0x9801.AuthorizeCode"> | |||
<summary> | |||
时效口令 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9800_0x9801.GnssData"> | |||
<summary> | |||
车辆进入跨域地区后5min之内的任何位置,仅跨域访问请求时使用此字段 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9800_0x9802"> | |||
<summary> | |||
主动请求停止实时音视频传输消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9800_0x9802.ChannelId"> | |||
<summary> | |||
逻辑通道号 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9800_0x9802.AVitemType"> | |||
<summary> | |||
音视频类型 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900"> | |||
<summary> | |||
从链路远程录像检索交互消息 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900_0x9901"> | |||
<summary> | |||
主动上传音视频资源目录信息应答消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900_0x9901.Result"> | |||
<summary> | |||
应答结果 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900_0x9901.ItemNumber"> | |||
<summary> | |||
资源目录总数 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900_0x9902"> | |||
<summary> | |||
查询音视频资源目录请求消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900_0x9902.ChannelId"> | |||
<summary> | |||
逻辑通道号 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900_0x9902.StartTime"> | |||
<summary> | |||
起始时间 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900_0x9902.EndTime"> | |||
<summary> | |||
终止时间 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900_0x9902.AlarmType"> | |||
<summary> | |||
报警类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900_0x9902.AVItemType"> | |||
<summary> | |||
音视频类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900_0x9902.StreamType"> | |||
<summary> | |||
码流类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900_0x9902.MemType"> | |||
<summary> | |||
存储器类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900_0x9902.AuthorizeCode"> | |||
<summary> | |||
时效口令 | |||
64 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9900_0x9902.GnssData"> | |||
<summary> | |||
车辆进入跨域地区后5min之内任一位置,仅跨域访问请求时,使用此字段 | |||
36 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00"> | |||
<summary> | |||
从链路远程录像回放交互消息 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00_0x9A01"> | |||
<summary> | |||
远程录像回放请求消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00_0x9A01.ChannelId"> | |||
<summary> | |||
逻辑通道号 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00_0x9A01.AVItemType"> | |||
<summary> | |||
音视频类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00_0x9A01.StreamType"> | |||
<summary> | |||
码流类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00_0x9A01.MemType"> | |||
<summary> | |||
存储器类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00_0x9A01.PlayBackStartTime"> | |||
<summary> | |||
回放起始时间 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00_0x9A01.PlayBackEndTime"> | |||
<summary> | |||
回放结束时间 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00_0x9A01.AuthorizeCode"> | |||
<summary> | |||
时效口令 | |||
64 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00_0x9A01.GnssData"> | |||
<summary> | |||
车辆进入跨域地区后5min之内任一位置,仅跨域访问请求时,使用此字段 | |||
36 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00_0x9A02"> | |||
<summary> | |||
远程录像回放控制消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00_0x9A02.ControlType"> | |||
<summary> | |||
控制类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00_0x9A02.FastTime"> | |||
<summary> | |||
快进或倒退倍数 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9A00_0x9A02.DateTime"> | |||
<summary> | |||
拖动位置 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00"> | |||
<summary> | |||
从链路远程录像下载交互消息 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B01"> | |||
<summary> | |||
远程录像下载请求消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B01.ChannelId"> | |||
<summary> | |||
逻辑通道号 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B01.StartTime"> | |||
<summary> | |||
起始时间 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B01.EndTime"> | |||
<summary> | |||
终止时间 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B01.AlarmType"> | |||
<summary> | |||
报警类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B01.AVItemType"> | |||
<summary> | |||
音视频类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B01.StreamType"> | |||
<summary> | |||
码流类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B01.MemType"> | |||
<summary> | |||
存储器类型 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B01.FileSize"> | |||
<summary> | |||
文件大小 byte | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B01.AuthorizeCode"> | |||
<summary> | |||
时效口令 | |||
64 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B01.GnssData"> | |||
<summary> | |||
车辆进入跨域地区后5min之内任一位置,仅跨域访问请求时,使用此字段 | |||
36 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B02"> | |||
<summary> | |||
远程录像下载完成通知应答消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B02.Result"> | |||
<summary> | |||
应答结果 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B02.SessionId"> | |||
<summary> | |||
对应平台文件上传消息的流水号 | |||
</summary> | |||
</member> | |||
<member name="T:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B03"> | |||
<summary> | |||
远程录像下载控制消息 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B03.SessionId"> | |||
<summary> | |||
对应平台文件上传消息的流水号 | |||
</summary> | |||
</member> | |||
<member name="P:JT809.Protocol.Extensions.JT1078.MessageBody.JT809_JT1078_0x9B00_0x9B03.Type"> | |||
<summary> | |||
控制类型 | |||
</summary> | |||
</member> | |||
</members> | |||
</doc> |
@@ -1,114 +0,0 @@ | |||
using JT809.Protocol.Enums; | |||
using JT809.Protocol.Exceptions; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 主链路时效口令交互消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1700 : JT809ExchangeMessageBodies,IJT809MessagePackFormatter<JT809_JT1078_0x1700>, IJT809Analyze | |||
{ | |||
public override ushort MsgId { get; }=JT809_JT1078_BusinessType.主链路时效口令业务类.ToUInt16Value(); | |||
public override JT809_LinkType LinkType { get; } = JT809_LinkType.main; | |||
public override string Description { get; }= "主链路时效口令交互消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1700 value = new JT809_JT1078_0x1700(); | |||
var virtualHex = reader.ReadVirtualArray(21); | |||
value.VehicleNo = reader.ReadString(21); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车牌号", value.VehicleNo); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.VehicleColor).ReadNumber()}]车牌颜色", value.VehicleColor.ToString()); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
writer.WriteString($"[{value.SubBusinessType.ReadNumber()}]子业务类型标识", ((JT809SubBusinessType)value.SubBusinessType).ToString()); | |||
value.DataLength = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.DataLength.ReadNumber()}]后续数据长度", value.DataLength); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
writer.WriteStartObject("子业务类型"); | |||
instance.Analyze(ref reader, writer, config); | |||
writer.WriteEndObject(); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
public JT809_JT1078_0x1700 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1700 value = new JT809_JT1078_0x1700(); | |||
value.VehicleNo = reader.ReadString(21); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
value.DataLength = reader.ReadUInt32(); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
value.SubBodies = JT809MessagePackFormatterResolverExtensions.JT809DynamicDeserialize( | |||
instance, | |||
ref reader, config); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1700 value, IJT809Config config) | |||
{ | |||
writer.WriteStringPadRight(value.VehicleNo, 21); | |||
writer.WriteByte((byte)value.VehicleColor); | |||
writer.WriteUInt16(value.SubBusinessType); | |||
try | |||
{ | |||
// 先写入内容,然后在根据内容反写内容长度 | |||
writer.Skip(4, out int subContentLengthPosition); | |||
if (value.SubBodies != null) | |||
{ | |||
if (!value.SubBodies.SkipSerialization) | |||
{ | |||
JT809MessagePackFormatterResolverExtensions.JT809DynamicSerialize( | |||
value.SubBodies, | |||
ref writer, value.SubBodies, | |||
config); | |||
} | |||
} | |||
writer.WriteInt32Return(writer.GetCurrentPosition() - subContentLengthPosition - 4, subContentLengthPosition); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
} | |||
} |
@@ -1,64 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 时效口令上报消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1700_0x1701 : JT809SubBodies,IJT809MessagePackFormatter<JT809_JT1078_0x1700_0x1701>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 企业视频监控平台唯一编码,平台所属企业行政区域代码+平台公共编号 | |||
/// </summary> | |||
public string PlateFormId { get; set; } | |||
/// <summary> | |||
/// 归属地区政府平台使用的时效口令 | |||
/// </summary> | |||
public string AuthorizeCode1 { get; set; } | |||
/// <summary> | |||
/// 跨域地区政府平台使用的时效口令 | |||
/// </summary> | |||
public string AuthorizeCode2 { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.时效口令上报消息.ToUInt16Value(); | |||
public override string Description { get; }= "时效口令上报消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1700_0x1701 value = new JT809_JT1078_0x1700_0x1701(); | |||
var virtualHex = reader.ReadVirtualArray(11); | |||
value.PlateFormId = reader.ReadString(11); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]企业视频监控平台唯一编码",value.PlateFormId); | |||
virtualHex = reader.ReadVirtualArray(64); | |||
value.AuthorizeCode1 = reader.ReadString(64); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]归属地区政府平台使用的时效口令", value.AuthorizeCode1); | |||
virtualHex = reader.ReadVirtualArray(64); | |||
value.AuthorizeCode2 = reader.ReadString(64); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]跨域地区政府平台使用的时效口令", value.AuthorizeCode2); | |||
} | |||
public JT809_JT1078_0x1700_0x1701 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1700_0x1701 value = new JT809_JT1078_0x1700_0x1701(); | |||
value.PlateFormId = reader.ReadString(11); | |||
value.AuthorizeCode1 = reader.ReadString(64); | |||
value.AuthorizeCode2 = reader.ReadString(64); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1700_0x1701 value, IJT809Config config) | |||
{ | |||
writer.WriteStringPadRight(value.PlateFormId,11); | |||
writer.WriteStringPadRight(value.AuthorizeCode1,64); | |||
writer.WriteStringPadRight(value.AuthorizeCode2,64); | |||
} | |||
} | |||
} |
@@ -1,19 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 时效口令请求消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1700_0x1702 : JT809SubBodies | |||
{ | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.时效口令请求消息.ToUInt16Value(); | |||
public override string Description => "时效口令请求消息"; | |||
public override bool SkipSerialization { get; set; } = true; | |||
} | |||
} |
@@ -1,113 +0,0 @@ | |||
using JT809.Protocol.Enums; | |||
using JT809.Protocol.Exceptions; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 主链路实时音视频交互消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1800 : JT809ExchangeMessageBodies, IJT809MessagePackFormatter<JT809_JT1078_0x1800>, IJT809Analyze | |||
{ | |||
public override ushort MsgId { get; } | |||
public override JT809_LinkType LinkType { get; } = JT809_LinkType.main; | |||
public override string Description { get; } = "主链路实时音视频交互消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1800 value = new JT809_JT1078_0x1800(); | |||
var virtualHex = reader.ReadVirtualArray(21); | |||
value.VehicleNo = reader.ReadString(21); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车牌号", value.VehicleNo); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.VehicleColor).ReadNumber()}]车牌颜色", value.VehicleColor.ToString()); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
writer.WriteString($"[{value.SubBusinessType.ReadNumber()}]子业务类型标识", ((JT809SubBusinessType)value.SubBusinessType).ToString()); | |||
value.DataLength = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.DataLength.ReadNumber()}]后续数据长度", value.DataLength); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
writer.WriteStartObject("子业务类型"); | |||
instance.Analyze(ref reader, writer, config); | |||
writer.WriteEndObject(); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
public JT809_JT1078_0x1800 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1800 value = new JT809_JT1078_0x1800(); | |||
value.VehicleNo = reader.ReadString(21); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
value.DataLength = reader.ReadUInt32(); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
value.SubBodies = JT809MessagePackFormatterResolverExtensions.JT809DynamicDeserialize( | |||
instance, | |||
ref reader, config); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1800 value, IJT809Config config) | |||
{ | |||
writer.WriteStringPadRight(value.VehicleNo, 21); | |||
writer.WriteByte((byte)value.VehicleColor); | |||
writer.WriteUInt16(value.SubBusinessType); | |||
try | |||
{ | |||
// 先写入内容,然后在根据内容反写内容长度 | |||
writer.Skip(4, out int subContentLengthPosition); | |||
if (value.SubBodies != null) | |||
{ | |||
if (!value.SubBodies.SkipSerialization) | |||
{ | |||
JT809MessagePackFormatterResolverExtensions.JT809DynamicSerialize( | |||
value.SubBodies, | |||
ref writer, value.SubBodies, | |||
config); | |||
} | |||
} | |||
writer.WriteInt32Return(writer.GetCurrentPosition() - subContentLengthPosition - 4, subContentLengthPosition); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
} | |||
} |
@@ -1,63 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 实时音视频请求应答消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1800_0x1801 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x1800_0x1801>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 应答结果 | |||
/// </summary> | |||
public JT809_JT1078_0x1800_0x1801_Result Result { get; set; } | |||
/// <summary> | |||
/// 企业视频服务器ip地址 | |||
/// 32 | |||
/// </summary> | |||
public string ServerIp { get; set; } | |||
/// <summary> | |||
/// 企业视频服务器端口号 | |||
/// </summary> | |||
public ushort ServerPort { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.实时音视频请求应答消息.ToUInt16Value(); | |||
public override string Description { get; } = "实时音视频请求应答消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1800_0x1801 value = new JT809_JT1078_0x1800_0x1801(); | |||
value.Result = (JT809_JT1078_0x1800_0x1801_Result)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.Result).ReadNumber()}]应答结果", value.Result.ToString()); | |||
var virtualHex = reader.ReadVirtualArray(32); | |||
value.ServerIp = reader.ReadString(32); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]企业视频服务器ip地址", value.ServerIp); | |||
value.ServerPort = reader.ReadUInt16(); | |||
writer.WriteNumber($"[{value.ServerPort.ReadNumber()}]企业视频服务器端口号", value.ServerPort); | |||
} | |||
public JT809_JT1078_0x1800_0x1801 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1800_0x1801 value = new JT809_JT1078_0x1800_0x1801(); | |||
value.Result = (JT809_JT1078_0x1800_0x1801_Result)reader.ReadByte(); | |||
value.ServerIp = reader.ReadString(32); | |||
value.ServerPort = reader.ReadUInt16(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1800_0x1801 value, IJT809Config config) | |||
{ | |||
writer.WriteByte((byte)value.Result); | |||
writer.WriteStringPadLeft(value.ServerIp, 32); | |||
writer.WriteUInt16(value.ServerPort); | |||
} | |||
} | |||
} |
@@ -1,45 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 主动请求停止实时音视频传输应答消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1800_0x1802 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x1800_0x1802>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 应答结果 | |||
/// </summary> | |||
public JT809_JT1078_0x1800_0x1802_Result Result { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.主动请求停止实时音视频传输应答消息.ToUInt16Value(); | |||
public override string Description { get; } = "主动请求停止实时音视频传输应答消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1800_0x1802 value = new JT809_JT1078_0x1800_0x1802(); | |||
value.Result = (JT809_JT1078_0x1800_0x1802_Result)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.Result).ReadNumber()}]应答结果", value.Result.ToString()); | |||
} | |||
public JT809_JT1078_0x1800_0x1802 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1800_0x1802 value = new JT809_JT1078_0x1800_0x1802(); | |||
value.Result = (JT809_JT1078_0x1800_0x1802_Result)reader.ReadByte(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1800_0x1802 value, IJT809Config config) | |||
{ | |||
writer.WriteByte((byte)value.Result); | |||
} | |||
} | |||
} |
@@ -1,114 +0,0 @@ | |||
using JT809.Protocol.Enums; | |||
using JT809.Protocol.Exceptions; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 主链路远程录像检索交互消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1900 : JT809ExchangeMessageBodies,IJT809MessagePackFormatter<JT809_JT1078_0x1900>, IJT809Analyze | |||
{ | |||
public override ushort MsgId { get; } = JT809_JT1078_BusinessType.主链路远程录像检索业务类.ToUInt16Value(); | |||
public override JT809_LinkType LinkType { get; } = JT809_LinkType.main; | |||
public override string Description { get; } = "主链路远程录像检索交互消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1900 value = new JT809_JT1078_0x1900(); | |||
var virtualHex = reader.ReadVirtualArray(21); | |||
value.VehicleNo = reader.ReadString(21); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车牌号", value.VehicleNo); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.VehicleColor).ReadNumber()}]车牌颜色", value.VehicleColor.ToString()); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
writer.WriteString($"[{value.SubBusinessType.ReadNumber()}]子业务类型标识", ((JT809SubBusinessType)value.SubBusinessType).ToString()); | |||
value.DataLength = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.DataLength.ReadNumber()}]后续数据长度", value.DataLength); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
writer.WriteStartObject("子业务类型"); | |||
instance.Analyze(ref reader, writer, config); | |||
writer.WriteEndObject(); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
public JT809_JT1078_0x1900 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1900 value = new JT809_JT1078_0x1900(); | |||
value.VehicleNo = reader.ReadString(21); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
value.DataLength = reader.ReadUInt32(); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
value.SubBodies = JT809MessagePackFormatterResolverExtensions.JT809DynamicDeserialize( | |||
instance, | |||
ref reader, config); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1900 value, IJT809Config config) | |||
{ | |||
writer.WriteStringPadRight(value.VehicleNo, 21); | |||
writer.WriteByte((byte)value.VehicleColor); | |||
writer.WriteUInt16(value.SubBusinessType); | |||
try | |||
{ | |||
// 先写入内容,然后在根据内容反写内容长度 | |||
writer.Skip(4, out int subContentLengthPosition); | |||
if (value.SubBodies != null) | |||
{ | |||
if (!value.SubBodies.SkipSerialization) | |||
{ | |||
JT809MessagePackFormatterResolverExtensions.JT809DynamicSerialize( | |||
value.SubBodies, | |||
ref writer, value.SubBodies, | |||
config); | |||
} | |||
} | |||
writer.WriteInt32Return(writer.GetCurrentPosition() - subContentLengthPosition - 4, subContentLengthPosition); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
} | |||
} |
@@ -1,78 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System.Collections.Generic; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 主动上传音视频资源目录信息消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1900_0x1901 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x1900_0x1901>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 资源目录项数目 | |||
/// </summary> | |||
public uint ItemNum { get; set; } | |||
/// <summary> | |||
/// 资源目录项列表 | |||
/// </summary> | |||
public List<JT809_JT1078_0x1900_Record> ItemList { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.主动上传音视频资源目录信息消息.ToUInt16Value(); | |||
public override string Description { get; } = "主动上传音视频资源目录信息消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1900_0x1901 value = new JT809_JT1078_0x1900_0x1901(); | |||
value.ItemNum = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.ItemNum.ReadNumber() }]资源目录项数目", value.ItemNum); | |||
if (value.ItemNum > 0) | |||
{ | |||
writer.WriteStartArray("资源目录项列表"); | |||
var formatter = config.GetMessagePackFormatter<JT809_JT1078_0x1900_Record>(); | |||
for (int i = 0; i < value.ItemNum; i++) | |||
{ | |||
writer.WriteStartObject(); | |||
formatter.Analyze(ref reader, writer, config); | |||
writer.WriteEndObject(); | |||
} | |||
writer.WriteEndArray(); | |||
} | |||
} | |||
public JT809_JT1078_0x1900_0x1901 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1900_0x1901 value = new JT809_JT1078_0x1900_0x1901(); | |||
value.ItemNum = reader.ReadUInt32(); | |||
if (value.ItemNum > 0) | |||
{ | |||
List<JT809_JT1078_0x1900_Record> jT808_JT1078_0x1900_0x1901_RecordList = new List<JT809_JT1078_0x1900_Record>(); | |||
var formatter = config.GetMessagePackFormatter<JT809_JT1078_0x1900_Record>(); | |||
for (int i = 0; i < value.ItemNum; i++) | |||
{ | |||
var jT808_JT1078_0x1900_0x1901_Record = formatter.Deserialize(ref reader, config); | |||
jT808_JT1078_0x1900_0x1901_RecordList.Add(jT808_JT1078_0x1900_0x1901_Record); | |||
} | |||
value.ItemList = jT808_JT1078_0x1900_0x1901_RecordList; | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1900_0x1901 value, IJT809Config config) | |||
{ | |||
writer.WriteUInt32(value.ItemNum); | |||
if (value.ItemList.Count > 0) | |||
{ | |||
var formatter = config.GetMessagePackFormatter<JT809_JT1078_0x1900_Record>(); | |||
foreach (var item in value.ItemList) | |||
{ | |||
formatter.Serialize(ref writer, item, config); | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -1,89 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System.Collections.Generic; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 查询音视频资源目录应答消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1900_0x1902 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x1900_0x1902>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 应答结果 | |||
/// </summary> | |||
public JT809_JT1078_0x1900_0x1902_Result Result { get; set; } | |||
/// <summary> | |||
/// 资源目录项数目 | |||
/// </summary> | |||
public uint ItemNum { get; set; } | |||
/// <summary> | |||
/// 资源目录项列表 | |||
/// 与JT808_JT1078_0x1900_0x1901共用同一个子类 | |||
/// </summary> | |||
public List<JT809_JT1078_0x1900_Record> ItemList { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.查询音视频资源目录应答消息.ToUInt16Value(); | |||
public override string Description { get; } = "查询音视频资源目录应答消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1900_0x1902 value = new JT809_JT1078_0x1900_0x1902(); | |||
value.Result = (JT809_JT1078_0x1900_0x1902_Result)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.Result).ReadNumber() }]应答结果", value.Result.ToString()); | |||
value.ItemNum = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.ItemNum.ReadNumber() }]资源目录项数目", value.ItemNum); | |||
if (value.ItemNum > 0) | |||
{ | |||
writer.WriteStartArray("资源目录项列表"); | |||
List<JT809_JT1078_0x1900_Record> jT808_JT1078_0x1900_0x1901_RecordList = new List<JT809_JT1078_0x1900_Record>(); | |||
var formatter = config.GetMessagePackFormatter<JT809_JT1078_0x1900_Record>(); | |||
for (int i = 0; i < value.ItemNum; i++) | |||
{ | |||
writer.WriteStartObject(); | |||
formatter.Analyze(ref reader, writer, config); | |||
writer.WriteEndObject(); | |||
} | |||
writer.WriteEndArray(); | |||
value.ItemList = jT808_JT1078_0x1900_0x1901_RecordList; | |||
} | |||
} | |||
public JT809_JT1078_0x1900_0x1902 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1900_0x1902 value = new JT809_JT1078_0x1900_0x1902(); | |||
value.Result = (JT809_JT1078_0x1900_0x1902_Result)reader.ReadByte(); | |||
value.ItemNum = reader.ReadUInt32(); | |||
if (value.ItemNum > 0) | |||
{ | |||
List<JT809_JT1078_0x1900_Record> jT808_JT1078_0x1900_0x1901_RecordList = new List<JT809_JT1078_0x1900_Record>(); | |||
var formatter = config.GetMessagePackFormatter<JT809_JT1078_0x1900_Record>(); | |||
for (int i = 0; i < value.ItemNum; i++) | |||
{ | |||
var jT808_JT1078_0x1900_0x1901_Record = formatter.Deserialize(ref reader, config); | |||
jT808_JT1078_0x1900_0x1901_RecordList.Add(jT808_JT1078_0x1900_0x1901_Record); | |||
} | |||
value.ItemList = jT808_JT1078_0x1900_0x1901_RecordList; | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1900_0x1902 value, IJT809Config config) | |||
{ | |||
writer.WriteByte((byte)value.Result); | |||
writer.WriteUInt32(value.ItemNum); | |||
if (value.ItemList.Count > 0) | |||
{ | |||
var formatter = config.GetMessagePackFormatter<JT809_JT1078_0x1900_Record>(); | |||
foreach (var item in value.ItemList) | |||
{ | |||
formatter.Serialize(ref writer, item, config); | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -1,175 +0,0 @@ | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 上传音视频资源目录项 | |||
/// </summary> | |||
public class JT809_JT1078_0x1900_Record : IJT809MessagePackFormatter<JT809_JT1078_0x1900_Record>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 逻辑通道号 | |||
/// </summary> | |||
public byte ChannelId { get; set; } | |||
/// <summary> | |||
/// UTC时间 开始 | |||
/// </summary> | |||
public DateTime StartTime { get; set; } | |||
/// <summary> | |||
/// UTC时间 结束 | |||
/// </summary> | |||
public DateTime EndTime { get; set; } | |||
/// <summary> | |||
/// 报警标志物 | |||
/// </summary> | |||
public ulong AlarmType { get; set; } | |||
/// <summary> | |||
/// 音视频类型 | |||
/// </summary> | |||
public byte AVItemType { get; set; } | |||
/// <summary> | |||
/// 码流类型 | |||
/// </summary> | |||
public byte StreamType { get; set; } | |||
/// <summary> | |||
/// 存储器类型 | |||
/// </summary> | |||
public byte MemType { get; set; } | |||
/// <summary> | |||
/// 文件大小 | |||
/// </summary> | |||
public uint FileSize { get; set; } | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1900_Record value = new JT809_JT1078_0x1900_Record(); | |||
value.ChannelId = reader.ReadByte(); | |||
writer.WriteString($"[{value.ChannelId.ReadNumber()}]逻辑通道号", LogicalChannelNoDisplay(value.ChannelId)); | |||
var virtualHex = reader.ReadVirtualArray(8); | |||
value.StartTime = reader.ReadUTCDateTime(); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]开始时间", value.StartTime); | |||
virtualHex = reader.ReadVirtualArray(8); | |||
value.EndTime = reader.ReadUTCDateTime(); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]结束时间", value.StartTime); | |||
value.AlarmType = reader.ReadUInt64(); | |||
writer.WriteNumber($"[{value.AlarmType.ReadNumber()}]报警标志物", value.AlarmType); | |||
value.AVItemType = reader.ReadByte(); | |||
writer.WriteString($"[{value.AVItemType.ReadNumber()}]音视频资源类型", AVResourceTypeDisplay(value.AVItemType)); | |||
value.StreamType = reader.ReadByte(); | |||
writer.WriteString($"[{value.StreamType.ReadNumber()}]码流类型", StreamTypeDisplay(value.StreamType)); | |||
value.MemType = reader.ReadByte(); | |||
writer.WriteString($"[{value.MemType.ReadNumber()}]存储器类型", MemoryTypeDisplay(value.MemType)); | |||
value.FileSize = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.FileSize.ReadNumber()}]文件大小(B)", value.FileSize); | |||
string LogicalChannelNoDisplay(byte LogicalChannelNo) | |||
{ | |||
switch (LogicalChannelNo) | |||
{ | |||
case 1: | |||
return "驾驶员"; | |||
case 2: | |||
return "车辆正前方"; | |||
case 3: | |||
return "车前门"; | |||
case 4: | |||
return "车厢前部"; | |||
case 5: | |||
return "车厢后部"; | |||
case 7: | |||
return "行李舱"; | |||
case 8: | |||
return "车辆左侧"; | |||
case 9: | |||
return "车辆右侧"; | |||
case 10: | |||
return "车辆正后方"; | |||
case 11: | |||
return "车厢中部"; | |||
case 12: | |||
return "车中门"; | |||
case 13: | |||
return "驾驶席车门"; | |||
case 33: | |||
return "驾驶员"; | |||
case 36: | |||
return "车厢前部"; | |||
case 37: | |||
return "车厢后部"; | |||
default: | |||
return "预留"; | |||
} | |||
} | |||
string AVResourceTypeDisplay(byte AVResourceType) | |||
{ | |||
switch (AVResourceType) | |||
{ | |||
case 0: | |||
return "音视频"; | |||
case 1: | |||
return "音频"; | |||
case 2: | |||
return "视频"; | |||
default: | |||
break; | |||
} | |||
return "未知"; | |||
} | |||
string StreamTypeDisplay(byte StreamType) | |||
{ | |||
switch (StreamType) | |||
{ | |||
case 1: | |||
return "主码流"; | |||
case 2: | |||
return "子码流"; | |||
default: | |||
return "未知"; | |||
} | |||
} | |||
string MemoryTypeDisplay(byte MemoryType) | |||
{ | |||
switch (MemoryType) | |||
{ | |||
case 1: | |||
return "主存储器"; | |||
case 2: | |||
return "灾备存储器"; | |||
default: | |||
return "未知"; | |||
} | |||
} | |||
} | |||
public JT809_JT1078_0x1900_Record Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1900_Record value = new JT809_JT1078_0x1900_Record(); | |||
value.ChannelId = reader.ReadByte(); | |||
value.StartTime = reader.ReadUTCDateTime(); | |||
value.EndTime = reader.ReadUTCDateTime(); | |||
value.AlarmType = reader.ReadUInt64(); | |||
value.AVItemType = reader.ReadByte(); | |||
value.StreamType = reader.ReadByte(); | |||
value.MemType = reader.ReadByte(); | |||
value.FileSize = reader.ReadUInt32(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1900_Record value, IJT809Config config) | |||
{ | |||
writer.WriteByte(value.ChannelId); | |||
writer.WriteUTCDateTime(value.StartTime); | |||
writer.WriteUTCDateTime(value.EndTime); | |||
writer.WriteUInt64(value.AlarmType); | |||
writer.WriteByte(value.AVItemType); | |||
writer.WriteByte(value.StreamType); | |||
writer.WriteByte(value.MemType); | |||
writer.WriteUInt32(value.FileSize); | |||
} | |||
} | |||
} |
@@ -1,111 +0,0 @@ | |||
using System.Text.Json; | |||
using JT809.Protocol.Enums; | |||
using JT809.Protocol.Exceptions; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 主链路远程录像回放交互消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1A00 : JT809ExchangeMessageBodies, IJT809MessagePackFormatter<JT809_JT1078_0x1A00>, IJT809Analyze | |||
{ | |||
public override ushort MsgId { get; } = JT809_JT1078_BusinessType.主链路远程录像回放业务类.ToUInt16Value(); | |||
public override JT809_LinkType LinkType { get; } = JT809_LinkType.main; | |||
public override string Description { get; } = "主链路远程录像回放交互消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1A00 value = new JT809_JT1078_0x1A00(); | |||
var virtualHex = reader.ReadVirtualArray(21); | |||
value.VehicleNo = reader.ReadString(21); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车牌号", value.VehicleNo); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.VehicleColor).ReadNumber()}]车牌颜色", value.VehicleColor.ToString()); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
writer.WriteString($"[{value.SubBusinessType.ReadNumber()}]子业务类型标识", ((JT809SubBusinessType)value.SubBusinessType).ToString()); | |||
value.DataLength = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.DataLength.ReadNumber()}]后续数据长度", value.DataLength); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
writer.WriteStartObject("子业务类型"); | |||
instance.Analyze(ref reader, writer, config); | |||
writer.WriteEndObject(); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
public JT809_JT1078_0x1A00 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1A00 value = new JT809_JT1078_0x1A00(); | |||
value.VehicleNo = reader.ReadString(21); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
value.DataLength = reader.ReadUInt32(); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
value.SubBodies = JT809MessagePackFormatterResolverExtensions.JT809DynamicDeserialize( | |||
instance, | |||
ref reader, config); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1A00 value, IJT809Config config) | |||
{ | |||
writer.WriteStringPadRight(value.VehicleNo, 21); | |||
writer.WriteByte((byte)value.VehicleColor); | |||
writer.WriteUInt16(value.SubBusinessType); | |||
try | |||
{ | |||
// 先写入内容,然后在根据内容反写内容长度 | |||
writer.Skip(4, out int subContentLengthPosition); | |||
if (value.SubBodies != null) | |||
{ | |||
if (!value.SubBodies.SkipSerialization) | |||
{ | |||
JT809MessagePackFormatterResolverExtensions.JT809DynamicSerialize( | |||
value.SubBodies, | |||
ref writer, value.SubBodies, | |||
config); | |||
} | |||
} | |||
writer.WriteInt32Return(writer.GetCurrentPosition() - subContentLengthPosition - 4, subContentLengthPosition); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
} | |||
} |
@@ -1,63 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 远程录像回放请求应答消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1A00_0x1A01 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x1A00_0x1A01>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 企业视频服务器ip地址 | |||
/// 32 | |||
/// </summary> | |||
public string ServerIp { get; set; } | |||
/// <summary> | |||
/// 企业视频服务器端口号 | |||
/// </summary> | |||
public ushort ServerPort { get; set; } | |||
/// <summary> | |||
/// 应答结果 | |||
/// </summary> | |||
public JT809_JT1078_0x1A00_0x1A01_Result Result { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.远程录像回放请求应答消息.ToUInt16Value(); | |||
public override string Description { get; } = "远程录像回放请求应答消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1A00_0x1A01 value = new JT809_JT1078_0x1A00_0x1A01(); | |||
var virtualHex = reader.ReadVirtualArray(32); | |||
value.ServerIp = reader.ReadString(32); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]企业视频服务器ip地址", value.ServerIp); | |||
value.ServerPort = reader.ReadUInt16(); | |||
writer.WriteNumber($"[{value.ServerPort.ReadNumber()}]企业视频服务器端口号", value.ServerPort); | |||
value.Result = (JT809_JT1078_0x1A00_0x1A01_Result)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.Result).ReadNumber()}]应答结果", value.Result.ToString()); | |||
} | |||
public JT809_JT1078_0x1A00_0x1A01 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1A00_0x1A01 value = new JT809_JT1078_0x1A00_0x1A01(); | |||
value.ServerIp = reader.ReadString(32); | |||
value.ServerPort = reader.ReadUInt16(); | |||
value.Result = (JT809_JT1078_0x1A00_0x1A01_Result)reader.ReadByte(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1A00_0x1A01 value, IJT809Config config) | |||
{ | |||
writer.WriteStringPadLeft(value.ServerIp, 32); | |||
writer.WriteUInt16(value.ServerPort); | |||
writer.WriteByte((byte)value.Result); | |||
} | |||
} | |||
} |
@@ -1,42 +0,0 @@ | |||
using System.Text.Json; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 远程录像回放控制应答消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1A00_0x1A02 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x1A00_0x1A02>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 应答结果 | |||
/// </summary> | |||
public JT809_JT1078_0x1A00_0x1A02_Result Result { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.远程录像回放控制应答消息.ToUInt16Value(); | |||
public override string Description { get; } = "远程录像回放控制应答消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1A00_0x1A02 value = new JT809_JT1078_0x1A00_0x1A02(); | |||
value.Result = (JT809_JT1078_0x1A00_0x1A02_Result)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.Result).ReadNumber()}]应答结果", value.Result.ToString()); | |||
} | |||
public JT809_JT1078_0x1A00_0x1A02 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1A00_0x1A02 value = new JT809_JT1078_0x1A00_0x1A02(); | |||
value.Result = (JT809_JT1078_0x1A00_0x1A02_Result)reader.ReadByte(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1A00_0x1A02 value, IJT809Config config) | |||
{ | |||
writer.WriteByte((byte)value.Result); | |||
} | |||
} | |||
} |
@@ -1,111 +0,0 @@ | |||
using System.Text.Json; | |||
using JT809.Protocol.Enums; | |||
using JT809.Protocol.Exceptions; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 主链路远程录像下载交互消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1B00 : JT809ExchangeMessageBodies, IJT809MessagePackFormatter<JT809_JT1078_0x1B00>, IJT809Analyze | |||
{ | |||
public override ushort MsgId { get; } = JT809_JT1078_BusinessType.主链路远程录像下载业务类.ToUInt16Value(); | |||
public override JT809_LinkType LinkType { get; } = JT809_LinkType.main; | |||
public override string Description { get; } = "主链路远程录像下载交互消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1B00 value = new JT809_JT1078_0x1B00(); | |||
var virtualHex = reader.ReadVirtualArray(21); | |||
value.VehicleNo = reader.ReadString(21); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车牌号", value.VehicleNo); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.VehicleColor).ReadNumber()}]车牌颜色", value.VehicleColor.ToString()); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
writer.WriteString($"[{value.SubBusinessType.ReadNumber()}]子业务类型标识", ((JT809SubBusinessType)value.SubBusinessType).ToString()); | |||
value.DataLength = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.DataLength.ReadNumber()}]后续数据长度", value.DataLength); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
writer.WriteStartObject("子业务类型"); | |||
instance.Analyze(ref reader, writer, config); | |||
writer.WriteEndObject(); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
public JT809_JT1078_0x1B00 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1B00 value = new JT809_JT1078_0x1B00(); | |||
value.VehicleNo = reader.ReadString(21); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
value.DataLength = reader.ReadUInt32(); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
value.SubBodies = JT809MessagePackFormatterResolverExtensions.JT809DynamicDeserialize( | |||
instance, | |||
ref reader, config); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1B00 value, IJT809Config config) | |||
{ | |||
writer.WriteStringPadRight(value.VehicleNo, 21); | |||
writer.WriteByte((byte)value.VehicleColor); | |||
writer.WriteUInt16(value.SubBusinessType); | |||
try | |||
{ | |||
// 先写入内容,然后在根据内容反写内容长度 | |||
writer.Skip(4, out int subContentLengthPosition); | |||
if (value.SubBodies != null) | |||
{ | |||
if (!value.SubBodies.SkipSerialization) | |||
{ | |||
JT809MessagePackFormatterResolverExtensions.JT809DynamicSerialize( | |||
value.SubBodies, | |||
ref writer, value.SubBodies, | |||
config); | |||
} | |||
} | |||
writer.WriteInt32Return(writer.GetCurrentPosition() - subContentLengthPosition - 4, subContentLengthPosition); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
} | |||
} |
@@ -1,53 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 远程录像下载请求应答消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1B00_0x1B01 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x1B00_0x1B01>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 应答结果 | |||
/// </summary> | |||
public JT809_JT1078_0x1B00_0x1B01_Result Result { get; set; } | |||
/// <summary> | |||
/// 对应平台文件上传消息的流水号 | |||
/// </summary> | |||
public ushort SessionId { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.远程录像下载请求应答消息.ToUInt16Value(); | |||
public override string Description { get; } = "远程录像下载请求应答消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1B00_0x1B01 value = new JT809_JT1078_0x1B00_0x1B01(); | |||
value.Result = (JT809_JT1078_0x1B00_0x1B01_Result)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.Result).ReadNumber() }]应答结果", value.Result.ToString()); | |||
value.SessionId = reader.ReadUInt16(); | |||
writer.WriteNumber($"[{value.SessionId.ReadNumber()}]对应平台文件上传消息的流水号", value.SessionId); | |||
} | |||
public JT809_JT1078_0x1B00_0x1B01 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1B00_0x1B01 value = new JT809_JT1078_0x1B00_0x1B01(); | |||
value.Result = (JT809_JT1078_0x1B00_0x1B01_Result)reader.ReadByte(); | |||
value.SessionId = reader.ReadUInt16(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1B00_0x1B01 value, IJT809Config config) | |||
{ | |||
writer.WriteByte((byte)value.Result); | |||
writer.WriteUInt16(value.SessionId); | |||
} | |||
} | |||
} |
@@ -1,97 +0,0 @@ | |||
using System.Text.Json; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 远程录像下载通知消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1B00_0x1B02 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x1B00_0x1B02>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 应答结果 | |||
/// </summary> | |||
public JT809_JT1078_0x1B00_0x1B02_Result Result { get; set; } | |||
/// <summary> | |||
/// 对应平台文件上传消息的流水号 | |||
/// </summary> | |||
public ushort SessionId { get; set; } | |||
/// <summary> | |||
/// FTP服务器ip地址 | |||
/// </summary> | |||
public string ServerIp { get; set; } | |||
/// <summary> | |||
/// FTP服务器端口 | |||
/// </summary> | |||
public ushort TcpPort { get; set; } | |||
/// <summary> | |||
/// FTP用户名 | |||
/// 49 | |||
/// </summary> | |||
public string UserName { get; set; } | |||
/// <summary> | |||
/// FTP密码 | |||
/// 22 | |||
/// </summary> | |||
public string Password { get; set; } | |||
/// <summary> | |||
/// 文件存储路径 | |||
/// 200 | |||
/// </summary> | |||
public string FilePath { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.远程录像下载通知消息.ToUInt16Value(); | |||
public override string Description { get; } = "远程录像下载通知消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1B00_0x1B02 value = new JT809_JT1078_0x1B00_0x1B02(); | |||
value.Result = (JT809_JT1078_0x1B00_0x1B02_Result)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.Result).ReadNumber() }]应答结果", value.Result.ToString()); | |||
value.SessionId = reader.ReadUInt16(); | |||
writer.WriteNumber($"[{value.SessionId.ReadNumber()}]对应平台文件上传消息的流水号", value.SessionId); | |||
var virtualHex = reader.ReadVirtualArray(32); | |||
value.ServerIp = reader.ReadString(32); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]FTP服务器ip地址", value.ServerIp); | |||
value.TcpPort = reader.ReadUInt16(); | |||
writer.WriteNumber($"[{value.TcpPort.ReadNumber()}]FTP服务器端口", value.TcpPort); | |||
virtualHex = reader.ReadVirtualArray(49); | |||
value.UserName = reader.ReadString(49); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]FTP用户名", value.UserName); | |||
virtualHex = reader.ReadVirtualArray(22); | |||
value.Password = reader.ReadString(22); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]FTP密码", value.Password); | |||
virtualHex = reader.ReadVirtualArray(200); | |||
value.FilePath = reader.ReadString(200); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]文件存储路径", value.FilePath); | |||
} | |||
public JT809_JT1078_0x1B00_0x1B02 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1B00_0x1B02 value = new JT809_JT1078_0x1B00_0x1B02(); | |||
value.Result = (JT809_JT1078_0x1B00_0x1B02_Result)reader.ReadByte(); | |||
value.SessionId = reader.ReadUInt16(); | |||
value.ServerIp = reader.ReadString(32); | |||
value.TcpPort = reader.ReadUInt16(); | |||
value.UserName = reader.ReadString(49); | |||
value.Password = reader.ReadString(22); | |||
value.FilePath = reader.ReadString(200); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1B00_0x1B02 value, IJT809Config config) | |||
{ | |||
writer.WriteByte((byte)value.Result); | |||
writer.WriteUInt16(value.SessionId); | |||
writer.WriteStringPadLeft(value.ServerIp, 32); | |||
writer.WriteUInt16(value.TcpPort); | |||
writer.WriteStringPadLeft(value.UserName, 49); | |||
writer.WriteStringPadLeft(value.Password, 22); | |||
writer.WriteStringPadLeft(value.FilePath, 200); | |||
} | |||
} | |||
} |
@@ -1,42 +0,0 @@ | |||
using System.Text.Json; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 远程录像下载控制应答消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x1B00_0x1B03 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x1B00_0x1B03>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 应答结果 | |||
/// </summary> | |||
public JT809_JT1078_0x1B00_0x1B03_Result Result { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.远程录像下载控制应答消息.ToUInt16Value(); | |||
public override string Description { get; } = "远程录像下载控制应答消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1B00_0x1B03 value = new JT809_JT1078_0x1B00_0x1B03(); | |||
value.Result = (JT809_JT1078_0x1B00_0x1B03_Result)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.Result).ReadNumber()}]应答结果", value.Result.ToString()); | |||
} | |||
public JT809_JT1078_0x1B00_0x1B03 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x1B00_0x1B03 value = new JT809_JT1078_0x1B00_0x1B03(); | |||
value.Result = (JT809_JT1078_0x1B00_0x1B03_Result)reader.ReadByte(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x1B00_0x1B03 value, IJT809Config config) | |||
{ | |||
writer.WriteByte((byte)value.Result); | |||
} | |||
} | |||
} |
@@ -1,111 +0,0 @@ | |||
using System.Text.Json; | |||
using JT809.Protocol.Enums; | |||
using JT809.Protocol.Exceptions; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 从链路时效口令交互消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9700 : JT809ExchangeMessageBodies, IJT809MessagePackFormatter<JT809_JT1078_0x9700>, IJT809Analyze | |||
{ | |||
public override ushort MsgId { get; } = JT809_JT1078_BusinessType.从链路时效口令业务类.ToUInt16Value(); | |||
public override JT809_LinkType LinkType { get; } = JT809_LinkType.subordinate; | |||
public override string Description { get; } = "从链路时效口令交互消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9700 value = new JT809_JT1078_0x9700(); | |||
var virtualHex = reader.ReadVirtualArray(21); | |||
value.VehicleNo = reader.ReadString(21); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车牌号", value.VehicleNo); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.VehicleColor).ReadNumber()}]车牌颜色", value.VehicleColor.ToString()); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
writer.WriteString($"[{value.SubBusinessType.ReadNumber()}]子业务类型标识", ((JT809SubBusinessType)value.SubBusinessType).ToString()); | |||
value.DataLength = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.DataLength.ReadNumber()}]后续数据长度", value.DataLength); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
writer.WriteStartObject("子业务类型"); | |||
instance.Analyze(ref reader, writer, config); | |||
writer.WriteEndObject(); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
public JT809_JT1078_0x9700 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9700 value = new JT809_JT1078_0x9700(); | |||
value.VehicleNo = reader.ReadString(21); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
value.DataLength = reader.ReadUInt32(); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
value.SubBodies = JT809MessagePackFormatterResolverExtensions.JT809DynamicDeserialize( | |||
instance, | |||
ref reader, config); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9700 value, IJT809Config config) | |||
{ | |||
writer.WriteStringPadRight(value.VehicleNo, 21); | |||
writer.WriteByte((byte)value.VehicleColor); | |||
writer.WriteUInt16(value.SubBusinessType); | |||
try | |||
{ | |||
// 先写入内容,然后在根据内容反写内容长度 | |||
writer.Skip(4, out int subContentLengthPosition); | |||
if (value.SubBodies != null) | |||
{ | |||
if (!value.SubBodies.SkipSerialization) | |||
{ | |||
JT809MessagePackFormatterResolverExtensions.JT809DynamicSerialize( | |||
value.SubBodies, | |||
ref writer, value.SubBodies, | |||
config); | |||
} | |||
} | |||
writer.WriteInt32Return(writer.GetCurrentPosition() - subContentLengthPosition - 4, subContentLengthPosition); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
} | |||
} |
@@ -1,16 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 时效口令请求应答消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9700_0x9702 : JT809SubBodies | |||
{ | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.时效口令请求应答消息.ToUInt16Value(); | |||
public override string Description { get; } = "时效口令请求应答消息"; | |||
public override bool SkipSerialization { get; set; } = true; | |||
} | |||
} |
@@ -1,111 +0,0 @@ | |||
using System.Text.Json; | |||
using JT809.Protocol.Enums; | |||
using JT809.Protocol.Exceptions; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 从链路实时音视频交互信息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9800 : JT809ExchangeMessageBodies, IJT809MessagePackFormatter<JT809_JT1078_0x9800>, IJT809Analyze | |||
{ | |||
public override ushort MsgId { get; } = JT809_JT1078_BusinessType.从链路实时音视频业务类.ToUInt16Value(); | |||
public override JT809_LinkType LinkType { get; } = JT809_LinkType.subordinate; | |||
public override string Description { get; } = "从链路实时音视频交互信息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9800 value = new JT809_JT1078_0x9800(); | |||
var virtualHex = reader.ReadVirtualArray(21); | |||
value.VehicleNo = reader.ReadString(21); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车牌号", value.VehicleNo); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.VehicleColor).ReadNumber()}]车牌颜色", value.VehicleColor.ToString()); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
writer.WriteString($"[{value.SubBusinessType.ReadNumber()}]子业务类型标识", ((JT809SubBusinessType)value.SubBusinessType).ToString()); | |||
value.DataLength = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.DataLength.ReadNumber()}]后续数据长度", value.DataLength); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
writer.WriteStartObject("子业务类型"); | |||
instance.Analyze(ref reader, writer, config); | |||
writer.WriteEndObject(); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
public JT809_JT1078_0x9800 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9800 value = new JT809_JT1078_0x9800(); | |||
value.VehicleNo = reader.ReadString(21); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
value.DataLength = reader.ReadUInt32(); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
value.SubBodies = JT809MessagePackFormatterResolverExtensions.JT809DynamicDeserialize( | |||
instance, | |||
ref reader, config); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9800 value, IJT809Config config) | |||
{ | |||
writer.WriteStringPadRight(value.VehicleNo, 21); | |||
writer.WriteByte((byte)value.VehicleColor); | |||
writer.WriteUInt16(value.SubBusinessType); | |||
try | |||
{ | |||
// 先写入内容,然后在根据内容反写内容长度 | |||
writer.Skip(4, out int subContentLengthPosition); | |||
if (value.SubBodies != null) | |||
{ | |||
if (!value.SubBodies.SkipSerialization) | |||
{ | |||
JT809MessagePackFormatterResolverExtensions.JT809DynamicSerialize( | |||
value.SubBodies, | |||
ref writer, value.SubBodies, | |||
config); | |||
} | |||
} | |||
writer.WriteInt32Return(writer.GetCurrentPosition() - subContentLengthPosition - 4, subContentLengthPosition); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
} | |||
} |
@@ -1,121 +0,0 @@ | |||
using System.Text.Json; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 实时音视频请求消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9800_0x9801 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x9800_0x9801>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 逻辑通道号 | |||
/// </summary> | |||
public byte ChannelId { get; set; } | |||
/// <summary> | |||
/// 音视频类型 | |||
/// </summary> | |||
public byte AVitemType { get; set; } | |||
/// <summary> | |||
/// 时效口令 | |||
/// </summary> | |||
public string AuthorizeCode { get; set; } | |||
/// <summary> | |||
/// 车辆进入跨域地区后5min之内的任何位置,仅跨域访问请求时使用此字段 | |||
/// </summary> | |||
public byte[] GnssData { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.实时音视频请求消息.ToUInt16Value(); | |||
public override string Description { get; } = "实时音视频请求消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9800_0x9801 value = new JT809_JT1078_0x9800_0x9801(); | |||
value.ChannelId = reader.ReadByte(); | |||
writer.WriteString($"[{value.ChannelId.ReadNumber()}]逻辑通道号", LogicalChannelNoDisplay(value.ChannelId)); | |||
value.AVitemType = reader.ReadByte(); | |||
writer.WriteString($"[{value.AVitemType.ReadNumber()}]音视频资源类型", AVResourceTypeDisplay(value.AVitemType)); | |||
var virtualHex = reader.ReadVirtualArray(64); | |||
value.AuthorizeCode = reader.ReadString(64); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]时效口令", value.AuthorizeCode); | |||
virtualHex = reader.ReadVirtualArray(36); | |||
value.GnssData = reader.ReadArray(36).ToArray(); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车辆进入跨域地区后5min之内的任何位置", virtualHex.ToArray().ToHexString()); | |||
string LogicalChannelNoDisplay(byte LogicalChannelNo) | |||
{ | |||
switch (LogicalChannelNo) | |||
{ | |||
case 1: | |||
return "驾驶员"; | |||
case 2: | |||
return "车辆正前方"; | |||
case 3: | |||
return "车前门"; | |||
case 4: | |||
return "车厢前部"; | |||
case 5: | |||
return "车厢后部"; | |||
case 7: | |||
return "行李舱"; | |||
case 8: | |||
return "车辆左侧"; | |||
case 9: | |||
return "车辆右侧"; | |||
case 10: | |||
return "车辆正后方"; | |||
case 11: | |||
return "车厢中部"; | |||
case 12: | |||
return "车中门"; | |||
case 13: | |||
return "驾驶席车门"; | |||
case 33: | |||
return "驾驶员"; | |||
case 36: | |||
return "车厢前部"; | |||
case 37: | |||
return "车厢后部"; | |||
default: | |||
return "预留"; | |||
} | |||
} | |||
string AVResourceTypeDisplay(byte AVResourceType) | |||
{ | |||
switch (AVResourceType) | |||
{ | |||
case 0: | |||
return "音视频"; | |||
case 1: | |||
return "音频"; | |||
case 2: | |||
return "视频"; | |||
default: | |||
break; | |||
} | |||
return "未知"; | |||
} | |||
} | |||
public JT809_JT1078_0x9800_0x9801 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9800_0x9801 value = new JT809_JT1078_0x9800_0x9801(); | |||
value.ChannelId = reader.ReadByte(); | |||
value.AVitemType = reader.ReadByte(); | |||
value.AuthorizeCode = reader.ReadString(64); | |||
value.GnssData = reader.ReadArray(36).ToArray(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9800_0x9801 value, IJT809Config config) | |||
{ | |||
writer.WriteByte(value.ChannelId); | |||
writer.WriteByte(value.AVitemType); | |||
writer.WriteStringPadRight(value.AuthorizeCode,64); | |||
writer.WriteArray(value.GnssData); | |||
} | |||
} | |||
} |
@@ -1,103 +0,0 @@ | |||
using System.Text.Json; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 主动请求停止实时音视频传输消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9800_0x9802 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x9800_0x9802>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 逻辑通道号 | |||
/// </summary> | |||
public byte ChannelId { get; set; } | |||
/// <summary> | |||
/// 音视频类型 | |||
/// </summary> | |||
public byte AVitemType { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.主动请求停止实时音视频传输消息.ToUInt16Value(); | |||
public override string Description { get; } = "主动请求停止实时音视频传输消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9800_0x9802 value = new JT809_JT1078_0x9800_0x9802(); | |||
value.ChannelId = reader.ReadByte(); | |||
writer.WriteString($"[{value.ChannelId.ReadNumber()}]逻辑通道号", LogicalChannelNoDisplay(value.ChannelId)); | |||
value.AVitemType = reader.ReadByte(); | |||
writer.WriteString($"[{value.AVitemType.ReadNumber()}]音视频资源类型", AVResourceTypeDisplay(value.AVitemType)); | |||
string LogicalChannelNoDisplay(byte LogicalChannelNo) | |||
{ | |||
switch (LogicalChannelNo) | |||
{ | |||
case 1: | |||
return "驾驶员"; | |||
case 2: | |||
return "车辆正前方"; | |||
case 3: | |||
return "车前门"; | |||
case 4: | |||
return "车厢前部"; | |||
case 5: | |||
return "车厢后部"; | |||
case 7: | |||
return "行李舱"; | |||
case 8: | |||
return "车辆左侧"; | |||
case 9: | |||
return "车辆右侧"; | |||
case 10: | |||
return "车辆正后方"; | |||
case 11: | |||
return "车厢中部"; | |||
case 12: | |||
return "车中门"; | |||
case 13: | |||
return "驾驶席车门"; | |||
case 33: | |||
return "驾驶员"; | |||
case 36: | |||
return "车厢前部"; | |||
case 37: | |||
return "车厢后部"; | |||
default: | |||
return "预留"; | |||
} | |||
} | |||
string AVResourceTypeDisplay(byte AVResourceType) | |||
{ | |||
switch (AVResourceType) | |||
{ | |||
case 0: | |||
return "音视频"; | |||
case 1: | |||
return "音频"; | |||
case 2: | |||
return "视频"; | |||
default: | |||
break; | |||
} | |||
return "未知"; | |||
} | |||
} | |||
public JT809_JT1078_0x9800_0x9802 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9800_0x9802 value = new JT809_JT1078_0x9800_0x9802(); | |||
value.ChannelId = reader.ReadByte(); | |||
value.AVitemType = reader.ReadByte(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9800_0x9802 value, IJT809Config config) | |||
{ | |||
writer.WriteByte(value.ChannelId); | |||
writer.WriteByte(value.AVitemType); | |||
} | |||
} | |||
} |
@@ -1,111 +0,0 @@ | |||
using System.Text.Json; | |||
using JT809.Protocol.Enums; | |||
using JT809.Protocol.Exceptions; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 从链路远程录像检索交互消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9900 : JT809ExchangeMessageBodies, IJT809MessagePackFormatter<JT809_JT1078_0x9900>, IJT809Analyze | |||
{ | |||
public override ushort MsgId { get; } = JT809_JT1078_BusinessType.从链路远程录像检索业务类.ToUInt16Value(); | |||
public override JT809_LinkType LinkType { get; } = JT809_LinkType.subordinate; | |||
public override string Description { get; } = "从链路远程录像检索交互消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9900 value = new JT809_JT1078_0x9900(); | |||
var virtualHex = reader.ReadVirtualArray(21); | |||
value.VehicleNo = reader.ReadString(21); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车牌号", value.VehicleNo); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.VehicleColor).ReadNumber()}]车牌颜色", value.VehicleColor.ToString()); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
writer.WriteString($"[{value.SubBusinessType.ReadNumber()}]子业务类型标识", ((JT809SubBusinessType)value.SubBusinessType).ToString()); | |||
value.DataLength = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.DataLength.ReadNumber()}]后续数据长度", value.DataLength); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
writer.WriteStartObject("子业务类型"); | |||
instance.Analyze(ref reader, writer, config); | |||
writer.WriteEndObject(); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
public JT809_JT1078_0x9900 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9900 value = new JT809_JT1078_0x9900(); | |||
value.VehicleNo = reader.ReadString(21); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
value.DataLength = reader.ReadUInt32(); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
value.SubBodies = JT809MessagePackFormatterResolverExtensions.JT809DynamicDeserialize( | |||
instance, | |||
ref reader, config); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9900 value, IJT809Config config) | |||
{ | |||
writer.WriteStringPadRight(value.VehicleNo, 21); | |||
writer.WriteByte((byte)value.VehicleColor); | |||
writer.WriteUInt16(value.SubBusinessType); | |||
try | |||
{ | |||
// 先写入内容,然后在根据内容反写内容长度 | |||
writer.Skip(4, out int subContentLengthPosition); | |||
if (value.SubBodies != null) | |||
{ | |||
if (!value.SubBodies.SkipSerialization) | |||
{ | |||
JT809MessagePackFormatterResolverExtensions.JT809DynamicSerialize( | |||
value.SubBodies, | |||
ref writer, value.SubBodies, | |||
config); | |||
} | |||
} | |||
writer.WriteInt32Return(writer.GetCurrentPosition() - subContentLengthPosition - 4, subContentLengthPosition); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
} | |||
} |
@@ -1,50 +0,0 @@ | |||
using System.Text.Json; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 主动上传音视频资源目录信息应答消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9900_0x9901 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x9900_0x9901>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 应答结果 | |||
/// </summary> | |||
public JT809_JT1078_0x9900_0x9901_Result Result { get; set; } | |||
/// <summary> | |||
/// 资源目录总数 | |||
/// </summary> | |||
public byte ItemNumber { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.主动上传音视频资源目录信息应答消息.ToUInt16Value(); | |||
public override string Description { get; } = "主动上传音视频资源目录信息应答消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9900_0x9901 value = new JT809_JT1078_0x9900_0x9901(); | |||
value.Result = (JT809_JT1078_0x9900_0x9901_Result)reader.ReadByte(); | |||
writer.WriteString($"[{ (byte)value.Result }]应答结果", value.Result.ToString()); | |||
value.ItemNumber = reader.ReadByte(); | |||
writer.WriteNumber($"[{value.ItemNumber.ReadNumber()}]资源目录总数", value.ItemNumber); | |||
} | |||
public JT809_JT1078_0x9900_0x9901 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9900_0x9901 value = new JT809_JT1078_0x9900_0x9901(); | |||
value.Result = (JT809_JT1078_0x9900_0x9901_Result)reader.ReadByte(); | |||
value.ItemNumber = reader.ReadByte(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9900_0x9901 value, IJT809Config config) | |||
{ | |||
writer.WriteByte((byte)value.Result); | |||
writer.WriteByte(value.ItemNumber); | |||
} | |||
} | |||
} |
@@ -1,190 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 查询音视频资源目录请求消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9900_0x9902 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x9900_0x9902>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 逻辑通道号 | |||
/// </summary> | |||
public byte ChannelId { get; set; } | |||
/// <summary> | |||
/// 起始时间 | |||
/// </summary> | |||
public DateTime StartTime { get; set; } | |||
/// <summary> | |||
/// 终止时间 | |||
/// </summary> | |||
public DateTime EndTime { get; set; } | |||
/// <summary> | |||
/// 报警类型 | |||
/// </summary> | |||
public ulong AlarmType { get; set; } | |||
/// <summary> | |||
/// 音视频类型 | |||
/// </summary> | |||
public byte AVItemType { get; set; } | |||
/// <summary> | |||
/// 码流类型 | |||
/// </summary> | |||
public byte StreamType { get; set; } | |||
/// <summary> | |||
/// 存储器类型 | |||
/// </summary> | |||
public byte MemType { get; set; } | |||
/// <summary> | |||
/// 时效口令 | |||
/// 64 | |||
/// </summary> | |||
public string AuthorizeCode { get; set; } | |||
/// <summary> | |||
/// 车辆进入跨域地区后5min之内任一位置,仅跨域访问请求时,使用此字段 | |||
/// 36 | |||
/// </summary> | |||
public byte[] GnssData { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.查询音视频资源目录请求消息.ToUInt16Value(); | |||
public override string Description { get; } = "查询音视频资源目录请求消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9900_0x9902 value = new JT809_JT1078_0x9900_0x9902(); | |||
value.ChannelId = reader.ReadByte(); | |||
writer.WriteString($"[{value.ChannelId.ReadNumber()}]逻辑通道号", LogicalChannelNoDisplay(value.ChannelId)); | |||
var virtualHex = reader.ReadVirtualArray(8); | |||
value.StartTime = reader.ReadUTCDateTime(); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]开始时间", value.StartTime); | |||
virtualHex = reader.ReadVirtualArray(8); | |||
value.EndTime = reader.ReadUTCDateTime(); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]结束时间", value.StartTime); | |||
value.AlarmType = reader.ReadUInt64(); | |||
writer.WriteNumber($"[{value.AlarmType.ReadNumber()}]报警标志物", value.AlarmType); | |||
value.AVItemType = reader.ReadByte(); | |||
writer.WriteString($"[{value.AVItemType.ReadNumber()}]音视频资源类型", AVResourceTypeDisplay(value.AVItemType)); | |||
value.StreamType = reader.ReadByte(); | |||
writer.WriteString($"[{value.StreamType.ReadNumber()}]码流类型", StreamTypeDisplay(value.StreamType)); | |||
value.MemType = reader.ReadByte(); | |||
writer.WriteString($"[{value.MemType.ReadNumber()}]存储器类型", MemoryTypeDisplay(value.MemType)); | |||
virtualHex = reader.ReadVirtualArray(64); | |||
value.AuthorizeCode = reader.ReadString(64); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]时效口令", value.AuthorizeCode); | |||
virtualHex = reader.ReadVirtualArray(36); | |||
value.GnssData = reader.ReadArray(36).ToArray(); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车辆进入跨域地区后5min之内任一位置", virtualHex.ToArray().ToHexString()); | |||
string LogicalChannelNoDisplay(byte LogicalChannelNo) | |||
{ | |||
switch (LogicalChannelNo) | |||
{ | |||
case 1: | |||
return "驾驶员"; | |||
case 2: | |||
return "车辆正前方"; | |||
case 3: | |||
return "车前门"; | |||
case 4: | |||
return "车厢前部"; | |||
case 5: | |||
return "车厢后部"; | |||
case 7: | |||
return "行李舱"; | |||
case 8: | |||
return "车辆左侧"; | |||
case 9: | |||
return "车辆右侧"; | |||
case 10: | |||
return "车辆正后方"; | |||
case 11: | |||
return "车厢中部"; | |||
case 12: | |||
return "车中门"; | |||
case 13: | |||
return "驾驶席车门"; | |||
case 33: | |||
return "驾驶员"; | |||
case 36: | |||
return "车厢前部"; | |||
case 37: | |||
return "车厢后部"; | |||
default: | |||
return "预留"; | |||
} | |||
} | |||
string AVResourceTypeDisplay(byte AVResourceType) | |||
{ | |||
switch (AVResourceType) | |||
{ | |||
case 0: | |||
return "音视频"; | |||
case 1: | |||
return "音频"; | |||
case 2: | |||
return "视频"; | |||
default: | |||
break; | |||
} | |||
return "未知"; | |||
} | |||
string StreamTypeDisplay(byte StreamType) | |||
{ | |||
switch (StreamType) | |||
{ | |||
case 1: | |||
return "主码流"; | |||
case 2: | |||
return "子码流"; | |||
default: | |||
return "未知"; | |||
} | |||
} | |||
string MemoryTypeDisplay(byte MemoryType) | |||
{ | |||
switch (MemoryType) | |||
{ | |||
case 1: | |||
return "主存储器"; | |||
case 2: | |||
return "灾备存储器"; | |||
default: | |||
return "未知"; | |||
} | |||
} | |||
} | |||
public JT809_JT1078_0x9900_0x9902 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9900_0x9902 value = new JT809_JT1078_0x9900_0x9902(); | |||
value.ChannelId = reader.ReadByte(); | |||
value.StartTime = reader.ReadUTCDateTime(); | |||
value.EndTime = reader.ReadUTCDateTime(); | |||
value.AlarmType = reader.ReadUInt64(); | |||
value.AVItemType = reader.ReadByte(); | |||
value.StreamType = reader.ReadByte(); | |||
value.MemType = reader.ReadByte(); | |||
value.AuthorizeCode = reader.ReadString(64); | |||
value.GnssData = reader.ReadArray(36).ToArray(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9900_0x9902 value, IJT809Config config) | |||
{ | |||
writer.WriteByte(value.ChannelId); | |||
writer.WriteUTCDateTime(value.StartTime); | |||
writer.WriteUTCDateTime(value.EndTime); | |||
writer.WriteUInt64(value.AlarmType); | |||
writer.WriteByte(value.AVItemType); | |||
writer.WriteByte(value.StreamType); | |||
writer.WriteByte(value.MemType); | |||
writer.WriteStringPadRight(value.AuthorizeCode, 64); | |||
writer.WriteArray(value.GnssData); | |||
} | |||
} | |||
} |
@@ -1,111 +0,0 @@ | |||
using System.Text.Json; | |||
using JT809.Protocol.Enums; | |||
using JT809.Protocol.Exceptions; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 从链路远程录像回放交互消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9A00 : JT809ExchangeMessageBodies, IJT809MessagePackFormatter<JT809_JT1078_0x9A00>, IJT809Analyze | |||
{ | |||
public override ushort MsgId { get; } = JT809_JT1078_BusinessType.从链路远程录像回放业务类.ToUInt16Value(); | |||
public override JT809_LinkType LinkType { get; } = JT809_LinkType.subordinate; | |||
public override string Description { get; } = "从链路远程录像回放交互消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9A00 value = new JT809_JT1078_0x9A00(); | |||
var virtualHex = reader.ReadVirtualArray(21); | |||
value.VehicleNo = reader.ReadString(21); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车牌号", value.VehicleNo); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.VehicleColor).ReadNumber()}]车牌颜色", value.VehicleColor.ToString()); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
writer.WriteString($"[{value.SubBusinessType.ReadNumber()}]子业务类型标识", ((JT809SubBusinessType)value.SubBusinessType).ToString()); | |||
value.DataLength = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.DataLength.ReadNumber()}]后续数据长度", value.DataLength); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
writer.WriteStartObject("子业务类型"); | |||
instance.Analyze(ref reader, writer, config); | |||
writer.WriteEndObject(); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
public JT809_JT1078_0x9A00 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9A00 value = new JT809_JT1078_0x9A00(); | |||
value.VehicleNo = reader.ReadString(21); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
value.DataLength = reader.ReadUInt32(); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
value.SubBodies = JT809MessagePackFormatterResolverExtensions.JT809DynamicDeserialize( | |||
instance, | |||
ref reader, config); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9A00 value, IJT809Config config) | |||
{ | |||
writer.WriteStringPadRight(value.VehicleNo, 21); | |||
writer.WriteByte((byte)value.VehicleColor); | |||
writer.WriteUInt16(value.SubBusinessType); | |||
try | |||
{ | |||
// 先写入内容,然后在根据内容反写内容长度 | |||
writer.Skip(4, out int subContentLengthPosition); | |||
if (value.SubBodies != null) | |||
{ | |||
if (!value.SubBodies.SkipSerialization) | |||
{ | |||
JT809MessagePackFormatterResolverExtensions.JT809DynamicSerialize( | |||
value.SubBodies, | |||
ref writer, value.SubBodies, | |||
config); | |||
} | |||
} | |||
writer.WriteInt32Return(writer.GetCurrentPosition() - subContentLengthPosition - 4, subContentLengthPosition); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
} | |||
} |
@@ -1,182 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 远程录像回放请求消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9A00_0x9A01 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x9A00_0x9A01>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 逻辑通道号 | |||
/// </summary> | |||
public byte ChannelId { get; set; } | |||
/// <summary> | |||
/// 音视频类型 | |||
/// </summary> | |||
public byte AVItemType { get; set; } | |||
/// <summary> | |||
/// 码流类型 | |||
/// </summary> | |||
public byte StreamType { get; set; } | |||
/// <summary> | |||
/// 存储器类型 | |||
/// </summary> | |||
public byte MemType { get; set; } | |||
/// <summary> | |||
/// 回放起始时间 | |||
/// </summary> | |||
public DateTime PlayBackStartTime { get; set; } | |||
/// <summary> | |||
/// 回放结束时间 | |||
/// </summary> | |||
public DateTime PlayBackEndTime { get; set; } | |||
/// <summary> | |||
/// 时效口令 | |||
/// 64 | |||
/// </summary> | |||
public string AuthorizeCode { get; set; } | |||
/// <summary> | |||
/// 车辆进入跨域地区后5min之内任一位置,仅跨域访问请求时,使用此字段 | |||
/// 36 | |||
/// </summary> | |||
public byte[] GnssData { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.远程录像回放请求消息.ToUInt16Value(); | |||
public override string Description { get; } = "远程录像回放请求消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9A00_0x9A01 value = new JT809_JT1078_0x9A00_0x9A01(); | |||
value.ChannelId = reader.ReadByte(); | |||
writer.WriteString($"[{value.ChannelId.ReadNumber()}]逻辑通道号", LogicalChannelNoDisplay(value.ChannelId)); | |||
value.AVItemType = reader.ReadByte(); | |||
writer.WriteString($"[{value.AVItemType.ReadNumber()}]音视频资源类型", AVResourceTypeDisplay(value.AVItemType)); | |||
value.StreamType = reader.ReadByte(); | |||
writer.WriteString($"[{value.StreamType.ReadNumber()}]码流类型", StreamTypeDisplay(value.StreamType)); | |||
value.MemType = reader.ReadByte(); | |||
writer.WriteString($"[{value.MemType.ReadNumber()}]存储器类型", MemoryTypeDisplay(value.MemType)); | |||
var virtualHex = reader.ReadVirtualArray(8); | |||
value.PlayBackStartTime = reader.ReadUTCDateTime(); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]回放开始时间", value.PlayBackStartTime); | |||
virtualHex = reader.ReadVirtualArray(8); | |||
value.PlayBackEndTime = reader.ReadUTCDateTime(); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]回放结束时间", value.PlayBackEndTime); | |||
virtualHex = reader.ReadVirtualArray(64); | |||
value.AuthorizeCode = reader.ReadString(64); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]时效口令", value.AuthorizeCode); | |||
virtualHex = reader.ReadVirtualArray(36); | |||
value.GnssData = reader.ReadArray(36).ToArray(); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车辆进入跨域地区后5min之内任一位置", virtualHex.ToArray().ToHexString()); | |||
string LogicalChannelNoDisplay(byte LogicalChannelNo) | |||
{ | |||
switch (LogicalChannelNo) | |||
{ | |||
case 1: | |||
return "驾驶员"; | |||
case 2: | |||
return "车辆正前方"; | |||
case 3: | |||
return "车前门"; | |||
case 4: | |||
return "车厢前部"; | |||
case 5: | |||
return "车厢后部"; | |||
case 7: | |||
return "行李舱"; | |||
case 8: | |||
return "车辆左侧"; | |||
case 9: | |||
return "车辆右侧"; | |||
case 10: | |||
return "车辆正后方"; | |||
case 11: | |||
return "车厢中部"; | |||
case 12: | |||
return "车中门"; | |||
case 13: | |||
return "驾驶席车门"; | |||
case 33: | |||
return "驾驶员"; | |||
case 36: | |||
return "车厢前部"; | |||
case 37: | |||
return "车厢后部"; | |||
default: | |||
return "预留"; | |||
} | |||
} | |||
string AVResourceTypeDisplay(byte AVResourceType) | |||
{ | |||
switch (AVResourceType) | |||
{ | |||
case 0: | |||
return "音视频"; | |||
case 1: | |||
return "音频"; | |||
case 2: | |||
return "视频"; | |||
default: | |||
break; | |||
} | |||
return "未知"; | |||
} | |||
string StreamTypeDisplay(byte StreamType) | |||
{ | |||
switch (StreamType) | |||
{ | |||
case 1: | |||
return "主码流"; | |||
case 2: | |||
return "子码流"; | |||
default: | |||
return "未知"; | |||
} | |||
} | |||
string MemoryTypeDisplay(byte MemoryType) | |||
{ | |||
switch (MemoryType) | |||
{ | |||
case 1: | |||
return "主存储器"; | |||
case 2: | |||
return "灾备存储器"; | |||
default: | |||
return "未知"; | |||
} | |||
} | |||
} | |||
public JT809_JT1078_0x9A00_0x9A01 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9A00_0x9A01 value = new JT809_JT1078_0x9A00_0x9A01(); | |||
value.ChannelId = reader.ReadByte(); | |||
value.AVItemType = reader.ReadByte(); | |||
value.StreamType = reader.ReadByte(); | |||
value.MemType = reader.ReadByte(); | |||
value.PlayBackStartTime = reader.ReadUTCDateTime(); | |||
value.PlayBackEndTime = reader.ReadUTCDateTime(); | |||
value.AuthorizeCode = reader.ReadString(64); | |||
value.GnssData = reader.ReadArray(36).ToArray(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9A00_0x9A01 value, IJT809Config config) | |||
{ | |||
writer.WriteByte(value.ChannelId); | |||
writer.WriteByte(value.AVItemType); | |||
writer.WriteByte(value.StreamType); | |||
writer.WriteByte(value.MemType); | |||
writer.WriteUTCDateTime(value.PlayBackStartTime); | |||
writer.WriteUTCDateTime(value.PlayBackEndTime); | |||
writer.WriteStringPadRight(value.AuthorizeCode, 64); | |||
writer.WriteArray(value.GnssData); | |||
} | |||
} | |||
} |
@@ -1,60 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 远程录像回放控制消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9A00_0x9A02 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x9A00_0x9A02>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 控制类型 | |||
/// </summary> | |||
public ControlType ControlType { get; set; } | |||
/// <summary> | |||
/// 快进或倒退倍数 | |||
/// </summary> | |||
public FastTime FastTime { get; set; } | |||
/// <summary> | |||
/// 拖动位置 | |||
/// </summary> | |||
public DateTime DateTime { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.远程录像回放控制消息.ToUInt16Value(); | |||
public override string Description { get; } = "远程录像回放控制消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9A00_0x9A02 value = new JT809_JT1078_0x9A00_0x9A02(); | |||
value.ControlType = (ControlType)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.ControlType).ReadNumber()}]控制类型", value.ControlType.ToString()); | |||
value.FastTime = (FastTime)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.FastTime).ReadNumber()}]快进或倒退倍数", value.FastTime.ToString()); | |||
var virtualHex = reader.ReadVirtualArray(8); | |||
value.DateTime = reader.ReadUTCDateTime(); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]拖动位置", value.DateTime); | |||
} | |||
public JT809_JT1078_0x9A00_0x9A02 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9A00_0x9A02 value = new JT809_JT1078_0x9A00_0x9A02(); | |||
value.ControlType = (ControlType)reader.ReadByte(); | |||
value.FastTime = (FastTime)reader.ReadByte(); | |||
value.DateTime = reader.ReadUTCDateTime(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9A00_0x9A02 value, IJT809Config config) | |||
{ | |||
writer.WriteByte((byte)value.ControlType); | |||
writer.WriteByte((byte)value.FastTime); | |||
writer.WriteUTCDateTime(value.DateTime); | |||
} | |||
} | |||
} |
@@ -1,114 +0,0 @@ | |||
using JT809.Protocol.Enums; | |||
using JT809.Protocol.Exceptions; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 从链路远程录像下载交互消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9B00 : JT809ExchangeMessageBodies, IJT809MessagePackFormatter<JT809_JT1078_0x9B00>, IJT809Analyze | |||
{ | |||
public override ushort MsgId { get; } = JT809_JT1078_BusinessType.从链路远程录像下载业务类.ToUInt16Value(); | |||
public override JT809_LinkType LinkType { get; } = JT809_LinkType.subordinate; | |||
public override string Description { get; } = "从链路远程录像下载交互消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9B00 value = new JT809_JT1078_0x9B00(); | |||
var virtualHex = reader.ReadVirtualArray(21); | |||
value.VehicleNo = reader.ReadString(21); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车牌号", value.VehicleNo); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.VehicleColor).ReadNumber()}]车牌颜色", value.VehicleColor.ToString()); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
writer.WriteString($"[{value.SubBusinessType.ReadNumber()}]子业务类型标识", ((JT809SubBusinessType)value.SubBusinessType).ToString()); | |||
value.DataLength = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.DataLength.ReadNumber()}]后续数据长度", value.DataLength); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
writer.WriteStartObject("子业务类型"); | |||
instance.Analyze(ref reader, writer, config); | |||
writer.WriteEndObject(); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
public JT809_JT1078_0x9B00 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9B00 value = new JT809_JT1078_0x9B00(); | |||
value.VehicleNo = reader.ReadString(21); | |||
value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); | |||
value.SubBusinessType = reader.ReadUInt16(); | |||
value.DataLength = reader.ReadUInt32(); | |||
try | |||
{ | |||
if (config.SubBusinessTypeFactory.TryGetValue(value.SubBusinessType, out object instance)) | |||
{ | |||
if (instance is JT809SubBodies subBodies) | |||
{ | |||
if (!subBodies.SkipSerialization) | |||
{ | |||
value.SubBodies = JT809MessagePackFormatterResolverExtensions.JT809DynamicDeserialize( | |||
instance, | |||
ref reader, config); | |||
} | |||
} | |||
} | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9B00 value, IJT809Config config) | |||
{ | |||
writer.WriteStringPadRight(value.VehicleNo, 21); | |||
writer.WriteByte((byte)value.VehicleColor); | |||
writer.WriteUInt16(value.SubBusinessType); | |||
try | |||
{ | |||
// 先写入内容,然后在根据内容反写内容长度 | |||
writer.Skip(4, out int subContentLengthPosition); | |||
if (value.SubBodies != null) | |||
{ | |||
if (!value.SubBodies.SkipSerialization) | |||
{ | |||
JT809MessagePackFormatterResolverExtensions.JT809DynamicSerialize( | |||
value.SubBodies, | |||
ref writer, value.SubBodies, | |||
config); | |||
} | |||
} | |||
writer.WriteInt32Return(writer.GetCurrentPosition() - subContentLengthPosition - 4, subContentLengthPosition); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||
} | |||
} | |||
} | |||
} |
@@ -1,202 +0,0 @@ | |||
using JT809.Protocol.Attributes; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Extensions.JT1078.Formatters; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 远程录像下载请求消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9B00_0x9B01 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x9B00_0x9B01>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 逻辑通道号 | |||
/// </summary> | |||
public byte ChannelId { get; set; } | |||
/// <summary> | |||
/// 起始时间 | |||
/// </summary> | |||
public DateTime StartTime { get; set; } | |||
/// <summary> | |||
/// 终止时间 | |||
/// </summary> | |||
public DateTime EndTime { get; set; } | |||
/// <summary> | |||
/// 报警类型 | |||
/// </summary> | |||
public ulong AlarmType { get; set; } | |||
/// <summary> | |||
/// 音视频类型 | |||
/// </summary> | |||
public byte AVItemType { get; set; } | |||
/// <summary> | |||
/// 码流类型 | |||
/// </summary> | |||
public byte StreamType { get; set; } | |||
/// <summary> | |||
/// 存储器类型 | |||
/// </summary> | |||
public byte MemType { get; set; } | |||
/// <summary> | |||
/// 文件大小 byte | |||
/// </summary> | |||
public uint FileSize { get; set; } | |||
/// <summary> | |||
/// 时效口令 | |||
/// 64 | |||
/// </summary> | |||
public string AuthorizeCode { get; set; } | |||
/// <summary> | |||
/// 车辆进入跨域地区后5min之内任一位置,仅跨域访问请求时,使用此字段 | |||
/// 36 | |||
/// </summary> | |||
public byte[] GnssData { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.远程录像下载请求消息.ToUInt16Value(); | |||
public override string Description { get; } = "远程录像下载请求消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9B00_0x9B01 value = new JT809_JT1078_0x9B00_0x9B01(); | |||
value.ChannelId = reader.ReadByte(); | |||
writer.WriteString($"[{value.ChannelId.ReadNumber()}]逻辑通道号", LogicalChannelNoDisplay(value.ChannelId)); | |||
var virtualHex = reader.ReadVirtualArray(8); | |||
value.StartTime = reader.ReadUTCDateTime(); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]开始时间", value.StartTime); | |||
virtualHex = reader.ReadVirtualArray(8); | |||
value.EndTime = reader.ReadUTCDateTime(); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]结束时间", value.StartTime); | |||
value.AlarmType = reader.ReadUInt64(); | |||
writer.WriteNumber($"[{value.AlarmType.ReadNumber()}]报警标志物", value.AlarmType); | |||
value.AVItemType = reader.ReadByte(); | |||
writer.WriteString($"[{value.AVItemType.ReadNumber()}]音视频资源类型", AVResourceTypeDisplay(value.AVItemType)); | |||
value.StreamType = reader.ReadByte(); | |||
writer.WriteString($"[{value.StreamType.ReadNumber()}]码流类型", StreamTypeDisplay(value.StreamType)); | |||
value.MemType = reader.ReadByte(); | |||
writer.WriteString($"[{value.MemType.ReadNumber()}]存储器类型", MemoryTypeDisplay(value.MemType)); | |||
value.FileSize = reader.ReadUInt32(); | |||
writer.WriteNumber($"[{value.FileSize.ReadNumber()}文件大小 byte]", value.FileSize); | |||
virtualHex = reader.ReadVirtualArray(64); | |||
value.AuthorizeCode = reader.ReadString(64); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]时效口令", value.AuthorizeCode); | |||
virtualHex = reader.ReadVirtualArray(36); | |||
value.GnssData = reader.ReadArray(36).ToArray(); | |||
writer.WriteString($"[{virtualHex.ToArray().ToHexString()}]车辆进入跨域地区后5min之内任一位置", virtualHex.ToArray().ToHexString()); | |||
string LogicalChannelNoDisplay(byte LogicalChannelNo) | |||
{ | |||
switch (LogicalChannelNo) | |||
{ | |||
case 1: | |||
return "驾驶员"; | |||
case 2: | |||
return "车辆正前方"; | |||
case 3: | |||
return "车前门"; | |||
case 4: | |||
return "车厢前部"; | |||
case 5: | |||
return "车厢后部"; | |||
case 7: | |||
return "行李舱"; | |||
case 8: | |||
return "车辆左侧"; | |||
case 9: | |||
return "车辆右侧"; | |||
case 10: | |||
return "车辆正后方"; | |||
case 11: | |||
return "车厢中部"; | |||
case 12: | |||
return "车中门"; | |||
case 13: | |||
return "驾驶席车门"; | |||
case 33: | |||
return "驾驶员"; | |||
case 36: | |||
return "车厢前部"; | |||
case 37: | |||
return "车厢后部"; | |||
default: | |||
return "预留"; | |||
} | |||
} | |||
string AVResourceTypeDisplay(byte AVResourceType) | |||
{ | |||
switch (AVResourceType) | |||
{ | |||
case 0: | |||
return "音视频"; | |||
case 1: | |||
return "音频"; | |||
case 2: | |||
return "视频"; | |||
default: | |||
break; | |||
} | |||
return "未知"; | |||
} | |||
string StreamTypeDisplay(byte StreamType) | |||
{ | |||
switch (StreamType) | |||
{ | |||
case 1: | |||
return "主码流"; | |||
case 2: | |||
return "子码流"; | |||
default: | |||
return "未知"; | |||
} | |||
} | |||
string MemoryTypeDisplay(byte MemoryType) | |||
{ | |||
switch (MemoryType) | |||
{ | |||
case 1: | |||
return "主存储器"; | |||
case 2: | |||
return "灾备存储器"; | |||
default: | |||
return "未知"; | |||
} | |||
} | |||
} | |||
public JT809_JT1078_0x9B00_0x9B01 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9B00_0x9B01 value = new JT809_JT1078_0x9B00_0x9B01(); | |||
value.ChannelId = reader.ReadByte(); | |||
value.StartTime = reader.ReadUTCDateTime(); | |||
value.EndTime = reader.ReadUTCDateTime(); | |||
value.AlarmType = reader.ReadUInt64(); | |||
value.AVItemType = reader.ReadByte(); | |||
value.StreamType = reader.ReadByte(); | |||
value.MemType = reader.ReadByte(); | |||
value.FileSize = reader.ReadUInt32(); | |||
value.AuthorizeCode = reader.ReadString(64); | |||
value.GnssData = reader.ReadArray(36).ToArray(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9B00_0x9B01 value, IJT809Config config) | |||
{ | |||
writer.WriteByte(value.ChannelId); | |||
writer.WriteUTCDateTime(value.StartTime); | |||
writer.WriteUTCDateTime(value.EndTime); | |||
writer.WriteUInt64(value.AlarmType); | |||
writer.WriteByte(value.AVItemType); | |||
writer.WriteByte(value.StreamType); | |||
writer.WriteByte(value.MemType); | |||
writer.WriteUInt32(value.FileSize); | |||
writer.WriteStringPadRight(value.AuthorizeCode,64); | |||
writer.WriteArray(value.GnssData); | |||
} | |||
} | |||
} |
@@ -1,50 +0,0 @@ | |||
using System.Text.Json; | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 远程录像下载完成通知应答消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9B00_0x9B02 : JT809SubBodies,IJT809MessagePackFormatter<JT809_JT1078_0x9B00_0x9B02>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 应答结果 | |||
/// </summary> | |||
public JT809_JT1078_0x9B00_0x9B02_Result Result { get; set; } | |||
/// <summary> | |||
/// 对应平台文件上传消息的流水号 | |||
/// </summary> | |||
public ushort SessionId { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.远程录像下载完成通知应答消息.ToUInt16Value(); | |||
public override string Description { get; } = "远程录像下载完成通知应答消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9B00_0x9B02 value = new JT809_JT1078_0x9B00_0x9B02(); | |||
value.Result = (JT809_JT1078_0x9B00_0x9B02_Result)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.Result).ReadNumber()}]应答结果", value.Result.ToString()); | |||
value.SessionId = reader.ReadUInt16(); | |||
writer.WriteNumber($"[{value.SessionId.ReadNumber()}]对应平台文件上传消息的流水号", value.SessionId); | |||
} | |||
public JT809_JT1078_0x9B00_0x9B02 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9B00_0x9B02 value = new JT809_JT1078_0x9B00_0x9B02(); | |||
value.Result = (JT809_JT1078_0x9B00_0x9B02_Result)reader.ReadByte(); | |||
value.SessionId = reader.ReadUInt16(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9B00_0x9B02 value, IJT809Config config) | |||
{ | |||
writer.WriteByte((byte)value.Result); | |||
writer.WriteUInt16(value.SessionId); | |||
} | |||
} | |||
} |
@@ -1,53 +0,0 @@ | |||
using JT809.Protocol.Extensions.JT1078.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
using System.Text.Json; | |||
namespace JT809.Protocol.Extensions.JT1078.MessageBody | |||
{ | |||
/// <summary> | |||
/// 远程录像下载控制消息 | |||
/// </summary> | |||
public class JT809_JT1078_0x9B00_0x9B03 : JT809SubBodies, IJT809MessagePackFormatter<JT809_JT1078_0x9B00_0x9B03>, IJT809Analyze | |||
{ | |||
/// <summary> | |||
/// 对应平台文件上传消息的流水号 | |||
/// </summary> | |||
public ushort SessionId { get; set; } | |||
/// <summary> | |||
/// 控制类型 | |||
/// </summary> | |||
public JT809_JT1078_0x9B00_0x9B03_Type Type { get; set; } | |||
public override ushort SubMsgId { get; } = JT809_JT1078_SubBusinessType.远程录像下载控制消息.ToUInt16Value(); | |||
public override string Description { get; } = "远程录像下载控制消息"; | |||
public void Analyze(ref JT809MessagePackReader reader, Utf8JsonWriter writer, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9B00_0x9B03 value = new JT809_JT1078_0x9B00_0x9B03(); | |||
value.SessionId = reader.ReadUInt16(); | |||
writer.WriteNumber($"[{ value.SessionId.ReadNumber()}]对应平台文件上传消息的流水号", value.SessionId); | |||
value.Type = (JT809_JT1078_0x9B00_0x9B03_Type)reader.ReadByte(); | |||
writer.WriteString($"[{((byte)value.Type).ReadNumber()}]控制类型", value.Type.ToString()); | |||
} | |||
public JT809_JT1078_0x9B00_0x9B03 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_JT1078_0x9B00_0x9B03 value = new JT809_JT1078_0x9B00_0x9B03(); | |||
value.SessionId = reader.ReadUInt16(); | |||
value.Type = (JT809_JT1078_0x9B00_0x9B03_Type)reader.ReadByte(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_JT1078_0x9B00_0x9B03 value, IJT809Config config) | |||
{ | |||
writer.WriteUInt16(value.SessionId); | |||
writer.WriteByte((byte)value.Type); | |||
} | |||
} | |||
} |