From e2ba47ad7cc3af9d3aadd9a36711ae215ba9c2bb Mon Sep 17 00:00:00 2001 From: "SmallChi(Koike)" <564952747@qq.com> Date: Mon, 15 Jan 2024 18:08:12 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E9=83=A8=E5=88=86gps51?= =?UTF-8?q?=E7=9A=84=E6=89=A9=E5=B1=95id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...T808.Protocol.Extensions.GPS51.Test.csproj | 22 ++++ .../JT808_0x0200_0x2B_Ext_Test.cs | 60 +++++++++ .../JT808_0x0200_0x51_Test.cs | 63 +++++++++ .../DependencyInjectionExtensions.cs | 30 +++++ .../Enums/ActivePhotographyStrategyType.cs | 39 ++++++ .../JT808.Protocol.Extensions.GPS51.csproj | 11 ++ .../JT808_GPS51_Constants.cs | 121 ++++++++++++++++++ .../MessageBody/JT808_0x0200_0x2B_Ext.cs | 84 ++++++++++++ .../MessageBody/JT808_0x0200_0x51.cs | 84 ++++++++++++ .../Metadata/AlarmIdentificationProperty.cs | 34 +++++ .../MessageBody/JT808_0x9201.cs | 2 +- src/JT808.Protocol.sln | 14 ++ 12 files changed, 563 insertions(+), 1 deletion(-) create mode 100644 src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51.Test/JT808.Protocol.Extensions.GPS51.Test.csproj create mode 100644 src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51.Test/JT808_0x0200_0x2B_Ext_Test.cs create mode 100644 src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51.Test/JT808_0x0200_0x51_Test.cs create mode 100644 src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/DependencyInjectionExtensions.cs create mode 100644 src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/Enums/ActivePhotographyStrategyType.cs create mode 100644 src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/JT808.Protocol.Extensions.GPS51.csproj create mode 100644 src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/JT808_GPS51_Constants.cs create mode 100644 src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/MessageBody/JT808_0x0200_0x2B_Ext.cs create mode 100644 src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/MessageBody/JT808_0x0200_0x51.cs create mode 100644 src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/Metadata/AlarmIdentificationProperty.cs diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51.Test/JT808.Protocol.Extensions.GPS51.Test.csproj b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51.Test/JT808.Protocol.Extensions.GPS51.Test.csproj new file mode 100644 index 00000000..500bf2a7 --- /dev/null +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51.Test/JT808.Protocol.Extensions.GPS51.Test.csproj @@ -0,0 +1,22 @@ + + + + net8.0 + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51.Test/JT808_0x0200_0x2B_Ext_Test.cs b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51.Test/JT808_0x0200_0x2B_Ext_Test.cs new file mode 100644 index 00000000..3c48ff45 --- /dev/null +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51.Test/JT808_0x0200_0x2B_Ext_Test.cs @@ -0,0 +1,60 @@ +using JT808.Protocol.Extensions.GPS51.MessageBody; +using JT808.Protocol.MessageBody; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using Xunit; + +namespace JT808.Protocol.Extensions.GPS51.Test +{ + public class JT808_0x0200_0x2B_Ext_Test + { + JT808Serializer JT808Serializer; + public JT808_0x0200_0x2B_Ext_Test() + { + ServiceCollection serviceDescriptors = new ServiceCollection(); + serviceDescriptors.AddJT808Configure() + .AddGPS51Configure(); + + IJT808Config jT808Config = serviceDescriptors.BuildServiceProvider().GetRequiredService(); + JT808Serializer = new JT808Serializer(jT808Config); + } + [Fact] + public void Serializer() + { + JT808_0x0200 jT808UploadLocationRequest = new JT808_0x0200 + { + AlarmFlag = 1, + Altitude = 40, + GPSTime = DateTime.Parse("2018-07-15 10:10:10"), + Lat = 12222222, + Lng = 132444444, + Speed = 60, + Direction = 0, + StatusFlag = 2, + CustomLocationAttachData = new Dictionary() + }; + jT808UploadLocationRequest.CustomLocationAttachData.Add(JT808_GPS51_Constants.JT808_0x0200_0x2B, new JT808_0x0200_0x2B_Ext + { + AttachInfoId = 0x2b, + AttachInfoLength = 4, + Oils = new List { + 12,34 + } + }); + var hex = JT808Serializer.Serialize(jT808UploadLocationRequest).ToHexString(); + Assert.Equal("000000010000000200BA7F0E07E4F11C0028003C00001807151010102B04000C0022", hex); + } + [Fact] + public void Deserialize() + { + var jT808UploadLocationRequest = JT808Serializer.Deserialize("7e020000470412106280030233000000000000200201d365df072f15d500280000002d21091719155801040002a10f2a0200042b049203a46f520103eb06000100ce0a5730011b31010951080000000000000000ca7e".ToHexBytes()); + var body0200 = jT808UploadLocationRequest.Bodies as JT808_0x0200; + body0200.CustomLocationAttachData.TryGetValue(JT808_GPS51_Constants.JT808_0x0200_0x2B, out var value); + var jt808_0x0200_0x2b = value as JT808_0x0200_0x2B_Ext; + //2b049203a46f + Assert.Equal(0x9203, jt808_0x0200_0x2b.Oils[0]); + Assert.Equal(0xa46f, jt808_0x0200_0x2b.Oils[1]); + } + } +} diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51.Test/JT808_0x0200_0x51_Test.cs b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51.Test/JT808_0x0200_0x51_Test.cs new file mode 100644 index 00000000..a295e47c --- /dev/null +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51.Test/JT808_0x0200_0x51_Test.cs @@ -0,0 +1,63 @@ +using JT808.Protocol.Extensions.GPS51.MessageBody; +using JT808.Protocol.MessageBody; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using Xunit; + +namespace JT808.Protocol.Extensions.GPS51.Test +{ + public class JT808_0x0200_0x51_Test + { + JT808Serializer JT808Serializer; + public JT808_0x0200_0x51_Test() + { + ServiceCollection serviceDescriptors = new ServiceCollection(); + serviceDescriptors.AddJT808Configure() + .AddGPS51Configure(); + + IJT808Config jT808Config = serviceDescriptors.BuildServiceProvider().GetRequiredService(); + JT808Serializer = new JT808Serializer(jT808Config); + } + [Fact] + public void Serializer() + { + JT808_0x0200 jT808UploadLocationRequest = new JT808_0x0200 + { + AlarmFlag = 1, + Altitude = 40, + GPSTime = DateTime.Parse("2018-07-15 10:10:10"), + Lat = 12222222, + Lng = 132444444, + Speed = 60, + Direction = 0, + StatusFlag = 2, + CustomLocationAttachData = new Dictionary() + }; + jT808UploadLocationRequest.CustomLocationAttachData.Add(JT808_GPS51_Constants.JT808_0x0200_0x51, new JT808_0x0200_0x51 + { + AttachInfoId = 0x2b, + AttachInfoLength = 4, + Temperatures = new List { + 12,-34 + } + }); + var hex = JT808Serializer.Serialize(jT808UploadLocationRequest).ToHexString(); + Assert.Equal("000000010000000200BA7F0E07E4F11C0028003C00001807151010102B04000C0022", hex); + } + [Fact] + public void Deserialize() + { + var jT808UploadLocationRequest = JT808Serializer.Deserialize("7e020000470158666660580571000000000000000201d59c1c06a36599006e0000000021091719313901040000eb8830011d3101192a0200005201002b040000000051080134011a04f604f6eb06000400ce04f8847e".ToHexBytes()); + var body0200 = jT808UploadLocationRequest.Bodies as JT808_0x0200; + body0200.CustomLocationAttachData.TryGetValue(JT808_GPS51_Constants.JT808_0x0200_0x51, out var value); + var jt808_0x0200_0x51 = value as JT808_0x0200_0x51; + //2b049203a46f + Assert.Equal(0x0134, jt808_0x0200_0x51.Temperatures[0]); + Assert.Equal(0x011A, jt808_0x0200_0x51.Temperatures[1]); + Assert.Equal(0x04F6, jt808_0x0200_0x51.Temperatures[2]); + Assert.Equal(0x04F6, jt808_0x0200_0x51.Temperatures[3]); + + } + } +} diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/DependencyInjectionExtensions.cs b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/DependencyInjectionExtensions.cs new file mode 100644 index 00000000..3ef4f84c --- /dev/null +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/DependencyInjectionExtensions.cs @@ -0,0 +1,30 @@ +using JT808.Protocol.Extensions.GPS51.Enums; +using JT808.Protocol.Extensions.GPS51.MessageBody; +using JT808.Protocol.Interfaces; +using JT808.Protocol.MessageBody; +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; + +namespace JT808.Protocol.Extensions.GPS51 +{ + /// + /// GPS51 extension JT/T808 + /// + public static class DependencyInjectionExtensions + { + /// + /// 注册GPS51扩展JT/T808 + /// Register GPS51 extension JT/T808 + /// + /// + /// + public static IJT808Builder AddGPS51Configure(this IJT808Builder jT808Builder) + { + jT808Builder.Config.JT808_0X0200_Factory.Map.Remove(JT808_GPS51_Constants.JT808_0x0200_0x2B); + jT808Builder.Config.Register(Assembly.GetExecutingAssembly()); + return jT808Builder; + } + } +} diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/Enums/ActivePhotographyStrategyType.cs b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/Enums/ActivePhotographyStrategyType.cs new file mode 100644 index 00000000..c90e6db2 --- /dev/null +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/Enums/ActivePhotographyStrategyType.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.GPS51.Enums +{ + /// + /// 主动拍照策略 + /// Active photo taking strategy + /// + public enum ActivePhotographyStrategyType:byte + { + /// + /// 不开启 + /// Is not enabled + /// + not_enabled = 0x00, + /// + /// 定时拍照 + /// Camera Timer + /// + camera_timer = 0x01, + /// + /// 定距拍照 + /// Distance take photos + /// + distance_take_photos = 0x02, + /// + /// 保留 + /// reserve + /// + reserve = 0x03, + /// + /// 不修改参数 + /// Do not Modify parameters + /// + not_modify_parameters = 0xFF + } +} diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/JT808.Protocol.Extensions.GPS51.csproj b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/JT808.Protocol.Extensions.GPS51.csproj new file mode 100644 index 00000000..f07903ec --- /dev/null +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/JT808.Protocol.Extensions.GPS51.csproj @@ -0,0 +1,11 @@ + + + + netstandard2.0 + + + + + + + diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/JT808_GPS51_Constants.cs b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/JT808_GPS51_Constants.cs new file mode 100644 index 00000000..217ec791 --- /dev/null +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/JT808_GPS51_Constants.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; + +namespace JT808.Protocol.Extensions.GPS51 +{ + /// + /// 主动安全常量 + /// + public static class JT808_GPS51_Constants + { + /// + /// 附加信息ID 多路油耗模拟量, + /// 2*N + /// 例子报文:2b049203a46f + /// 解析结果为:2路 模拟量分别为37379 42095 + /// + public const byte JT808_0x0200_0x2B = 0x2b; + /// + /// 附加信息ID 2个字节一组温度 0.1度 ffff 代表无效, + /// 2*N + /// 04F6代表未接或者传感器掉电, + /// 第16位代表正负温度 51080134011A04F604F6 + /// 308=30.8度 282=28.2度 8050=-80=-8度 + /// + public const byte JT808_0x0200_0x51 = 0x51; + /// + /// 附加信息ID + /// 1 + /// 正反转 0:未知;1:正转(空车)2:反转(重车);3:停转 + /// 例子解析为:03 + /// + public const byte JT808_0x0200_0x52 = 0x52; + /// + /// 附加信息ID + /// 1+7*N + /// Wifi数据:第1个字节wifi个数,后面为n个wifi数据; + /// WIFI数据:6字节 wifiMac 1字节 信号强度 + /// + public const byte JT808_0x0200_0x54 = 0x54; + /// + /// 载重扩展 8 + /// 1/10千克 8 字节 + /// + public const uint JT808_0x0200_0x55 = 0x55; + /// + /// 湿度, + /// 2*N + /// 精度0.1,0fff 代表无效数据,例子数据: 0012 表示:1.8% + /// + public const uint JT808_0x0200_0x58 = 0x58; + /// + /// 电压, + /// 2 + /// 单位0.01V,例子报文:61021d74,解析结果7540,最终电压75.40V + /// + public const uint JT808_0x0200_0x61 = 0x61; + /// + /// 基站编码 + /// 4+7*N + /// 的格式为 MCC MNC LAC CI Signal 2-2-2-4-1-2-4-1, + /// 其中MCC 2个字节国家编码,MNC 为 2个字节网络编码,LAC为 2个字节地区编码, + /// CI 为 4个字节蜂窝 ID , + /// 信号强度 1字节, + /// 单基站可以不用信号强度 1cc-0-696a-863a8d0-0 + /// + public const uint JT808_0x0200_0xe1 = 0xe1; + /// + /// 版本号, + /// N + /// 开机或者重连第一条上报,例子结果:GB201-GSM-21001-1.1.1 + /// + public const byte JT808_0x0200_0xe2 = 0xe2; + /// + /// iccid, + /// 20 + /// 一般开机或者重连第一条0200位置信息上报, + /// 例子报文:f1143839383630343032313032303930393737303032, + /// 解析结果为:89860402102090977002 + /// + public const byte JT808_0x0200_0xf1 = 0xf1; + /// + /// IMEI数据: + /// 8字节, + /// 第1位为0,后面15位为imei的16进制数据 + /// + public const byte JT808_0x0200_0xf6 = 0xf6; + /// + /// 4 + /// 第0位:震动报警 + /// 第1位:拆除报警 例子:第0位:震动报警 fa0400000001 第1位:拆除报警 fa0400000002 + /// 第2位:进入深度休眠 fa0400000004 + /// 第3位:急加速 fa0400000008 + /// 第4位:急减速 fa0400000010 + /// 第5位:急转弯 fa0400000020 + /// 第6位:acc开报警 fa0400000040 + /// 第7位:acc关报警 fa0400000080 + /// 第8位:内部电池电量低fa0400000100 + /// 第9位:人为关机 + /// 第10位:低电关机 + /// + public const byte JT808_0x0200_0xfa = 0xfa; + /// + /// 4 + /// 电量百分比和外部电压, + /// 电压精度0.01V,充电状态0未充电 1充电中,没有的数据传00 + /// 例子:fb045F050701 + /// 解析结果:电量百分比5F=95 电压:0507=1287 最终显示为12.87V 01:充电中 + /// + public const byte JT808_0x0200_0xfb = 0xfb; + /// + /// + /// + /// + public static Assembly GetCurrentAssembly() + { + return Assembly.GetExecutingAssembly(); + } + } +} diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/MessageBody/JT808_0x0200_0x2B_Ext.cs b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/MessageBody/JT808_0x0200_0x2B_Ext.cs new file mode 100644 index 00000000..936ba8c0 --- /dev/null +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/MessageBody/JT808_0x0200_0x2B_Ext.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using JT808.Protocol.Extensions.GPS51.Metadata; +using JT808.Protocol.Formatters; +using JT808.Protocol.Interfaces; +using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; + +namespace JT808.Protocol.Extensions.GPS51.MessageBody +{ + /// + /// 多路油耗模拟量 + /// + public class JT808_0x0200_0x2B_Ext : JT808MessagePackFormatter, JT808_0x0200_CustomBodyBase, IJT808Analyze + { + /// + /// 多路油耗模拟量,Id + /// + public byte AttachInfoId { get; set; } = JT808_GPS51_Constants.JT808_0x0200_0x2B; + /// + /// 多路油耗模拟量信息附加长度 + /// + public byte AttachInfoLength { get; set; } + /// + /// 油量数据 + /// + public List Oils { get; set; } + + /// + /// + /// + /// + /// + /// + public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config) + { + JT808_0x0200_0x2B_Ext value = new JT808_0x0200_0x2B_Ext(); + value.AttachInfoId = reader.ReadByte(); + writer.WriteNumber($"[{value.AttachInfoId.ReadNumber()}]附加信息Id", value.AttachInfoId); + value.AttachInfoLength = reader.ReadByte(); + writer.WriteNumber($"[{value.AttachInfoLength.ReadNumber()}]附加信息长度", value.AttachInfoLength); + value.Oils = new List(); + for (ushort i = 0; i < value.AttachInfoLength/2; i++) { + value.Oils.Add(reader.ReadUInt16()); + } + writer.WriteString($"[油量值:{string.Join("", value.Oils.Select(m=>m.ReadNumber()))}]",string.Join(",", value.Oils)); + } + /// + /// + /// + /// + /// + /// + public override JT808_0x0200_0x2B_Ext Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x0200_0x2B_Ext value = new JT808_0x0200_0x2B_Ext(); + value.AttachInfoId = reader.ReadByte(); + value.AttachInfoLength = reader.ReadByte(); + value.Oils = new List(); + for (int i = 0; i < value.AttachInfoLength/2; i++) { + value.Oils.Add(reader.ReadUInt16()); + } + return value; + } + /// + /// + /// + /// + /// + /// + public override void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x2B_Ext value, IJT808Config config) + { + writer.WriteByte(value.AttachInfoId); + writer.WriteByte((byte)(value.Oils.Count*2)); + foreach (var item in value.Oils) + { + writer.WriteUInt16(item); + } + } + } +} diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/MessageBody/JT808_0x0200_0x51.cs b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/MessageBody/JT808_0x0200_0x51.cs new file mode 100644 index 00000000..fd3ee3e1 --- /dev/null +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/MessageBody/JT808_0x0200_0x51.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using JT808.Protocol.Extensions.GPS51.Metadata; +using JT808.Protocol.Formatters; +using JT808.Protocol.Interfaces; +using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; + +namespace JT808.Protocol.Extensions.GPS51.MessageBody +{ + /// + /// 温度 + /// + public class JT808_0x0200_0x51 : JT808MessagePackFormatter, JT808_0x0200_CustomBodyBase, IJT808Analyze + { + /// + /// 温度,Id + /// + public byte AttachInfoId { get; set; } = JT808_GPS51_Constants.JT808_0x0200_0x51; + /// + /// 温度信息附加长度 + /// + public byte AttachInfoLength { get; set; } + /// + /// 温度数据 + /// + public List Temperatures { get; set; } + + /// + /// + /// + /// + /// + /// + public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config) + { + JT808_0x0200_0x51 value = new JT808_0x0200_0x51(); + value.AttachInfoId = reader.ReadByte(); + writer.WriteNumber($"[{value.AttachInfoId.ReadNumber()}]附加信息Id", value.AttachInfoId); + value.AttachInfoLength = reader.ReadByte(); + writer.WriteNumber($"[{value.AttachInfoLength.ReadNumber()}]附加信息长度", value.AttachInfoLength); + value.Temperatures = new List(); + for (ushort i = 0; i < value.AttachInfoLength/2; i++) { + value.Temperatures.Add(reader.ReadInt16()); + } + writer.WriteString($"[温度值:{string.Join("", value.Temperatures.Select(m=>m.ReadNumber()))}]",string.Join(",", value.Temperatures)); + } + /// + /// + /// + /// + /// + /// + public override JT808_0x0200_0x51 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x0200_0x51 value = new JT808_0x0200_0x51(); + value.AttachInfoId = reader.ReadByte(); + value.AttachInfoLength = reader.ReadByte(); + value.Temperatures = new List(); + for (int i = 0; i < value.AttachInfoLength / 2; i++) { + value.Temperatures.Add(reader.ReadInt16()); + } + return value; + } + /// + /// + /// + /// + /// + /// + public override void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x51 value, IJT808Config config) + { + writer.WriteByte(value.AttachInfoId); + writer.WriteByte((byte)(value.Temperatures.Count*2)); + foreach (var item in value.Temperatures) + { + writer.WriteInt16(item); + } + } + } +} diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/Metadata/AlarmIdentificationProperty.cs b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/Metadata/AlarmIdentificationProperty.cs new file mode 100644 index 00000000..4ce5109f --- /dev/null +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.GPS51/Metadata/AlarmIdentificationProperty.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.GPS51.Metadata +{ + /// + /// 报警标识号 + /// + public class AlarmIdentificationProperty + { + /// + /// 终端ID + /// + public string TerminalID { get; set; } + /// + /// YY-MM-DD-hh-mm-ss + /// BCD[6] + /// + public DateTime Time { get; set; } + /// + /// 序号 + /// + public byte SN { get; set; } + /// + /// 附件数量 + /// + public byte AttachCount { get; set; } + /// + /// 预留 + /// + public byte Retain { get; set; } + } +} diff --git a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9201.cs b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9201.cs index 399bae04..16cd3565 100644 --- a/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9201.cs +++ b/src/JT808.Protocol.Extensions/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9201.cs @@ -123,7 +123,7 @@ public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJ value.MemoryType = reader.ReadByte(); writer.WriteString($"[{value.MemoryType.ReadNumber()}]存储器类型", MemTypeDisplay(value.MemoryType)); value.PlaybackWay = reader.ReadByte(); - writer.WriteString($"[{value.PlaybackWay.ReadNumber()}]回访方式", PlayBackWayDisplay(value.PlaybackWay)); + writer.WriteString($"[{value.PlaybackWay.ReadNumber()}]回放方式", PlayBackWayDisplay(value.PlaybackWay)); value.PlaySpeed = reader.ReadByte(); writer.WriteString($"[{value.PlaySpeed.ReadNumber()}]快进或快退倍数", FastForwardOrFastRewindMultiplesDisplay(value.PlaySpeed)); value.BeginTime = reader.ReadDateTime_yyMMddHHmmss(); diff --git a/src/JT808.Protocol.sln b/src/JT808.Protocol.sln index acd871a9..3250e2ed 100644 --- a/src/JT808.Protocol.sln +++ b/src/JT808.Protocol.sln @@ -33,6 +33,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT808.Protocol.Extensions.S EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT808.Protocol.Extensions.SuBiao.Test", "JT808.Protocol.Extensions\JT808.Protocol.Extensions.SuBiao.Test\JT808.Protocol.Extensions.SuBiao.Test.csproj", "{BEE2E12D-C123-4682-AB7E-210C2BF564B3}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT808.Protocol.Extensions.GPS51", "JT808.Protocol.Extensions\JT808.Protocol.Extensions.GPS51\JT808.Protocol.Extensions.GPS51.csproj", "{913959F7-95D1-40FD-B67C-E4906531A828}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT808.Protocol.Extensions.GPS51.Test", "JT808.Protocol.Extensions\JT808.Protocol.Extensions.GPS51.Test\JT808.Protocol.Extensions.GPS51.Test.csproj", "{AFB9EA79-566C-4861-A08E-AFB46879CFE3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -75,6 +79,14 @@ Global {BEE2E12D-C123-4682-AB7E-210C2BF564B3}.Debug|Any CPU.Build.0 = Debug|Any CPU {BEE2E12D-C123-4682-AB7E-210C2BF564B3}.Release|Any CPU.ActiveCfg = Release|Any CPU {BEE2E12D-C123-4682-AB7E-210C2BF564B3}.Release|Any CPU.Build.0 = Release|Any CPU + {913959F7-95D1-40FD-B67C-E4906531A828}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {913959F7-95D1-40FD-B67C-E4906531A828}.Debug|Any CPU.Build.0 = Debug|Any CPU + {913959F7-95D1-40FD-B67C-E4906531A828}.Release|Any CPU.ActiveCfg = Release|Any CPU + {913959F7-95D1-40FD-B67C-E4906531A828}.Release|Any CPU.Build.0 = Release|Any CPU + {AFB9EA79-566C-4861-A08E-AFB46879CFE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AFB9EA79-566C-4861-A08E-AFB46879CFE3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AFB9EA79-566C-4861-A08E-AFB46879CFE3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AFB9EA79-566C-4861-A08E-AFB46879CFE3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -86,6 +98,8 @@ Global {4984E375-4B55-4188-A94E-844B694BBA5C} = {3A0EEA9A-9667-4386-BB46-4A9CB319CE30} {001ECBA0-CF17-40B0-B983-B7AE824B8050} = {3A0EEA9A-9667-4386-BB46-4A9CB319CE30} {BEE2E12D-C123-4682-AB7E-210C2BF564B3} = {3A0EEA9A-9667-4386-BB46-4A9CB319CE30} + {913959F7-95D1-40FD-B67C-E4906531A828} = {3A0EEA9A-9667-4386-BB46-4A9CB319CE30} + {AFB9EA79-566C-4861-A08E-AFB46879CFE3} = {3A0EEA9A-9667-4386-BB46-4A9CB319CE30} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D58CCAA8-ED94-4048-A6DE-55A84814DF17}