JT905 1.0.0
dotnet add package JT905 --version 1.0.0
NuGet\Install-Package JT905 -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JT905" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JT905" Version="1.0.0" />
<PackageReference Include="JT905" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JT905 --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JT905, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JT905@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JT905&version=1.0.0
#tool nuget:?package=JT905&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
JT905 ��
ǰ������
- ���ս���ת����������תʮ�����ƣ�
- ���� BCD ���롢Hex ���룻
- ���ո���λ�ơ����
- ���ճ��÷��䣻
- ���� JObject ���÷���
- ���տ��� ctrl+c��ctrl+v��
- ���� Span<T>�Ļ����÷�
- ��������װ�Ƽ��ܣ��Ϳ��Կ�ʼ��ש�ˡ�
JT905 ���ݽṹ����
���ݰ�[JT905Package]
| ͷ��ʶ | ����ͷ | ������ | У���� | β��ʶ |
|---|---|---|---|---|
| Begin | JT905Header | JT905Bodies | CheckCode | End |
| 7E | - | - | - | 7E |
����ͷ[JT905Header]
| ��Ϣ ID | ��Ϣ�峤�� | ISU ��ʶ | ��Ϣ��ˮ�� |
|---|---|---|---|
| MsgId | DataLength | ISU | MsgNum |
��Ϣ������[JT905Bodies]
���ݶ�Ӧ��Ϣ ID��MsgId
ע�⣺��������(��ȥͷ��β��ʶ)����ת���ж�
ת���������:
- �������������г����ַ� 0x7e �ģ����滻Ϊ�ַ� 0x7d ����ַ� 0x02;
- �������������г����ַ� 0x7d �ģ����滻Ϊ�ַ� 0x7d ����ַ� 0x01;
��ת���ԭ��ȷ�� JT905 Э��� TCP ��Ϣ�߽硣
�ٸ����� 1
1.�����
MsgId 0x0200:λ����Ϣ�㱨
JT905Package JT905Package = new JT905Package();
JT905Package.Header = new JT905Header
{
MsgId = Enums.JT905MsgId.λ����Ϣ�㱨.ToUInt16Value(),
ManualMsgNum = 126,
ISU = "103456789012"
};
JT905_0x0200 JT905_0x0200 = new JT905_0x0200
{
AlarmFlag = 1,
GPSTime = DateTime.Parse("2021-10-15 21:10:10"),
Lat = 12222222,
Lng = 132444444,
Speed = 60,
Direction = 0,
StatusFlag = 2,
BasicLocationAttachData = new Dictionary<byte, JT905_0x0200_BodyBase>()
};
JT905_0x0200.BasicLocationAttachData.Add(JT905Constants.JT905_0x0200_0x01, new JT905_0x0200_0x01
{
Mileage = 100
});
JT905_0x0200.BasicLocationAttachData.Add(JT905Constants.JT905_0x0200_0x02, new JT905_0x0200_0x02
{
Oil = 125
});
JT905Package.Bodies = JT905_0x0200;
byte[] data = JT905Serializer.Serialize(JT905Package);
var hex = data.ToHexString();
// ������Hex��
// 7E02000023103456789012007D02000000010000000200BA7F0E07E4F11C003C002110152110100104000000640202007D01347E
2.�ֶ������
1.ԭ����
7E 02 00 00 23 10 34 56 78 90 12 00 (7D 02) 00 00 00 01 00 00 00 02 00 BA 7F 0E 07 E4 F1 1C 00 3C 00 21 10 15 21 10 10 01 04 00 00 00 64 02 02 00 (7D 01) 34 7E
2.���з�ת��
7D 02 ->7E
7D 01 ->7D
��ת���
7E 02 00 00 23 10 34 56 78 90 12 00 7E 00 00 00 01 00 00 00 02 00 BA 7F 0E 07 E4 F1 1C 00 3C 00 21 10 15 21 10 10 01 04 00 00 00 64 02 02 00 7D 34 7E
3.���
7E --ͷ��ʶ
02 00 --����ͷ->��ϢID
00 23 --����ͷ->��Ϣ������
10 34 56 78 90 12 --����ͷ->�ն��ֻ���
00 7E --����ͷ->��Ϣ��ˮ��
00 00 00 01 --��Ϣ��->������־
00 00 00 02 --��Ϣ��->״̬λ��־
00 BA 7F 0E --��Ϣ��->γ��
07 E4 F1 1C --��Ϣ��->����
00 3C --��Ϣ��->�ٶ�
00 --��Ϣ��->����
21 10 15 21 10 10 --��Ϣ��->GPSʱ��
01 --��Ϣ��->������Ϣ->���
04 --��Ϣ��->������Ϣ->����
00 00 00 64 --��Ϣ��->������Ϣ->����
02 --��Ϣ��->������Ϣ->����
02 --��Ϣ��->������Ϣ->����
00 7D --��Ϣ��->������Ϣ->����
34 --������
7E --β��ʶ
3.��������
//1.ת��byte����
byte[] bytes = "7E02000023103456789012007D02000000010000000200BA7F0E07E4F11C003C002110152110100104000000640202007D01347E".ToHexBytes();
//2.�����鷴���л�
var jT905Package = JT905Serializer.Deserialize<JT905Package>(bytes);
//3.���ݰ�ͷ
Assert.Equal(Enums.JT905MsgId.λ����Ϣ�㱨.ToValue(), jT905Package.Header.MsgId);
Assert.Equal(0x23, jT905Package.Header.DataLength);
Assert.Equal(126, jT905Package.Header.MsgNum);
Assert.Equal("103456789012", jT905Package.Header.ISU);
//4.���ݰ���
JT905_0x0200 jT905_0x0200 = (JT905_0x0200)jT905Package.Bodies;
Assert.Equal((uint)1, jT905_0x0200.AlarmFlag);
Assert.Equal(DateTime.Parse("2021-10-15 21:10:10"), jT905_0x0200.GPSTime);
Assert.Equal(12222222, jT905_0x0200.Lat);
Assert.Equal(132444444, jT905_0x0200.Lng);
Assert.Equal(60, jT905_0x0200.Speed);
Assert.Equal(0, jT905_0x0200.Direction);
Assert.Equal((uint)2, jT905_0x0200.StatusFlag);
//4.1.������Ϣ1
Assert.Equal(100, ((JT905_0x0200_0x01)jT905_0x0200.BasicLocationAttachData[JT905Constants.JT905_0x0200_0x01]).Mileage);
//4.2.������Ϣ2
Assert.Equal(125, ((JT905_0x0200_0x02)jT905_0x0200.BasicLocationAttachData[JT905Constants.JT905_0x0200_0x02]).Oil);
BenchmarkDotNet v0.15.8, Windows 11 (10.0.26200.6584/25H2/2025Update/HudsonValley2)
Intel Core i7-8700K CPU 3.70GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET SDK 10.0.100
[Host] : .NET 10.0.0 (10.0.0, 10.0.25.52411), X64 RyuJIT x86-64-v3
Job-SRTPUO : .NET 10.0.0 (10.0.0, 10.0.25.52411), X64 RyuJIT x86-64-v3
Platform=AnyCpu Server=False Toolchain=.NET 10.0
| Method | Categories | N | Mean | Error | StdDev | Median | Gen0 | Allocated |
|---|---|---|---|---|---|---|---|---|
| 0x0100Serialize | 0x0100Serializer | 100 | 19.02 ��s | 0.127 ��s | 0.119 ��s | 19.04 ��s | 5.0964 | 31.25 KB |
| 0x0100Deserialize | 0x0100Serializer | 100 | 28.09 ��s | 0.402 ��s | 0.356 ��s | 27.97 ��s | 9.7961 | 60.16 KB |
| 0x0100Serialize | 0x0100Serializer | 10000 | 1,934.98 ��s | 16.083 ��s | 15.044 ��s | 1,934.42 ��s | 509.7656 | 3125.01 KB |
| 0x0100Deserialize | 0x0100Serializer | 10000 | 2,769.21 ��s | 47.088 ��s | 44.046 ��s | 2,763.99 ��s | 980.4688 | 6015.63 KB |
| 0x0100Serialize | 0x0100Serializer | 100000 | 19,246.47 ��s | 208.207 ��s | 184.570 ��s | 19,295.84 ��s | 5093.7500 | 31250.14 KB |
| 0x0100Deserialize | 0x0100Serializer | 100000 | 29,617.52 ��s | 537.471 ��s | 639.822 ��s | 29,513.80 ��s | 9812.5000 | 60156.25 KB |
| 0x0200_All_AttachId_Serialize | 0x0200Serializer | 100 | 68.22 ��s | 0.929 ��s | 0.913 ��s | 67.86 ��s | 11.4746 | 70.33 KB |
| 0x0200_All_AttachId_Deserialize | 0x0200Serializer | 100 | 379.20 ��s | 4.054 ��s | 3.792 ��s | 378.17 ��s | 50.7813 | 311.72 KB |
| 0x0200_All_AttachId_Serialize | 0x0200Serializer | 10000 | 7,017.92 ��s | 122.142 ��s | 108.276 ��s | 7,011.70 ��s | 1140.6250 | 7033.08 KB |
| 0x0200_All_AttachId_Deserialize | 0x0200Serializer | 10000 | 39,666.05 ��s | 787.275 ��s | 1,516.812 ��s | 38,948.96 ��s | 5076.9231 | 31171.88 KB |
| 0x0200_All_AttachId_Serialize | 0x0200Serializer | 100000 | 67,774.32 ��s | 535.331 ��s | 474.557 ��s | 67,679.77 ��s | 11375.0000 | 70331.05 KB |
| 0x0200_All_AttachId_Deserialize | 0x0200Serializer | 100000 | 389,044.13 ��s | 6,220.753 ��s | 6,656.136 ��s | 387,608.85 ��s | 50000.0000 | 311718.75 KB |
NuGet ��װ
| Package Name | Version | Preview Version | Downloads | Remark |
|---|---|---|---|---|
| Install-Package JT905 | JT905 |
ʹ�� BenchmarkDotNet ���ܲ��Ա��棨ֻ�����棬���ܵ��棩
todo:
JT905 �ն�ͨѶЭ����Ϣ���ձ�
| ��� | ��Ϣ ID | ������ | ������� | ��Ϣ������ |
|---|---|---|---|---|
| 1 | 0x0001 | �� | �� | ISU ͨ��Ӧ�� |
| 2 | 0x8001 | �� | �� | ����ͨ��Ӧ�� |
| 3 | 0x0002 | �� | �� | ISU ���� |
| 4 | 0x8103 | �� | �� | ���� |
| 5 | 0x8104 | �� | �� | ��ѯ ISU ���� |
| 6 | 0x0104 | �� | �� | ��ѯ ISU ����Ӧ�� |
| 7 | 0x8105 | �� | �� | ISU ���� |
| 8 | 0x0105 | �� | �� | ISU �������������Ϣ |
| 9 | 0x0200 | �� | �� | λ����Ϣ�㱨 |
| 10 | 0x8201 | �� | �� | λ����Ϣ��ѯ |
| 11 | 0x0201 | �� | �� | λ����Ϣ��ѯӦ�� |
| 12 | 0x8202 | �� | �� | λ�ø��ٿ��� |
| 13 | 0x0202 | �� | �� | λ�ø�����Ϣ�㱨 |
| 14 | 0x0203 | �� | �� | λ�û�㱨���ݲ��� |
| 15 | 0x8300 | �� | �� | �ı���Ϣ�·� |
| 16 | 0x8301 | �� | �� | �¼����� |
| 17 | 0x0301 | �� | �� | �¼����� |
| 18 | 0x8302 | �� | �� | �����·� |
| 19 | 0x0302 | �� | �� | ����Ӧ�� |
| 20 | 0x8400 | �� | �� | �绰�ز� |
| 21 | 0x8401 | �� | �� | ���õ绰�� |
| 22 | 0x8500 | �� | �� | �������� |
| 23 | 0x0500 | �� | �� | ��������Ӧ�� |
| 24 | 0x0800 | �� | �� | ����ͷͼ���ϴ� |
| 25 | 0x8801 | �� | �� | ����ͷ������������ |
| 26 | 0x8802 | �� | �� | �洢ͼ����� |
| 27 | 0x0802 | �� | �� | �洢ͼ�����Ӧ�� |
| 28 | 0x8803 | �� | �� | �洢ͼ��/����Ƶ�ϴ����� |
| 29 | 0x8B00 | �� | �� | ���������·� |
| 30 | 0x8B01 | �� | �� | �·���������Ϣ |
| 31 | 0x0B01 | �� | �� | ��ʻԱ���� |
| 32 | 0x0B07 | �� | �� | ��ʻԱ�����������ȷ�� |
| 33 | 0x0B08 | �� | �� | ��ʻԱȡ������ |
| 34 | 0x8B09 | �� | �� | ����ȡ������ |
| 35 | 0x0B03 | �� | �� | �ϰ�ǩ����Ϣ�ϴ� |
| 36 | 0x0B04 | �� | �� | �°�ǩ����Ϣ�ϴ� |
| 37 | 0x0B05 | �� | �� | ��Ӫ�����ϴ� |
| 38 | 0x8B10 | �� | �� | ��Χ�豸ָ�������� |
| 39 | 0x0B10 | �� | �� | ��Χ�豸ָ�������� |
| 40 | 0x8850 | ��Ƶ���� | ||
| 41 | 0x0805 | �洢��Ƶ����Ӧ�� | ||
| 42 | 0x0806 | ��Ƶ�ϴ� | ||
| 43 | 0x8B0A | �� | �� | ���ı���ȷ�� |
| 44 | 0x8B0B | �� | �� | ���ı������ |
| 45 | 0x8B11 | �� | �� | ����Ѳ���豸 |
| 46 | 0x0B11 | �豸Ѳ��Ӧ�� |
todo:
�������ݽ���
�Ƽ������ݽ���
��Ӫ������Ϊ��������ʹ�÷��������
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on JT905:
| Repository | Stars |
|---|---|
|
SmallChi/JTTools
JT808、JT809、JT1078、JT19056、JT905、JTNE(新能源)、主动安全(苏标)、主动安全(粤标)解析工具
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 248 | 12/13/2025 |
| 1.0.0-preview3 | 359 | 11/22/2024 |
| 1.0.0-preview2 | 261 | 8/20/2023 |
| 1.0.0-preview1 | 252 | 5/9/2023 |
JT905协议、GB905协议、出租汽车终端与中心平台通讯协议