From a1154e9b34dd5dd4c093398669f319102f5b1b15 Mon Sep 17 00:00:00 2001 From: "SmallChi(Koike)" <564952747@qq.com> Date: Fri, 22 Nov 2019 17:37:40 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=87=8F=E5=B0=91=E6=90=AC=E7=A0=96=E9=87=8F?= =?UTF-8?q?=E2=95=AE(=E2=95=AF=E2=96=BD=E2=95=B0)=E2=95=AD=202.=E5=87=8F?= =?UTF-8?q?=E5=B0=91=E4=B8=80=E6=AC=A1=E6=9F=A5=E8=AF=A2=F0=9F=98=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JT808.Protocol.Benchmark.csproj | 6 +- .../JT808.Protocol.Test.csproj | 3 + .../JT808_0X8900_Test_BodiesImplFormatter.cs | 26 --- .../JT808_0x0200_0x06Formatter.cs | 32 ---- .../JT808_0x0701TestBodiesImplFormatter.cs | 30 ---- .../JT808_0x0900_0x83Formatter.cs | 24 --- .../JT808_0x8103_0x0075_Formatter.cs | 51 ------ .../JT808_0x8103_0x0075.cs | 44 ++++- .../MessageBody/JT808_0x8103Test.cs | 22 +-- src/JT808.Protocol/Enums/JT808MsgId.cs | 1 - .../JT808PackageExtensionsTemplate.cs | 57 ++++--- .../Formatters/JT808HeaderFormatter.cs | 56 ------- .../Formatters/JT808HeaderPackageFormatter.cs | 65 -------- .../Formatters/JT808PackageFormatter.cs | 156 ------------------ .../JT808SplitPackageBodiesFormatter.cs | 25 --- .../JT808_0x0001_Formatter.cs | 26 --- .../JT808_0x0100_Formatter.cs | 35 ---- .../JT808_0x0102_Formatter.cs | 22 --- .../JT808_0x0104_Formatter.cs | 48 ------ .../JT808_0x0107_Formatter.cs | 43 ----- .../JT808_0x0108_Formatter.cs | 26 --- .../JT808_0x0200_0x01_Formatter.cs | 27 --- .../JT808_0x0200_0x02_Formatter.cs | 25 --- .../JT808_0x0200_0x03_Formatter.cs | 27 --- .../JT808_0x0200_0x04_Formatter.cs | 27 --- .../JT808_0x0200_0x11_Formatter.cs | 36 ---- .../JT808_0x0200_0x12_Formatter.cs | 32 ---- .../JT808_0x0200_0x13_Formatter.cs | 32 ---- .../JT808_0x0200_0x25_Formatter.cs | 27 --- .../JT808_0x0200_0x2A_Formatter.cs | 27 --- .../JT808_0x0200_0x2B_Formatter.cs | 28 ---- .../JT808_0x0200_0x30_Formatter.cs | 27 --- .../JT808_0x0200_0x31_Formatter.cs | 26 --- .../JT808_0x0200_Formatter.cs | 150 ----------------- .../JT808_0x0201_Formatter.cs | 25 --- .../JT808_0x0301_Formatter.cs | 22 --- .../JT808_0x0302_Formatter.cs | 24 --- .../JT808_0x0303_Formatter.cs | 25 --- .../JT808_0x0500_Formatter.cs | 25 --- .../JT808_0x0701_Formatter.cs | 27 --- .../JT808_0x0702_Formatter.cs | 52 ------ .../JT808_0x0704_Formatter.cs | 56 ------- .../JT808_0x0705_Formatter.cs | 60 ------- .../JT808_0x0800_Formatter.cs | 31 ---- .../JT808_0x0801_Formatter.cs | 36 ---- .../JT808_0x0802_Formatter.cs | 47 ------ .../JT808_0x0805_Formatter.cs | 38 ----- .../JT808_0x0900_Formatter.cs | 26 --- .../JT808_0x0901_Formatter.cs | 28 ---- .../JT808_0x0A00_Formatter.cs | 36 ---- .../JT808_0x8001_Formatter.cs | 28 ---- .../JT808_0x8003_Formatter.cs | 27 --- .../JT808_0x8100_Formatter.cs | 36 ---- .../JT808_0x8103_0x0001_Formatter.cs | 27 --- .../JT808_0x8103_0x0002_Formatter.cs | 27 --- .../JT808_0x8103_0x0003_Formatter.cs | 27 --- .../JT808_0x8103_0x0004_Formatter.cs | 27 --- .../JT808_0x8103_0x0005_Formatter.cs | 27 --- .../JT808_0x8103_0x0006_Formatter.cs | 27 --- .../JT808_0x8103_0x0007_Formatter.cs | 27 --- .../JT808_0x8103_0x0010_Formatter.cs | 29 ---- .../JT808_0x8103_0x0011_Formatter.cs | 29 ---- .../JT808_0x8103_0x0012_Formatter.cs | 29 ---- .../JT808_0x8103_0x0013_Formatter.cs | 29 ---- .../JT808_0x8103_0x0014_Formatter.cs | 29 ---- .../JT808_0x8103_0x0015_Formatter.cs | 29 ---- .../JT808_0x8103_0x0016_Formatter.cs | 29 ---- .../JT808_0x8103_0x0017_Formatter.cs | 29 ---- .../JT808_0x8103_0x0018_Formatter.cs | 27 --- .../JT808_0x8103_0x0019_Formatter.cs | 27 --- .../JT808_0x8103_0x001A_Formatter.cs | 29 ---- .../JT808_0x8103_0x001B_Formatter.cs | 27 --- .../JT808_0x8103_0x001C_Formatter.cs | 27 --- .../JT808_0x8103_0x001D_Formatter.cs | 29 ---- .../JT808_0x8103_0x0020_Formatter.cs | 27 --- .../JT808_0x8103_0x0021_Formatter.cs | 27 --- .../JT808_0x8103_0x0022_Formatter.cs | 27 --- .../JT808_0x8103_0x0027_Formatter.cs | 27 --- .../JT808_0x8103_0x0028_Formatter.cs | 27 --- .../JT808_0x8103_0x0029_Formatter.cs | 27 --- .../JT808_0x8103_0x002C_Formatter.cs | 27 --- .../JT808_0x8103_0x002D_Formatter.cs | 27 --- .../JT808_0x8103_0x002E_Formatter.cs | 27 --- .../JT808_0x8103_0x002F_Formatter.cs | 27 --- .../JT808_0x8103_0x0030_Formatter.cs | 27 --- .../JT808_0x8103_0x0031_Formatter.cs | 27 --- .../JT808_0x8103_0x0040_Formatter.cs | 29 ---- .../JT808_0x8103_0x0041_Formatter.cs | 29 ---- .../JT808_0x8103_0x0042_Formatter.cs | 29 ---- .../JT808_0x8103_0x0043_Formatter.cs | 29 ---- .../JT808_0x8103_0x0044_Formatter.cs | 29 ---- .../JT808_0x8103_0x0045_Formatter.cs | 27 --- .../JT808_0x8103_0x0046_Formatter.cs | 27 --- .../JT808_0x8103_0x0047_Formatter.cs | 27 --- .../JT808_0x8103_0x0048_Formatter.cs | 29 ---- .../JT808_0x8103_0x0049_Formatter.cs | 29 ---- .../JT808_0x8103_0x0050_Formatter.cs | 27 --- .../JT808_0x8103_0x0051_Formatter.cs | 27 --- .../JT808_0x8103_0x0052_Formatter.cs | 27 --- .../JT808_0x8103_0x0053_Formatter.cs | 27 --- .../JT808_0x8103_0x0054_Formatter.cs | 27 --- .../JT808_0x8103_0x0055_Formatter.cs | 27 --- .../JT808_0x8103_0x0056_Formatter.cs | 27 --- .../JT808_0x8103_0x0057_Formatter.cs | 27 --- .../JT808_0x8103_0x0058_Formatter.cs | 27 --- .../JT808_0x8103_0x0059_Formatter.cs | 27 --- .../JT808_0x8103_0x005A_Formatter.cs | 27 --- .../JT808_0x8103_0x005B_Formatter.cs | 27 --- .../JT808_0x8103_0x005C_Formatter.cs | 27 --- .../JT808_0x8103_0x005D_Formatter.cs | 27 --- .../JT808_0x8103_0x005E_Formatter.cs | 27 --- .../JT808_0x8103_0x0064_Formatter.cs | 27 --- .../JT808_0x8103_0x0065_Formatter.cs | 27 --- .../JT808_0x8103_0x0070_Formatter.cs | 27 --- .../JT808_0x8103_0x0071_Formatter.cs | 27 --- .../JT808_0x8103_0x0072_Formatter.cs | 27 --- .../JT808_0x8103_0x0073_Formatter.cs | 27 --- .../JT808_0x8103_0x0074_Formatter.cs | 27 --- .../JT808_0x8103_0x0080_Formatter.cs | 27 --- .../JT808_0x8103_0x0081_Formatter.cs | 27 --- .../JT808_0x8103_0x0082_Formatter.cs | 27 --- .../JT808_0x8103_0x0083_Formatter.cs | 29 ---- .../JT808_0x8103_0x0084_Formatter.cs | 27 --- .../JT808_0x8103_0x0090_Formatter.cs | 27 --- .../JT808_0x8103_0x0091_Formatter.cs | 27 --- .../JT808_0x8103_0x0092_Formatter.cs | 27 --- .../JT808_0x8103_0x0093_Formatter.cs | 27 --- .../JT808_0x8103_0x0094_Formatter.cs | 27 --- .../JT808_0x8103_0x0095_Formatter.cs | 27 --- .../JT808_0x8103_0x0100_Formatter.cs | 27 --- .../JT808_0x8103_0x0101_Formatter.cs | 27 --- .../JT808_0x8103_0x0102_Formatter.cs | 27 --- .../JT808_0x8103_0x0103_Formatter.cs | 27 --- .../JT808_0x8103_0x0110_Formatter.cs | 27 --- .../JT808_0x8103_Formatter.cs | 68 -------- .../JT808_0x8105_Formatter.cs | 34 ---- .../JT808_0x8106_Formatter.cs | 32 ---- .../JT808_0x8108_Formatter.cs | 34 ---- .../JT808_0x8202_Formatter.cs | 25 --- .../JT808_0x8203_Formatter.cs | 25 --- .../JT808_0x8300_Formatter.cs | 25 --- .../JT808_0x8301_Formatter.cs | 48 ------ .../JT808_0x8302_Formatter.cs | 58 ------- .../JT808_0x8303_Formatter.cs | 45 ----- .../JT808_0x8304_Formatter.cs | 30 ---- .../JT808_0x8400_Formatter.cs | 27 --- .../JT808_0x8401_Formatter.cs | 48 ------ .../JT808_0x8500_Formatter.cs | 22 --- .../JT808_0x8600_Formatter.cs | 87 ---------- .../JT808_0x8601_Formatter.cs | 36 ---- .../JT808_0x8602_Formatter.cs | 89 ---------- .../JT808_0x8603_Formatter.cs | 36 ---- .../JT808_0x8604_Formatter.cs | 83 ---------- .../JT808_0x8605_Formatter.cs | 36 ---- .../JT808_0x8606_Formatter.cs | 102 ------------ .../JT808_0x8607_Formatter.cs | 36 ---- .../JT808_0x8800_Formatter.cs | 27 --- .../JT808_0x8801_Formatter.cs | 41 ----- .../JT808_0x8802_Formatter.cs | 31 ---- .../JT808_0x8803_Formatter.cs | 33 ---- .../JT808_0x8804_Formatter.cs | 29 ---- .../JT808_0x8805_Formatter.cs | 25 --- .../JT808_0x8900_Formatter.cs | 26 --- .../JT808_0x8A00_Formatter.cs | 30 ---- .../Interfaces/GlobalConfigBase.cs | 8 +- .../Interfaces/IJT808MsgIdFactory.cs | 2 +- .../Internal/JT808MsgIdFactory.cs | 37 +++-- src/JT808.Protocol/JT808.Protocol.csproj | 3 +- src/JT808.Protocol/JT808.Protocol.xml | 41 ++++- src/JT808.Protocol/JT808Package.cs | 16 +- src/JT808.Protocol/JT808Serializer.cs | 31 ++++ .../MessagePack/JT808MessagePackWriter.cs | 11 ++ 172 files changed, 203 insertions(+), 5375 deletions(-) delete mode 100644 src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0X8900_Test_BodiesImplFormatter.cs delete mode 100644 src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x0200_0x06Formatter.cs delete mode 100644 src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x0701TestBodiesImplFormatter.cs delete mode 100644 src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x0900_0x83Formatter.cs delete mode 100644 src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x8103_0x0075_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/JT808HeaderFormatter.cs delete mode 100644 src/JT808.Protocol/Formatters/JT808HeaderPackageFormatter.cs delete mode 100644 src/JT808.Protocol/Formatters/JT808PackageFormatter.cs delete mode 100644 src/JT808.Protocol/Formatters/JT808SplitPackageBodiesFormatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0001_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0100_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0102_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0104_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0107_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0108_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x01_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x02_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x03_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x04_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x11_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x12_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x13_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x25_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x2A_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x2B_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x30_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x31_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0201_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0301_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0302_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0303_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0500_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0701_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0702_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0704_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0705_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0800_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0801_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0802_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0805_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0900_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0901_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0A00_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8001_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8003_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8100_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0001_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0002_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0003_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0004_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0005_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0006_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0007_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0010_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0011_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0012_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0013_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0014_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0015_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0016_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0017_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0018_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0019_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001A_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001B_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001C_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001D_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0020_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0021_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0022_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0027_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0028_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0029_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002C_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002D_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002E_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002F_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0030_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0031_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0040_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0041_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0042_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0043_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0044_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0045_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0046_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0047_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0048_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0049_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0050_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0051_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0052_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0053_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0054_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0055_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0056_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0057_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0058_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0059_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005A_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005B_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005C_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005D_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005E_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0064_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0065_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0070_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0071_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0072_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0073_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0074_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0080_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0081_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0082_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0083_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0084_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0090_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0091_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0092_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0093_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0094_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0095_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0100_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0101_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0102_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0103_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0110_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8105_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8106_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8108_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8202_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8203_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8300_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8301_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8302_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8303_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8304_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8400_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8401_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8500_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8600_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8601_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8602_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8603_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8604_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8605_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8606_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8607_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8800_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8801_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8802_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8803_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8804_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8805_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8900_Formatter.cs delete mode 100644 src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8A00_Formatter.cs diff --git a/src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj b/src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj index 37e4798..c79ab83 100644 --- a/src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj +++ b/src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj @@ -1,7 +1,7 @@  - net472;netcoreapp3.0; + netcoreapp3.0 true AnyCPU Exe @@ -14,8 +14,8 @@ - - + + diff --git a/src/JT808.Protocol.Test/JT808.Protocol.Test.csproj b/src/JT808.Protocol.Test/JT808.Protocol.Test.csproj index 483375a..0f2fa52 100644 --- a/src/JT808.Protocol.Test/JT808.Protocol.Test.csproj +++ b/src/JT808.Protocol.Test/JT808.Protocol.Test.csproj @@ -33,6 +33,7 @@ + @@ -57,6 +58,8 @@ + + diff --git a/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0X8900_Test_BodiesImplFormatter.cs b/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0X8900_Test_BodiesImplFormatter.cs deleted file mode 100644 index f92057b..0000000 --- a/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0X8900_Test_BodiesImplFormatter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using JT808.Protocol.Test.MessageBody.JT808_0X8900_BodiesImpl; -using System; - -namespace JT808.Protocol.Test.MessageBody.JT808Formatters -{ - public class JT808_0X8900_Test_BodiesImplFormatter : IJT808MessagePackFormatter - { - public JT808_0X8900_Test_BodiesImpl Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0X8900_Test_BodiesImpl jT808_0X8900_Test_BodiesImpl = new JT808_0X8900_Test_BodiesImpl(); - jT808_0X8900_Test_BodiesImpl.Id = reader.ReadUInt32(); - jT808_0X8900_Test_BodiesImpl.Sex = reader.ReadByte(); - return jT808_0X8900_Test_BodiesImpl; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0X8900_Test_BodiesImpl value, IJT808Config config) - { - writer.WriteUInt32(value.Id); - writer.WriteByte(value.Sex); - } - } -} diff --git a/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x0200_0x06Formatter.cs b/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x0200_0x06Formatter.cs deleted file mode 100644 index b120046..0000000 --- a/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x0200_0x06Formatter.cs +++ /dev/null @@ -1,32 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using JT808.Protocol.Test.JT808LocationAttach; -using System; - -namespace JT808.Protocol.Test.JT808Formatters.MessageBodyFormatters.JT808LocationAttach -{ - public class JT808_0x0200_0x06Formatter : IJT808MessagePackFormatter - { - public JT808LocationAttachImpl0x06 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808LocationAttachImpl0x06 jT808LocationAttachImpl0x06 = new JT808LocationAttachImpl0x06(); - jT808LocationAttachImpl0x06.AttachInfoId = reader.ReadByte(); - jT808LocationAttachImpl0x06.AttachInfoLength = reader.ReadByte(); - jT808LocationAttachImpl0x06.Age = reader.ReadInt32(); - jT808LocationAttachImpl0x06.Gender = reader.ReadByte(); - jT808LocationAttachImpl0x06.UserName = reader.ReadRemainStringContent(); - return jT808LocationAttachImpl0x06; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808LocationAttachImpl0x06 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteInt32(value.Age); - writer.WriteByte(value.Gender); - writer.WriteString(value.UserName); - } - } -} diff --git a/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x0701TestBodiesImplFormatter.cs b/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x0701TestBodiesImplFormatter.cs deleted file mode 100644 index 2989332..0000000 --- a/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x0701TestBodiesImplFormatter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using JT808.Protocol.Test.MessageBody.JT808_0x0701BodiesImpl; -using System; - -namespace JT808.Protocol.Test.MessageBody.JT808Formatters -{ - public class JT808_0x0701TestBodiesImplFormatter : IJT808MessagePackFormatter - { - public JT808_0x0701TestBodiesImpl Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0701TestBodiesImpl jT808_0X0701TestBodiesImpl = new JT808_0x0701TestBodiesImpl(); - jT808_0X0701TestBodiesImpl.Id = reader.ReadUInt32(); - jT808_0X0701TestBodiesImpl.UserNameLength = reader.ReadUInt16(); - jT808_0X0701TestBodiesImpl.UserName = reader.ReadString(jT808_0X0701TestBodiesImpl.UserNameLength); - return jT808_0X0701TestBodiesImpl; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0701TestBodiesImpl value, IJT808Config config) - { - writer.WriteUInt32(value.Id); - writer.Skip(2,out int position); - writer.WriteString(value.UserName); - int strLength = writer.GetCurrentPosition() - position - 2; - writer.WriteUInt16Return((ushort)strLength, position); - } - } -} diff --git a/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x0900_0x83Formatter.cs b/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x0900_0x83Formatter.cs deleted file mode 100644 index cbf391c..0000000 --- a/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x0900_0x83Formatter.cs +++ /dev/null @@ -1,24 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using JT808.Protocol.Test.JT808_0x0900_BodiesImpl; -using System; - -namespace JT808.Protocol.Test.MessageBody.JT808Formatters -{ - public class JT808_0x0900_0x83Formatter : IJT808MessagePackFormatter - { - public JT808_0x0900_0x83 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0900_0x83 jT808PassthroughType0x83 = new JT808_0x0900_0x83(); - jT808PassthroughType0x83.PassthroughContent = reader.ReadRemainStringContent(); - return jT808PassthroughType0x83; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0900_0x83 value, IJT808Config config) - { - writer.WriteString(value.PassthroughContent); - } - } -} diff --git a/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x8103_0x0075_Formatter.cs b/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x8103_0x0075_Formatter.cs deleted file mode 100644 index 7b911f9..0000000 --- a/src/JT808.Protocol.Test/MessageBody/JT808Formatters/JT808_0x8103_0x0075_Formatter.cs +++ /dev/null @@ -1,51 +0,0 @@ -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using JT808.Protocol.Test.MessageBody.JT808_0x8103CustomIdExtensions; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Test.MessageBody.JT808Formatters -{ - public class JT808_0x8103_0x0075_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0075 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0075 jT808_0X8103_0X0075 = new JT808_0x8103_0x0075(); - jT808_0X8103_0X0075.ParamId = reader.ReadUInt32(); - jT808_0X8103_0X0075.ParamLength = reader.ReadByte(); - jT808_0X8103_0X0075.RTS_EncodeMode = reader.ReadByte(); - jT808_0X8103_0X0075.RTS_Resolution = reader.ReadByte(); - jT808_0X8103_0X0075.RTS_KF_Interval = reader.ReadUInt16(); - jT808_0X8103_0X0075.RTS_Target_FPS = reader.ReadByte(); - jT808_0X8103_0X0075.RTS_Target_CodeRate = reader.ReadUInt32(); - jT808_0X8103_0X0075.StreamStore_EncodeMode = reader.ReadByte(); - jT808_0X8103_0X0075.StreamStore_Resolution = reader.ReadByte(); - jT808_0X8103_0X0075.StreamStore_KF_Interval = reader.ReadUInt16(); - jT808_0X8103_0X0075.StreamStore_Target_FPS = reader.ReadByte(); - jT808_0X8103_0X0075.StreamStore_Target_CodeRate = reader.ReadUInt32(); - jT808_0X8103_0X0075.OSD = reader.ReadUInt16(); - jT808_0X8103_0X0075.AudioOutputEnabled = reader.ReadByte(); - return jT808_0X8103_0X0075; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0075 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteByte(value.RTS_EncodeMode); - writer.WriteByte(value.RTS_Resolution); - writer.WriteUInt16(value.RTS_KF_Interval); - writer.WriteByte(value.RTS_Target_FPS); - writer.WriteUInt32(value.RTS_Target_CodeRate); - writer.WriteByte(value.StreamStore_EncodeMode); - writer.WriteByte(value.StreamStore_Resolution); - writer.WriteUInt16(value.StreamStore_KF_Interval); - writer.WriteByte(value.StreamStore_Target_FPS); - writer.WriteUInt32(value.StreamStore_Target_CodeRate); - writer.WriteUInt16(value.OSD); - writer.WriteByte(value.AudioOutputEnabled); - } - } -} diff --git a/src/JT808.Protocol.Test/MessageBody/JT808_0x8103CustomIdExtensions/JT808_0x8103_0x0075.cs b/src/JT808.Protocol.Test/MessageBody/JT808_0x8103CustomIdExtensions/JT808_0x8103_0x0075.cs index 279f082..6028518 100644 --- a/src/JT808.Protocol.Test/MessageBody/JT808_0x8103CustomIdExtensions/JT808_0x8103_0x0075.cs +++ b/src/JT808.Protocol.Test/MessageBody/JT808_0x8103CustomIdExtensions/JT808_0x8103_0x0075.cs @@ -1,6 +1,7 @@ using JT808.Protocol.Attributes; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; -using JT808.Protocol.Test.MessageBody.JT808Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -11,8 +12,7 @@ namespace JT808.Protocol.Test.MessageBody.JT808_0x8103CustomIdExtensions /// 音视频参数设置 /// 0x8103_0x0075 /// - [JT808Formatter(typeof(JT808_0x8103_0x0075_Formatter))] - public class JT808_0x8103_0x0075 : JT808_0x8103_CustomBodyBase + public class JT808_0x8103_0x0075 : JT808_0x8103_CustomBodyBase, IJT808MessagePackFormatter { public override uint ParamId { get; set; } = 0x0075; /// @@ -73,5 +73,43 @@ namespace JT808.Protocol.Test.MessageBody.JT808_0x8103CustomIdExtensions ///1:启用 /// public byte AudioOutputEnabled { get; set; } + + public JT808_0x8103_0x0075 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0x0075 jT808_0X8103_0X0075 = new JT808_0x8103_0x0075(); + jT808_0X8103_0X0075.ParamId = reader.ReadUInt32(); + jT808_0X8103_0X0075.ParamLength = reader.ReadByte(); + jT808_0X8103_0X0075.RTS_EncodeMode = reader.ReadByte(); + jT808_0X8103_0X0075.RTS_Resolution = reader.ReadByte(); + jT808_0X8103_0X0075.RTS_KF_Interval = reader.ReadUInt16(); + jT808_0X8103_0X0075.RTS_Target_FPS = reader.ReadByte(); + jT808_0X8103_0X0075.RTS_Target_CodeRate = reader.ReadUInt32(); + jT808_0X8103_0X0075.StreamStore_EncodeMode = reader.ReadByte(); + jT808_0X8103_0X0075.StreamStore_Resolution = reader.ReadByte(); + jT808_0X8103_0X0075.StreamStore_KF_Interval = reader.ReadUInt16(); + jT808_0X8103_0X0075.StreamStore_Target_FPS = reader.ReadByte(); + jT808_0X8103_0X0075.StreamStore_Target_CodeRate = reader.ReadUInt32(); + jT808_0X8103_0X0075.OSD = reader.ReadUInt16(); + jT808_0X8103_0X0075.AudioOutputEnabled = reader.ReadByte(); + return jT808_0X8103_0X0075; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0075 value, IJT808Config config) + { + writer.WriteUInt32(value.ParamId); + writer.WriteByte(value.ParamLength); + writer.WriteByte(value.RTS_EncodeMode); + writer.WriteByte(value.RTS_Resolution); + writer.WriteUInt16(value.RTS_KF_Interval); + writer.WriteByte(value.RTS_Target_FPS); + writer.WriteUInt32(value.RTS_Target_CodeRate); + writer.WriteByte(value.StreamStore_EncodeMode); + writer.WriteByte(value.StreamStore_Resolution); + writer.WriteUInt16(value.StreamStore_KF_Interval); + writer.WriteByte(value.StreamStore_Target_FPS); + writer.WriteUInt32(value.StreamStore_Target_CodeRate); + writer.WriteUInt16(value.OSD); + writer.WriteByte(value.AudioOutputEnabled); + } } } \ No newline at end of file diff --git a/src/JT808.Protocol.Test/MessageBody/JT808_0x8103Test.cs b/src/JT808.Protocol.Test/MessageBody/JT808_0x8103Test.cs index f34261a..39b475d 100644 --- a/src/JT808.Protocol.Test/MessageBody/JT808_0x8103Test.cs +++ b/src/JT808.Protocol.Test/MessageBody/JT808_0x8103Test.cs @@ -132,17 +132,17 @@ namespace JT808.Protocol.Test.MessageBody CustomParamList = new List { new JT808_0x8103_0x0075() { AudioOutputEnabled=1, - OSD=2, - RTS_EncodeMode=3, - RTS_KF_Interval=4, - RTS_Resolution=5, - RTS_Target_CodeRate=6, - RTS_Target_FPS=7, - StreamStore_EncodeMode=8, - StreamStore_KF_Interval=9, - StreamStore_Resolution=10, - StreamStore_Target_CodeRate=11, - StreamStore_Target_FPS=12 + OSD=2, + RTS_EncodeMode=3, + RTS_KF_Interval=4, + RTS_Resolution=5, + RTS_Target_CodeRate=6, + RTS_Target_FPS=7, + StreamStore_EncodeMode=8, + StreamStore_KF_Interval=9, + StreamStore_Resolution=10, + StreamStore_Target_CodeRate=11, + StreamStore_Target_FPS=12 } } }; diff --git a/src/JT808.Protocol/Enums/JT808MsgId.cs b/src/JT808.Protocol/Enums/JT808MsgId.cs index ed62b0a..cd41b0a 100644 --- a/src/JT808.Protocol/Enums/JT808MsgId.cs +++ b/src/JT808.Protocol/Enums/JT808MsgId.cs @@ -64,7 +64,6 @@ namespace JT808.Protocol.Enums [JT808BodiesType(typeof(JT808_0x0102))] [JT808MsgIdDescription("0x0102", "终端鉴权")] 终端鉴权 = 0x0102, -#warning 设置终端参数 查询终端参数 查询终端参数应答 /// /// 设置终端参数 /// 0x8103 diff --git a/src/JT808.Protocol/Extensions/JT808PackageExtensionsTemplate.cs b/src/JT808.Protocol/Extensions/JT808PackageExtensionsTemplate.cs index 84f46af..0c79e71 100644 --- a/src/JT808.Protocol/Extensions/JT808PackageExtensionsTemplate.cs +++ b/src/JT808.Protocol/Extensions/JT808PackageExtensionsTemplate.cs @@ -89,23 +89,23 @@ namespace JT808.Protocol.Extensions { return Create(msgId,terminalPhoneNo,bodies); } - ///// - ///// 0x0104 - 查询终端参数应答 - ///// auto-generated - ///// - // public static JT808Package Create_查询终端参数应答(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x0104 bodies) - //{ - // return Create(msgId,terminalPhoneNo,bodies); - //} + /// + /// 0x0104 - 查询终端参数应答 + /// auto-generated + /// + public static JT808Package Create_查询终端参数应答(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x0104 bodies) + { + return Create(msgId,terminalPhoneNo,bodies); + } /// /// 0x0104 - 查询终端参数应答 /// auto-generated /// - // public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x0104 bodies) - //{ - // return Create(msgId,terminalPhoneNo,bodies); - //} + public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x0104 bodies) + { + return Create(msgId,terminalPhoneNo,bodies); + } /// /// 0x0107 - 查询终端属性应答 /// auto-generated @@ -464,22 +464,39 @@ namespace JT808.Protocol.Extensions return Create(msgId,terminalPhoneNo,bodies); } /// + /// 0x8103 - 设置终端参数 + /// auto-generated + /// + public static JT808Package Create_设置终端参数(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8103 bodies) + { + return Create(msgId,terminalPhoneNo,bodies); + } + + /// + /// 0x8103 - 设置终端参数 + /// auto-generated + /// + public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8103 bodies) + { + return Create(msgId,terminalPhoneNo,bodies); + } + /// /// 0x8104 - 查询终端参数 /// auto-generated /// - // public static JT808Package Create_查询终端参数(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8104 bodies) - //{ - // return Create(msgId,terminalPhoneNo,bodies); - //} + public static JT808Package Create_查询终端参数(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8104 bodies) + { + return Create(msgId,terminalPhoneNo,bodies); + } /// /// 0x8104 - 查询终端参数 /// auto-generated /// - // public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8104 bodies) - //{ - // return Create(msgId,terminalPhoneNo,bodies); - //} + public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8104 bodies) + { + return Create(msgId,terminalPhoneNo,bodies); + } /// /// 0x8105 - 终端控制 /// auto-generated diff --git a/src/JT808.Protocol/Formatters/JT808HeaderFormatter.cs b/src/JT808.Protocol/Formatters/JT808HeaderFormatter.cs deleted file mode 100644 index 28b806d..0000000 --- a/src/JT808.Protocol/Formatters/JT808HeaderFormatter.cs +++ /dev/null @@ -1,56 +0,0 @@ -using JT808.Protocol.Extensions; -using System; -using System.Buffers.Binary; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters -{ - /// - /// JT808头部序列化器 - /// - public class JT808HeaderFormatter : IJT808MessagePackFormatter - { - public static readonly JT808HeaderFormatter Instance = new JT808HeaderFormatter(); - public JT808Header Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808Header jT808Header = new JT808Header(); - // 1.消息ID - jT808Header.MsgId = reader.ReadUInt16(); - // 2.消息体属性 - jT808Header.MessageBodyProperty = new JT808HeaderMessageBodyProperty(reader.ReadUInt16()); - // 3.终端手机号 - jT808Header.TerminalPhoneNo = reader.ReadBCD(config.TerminalPhoneNoLength, config.Trim); - jT808Header.MsgNum = reader.ReadUInt16(); - // 4.判断有无分包 - if (jT808Header.MessageBodyProperty.IsPackage) - { - //5.读取消息包总数 - jT808Header.PackgeCount = reader.ReadUInt16(); - //6.读取消息包序号 - jT808Header.PackageIndex = reader.ReadUInt16(); - } - return jT808Header; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808Header value, IJT808Config config) - { - // 1.消息ID - writer.WriteUInt16(value.MsgId); - // 2.消息体属性 - writer.WriteUInt16(value.MessageBodyProperty.Wrap()); - // 3.终端手机号 - writer.WriteBCD(value.TerminalPhoneNo, config.TerminalPhoneNoLength); - // 4.消息流水号 - writer.WriteUInt16(value.MsgNum); - // 5.判断是否分包 - if (value.MessageBodyProperty.IsPackage) - { - // 6.消息包总数 - writer.WriteUInt16(value.PackgeCount); - // 7.消息包序号 - writer.WriteUInt16(value.PackageIndex); - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/JT808HeaderPackageFormatter.cs b/src/JT808.Protocol/Formatters/JT808HeaderPackageFormatter.cs deleted file mode 100644 index f678d22..0000000 --- a/src/JT808.Protocol/Formatters/JT808HeaderPackageFormatter.cs +++ /dev/null @@ -1,65 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.Exceptions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters -{ - public class JT808HeaderPackageFormatter : IJT808MessagePackFormatter - { - public static readonly JT808HeaderPackageFormatter Instance = new JT808HeaderPackageFormatter(); - public JT808HeaderPackage Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - // 1. 验证校验和 - if (!config.SkipCRCCode) - { - if (!reader.CheckXorCodeVali) - { - throw new JT808Exception(JT808ErrorCode.CheckCodeNotEqual, $"{reader.RealCheckXorCode}!={reader.CalculateCheckXorCode}"); - } - } - JT808HeaderPackage jT808Package = new JT808HeaderPackage(); - // ---------------开始解包-------------- - // 2.读取起始位置 - jT808Package.Begin = reader.ReadStart(); - // 3.读取头部信息 - jT808Package.Header = new JT808Header(); - // 3.1.读取消息Id - jT808Package.Header.MsgId = reader.ReadUInt16(); - // 3.2.读取消息体属性 - ushort messageBodyPropertyValue = reader.ReadUInt16(); - // 3.2.1.解包消息体属性 - jT808Package.Header.MessageBodyProperty = new JT808HeaderMessageBodyProperty(messageBodyPropertyValue); - // 3.3.读取终端手机号 - jT808Package.Header.TerminalPhoneNo = reader.ReadBCD(config.TerminalPhoneNoLength, config.Trim); - // 3.4.读取消息流水号 - jT808Package.Header.MsgNum = reader.ReadUInt16(); - // 3.5.判断有无分包 - if (jT808Package.Header.MessageBodyProperty.IsPackage) - { - //3.5.1.读取消息包总数 - jT808Package.Header.PackgeCount = reader.ReadUInt16(); - //3.5.2.读取消息包序号 - jT808Package.Header.PackageIndex = reader.ReadUInt16(); - } - // 4.处理数据体 - // 4.1.判断有无数据体 - if (jT808Package.Header.MessageBodyProperty.DataLength > 0) - { - jT808Package.Bodies = reader.ReadContent().ToArray(); - } - // 5.读取校验码 - jT808Package.CheckCode = reader.ReadByte(); - // 6.读取终止位置 - jT808Package.End = reader.ReadEnd(); - // ---------------解包完成-------------- - return jT808Package; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808HeaderPackage value, IJT808Config config) - { - throw new NotImplementedException("只适用反序列化"); - } - } -} diff --git a/src/JT808.Protocol/Formatters/JT808PackageFormatter.cs b/src/JT808.Protocol/Formatters/JT808PackageFormatter.cs deleted file mode 100644 index de18470..0000000 --- a/src/JT808.Protocol/Formatters/JT808PackageFormatter.cs +++ /dev/null @@ -1,156 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.Exceptions; -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters -{ - /// - /// JT808包序列化器 - /// - public class JT808PackageFormatter : IJT808MessagePackFormatter - { - public static readonly JT808PackageFormatter Instance = new JT808PackageFormatter(); - public JT808Package Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - // 1. 验证校验和 - if (!config.SkipCRCCode) - { - if (!reader.CheckXorCodeVali) - { - throw new JT808Exception(JT808ErrorCode.CheckCodeNotEqual, $"{reader.RealCheckXorCode}!={reader.CalculateCheckXorCode}"); - } - } - JT808Package jT808Package = new JT808Package(); - // ---------------开始解包-------------- - // 2.读取起始位置 - jT808Package.Begin = reader.ReadStart(); - // 3.读取头部信息 - jT808Package.Header = new JT808Header(); - // 3.1.读取消息Id - jT808Package.Header.MsgId = reader.ReadUInt16(); - // 3.2.读取消息体属性 - jT808Package.Header.MessageBodyProperty=new JT808HeaderMessageBodyProperty(reader.ReadUInt16()); - // 3.3.读取终端手机号 - jT808Package.Header.TerminalPhoneNo = reader.ReadBCD(config.TerminalPhoneNoLength, config.Trim); - // 3.4.读取消息流水号 - jT808Package.Header.MsgNum= reader.ReadUInt16(); - // 3.5.判断有无分包 - if (jT808Package.Header.MessageBodyProperty.IsPackage) - { - //3.5.1.读取消息包总数 - jT808Package.Header.PackgeCount = reader.ReadUInt16(); - //3.5.2.读取消息包序号 - jT808Package.Header.PackageIndex = reader.ReadUInt16(); - } - // 4.处理数据体 - // 4.1.判断有无数据体 - if (jT808Package.Header.MessageBodyProperty.DataLength > 0) - { - Type jT808BodiesImplType = config.MsgIdFactory.GetBodiesImplTypeByMsgId(jT808Package.Header.MsgId, jT808Package.Header.TerminalPhoneNo); - if (jT808BodiesImplType != null) - { - if (jT808Package.Header.MessageBodyProperty.IsPackage) - { - if (jT808Package.Header.PackageIndex > 1) - { - try - { - //4.2处理第二包之后的分包数据消息体 - jT808Package.Bodies = JT808SplitPackageBodiesFormatter.Instance.Deserialize(ref reader, config); - } - catch (Exception ex) - { - throw new JT808Exception(JT808ErrorCode.BodiesParseError, ex); - } - } - else - { - try - { - //4.2.处理消息体 - jT808Package.Bodies = JT808MessagePackFormatterResolverExtensions.JT808DynamicDeserialize( - config.GetMessagePackFormatterByType(jT808BodiesImplType), - ref reader, config); - } - catch (Exception ex) - { - throw new JT808Exception(JT808ErrorCode.BodiesParseError, ex); - } - } - } - else - { - try - { - //4.2.处理消息体 - jT808Package.Bodies = JT808MessagePackFormatterResolverExtensions.JT808DynamicDeserialize( - config.GetMessagePackFormatterByType(jT808BodiesImplType), - ref reader, config); - } - catch (Exception ex) - { - throw new JT808Exception(JT808ErrorCode.BodiesParseError, ex); - } - } - } - } - // 5.读取校验码 - jT808Package.CheckCode = reader.ReadByte(); - // 6.读取终止位置 - jT808Package.End = reader.ReadEnd(); - // ---------------解包完成-------------- - return jT808Package; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808Package value, IJT808Config config) - { - // ---------------开始组包-------------- - // 1.起始符 - writer.WriteStart(); - // 2.写入头部 //部分有带数据体的长度,那么先跳过写入头部部分 - // 2.1.消息ID - writer.WriteUInt16(value.Header.MsgId); - // 2.2.消息体属性(包含消息体长度所以先跳过) - writer.Skip(2,out int msgBodiesPropertyPosition); - // 2.3.终端手机号 (写死大陆手机号码) - writer.WriteBCD(value.Header.TerminalPhoneNo, config.TerminalPhoneNoLength); - value.Header.MsgNum = value.Header.MsgNum > 0 ? value.Header.MsgNum : config.MsgSNDistributed.Increment(); - // 2.4.消息流水号 - writer.WriteUInt16(value.Header.MsgNum); - // 2.5.判断是否分包 - if (value.Header.MessageBodyProperty.IsPackage) - { - // 2.5.1.消息包总数 - writer.WriteUInt16(value.Header.PackgeCount); - // 2.5.2.消息包序号 - writer.WriteUInt16(value.Header.PackageIndex); - } - int headerLength = writer.GetCurrentPosition(); - // 3.处理数据体部分 - if (value.Bodies != null) - { - if (!value.Bodies.SkipSerialization) - { - JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize( - config.GetMessagePackFormatterByType(value.Bodies.GetType()), - ref writer, value.Bodies, - config); - } - } - // 3.1.处理数据体长度 - value.Header.MessageBodyProperty=new JT808HeaderMessageBodyProperty((ushort)(writer.GetCurrentPosition() - headerLength)); - // 2.2.回写消息体属性 - writer.WriteUInt16Return(value.Header.MessageBodyProperty.Wrap(), msgBodiesPropertyPosition); - // 4.校验码 - writer.WriteXor(); - // 5.终止符 - writer.WriteEnd(); - // 6.编码 - writer.WriteEncode(); - // ---------------组包结束-------------- - } - } -} diff --git a/src/JT808.Protocol/Formatters/JT808SplitPackageBodiesFormatter.cs b/src/JT808.Protocol/Formatters/JT808SplitPackageBodiesFormatter.cs deleted file mode 100644 index 8796b40..0000000 --- a/src/JT808.Protocol/Formatters/JT808SplitPackageBodiesFormatter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using JT808.Protocol.Extensions; -using System; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters -{ - public class JT808SplitPackageBodiesFormatter : IJT808MessagePackFormatter - { - public static readonly JT808SplitPackageBodiesFormatter Instance = new JT808SplitPackageBodiesFormatter(); - public JT808SplitPackageBodies Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808SplitPackageBodies jT808SplitPackageBodies = new JT808SplitPackageBodies - { - Data = reader.ReadContent().ToArray() - }; - return jT808SplitPackageBodies; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808SplitPackageBodies value, IJT808Config config) - { - writer.WriteArray(value.Data); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0001_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0001_Formatter.cs deleted file mode 100644 index f8b5f0b..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0001_Formatter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0001_Formatter :IJT808MessagePackFormatter - { - public JT808_0x0001 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0001 jT808_0X0001 = new JT808_0x0001(); - jT808_0X0001.MsgNum = reader.ReadUInt16(); - jT808_0X0001.MsgId = reader.ReadUInt16(); - jT808_0X0001.JT808TerminalResult = (JT808TerminalResult)reader.ReadByte(); - return jT808_0X0001; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0001 value, IJT808Config config) - { - writer.WriteUInt16(value.MsgNum); - writer.WriteUInt16(value.MsgId); - writer.WriteByte((byte)value.JT808TerminalResult); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0100_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0100_Formatter.cs deleted file mode 100644 index 86c46e9..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0100_Formatter.cs +++ /dev/null @@ -1,35 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0100_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0100 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0100 jT808_0X0100 = new JT808_0x0100(); - jT808_0X0100.AreaID = reader.ReadUInt16(); - jT808_0X0100.CityOrCountyId = reader.ReadUInt16(); - jT808_0X0100.MakerId = reader.ReadString(5); - jT808_0X0100.TerminalModel = reader.ReadString(20); - jT808_0X0100.TerminalId = reader.ReadString(7); - jT808_0X0100.PlateColor = reader.ReadByte(); - jT808_0X0100.PlateNo = reader.ReadRemainStringContent(); - return jT808_0X0100; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0100 value, IJT808Config config) - { - writer.WriteUInt16(value.AreaID); - writer.WriteUInt16(value.CityOrCountyId); - writer.WriteString(value.MakerId.PadRight(5, '0')); - writer.WriteString(value.TerminalModel.PadRight(20, '0')); - writer.WriteString(value.TerminalId.PadRight(7, '0')); - writer.WriteByte(value.PlateColor); - writer.WriteString(value.PlateNo); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0102_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0102_Formatter.cs deleted file mode 100644 index 6912a06..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0102_Formatter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0102_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0102 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0102 jT808_0X0102 = new JT808_0x0102(); - jT808_0X0102.Code = reader.ReadRemainStringContent(); - return jT808_0X0102; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0102 value, IJT808Config config) - { - writer.WriteString(value.Code); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0104_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0104_Formatter.cs deleted file mode 100644 index 11adf4d..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0104_Formatter.cs +++ /dev/null @@ -1,48 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0104_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0104 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0104 jT808_0x0104 = new JT808_0x0104(); - jT808_0x0104.MsgNum = reader.ReadUInt16(); - jT808_0x0104.AnswerParamsCount = reader.ReadByte(); - for (int i = 0; i < jT808_0x0104.AnswerParamsCount; i++) - { - var paramId = reader.ReadVirtualUInt32();//参数ID - if (config.JT808_0X8103_Factory.ParamMethods.TryGetValue(paramId, out Type type)) - { - if (jT808_0x0104.ParamList != null) - { - jT808_0x0104.ParamList.Add(JT808MessagePackFormatterResolverExtensions.JT808DynamicDeserialize( - config.GetMessagePackFormatterByType(type), ref reader, config)); - } - else - { - jT808_0x0104.ParamList = new List { JT808MessagePackFormatterResolverExtensions.JT808DynamicDeserialize( - config.GetMessagePackFormatterByType(type), ref reader, config) }; - } - } - } - return jT808_0x0104; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0104 value, IJT808Config config) - { - writer.WriteUInt16(value.MsgNum); - writer.WriteByte(value.AnswerParamsCount); - foreach (var item in value.ParamList) - { - object obj = config.GetMessagePackFormatterByType(item.GetType()); - JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(obj, ref writer,item, config); - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0107_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0107_Formatter.cs deleted file mode 100644 index fd5454a..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0107_Formatter.cs +++ /dev/null @@ -1,43 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0107_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0107 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0107 jT808_0X0107 = new JT808_0x0107(); - jT808_0X0107.TerminalType = reader.ReadUInt16(); - jT808_0X0107.MakerId = reader.ReadString(5); - jT808_0X0107.TerminalModel = reader.ReadString(20); - jT808_0X0107.TerminalId = reader.ReadString(7); - jT808_0X0107.Terminal_SIM_ICCID = reader.ReadBCD(10, config.Trim); - jT808_0X0107.Terminal_Hardware_Version_Length = reader.ReadByte(); - jT808_0X0107.Terminal_Hardware_Version_Num = reader.ReadString(jT808_0X0107.Terminal_Hardware_Version_Length); - jT808_0X0107.Terminal_Firmware_Version_Length = reader.ReadByte(); - jT808_0X0107.Terminal_Firmware_Version_Num = reader.ReadString(jT808_0X0107.Terminal_Firmware_Version_Length); - jT808_0X0107.GNSSModule = reader.ReadByte(); - jT808_0X0107.CommunicationModule = reader.ReadByte(); - return jT808_0X0107; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0107 value, IJT808Config config) - { - writer.WriteUInt16(value.TerminalType); - writer.WriteString(value.MakerId.PadRight(5, '0')); - writer.WriteString(value.TerminalModel.PadRight(20, '0')); - writer.WriteString(value.TerminalId.PadRight(7, '0')); - writer.WriteBCD(value.Terminal_SIM_ICCID, 10); - writer.WriteByte((byte)value.Terminal_Hardware_Version_Num.Length); - writer.WriteString(value.Terminal_Hardware_Version_Num); - writer.WriteByte((byte)value.Terminal_Firmware_Version_Num.Length); - writer.WriteString(value.Terminal_Firmware_Version_Num); - writer.WriteByte(value.GNSSModule); - writer.WriteByte(value.CommunicationModule); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0108_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0108_Formatter.cs deleted file mode 100644 index ff4affc..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0108_Formatter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0108_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0108 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0108 jT808_0X0108 = new JT808_0x0108(); - jT808_0X0108.UpgradeType = (JT808UpgradeType)reader.ReadByte(); - jT808_0X0108.UpgradeResult = (JT808UpgradeResult)reader.ReadByte(); - return jT808_0X0108; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0108 value, IJT808Config config) - { - writer.WriteByte((byte)value.UpgradeType); - writer.WriteByte((byte)value.UpgradeResult); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x01_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x01_Formatter.cs deleted file mode 100644 index bdcf59a..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x01_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0200_0x01_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0200_0x01 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x01 jT808LocationAttachImpl0X01 = new JT808_0x0200_0x01(); - jT808LocationAttachImpl0X01.AttachInfoId = reader.ReadByte(); - jT808LocationAttachImpl0X01.AttachInfoLength = reader.ReadByte(); - jT808LocationAttachImpl0X01.Mileage = reader.ReadInt32(); - return jT808LocationAttachImpl0X01; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x01 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteInt32(value.Mileage); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x02_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x02_Formatter.cs deleted file mode 100644 index b4e8f36..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x02_Formatter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0200_0x02_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0200_0x02 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x02 jT808LocationAttachImpl0X02 = new JT808_0x0200_0x02(); - jT808LocationAttachImpl0X02.AttachInfoId = reader.ReadByte(); - jT808LocationAttachImpl0X02.AttachInfoLength = reader.ReadByte(); - jT808LocationAttachImpl0X02.Oil = reader.ReadUInt16(); - return jT808LocationAttachImpl0X02; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x02 value, IJT808Config config) - { - writer.WriteByte( value.AttachInfoId); - writer.WriteByte( value.AttachInfoLength); - writer.WriteUInt16( value.Oil); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x03_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x03_Formatter.cs deleted file mode 100644 index 33cadf4..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x03_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0200_0x03_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0200_0x03 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x03 jT808LocationAttachImpl0x03 = new JT808_0x0200_0x03(); - jT808LocationAttachImpl0x03.AttachInfoId = reader.ReadByte(); - jT808LocationAttachImpl0x03.AttachInfoLength = reader.ReadByte(); - jT808LocationAttachImpl0x03.Speed = reader.ReadUInt16(); - return jT808LocationAttachImpl0x03; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x03 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteUInt16(value.Speed); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x04_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x04_Formatter.cs deleted file mode 100644 index d4d237c..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x04_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0200_0x04_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0200_0x04 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x04 jT808LocationAttachImpl0x04 = new JT808_0x0200_0x04(); - jT808LocationAttachImpl0x04.AttachInfoId = reader.ReadByte(); - jT808LocationAttachImpl0x04.AttachInfoLength = reader.ReadByte(); - jT808LocationAttachImpl0x04.EventId = reader.ReadUInt16(); - return jT808LocationAttachImpl0x04; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x04 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteUInt16(value.EventId); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x11_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x11_Formatter.cs deleted file mode 100644 index 38de2e0..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x11_Formatter.cs +++ /dev/null @@ -1,36 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0200_0x11_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0200_0x11 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x11 jT808LocationAttachImpl0x11 = new JT808_0x0200_0x11(); - jT808LocationAttachImpl0x11.AttachInfoId = reader.ReadByte(); - jT808LocationAttachImpl0x11.AttachInfoLength = reader.ReadByte(); - jT808LocationAttachImpl0x11.JT808PositionType = (JT808PositionType)reader.ReadByte(); - if(jT808LocationAttachImpl0x11.JT808PositionType != JT808PositionType.无特定位置) - { - jT808LocationAttachImpl0x11.AreaId = reader.ReadInt32(); - } - return jT808LocationAttachImpl0x11; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x11 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteByte((byte)value.JT808PositionType); - if (value.JT808PositionType != JT808PositionType.无特定位置) - { - writer.WriteInt32(value.AreaId); - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x12_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x12_Formatter.cs deleted file mode 100644 index 5a95f31..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x12_Formatter.cs +++ /dev/null @@ -1,32 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0200_0x12_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0200_0x12 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x12 jT808LocationAttachImpl0x12 = new JT808_0x0200_0x12(); - jT808LocationAttachImpl0x12.AttachInfoId = reader.ReadByte(); - jT808LocationAttachImpl0x12.AttachInfoLength = reader.ReadByte(); - jT808LocationAttachImpl0x12.JT808PositionType = (JT808PositionType)reader.ReadByte(); - jT808LocationAttachImpl0x12.AreaId = reader.ReadInt32(); - jT808LocationAttachImpl0x12.Direction = (JT808DirectionType)reader.ReadByte(); - return jT808LocationAttachImpl0x12; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x12 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteByte((byte)value.JT808PositionType); - writer.WriteInt32(value.AreaId); - writer.WriteByte((byte)value.Direction); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x13_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x13_Formatter.cs deleted file mode 100644 index fcfc7a4..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x13_Formatter.cs +++ /dev/null @@ -1,32 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0200_0x13_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0200_0x13 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x13 jT808LocationAttachImpl0x13 = new JT808_0x0200_0x13(); - jT808LocationAttachImpl0x13.AttachInfoId = reader.ReadByte(); - jT808LocationAttachImpl0x13.AttachInfoLength = reader.ReadByte(); - jT808LocationAttachImpl0x13.DrivenRouteId = reader.ReadInt32(); - jT808LocationAttachImpl0x13.Time = reader.ReadUInt16(); - jT808LocationAttachImpl0x13.DrivenRoute = (JT808DrivenRouteType)reader.ReadByte(); - return jT808LocationAttachImpl0x13; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x13 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteInt32(value.DrivenRouteId); - writer.WriteUInt16(value.Time); - writer.WriteByte((byte)value.DrivenRoute); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x25_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x25_Formatter.cs deleted file mode 100644 index 93a4f1e..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x25_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0200_0x25_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0200_0x25 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x25 jT808LocationAttachImpl0x13 = new JT808_0x0200_0x25(); - jT808LocationAttachImpl0x13.AttachInfoId = reader.ReadByte(); - jT808LocationAttachImpl0x13.AttachInfoLength = reader.ReadByte(); - jT808LocationAttachImpl0x13.CarSignalStatus = reader.ReadInt32(); - return jT808LocationAttachImpl0x13; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x25 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteInt32(value.CarSignalStatus); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x2A_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x2A_Formatter.cs deleted file mode 100644 index 92e5fc9..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x2A_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0200_0x2A_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0200_0x2A Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x2A jT808LocationAttachImpl0X2A = new JT808_0x0200_0x2A(); - jT808LocationAttachImpl0X2A.AttachInfoId = reader.ReadByte(); - jT808LocationAttachImpl0X2A.AttachInfoLength = reader.ReadByte(); - jT808LocationAttachImpl0X2A.IOStatus = reader.ReadUInt16(); - return jT808LocationAttachImpl0X2A; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x2A value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteUInt16(value.IOStatus); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x2B_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x2B_Formatter.cs deleted file mode 100644 index cb3ec82..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x2B_Formatter.cs +++ /dev/null @@ -1,28 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0200_0x2B_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0200_0x2B Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x2B jT808LocationAttachImpl0x2B = new JT808_0x0200_0x2B(); - jT808LocationAttachImpl0x2B.AttachInfoId = reader.ReadByte(); - jT808LocationAttachImpl0x2B.AttachInfoLength = reader.ReadByte(); - jT808LocationAttachImpl0x2B.Analog = reader.ReadInt32(); - return jT808LocationAttachImpl0x2B; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x2B value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteInt32(value.Analog); - } - } -} - diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x30_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x30_Formatter.cs deleted file mode 100644 index e93ff17..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x30_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0200_0x30_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0200_0x30 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x30 jT808LocationAttachImpl0x30 = new JT808_0x0200_0x30(); - jT808LocationAttachImpl0x30.AttachInfoId = reader.ReadByte(); - jT808LocationAttachImpl0x30.AttachInfoLength = reader.ReadByte(); - jT808LocationAttachImpl0x30.WiFiSignalStrength = reader.ReadByte(); - return jT808LocationAttachImpl0x30; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x30 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteByte(value.WiFiSignalStrength); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x31_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x31_Formatter.cs deleted file mode 100644 index 9739626..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_0x31_Formatter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0200_0x31_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0200_0x31 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x31 jT808LocationAttachImpl0x31 = new JT808_0x0200_0x31(); - jT808LocationAttachImpl0x31.AttachInfoId = reader.ReadByte(); - jT808LocationAttachImpl0x31.AttachInfoLength = reader.ReadByte(); - jT808LocationAttachImpl0x31.GNSSCount = reader.ReadByte(); - return jT808LocationAttachImpl0x31; - } - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x31 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteByte(value.GNSSCount); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_Formatter.cs deleted file mode 100644 index 8584ac7..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0200_Formatter.cs +++ /dev/null @@ -1,150 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Metadata; -using JT808.Protocol.MessageBody; -using System; -using System.Collections.Generic; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using JT808.Protocol.Exceptions; -using JT808.Protocol.Enums; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0200_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0200 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200 jT808_0X0200 = new JT808_0x0200(); - jT808_0X0200.AlarmFlag = reader.ReadUInt32(); - jT808_0X0200.StatusFlag = reader.ReadUInt32(); - if (((jT808_0X0200.StatusFlag >> 28) & 1) == 1) - { //南纬 268435456 0x10000000 - jT808_0X0200.Lat = (int)reader.ReadUInt32(); - } - else - { - jT808_0X0200.Lat = reader.ReadInt32(); - } - if (((jT808_0X0200.StatusFlag >> 27) & 1) == 1) - { //西经 ‭134217728‬ 0x8000000 - jT808_0X0200.Lng = (int)reader.ReadUInt32(); - } - else - { - jT808_0X0200.Lng = reader.ReadInt32(); - } - jT808_0X0200.Altitude = reader.ReadUInt16(); - jT808_0X0200.Speed = reader.ReadUInt16(); - jT808_0X0200.Direction = reader.ReadUInt16(); - jT808_0X0200.GPSTime = reader.ReadDateTime6(); - // 位置附加信息 - jT808_0X0200.JT808LocationAttachData = new Dictionary(); - jT808_0X0200.JT808CustomLocationAttachOriginalData = new Dictionary(); - jT808_0X0200.JT808UnknownLocationAttachOriginalData = new Dictionary(); - while (reader.ReadCurrentRemainContentLength()>0) - { - try - { - ReadOnlySpan attachSpan= reader.GetVirtualReadOnlySpan(2); - byte attachId = attachSpan[0]; - byte attachLen = attachSpan[1]; - if (config.JT808_0X0200_Factory.JT808LocationAttachMethod.TryGetValue(attachId, out Type jT808LocationAttachType)) - { - object attachImplObj = config.GetMessagePackFormatterByType(jT808LocationAttachType); - dynamic attachImpl = JT808MessagePackFormatterResolverExtensions.JT808DynamicDeserialize(attachImplObj,ref reader, config); - jT808_0X0200.JT808LocationAttachData.Add(attachImpl.AttachInfoId, attachImpl); - } - else if (config.JT808_0X0200_Custom_Factory.AttachIds.Contains(attachId)) - { - reader.Skip(2); - jT808_0X0200.JT808CustomLocationAttachOriginalData.Add(attachId, reader.ReadArray(reader.ReaderCount-2, attachLen+2).ToArray()); - reader.Skip(attachLen); - } - else - { - reader.Skip(2); - jT808_0X0200.JT808UnknownLocationAttachOriginalData.Add(attachId, reader.ReadArray(reader.ReaderCount-2, attachLen+2).ToArray()); - reader.Skip(attachLen); - } - } - catch - { - try - { - byte attachId = reader.ReadByte(); - byte attachLen = reader.ReadByte(); - jT808_0X0200.JT808UnknownLocationAttachOriginalData.Add(attachId, reader.ReadArray(reader.ReaderCount - 2, attachLen+2).ToArray()); - reader.Skip(attachLen); - } - catch (Exception ex) - { - throw; - } - } - } - return jT808_0X0200; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200 value, IJT808Config config) - { - writer.WriteUInt32(value.AlarmFlag); - writer.WriteUInt32(value.StatusFlag); - //0x10000000 南纬 134217728 - //0x8000000 西经 ‭‬268435456 - //0x18000000 南纬-西经 134217728+268435456 - if (((value.StatusFlag >> 28) & 1) == 1) - { - uint lat=(uint)value.Lat; - writer.WriteUInt32(lat); - } - else - { - if (value.Lat < 0) - { - throw new JT808Exception(JT808ErrorCode.LatOrLngError, $"Lat {nameof(JT808_0x0200.StatusFlag)} ({value.StatusFlag}>>28) !=1"); - } - writer.WriteInt32(value.Lat); - } - if (((value.StatusFlag >> 27) & 1) == 1) - { - uint lng = (uint)value.Lng; - writer.WriteUInt32(lng); - } - else - { - if (value.Lng < 0) - { - throw new JT808Exception(JT808ErrorCode.LatOrLngError, $"Lng {nameof(JT808_0x0200.StatusFlag)} ({value.StatusFlag}>>29) !=1"); - } - writer.WriteInt32(value.Lng); - } - writer.WriteUInt16(value.Altitude); - writer.WriteUInt16(value.Speed); - writer.WriteUInt16(value.Direction); - writer.WriteDateTime6(value.GPSTime); - if (value.JT808LocationAttachData != null && value.JT808LocationAttachData.Count > 0) - { - foreach (var item in value.JT808LocationAttachData) - { - try - { - object attachImplObj = config.GetMessagePackFormatterByType(item.Value.GetType()); - JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(attachImplObj, ref writer,item.Value, config); - } - catch - { - - } - } - } - if (value.JT808CustomLocationAttachData != null && value.JT808CustomLocationAttachData.Count > 0) - { - foreach (var item in value.JT808CustomLocationAttachData) - { - object attachImplObj = config.GetMessagePackFormatterByType(item.Value.GetType()); - JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(attachImplObj, ref writer, item.Value, config); - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0201_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0201_Formatter.cs deleted file mode 100644 index b5baf15..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0201_Formatter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0201_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0201 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0201 jT808_0X0201 = new JT808_0x0201(); - jT808_0X0201.MsgNum = reader.ReadUInt16(); - jT808_0X0201.Position = config.GetMessagePackFormatter().Deserialize(ref reader, config); - return jT808_0X0201; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0201 value, IJT808Config config) - { - writer.WriteUInt16(value.MsgNum); - config.GetMessagePackFormatter().Serialize(ref writer,value.Position, config); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0301_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0301_Formatter.cs deleted file mode 100644 index 84dd00c..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0301_Formatter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0301_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0301 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0301 jT808_0X0301 = new JT808_0x0301(); - jT808_0X0301.EventId = reader.ReadByte(); - return jT808_0X0301; - } - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0301 value, IJT808Config config) - { - writer.WriteByte(value.EventId); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0302_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0302_Formatter.cs deleted file mode 100644 index ea1f2cd..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0302_Formatter.cs +++ /dev/null @@ -1,24 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0302_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0302 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0302 jT808_0X0302 = new JT808_0x0302(); - jT808_0X0302.ReplySNo = reader.ReadUInt16(); - jT808_0X0302.AnswerId = reader.ReadByte(); - return jT808_0X0302; - } - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0302 value, IJT808Config config) - { - writer.WriteUInt16(value.ReplySNo); - writer.WriteByte(value.AnswerId); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0303_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0303_Formatter.cs deleted file mode 100644 index 9355fcf..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0303_Formatter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0303_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0303 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0303 jT808_0X0303 = new JT808_0x0303(); - jT808_0X0303.InformationType = reader.ReadByte(); - jT808_0X0303.Flag = reader.ReadByte(); - return jT808_0X0303; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0303 value, IJT808Config config) - { - writer.WriteByte(value.InformationType); - writer.WriteByte(value.Flag); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0500_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0500_Formatter.cs deleted file mode 100644 index 0681db1..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0500_Formatter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0500_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0500 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0500 jT808_0X0500 = new JT808_0x0500(); - jT808_0X0500.MsgNum = reader.ReadUInt16(); - jT808_0X0500.JT808_0x0200 = config.GetMessagePackFormatter().Deserialize(ref reader, config); - return jT808_0X0500; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0500 value, IJT808Config config) - { - writer.WriteUInt16(value.MsgNum); - config.GetMessagePackFormatter().Serialize(ref writer, value.JT808_0x0200, config); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0701_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0701_Formatter.cs deleted file mode 100644 index 52cd25a..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0701_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0701_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0701 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0701 jT808_0X0701 = new JT808_0x0701(); - jT808_0X0701.ElectronicWaybillLength = reader.ReadUInt32(); - jT808_0X0701.ElectronicContent = reader.ReadArray((int)jT808_0X0701.ElectronicWaybillLength).ToArray(); - return jT808_0X0701; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0701 value, IJT808Config config) - { - writer.Skip(4, out int skipPosition); - object obj = config.GetMessagePackFormatterByType(value.ElectronicContentObj.GetType()); - JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(obj, ref writer, value.ElectronicContentObj, config); - int contentLength=writer.GetCurrentPosition()- skipPosition-4; - writer.WriteInt32Return(contentLength, skipPosition); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0702_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0702_Formatter.cs deleted file mode 100644 index 8185964..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0702_Formatter.cs +++ /dev/null @@ -1,52 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0702_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0702 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0702 jT808_0X0702 = new JT808_0x0702(); - jT808_0X0702.IC_Card_Status = (JT808ICCardStatus)reader.ReadByte(); - jT808_0X0702.IC_Card_PlugDateTime = reader.ReadDateTime6(); - if (jT808_0X0702.IC_Card_Status == JT808ICCardStatus.从业资格证IC卡插入_驾驶员上班) - { - jT808_0X0702.IC_Card_ReadResult = (JT808ICCardReadResult)reader.ReadByte(); - if (jT808_0X0702.IC_Card_ReadResult == JT808ICCardReadResult.IC卡读卡成功) - { - jT808_0X0702.DriverUserNameLength = reader.ReadByte(); - jT808_0X0702.DriverUserName = reader.ReadString( jT808_0X0702.DriverUserNameLength); - jT808_0X0702.QualificationCode = reader.ReadString(20); - jT808_0X0702.LicenseIssuingLength = reader.ReadByte(); - jT808_0X0702.LicenseIssuing = reader.ReadString(jT808_0X0702.LicenseIssuingLength); - jT808_0X0702.CertificateExpiresDate = reader.ReadDateTime4(); - } - } - return jT808_0X0702; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0702 value, IJT808Config config) - { - writer.WriteByte((byte)value.IC_Card_Status); - writer.WriteDateTime6(value.IC_Card_PlugDateTime); - if (value.IC_Card_Status == JT808ICCardStatus.从业资格证IC卡插入_驾驶员上班) - { - writer.WriteByte((byte)value.IC_Card_ReadResult); - if (value.IC_Card_ReadResult == JT808ICCardReadResult.IC卡读卡成功) - { - writer.WriteByte((byte)value.DriverUserName.Length); - writer.WriteString(value.DriverUserName); - writer.WriteString( value.QualificationCode.PadRight(20, '0')); - writer.WriteByte((byte)value.LicenseIssuing.Length); - writer.WriteString(value.LicenseIssuing); - writer.WriteDateTime4(value.CertificateExpiresDate); - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0704_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0704_Formatter.cs deleted file mode 100644 index 33f9578..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0704_Formatter.cs +++ /dev/null @@ -1,56 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0704_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0704 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0704 jT808_0X0704 = new JT808_0x0704(); - jT808_0X0704.Count = reader.ReadUInt16(); - jT808_0X0704.LocationType = (JT808_0x0704.BatchLocationType)reader.ReadByte(); - List jT808_0X0200s = new List(); - for (int i = 0; i < jT808_0X0704.Count; i++) - { - int buflen = reader.ReadUInt16(); - try - { - JT808MessagePackReader tmpReader = new JT808MessagePackReader(reader.ReadArray(buflen)); - JT808_0x0200 jT808_0X0200 = config.GetMessagePackFormatter().Deserialize(ref tmpReader, config); - jT808_0X0200s.Add(jT808_0X0200); - } - catch (Exception) - { - - } - } - jT808_0X0704.Positions = jT808_0X0200s; - return jT808_0X0704; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0704 value, IJT808Config config) - { - writer.WriteUInt16(value.Count); - writer.WriteByte((byte)value.LocationType); - foreach (var item in value?.Positions) - { - try - { - writer.Skip(2, out int position); - config.GetMessagePackFormatter().Serialize(ref writer, item, config); - ushort length = (ushort)(writer.GetCurrentPosition() - position - 2); - writer.WriteUInt16Return(length, position); - } - catch (Exception) - { - - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0705_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0705_Formatter.cs deleted file mode 100644 index a95cbe1..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0705_Formatter.cs +++ /dev/null @@ -1,60 +0,0 @@ -using JT808.Protocol.Exceptions; -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Metadata; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0705_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0705 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0705 jT808_0X0705 = new JT808_0x0705(); - jT808_0X0705.CanItemCount = reader.ReadUInt16(); - jT808_0X0705.FirstCanReceiveTime = reader.ReadDateTime5(); - jT808_0X0705.CanItems = new List(); - for (var i = 0; i < jT808_0X0705.CanItemCount; i++) - { - JT808CanProperty jT808CanProperty = new JT808CanProperty(); - jT808CanProperty.CanId = reader.ReadArray(4).ToArray(); - if (jT808CanProperty.CanId.Length != 4) - { - throw new JT808Exception(Enums.JT808ErrorCode.NotEnoughLength, $"{nameof(jT808CanProperty.CanId)}->4"); - } - jT808CanProperty.CanData = reader.ReadArray(8).ToArray(); - if (jT808CanProperty.CanData.Length != 8) - { - throw new JT808Exception(Enums.JT808ErrorCode.NotEnoughLength, $"{nameof(jT808CanProperty.CanData)}->8"); - } - jT808_0X0705.CanItems.Add(jT808CanProperty); - } - return jT808_0X0705; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0705 value, IJT808Config config) - { - if (value.CanItems != null && value.CanItems.Count > 0) - { - writer.WriteUInt16((ushort)value.CanItems.Count); - writer.WriteDateTime5(value.FirstCanReceiveTime); - foreach (var item in value.CanItems) - { - if (item.CanId.Length != 4) - { - throw new JT808Exception(Enums.JT808ErrorCode.NotEnoughLength, $"{nameof(item.CanId)}->4"); - } - writer.WriteArray(item.CanId); - if (item.CanData.Length != 8) - { - throw new JT808Exception(Enums.JT808ErrorCode.NotEnoughLength, $"{nameof(item.CanData)}->8"); - } - writer.WriteArray(item.CanData); - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0800_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0800_Formatter.cs deleted file mode 100644 index 0e2356e..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0800_Formatter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0800_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0800 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0800 jT808_0X0800 = new JT808_0x0800(); - jT808_0X0800.MultimediaId = reader.ReadUInt32(); - jT808_0X0800.MultimediaType = reader.ReadByte(); - jT808_0X0800.MultimediaCodingFormat = reader.ReadByte(); - jT808_0X0800.EventItemCoding = reader.ReadByte(); - jT808_0X0800.ChannelId = reader.ReadByte(); - return jT808_0X0800; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0800 value, IJT808Config config) - { - writer.WriteUInt32(value.MultimediaId); - writer.WriteByte(value.MultimediaType); - writer.WriteByte(value.MultimediaCodingFormat); - writer.WriteByte(value.EventItemCoding); - writer.WriteByte(value.ChannelId); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0801_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0801_Formatter.cs deleted file mode 100644 index e3e7088..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0801_Formatter.cs +++ /dev/null @@ -1,36 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0801_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0801 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0801 jT808_0X0801 = new JT808_0x0801(); - jT808_0X0801.MultimediaId = reader.ReadUInt32(); - jT808_0X0801.MultimediaType = reader.ReadByte(); - jT808_0X0801.MultimediaCodingFormat = reader.ReadByte(); - jT808_0X0801.EventItemCoding = reader.ReadByte(); - jT808_0X0801.ChannelId = reader.ReadByte(); - JT808MessagePackReader positionReader = new JT808MessagePackReader(reader.ReadArray(28)); - jT808_0X0801.Position = config.GetMessagePackFormatter().Deserialize(ref positionReader, config); - jT808_0X0801.MultimediaDataPackage = reader.ReadContent().ToArray(); - return jT808_0X0801; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0801 value, IJT808Config config) - { - writer.WriteUInt32(value.MultimediaId); - writer.WriteByte(value.MultimediaType); - writer.WriteByte(value.MultimediaCodingFormat); - writer.WriteByte(value.EventItemCoding); - writer.WriteByte(value.ChannelId); - config.GetMessagePackFormatter().Serialize(ref writer, value.Position, config); - writer.WriteArray(value.MultimediaDataPackage); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0802_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0802_Formatter.cs deleted file mode 100644 index 38f91fe..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0802_Formatter.cs +++ /dev/null @@ -1,47 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.Metadata; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0802_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0802 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0802 JT808_0x0802 = new JT808_0x0802(); - JT808_0x0802.MsgNum = reader.ReadUInt16(); - JT808_0x0802.MultimediaItemCount = reader.ReadUInt16(); - JT808_0x0802.MultimediaSearchItems = new List(); - for (var i = 0; i < JT808_0x0802.MultimediaItemCount; i++) - { - JT808MultimediaSearchProperty jT808MultimediaSearchProperty = new JT808MultimediaSearchProperty(); - jT808MultimediaSearchProperty.MultimediaId = reader.ReadUInt32(); - jT808MultimediaSearchProperty.MultimediaType = reader.ReadByte(); - jT808MultimediaSearchProperty.ChannelId = reader.ReadByte(); - jT808MultimediaSearchProperty.EventItemCoding = reader.ReadByte(); - JT808MessagePackReader positionReader = new JT808MessagePackReader(reader.ReadArray(28)); - jT808MultimediaSearchProperty.Position = config.GetMessagePackFormatter().Deserialize(ref positionReader, config); - JT808_0x0802.MultimediaSearchItems.Add(jT808MultimediaSearchProperty); - } - return JT808_0x0802; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0802 value, IJT808Config config) - { - writer.WriteUInt16(value.MsgNum); - writer.WriteUInt16((ushort)value.MultimediaSearchItems.Count); - foreach (var item in value.MultimediaSearchItems) - { - writer.WriteUInt32(item.MultimediaId); - writer.WriteByte(item.MultimediaType); - writer.WriteByte(item.ChannelId); - writer.WriteByte(item.EventItemCoding); - config.GetMessagePackFormatter().Serialize(ref writer,item.Position, config); - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0805_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0805_Formatter.cs deleted file mode 100644 index 80d1bc8..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0805_Formatter.cs +++ /dev/null @@ -1,38 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0805_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0805 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0805 jT808_0X0805 = new JT808_0x0805(); - jT808_0X0805.MsgNum = reader.ReadUInt16(); - jT808_0X0805.Result = reader.ReadByte(); - jT808_0X0805.MultimediaIdCount = reader.ReadUInt16(); - jT808_0X0805.MultimediaIds = new List(); - for (var i = 0; i < jT808_0X0805.MultimediaIdCount; i++) - { - uint id = reader.ReadUInt32(); - jT808_0X0805.MultimediaIds.Add(id); - } - return jT808_0X0805; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0805 value, IJT808Config config) - { - writer.WriteUInt16(value.MsgNum); - writer.WriteByte(value.Result); - writer.WriteUInt16((ushort)value.MultimediaIds.Count); - foreach (var item in value.MultimediaIds) - { - writer.WriteUInt32(item); - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0900_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0900_Formatter.cs deleted file mode 100644 index 0ae8b53..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0900_Formatter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0900_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0900 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0900 jT808_0X0900 = new JT808_0x0900(); - jT808_0X0900.PassthroughType = reader.ReadByte(); - jT808_0X0900.PassthroughData = reader.ReadContent().ToArray(); ; - return jT808_0X0900; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0900 value, IJT808Config config) - { - writer.WriteByte(value.PassthroughType); - object obj = config.GetMessagePackFormatterByType(value.JT808_0x0900_BodyBase.GetType()); - JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(obj, ref writer, value.JT808_0x0900_BodyBase, config); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0901_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0901_Formatter.cs deleted file mode 100644 index f44bf5c..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0901_Formatter.cs +++ /dev/null @@ -1,28 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0901_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0901 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0901 jT808_0X0901 = new JT808_0x0901(); - var compressMessageLength = reader.ReadUInt32(); - var data = reader.ReadArray((int)compressMessageLength); - jT808_0X0901.UnCompressMessage = config.Compress.Decompress(data.ToArray()); - jT808_0X0901.UnCompressMessageLength = (uint)jT808_0X0901.UnCompressMessage.Length; - return jT808_0X0901; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0901 value, IJT808Config config) - { - var data = config.Compress.Compress(value.UnCompressMessage); - writer.WriteUInt32((uint)data.Length); - writer.WriteArray(data); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0A00_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0A00_Formatter.cs deleted file mode 100644 index b0deaf6..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x0A00_Formatter.cs +++ /dev/null @@ -1,36 +0,0 @@ -using JT808.Protocol.Exceptions; -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x0A00_Formatter : IJT808MessagePackFormatter - { - public JT808_0x0A00 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0A00 jT808_0X0A00 = new JT808_0x0A00 - { - E = reader.ReadUInt32(), - N = reader.ReadArray(128).ToArray() - }; - if (jT808_0X0A00.N.Length != 128) - { - throw new JT808Exception(Enums.JT808ErrorCode.NotEnoughLength, $"{nameof(jT808_0X0A00.N)}->128"); - } - return jT808_0X0A00; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0A00 value, IJT808Config config) - { - writer.WriteUInt32(value.E); - if (value.N.Length != 128) - { - throw new JT808Exception(Enums.JT808ErrorCode.NotEnoughLength, $"{nameof(value.N)}->128"); - } - writer.WriteArray(value.N); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8001_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8001_Formatter.cs deleted file mode 100644 index 63067ac..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8001_Formatter.cs +++ /dev/null @@ -1,28 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8001_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8001 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8001 jT808_0X8001 = new JT808_0x8001(); - jT808_0X8001.MsgNum = reader.ReadUInt16(); - jT808_0X8001.MsgId = reader.ReadUInt16(); - jT808_0X8001.JT808PlatformResult = (JT808PlatformResult)reader.ReadByte(); - return jT808_0X8001; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8001 value, IJT808Config config) - { - writer.WriteUInt16(value.MsgNum); - writer.WriteUInt16(value.MsgId); - writer.WriteByte((byte)value.JT808PlatformResult); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8003_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8003_Formatter.cs deleted file mode 100644 index 8e7513b..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8003_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8003_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8003 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8003 jT808_0X8003 = new JT808_0x8003(); - jT808_0X8003.OriginalMsgNum = reader.ReadUInt16(); - jT808_0X8003.AgainPackageCount = reader.ReadByte(); - jT808_0X8003.AgainPackageData = reader.ReadArray(jT808_0X8003.AgainPackageCount * 2).ToArray(); - return jT808_0X8003; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8003 value, IJT808Config config) - { - writer.WriteUInt16(value.OriginalMsgNum); - writer.WriteByte((byte)(value.AgainPackageData.Length / 2)); - writer.WriteArray(value.AgainPackageData); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8100_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8100_Formatter.cs deleted file mode 100644 index 5b8a5d5..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8100_Formatter.cs +++ /dev/null @@ -1,36 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8100_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8100 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8100 jT808_0X8100 = new JT808_0x8100(); - jT808_0X8100.MsgNum = reader.ReadUInt16(); - jT808_0X8100.JT808TerminalRegisterResult = (JT808TerminalRegisterResult)reader.ReadByte(); - // 只有在成功后才有该字段 - if (jT808_0X8100.JT808TerminalRegisterResult == JT808TerminalRegisterResult.成功) - { - jT808_0X8100.Code = reader.ReadRemainStringContent(); - } - return jT808_0X8100; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8100 value, IJT808Config config) - { - writer.WriteUInt16(value.MsgNum); - writer.WriteByte((byte)value.JT808TerminalRegisterResult); - // 只有在成功后才有该字段 - if (value.JT808TerminalRegisterResult == JT808TerminalRegisterResult.成功) - { - writer.WriteString(value.Code); - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0001_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0001_Formatter.cs deleted file mode 100644 index 8ca5346..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0001_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0001_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0001 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0001 jT808_0x8103_0x0001 = new JT808_0x8103_0x0001(); - jT808_0x8103_0x0001.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0001.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0001.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0001; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0001 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0002_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0002_Formatter.cs deleted file mode 100644 index ee8c89e..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0002_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0002_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0002 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0002 jT808_0x8103_0x0002 = new JT808_0x8103_0x0002(); - jT808_0x8103_0x0002.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0002.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0002.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0002; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0002 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0003_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0003_Formatter.cs deleted file mode 100644 index 8ee4429..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0003_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0003_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0003 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0003 jT808_0x8103_0x0003 = new JT808_0x8103_0x0003(); - jT808_0x8103_0x0003.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0003.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0003.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0003; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0003 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0004_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0004_Formatter.cs deleted file mode 100644 index 24e1033..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0004_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0004_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0004 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0004 jT808_0x8103_0x0004 = new JT808_0x8103_0x0004(); - jT808_0x8103_0x0004.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0004.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0004.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0004; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0004 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0005_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0005_Formatter.cs deleted file mode 100644 index 07cc5e3..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0005_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0005_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0005 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0005 jT808_0x8103_0x0005 = new JT808_0x8103_0x0005(); - jT808_0x8103_0x0005.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0005.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0005.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0005; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0005 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0006_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0006_Formatter.cs deleted file mode 100644 index 7b2a1b5..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0006_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0006_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0006 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0006 jT808_0x8103_0x0006 = new JT808_0x8103_0x0006(); - jT808_0x8103_0x0006.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0006.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0006.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0006; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0006 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0007_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0007_Formatter.cs deleted file mode 100644 index 5c857a8..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0007_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0007_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0007 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0007 jT808_0x8103_0x0007 = new JT808_0x8103_0x0007(); - jT808_0x8103_0x0007.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0007.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0007.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0007; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0007 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0010_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0010_Formatter.cs deleted file mode 100644 index c8d3264..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0010_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0010_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0010 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0010 jT808_0x8103_0x0010 = new JT808_0x8103_0x0010(); - jT808_0x8103_0x0010.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0010.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0010.ParamValue = reader.ReadString(jT808_0x8103_0x0010.ParamLength); - return jT808_0x8103_0x0010; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0010 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0011_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0011_Formatter.cs deleted file mode 100644 index 0d81c5d..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0011_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0011_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0011 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0011 jT808_0x8103_0x0011 = new JT808_0x8103_0x0011(); - jT808_0x8103_0x0011.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0011.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0011.ParamValue = reader.ReadString( jT808_0x8103_0x0011.ParamLength); - return jT808_0x8103_0x0011; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0011 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0012_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0012_Formatter.cs deleted file mode 100644 index 286a81d..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0012_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0012_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0012 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0012 jT808_0x8103_0x0012 = new JT808_0x8103_0x0012(); - jT808_0x8103_0x0012.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0012.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0012.ParamValue = reader.ReadString(jT808_0x8103_0x0012.ParamLength); - return jT808_0x8103_0x0012; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0012 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0013_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0013_Formatter.cs deleted file mode 100644 index 22eabe9..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0013_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0013_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0013 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0013 jT808_0x8103_0x0013 = new JT808_0x8103_0x0013(); - jT808_0x8103_0x0013.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0013.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0013.ParamValue = reader.ReadString(jT808_0x8103_0x0013.ParamLength); - return jT808_0x8103_0x0013; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0013 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0014_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0014_Formatter.cs deleted file mode 100644 index cb5adfd..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0014_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0014_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0014 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0014 jT808_0x8103_0x0014 = new JT808_0x8103_0x0014(); - jT808_0x8103_0x0014.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0014.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0014.ParamValue = reader.ReadString( jT808_0x8103_0x0014.ParamLength); - return jT808_0x8103_0x0014; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0014 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0015_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0015_Formatter.cs deleted file mode 100644 index 98d1b8f..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0015_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0015_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0015 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0015 jT808_0x8103_0x0015 = new JT808_0x8103_0x0015(); - jT808_0x8103_0x0015.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0015.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0015.ParamValue = reader.ReadString(jT808_0x8103_0x0015.ParamLength); - return jT808_0x8103_0x0015; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0015 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0016_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0016_Formatter.cs deleted file mode 100644 index b14df16..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0016_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0016_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0016 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0016 jT808_0x8103_0x0016 = new JT808_0x8103_0x0016(); - jT808_0x8103_0x0016.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0016.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0016.ParamValue = reader.ReadString(jT808_0x8103_0x0016.ParamLength); - return jT808_0x8103_0x0016; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0016 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0017_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0017_Formatter.cs deleted file mode 100644 index 34f3890..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0017_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0017_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0017 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0017 jT808_0x8103_0x0017 = new JT808_0x8103_0x0017(); - jT808_0x8103_0x0017.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0017.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0017.ParamValue = reader.ReadString(jT808_0x8103_0x0017.ParamLength); - return jT808_0x8103_0x0017; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0017 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0018_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0018_Formatter.cs deleted file mode 100644 index 30f862f..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0018_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0018_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0018 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0018 jT808_0x8103_0x0018 = new JT808_0x8103_0x0018(); - jT808_0x8103_0x0018.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0018.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0018.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0018; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0018 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0019_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0019_Formatter.cs deleted file mode 100644 index 5ccd7a8..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0019_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0019_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0019 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0019 jT808_0x8103_0x0019 = new JT808_0x8103_0x0019(); - jT808_0x8103_0x0019.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0019.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0019.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0019; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0019 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001A_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001A_Formatter.cs deleted file mode 100644 index 4b0327a..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001A_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x001A_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x001A Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x001A jT808_0x8103_0x001A = new JT808_0x8103_0x001A(); - jT808_0x8103_0x001A.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x001A.ParamLength = reader.ReadByte(); - jT808_0x8103_0x001A.ParamValue = reader.ReadString( jT808_0x8103_0x001A.ParamLength); - return jT808_0x8103_0x001A; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x001A value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001B_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001B_Formatter.cs deleted file mode 100644 index 2edec78..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001B_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x001B_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x001B Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x001B jT808_0x8103_0x001B = new JT808_0x8103_0x001B(); - jT808_0x8103_0x001B.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x001B.ParamLength = reader.ReadByte(); - jT808_0x8103_0x001B.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x001B; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x001B value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001C_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001C_Formatter.cs deleted file mode 100644 index 57b1156..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001C_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x001C_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x001C Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x001C jT808_0x8103_0x001C = new JT808_0x8103_0x001C(); - jT808_0x8103_0x001C.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x001C.ParamLength = reader.ReadByte(); - jT808_0x8103_0x001C.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x001C; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x001C value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001D_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001D_Formatter.cs deleted file mode 100644 index 25d6d64..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x001D_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x001D_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x001D Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x001D jT808_0x8103_0x001D = new JT808_0x8103_0x001D(); - jT808_0x8103_0x001D.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x001D.ParamLength = reader.ReadByte(); - jT808_0x8103_0x001D.ParamValue = reader.ReadString(jT808_0x8103_0x001D.ParamLength); - return jT808_0x8103_0x001D; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x001D value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0020_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0020_Formatter.cs deleted file mode 100644 index 1686266..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0020_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0020_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0020 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0020 jT808_0x8103_0x0020 = new JT808_0x8103_0x0020(); - jT808_0x8103_0x0020.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0020.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0020.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0020; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0020 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0021_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0021_Formatter.cs deleted file mode 100644 index ad2a472..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0021_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using System; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0021_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0021 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0021 jT808_0x8103_0x0021 = new JT808_0x8103_0x0021(); - jT808_0x8103_0x0021.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0021.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0021.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0021; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0021 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0022_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0022_Formatter.cs deleted file mode 100644 index 4e7f0dd..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0022_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0022_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0022 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0022 jT808_0x8103_0x0022 = new JT808_0x8103_0x0022(); - jT808_0x8103_0x0022.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0022.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0022.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0022; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0022 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0027_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0027_Formatter.cs deleted file mode 100644 index 5046401..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0027_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0027_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0027 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0027 jT808_0x8103_0x0027 = new JT808_0x8103_0x0027(); - jT808_0x8103_0x0027.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0027.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0027.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0027; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0027 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0028_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0028_Formatter.cs deleted file mode 100644 index e7e4763..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0028_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0028_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0028 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0028 jT808_0x8103_0x0028 = new JT808_0x8103_0x0028(); - jT808_0x8103_0x0028.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0028.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0028.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0028; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0028 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0029_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0029_Formatter.cs deleted file mode 100644 index 1943d82..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0029_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0029_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0029 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0029 jT808_0x8103_0x0029 = new JT808_0x8103_0x0029(); - jT808_0x8103_0x0029.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0029.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0029.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0029; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0029 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002C_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002C_Formatter.cs deleted file mode 100644 index f2b37e9..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002C_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x002C_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x002C Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x002C jT808_0x8103_0x002C = new JT808_0x8103_0x002C(); - jT808_0x8103_0x002C.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x002C.ParamLength = reader.ReadByte(); - jT808_0x8103_0x002C.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x002C; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x002C value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002D_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002D_Formatter.cs deleted file mode 100644 index 6ffa8ce..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002D_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x002D_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x002D Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x002D jT808_0x8103_0x002D = new JT808_0x8103_0x002D(); - jT808_0x8103_0x002D.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x002D.ParamLength = reader.ReadByte(); - jT808_0x8103_0x002D.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x002D; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x002D value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002E_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002E_Formatter.cs deleted file mode 100644 index b4f00eb..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002E_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x002E_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x002E Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x002E jT808_0x8103_0x002E = new JT808_0x8103_0x002E(); - jT808_0x8103_0x002E.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x002E.ParamLength = reader.ReadByte(); - jT808_0x8103_0x002E.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x002E; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x002E value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002F_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002F_Formatter.cs deleted file mode 100644 index 68c190f..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x002F_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x002F_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x002F Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x002F jT808_0x8103_0x002F = new JT808_0x8103_0x002F(); - jT808_0x8103_0x002F.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x002F.ParamLength = reader.ReadByte(); - jT808_0x8103_0x002F.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x002F; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x002F value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0030_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0030_Formatter.cs deleted file mode 100644 index 708d157..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0030_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0030_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0030 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0030 jT808_0x8103_0x0030 = new JT808_0x8103_0x0030(); - jT808_0x8103_0x0030.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0030.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0030.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0030; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0030 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0031_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0031_Formatter.cs deleted file mode 100644 index fd6ff98..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0031_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0031_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0031 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0031 jT808_0x8103_0x0031 = new JT808_0x8103_0x0031(); - jT808_0x8103_0x0031.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0031.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0031.ParamValue = reader.ReadUInt16(); - return jT808_0x8103_0x0031; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0031 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt16(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0040_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0040_Formatter.cs deleted file mode 100644 index a077658..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0040_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0040_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0040 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0040 jT808_0x8103_0x0040 = new JT808_0x8103_0x0040(); - jT808_0x8103_0x0040.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0040.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0040.ParamValue = reader.ReadString( jT808_0x8103_0x0040.ParamLength); - return jT808_0x8103_0x0040; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0040 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0041_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0041_Formatter.cs deleted file mode 100644 index a5eba3d..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0041_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0041_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0041 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0041 jT808_0x8103_0x0041 = new JT808_0x8103_0x0041(); - jT808_0x8103_0x0041.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0041.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0041.ParamValue = reader.ReadString( jT808_0x8103_0x0041.ParamLength); - return jT808_0x8103_0x0041; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0041 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0042_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0042_Formatter.cs deleted file mode 100644 index 38f5b3a..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0042_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0042_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0042 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0042 jT808_0x8103_0x0042 = new JT808_0x8103_0x0042(); - jT808_0x8103_0x0042.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0042.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0042.ParamValue = reader.ReadString(jT808_0x8103_0x0042.ParamLength); - return jT808_0x8103_0x0042; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0042 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0043_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0043_Formatter.cs deleted file mode 100644 index 593e6a8..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0043_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0043_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0043 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0043 jT808_0x8103_0x0043 = new JT808_0x8103_0x0043(); - jT808_0x8103_0x0043.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0043.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0043.ParamValue = reader.ReadString(jT808_0x8103_0x0043.ParamLength); - return jT808_0x8103_0x0043; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0043 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0044_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0044_Formatter.cs deleted file mode 100644 index 5f3871a..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0044_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0044_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0044 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0044 jT808_0x8103_0x0044 = new JT808_0x8103_0x0044(); - jT808_0x8103_0x0044.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0044.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0044.ParamValue = reader.ReadString(jT808_0x8103_0x0044.ParamLength); - return jT808_0x8103_0x0044; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0044 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0045_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0045_Formatter.cs deleted file mode 100644 index 306916b..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0045_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0045_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0045 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0045 jT808_0x8103_0x0045 = new JT808_0x8103_0x0045(); - jT808_0x8103_0x0045.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0045.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0045.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0045; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0045 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0046_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0046_Formatter.cs deleted file mode 100644 index 2e0a914..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0046_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0046_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0046 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0046 jT808_0x8103_0x0046 = new JT808_0x8103_0x0046(); - jT808_0x8103_0x0046.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0046.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0046.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0046; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0046 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0047_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0047_Formatter.cs deleted file mode 100644 index 73d7251..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0047_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0047_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0047 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0047 jT808_0x8103_0x0047 = new JT808_0x8103_0x0047(); - jT808_0x8103_0x0047.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0047.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0047.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0047; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0047 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0048_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0048_Formatter.cs deleted file mode 100644 index 7edac0a..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0048_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0048_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0048 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0048 jT808_0x8103_0x0048 = new JT808_0x8103_0x0048(); - jT808_0x8103_0x0048.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0048.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0048.ParamValue = reader.ReadString(jT808_0x8103_0x0048.ParamLength); - return jT808_0x8103_0x0048; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0048 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0049_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0049_Formatter.cs deleted file mode 100644 index 24e3019..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0049_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0049_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0049 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0049 jT808_0x8103_0x0049 = new JT808_0x8103_0x0049(); - jT808_0x8103_0x0049.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0049.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0049.ParamValue = reader.ReadString( jT808_0x8103_0x0049.ParamLength); - return jT808_0x8103_0x0049; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0049 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0050_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0050_Formatter.cs deleted file mode 100644 index 4ecacbc..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0050_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0050_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0050 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0050 jT808_0x8103_0x0050 = new JT808_0x8103_0x0050(); - jT808_0x8103_0x0050.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0050.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0050.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0050; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0050 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0051_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0051_Formatter.cs deleted file mode 100644 index dfab89a..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0051_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0051_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0051 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0051 jT808_0x8103_0x0051 = new JT808_0x8103_0x0051(); - jT808_0x8103_0x0051.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0051.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0051.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0051; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0051 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0052_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0052_Formatter.cs deleted file mode 100644 index cd39961..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0052_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0052_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0052 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0052 jT808_0x8103_0x0052 = new JT808_0x8103_0x0052(); - jT808_0x8103_0x0052.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0052.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0052.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0052; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0052 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0053_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0053_Formatter.cs deleted file mode 100644 index 937a9a8..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0053_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0053_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0053 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0053 jT808_0x8103_0x0053 = new JT808_0x8103_0x0053(); - jT808_0x8103_0x0053.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0053.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0053.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0053; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0053 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0054_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0054_Formatter.cs deleted file mode 100644 index 0692771..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0054_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0054_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0054 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0054 jT808_0x8103_0x0054 = new JT808_0x8103_0x0054(); - jT808_0x8103_0x0054.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0054.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0054.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0054; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0054 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0055_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0055_Formatter.cs deleted file mode 100644 index 7f8084f..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0055_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0055_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0055 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0055 jT808_0x8103_0x0055 = new JT808_0x8103_0x0055(); - jT808_0x8103_0x0055.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0055.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0055.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0055; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0055 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0056_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0056_Formatter.cs deleted file mode 100644 index 532c01c..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0056_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0056_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0056 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0056 jT808_0x8103_0x0056 = new JT808_0x8103_0x0056(); - jT808_0x8103_0x0056.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0056.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0056.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0056; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0056 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0057_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0057_Formatter.cs deleted file mode 100644 index 936522e..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0057_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0057_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0057 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0057 jT808_0x8103_0x0057 = new JT808_0x8103_0x0057(); - jT808_0x8103_0x0057.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0057.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0057.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0057; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0057 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0058_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0058_Formatter.cs deleted file mode 100644 index 7f9b1f9..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0058_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0058_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0058 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0058 jT808_0x8103_0x0058 = new JT808_0x8103_0x0058(); - jT808_0x8103_0x0058.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0058.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0058.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0058; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0058 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0059_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0059_Formatter.cs deleted file mode 100644 index 0aef393..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0059_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0059_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0059 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0059 jT808_0x8103_0x0059 = new JT808_0x8103_0x0059(); - jT808_0x8103_0x0059.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0059.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0059.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0059; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0059 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005A_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005A_Formatter.cs deleted file mode 100644 index e70d25a..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005A_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x005A_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x005A Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x005A jT808_0x8103_0x005A = new JT808_0x8103_0x005A(); - jT808_0x8103_0x005A.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x005A.ParamLength = reader.ReadByte(); - jT808_0x8103_0x005A.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x005A; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x005A value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005B_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005B_Formatter.cs deleted file mode 100644 index 7969dc5..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005B_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x005B_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x005B Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x005B jT808_0x8103_0x005B = new JT808_0x8103_0x005B(); - jT808_0x8103_0x005B.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x005B.ParamLength = reader.ReadByte(); - jT808_0x8103_0x005B.ParamValue = reader.ReadUInt16(); - return jT808_0x8103_0x005B; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x005B value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt16(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005C_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005C_Formatter.cs deleted file mode 100644 index d4a929c..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005C_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x005C_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x005C Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x005C jT808_0x8103_0x005C = new JT808_0x8103_0x005C(); - jT808_0x8103_0x005C.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x005C.ParamLength = reader.ReadByte(); - jT808_0x8103_0x005C.ParamValue = reader.ReadUInt16(); - return jT808_0x8103_0x005C; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x005C value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt16(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005D_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005D_Formatter.cs deleted file mode 100644 index 5859a98..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005D_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x005D_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x005D Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x005D jT808_0x8103_0x005D = new JT808_0x8103_0x005D(); - jT808_0x8103_0x005D.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x005D.ParamLength = reader.ReadByte(); - jT808_0x8103_0x005D.ParamValue = reader.ReadUInt16(); - return jT808_0x8103_0x005D; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x005D value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt16(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005E_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005E_Formatter.cs deleted file mode 100644 index 11782b9..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x005E_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x005E_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x005E Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x005E jT808_0x8103_0x005E = new JT808_0x8103_0x005E(); - jT808_0x8103_0x005E.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x005E.ParamLength = reader.ReadByte(); - jT808_0x8103_0x005E.ParamValue = reader.ReadUInt16(); - return jT808_0x8103_0x005E; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x005E value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt16(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0064_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0064_Formatter.cs deleted file mode 100644 index 2098dbf..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0064_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0064_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0064 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0064 jT808_0x8103_0x0064 = new JT808_0x8103_0x0064(); - jT808_0x8103_0x0064.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0064.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0064.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0064; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0064 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0065_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0065_Formatter.cs deleted file mode 100644 index 23925e6..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0065_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0065_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0065 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0065 jT808_0x8103_0x0065 = new JT808_0x8103_0x0065(); - jT808_0x8103_0x0065.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0065.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0065.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0065; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0065 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0070_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0070_Formatter.cs deleted file mode 100644 index 649f021..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0070_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0070_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0070 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0070 jT808_0x8103_0x0070 = new JT808_0x8103_0x0070(); - jT808_0x8103_0x0070.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0070.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0070.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0070; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0070 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0071_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0071_Formatter.cs deleted file mode 100644 index 5461352..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0071_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0071_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0071 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0071 jT808_0x8103_0x0071 = new JT808_0x8103_0x0071(); - jT808_0x8103_0x0071.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0071.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0071.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0071; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0071 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0072_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0072_Formatter.cs deleted file mode 100644 index 895666c..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0072_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0072_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0072 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0072 jT808_0x8103_0x0072 = new JT808_0x8103_0x0072(); - jT808_0x8103_0x0072.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0072.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0072.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0072; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0072 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0073_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0073_Formatter.cs deleted file mode 100644 index d3c9989..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0073_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0073_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0073 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0073 jT808_0x8103_0x0073 = new JT808_0x8103_0x0073(); - jT808_0x8103_0x0073.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0073.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0073.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0073; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0073 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0074_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0074_Formatter.cs deleted file mode 100644 index e889a76..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0074_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0074_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0074 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0074 jT808_0x8103_0x0074 = new JT808_0x8103_0x0074(); - jT808_0x8103_0x0074.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0074.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0074.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0074; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0074 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0080_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0080_Formatter.cs deleted file mode 100644 index dc82d7e..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0080_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0080_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0080 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0080 jT808_0x8103_0x0080 = new JT808_0x8103_0x0080(); - jT808_0x8103_0x0080.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0080.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0080.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0080; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0080 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0081_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0081_Formatter.cs deleted file mode 100644 index d1ff8b7..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0081_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0081_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0081 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0081 jT808_0x8103_0x0081 = new JT808_0x8103_0x0081(); - jT808_0x8103_0x0081.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0081.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0081.ParamValue = reader.ReadUInt16(); - return jT808_0x8103_0x0081; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0081 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt16(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0082_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0082_Formatter.cs deleted file mode 100644 index 44ae17a..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0082_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0082_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0082 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0082 jT808_0x8103_0x0082 = new JT808_0x8103_0x0082(); - jT808_0x8103_0x0082.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0082.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0082.ParamValue = reader.ReadUInt16(); - return jT808_0x8103_0x0082; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0082 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt16(value.ParamValue); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0083_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0083_Formatter.cs deleted file mode 100644 index 0bca2cb..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0083_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0083_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0083 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0083 jT808_0x8103_0x0083 = new JT808_0x8103_0x0083(); - jT808_0x8103_0x0083.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0083.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0083.ParamValue = reader.ReadString(jT808_0x8103_0x0083.ParamLength); - return jT808_0x8103_0x0083; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0083 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out int skipPosition); - writer.WriteString(value.ParamValue); - int length = writer.GetCurrentPosition() - skipPosition - 1; - writer.WriteByteReturn((byte)length, skipPosition); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0084_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0084_Formatter.cs deleted file mode 100644 index 4ab1ab9..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0084_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0084_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0084 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0084 jT808_0x8103_0x0084 = new JT808_0x8103_0x0084(); - jT808_0x8103_0x0084.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0084.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0084.ParamValue = reader.ReadByte(); - return jT808_0x8103_0x0084; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0084 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteByte(value.ParamValue); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0090_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0090_Formatter.cs deleted file mode 100644 index 6b1ffc2..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0090_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0090_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0090 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0090 jT808_0x8103_0x0090 = new JT808_0x8103_0x0090(); - jT808_0x8103_0x0090.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0090.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0090.ParamValue = reader.ReadByte(); - return jT808_0x8103_0x0090; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0090 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteByte(value.ParamValue); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0091_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0091_Formatter.cs deleted file mode 100644 index c43f154..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0091_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0091_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0091 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0091 jT808_0x8103_0x0091 = new JT808_0x8103_0x0091(); - jT808_0x8103_0x0091.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0091.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0091.ParamValue = reader.ReadByte(); - return jT808_0x8103_0x0091; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0091 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteByte(value.ParamValue); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0092_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0092_Formatter.cs deleted file mode 100644 index 09e1c1f..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0092_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0092_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0092 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0092 jT808_0x8103_0x0092 = new JT808_0x8103_0x0092(); - jT808_0x8103_0x0092.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0092.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0092.ParamValue = reader.ReadByte(); - return jT808_0x8103_0x0092; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0092 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteByte(value.ParamValue); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0093_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0093_Formatter.cs deleted file mode 100644 index 1c09508..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0093_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0093_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0093 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0093 jT808_0x8103_0x0093 = new JT808_0x8103_0x0093(); - jT808_0x8103_0x0093.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0093.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0093.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0093; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0093 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0094_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0094_Formatter.cs deleted file mode 100644 index bb28cdc..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0094_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0094_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0094 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0094 jT808_0x8103_0x0094 = new JT808_0x8103_0x0094(); - jT808_0x8103_0x0094.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0094.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0094.ParamValue = reader.ReadByte(); - return jT808_0x8103_0x0094; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0094 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteByte(value.ParamValue); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0095_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0095_Formatter.cs deleted file mode 100644 index 35b1dc2..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0095_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0095_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0095 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0095 jT808_0x8103_0x0095 = new JT808_0x8103_0x0095(); - jT808_0x8103_0x0095.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0095.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0095.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0095; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0095 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0100_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0100_Formatter.cs deleted file mode 100644 index 176d18a..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0100_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0100_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0100 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0100 jT808_0x8103_0x0100 = new JT808_0x8103_0x0100(); - jT808_0x8103_0x0100.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0100.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0100.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0100; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0100 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0101_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0101_Formatter.cs deleted file mode 100644 index f2dd085..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0101_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0101_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0101 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0101 jT808_0x8103_0x0101 = new JT808_0x8103_0x0101(); - jT808_0x8103_0x0101.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0101.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0101.ParamValue = reader.ReadUInt16(); - return jT808_0x8103_0x0101; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0101 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt16(value.ParamValue); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0102_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0102_Formatter.cs deleted file mode 100644 index 2b909b2..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0102_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0102_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0102 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0102 jT808_0x8103_0x0102 = new JT808_0x8103_0x0102(); - jT808_0x8103_0x0102.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0102.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0102.ParamValue = reader.ReadUInt32(); - return jT808_0x8103_0x0102; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0102 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.ParamValue); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0103_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0103_Formatter.cs deleted file mode 100644 index 50165e4..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0103_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0103_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0103 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0103 jT808_0x8103_0x0103 = new JT808_0x8103_0x0103(); - jT808_0x8103_0x0103.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0103.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0103.ParamValue = reader.ReadUInt16(); - return jT808_0x8103_0x0103; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0103 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt16(value.ParamValue); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0110_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0110_Formatter.cs deleted file mode 100644 index fa0077e..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_0x0110_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_0x0110_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103_0x0110 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0110 jT808_0x8103_0x0110 = new JT808_0x8103_0x0110(); - jT808_0x8103_0x0110.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0110.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0110.ParamValue = reader.ReadArray(jT808_0x8103_0x0110.ParamLength).ToArray(); - return jT808_0x8103_0x0110; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0110 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte((byte)value.ParamValue.Length); - writer.WriteArray(value.ParamValue); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_Formatter.cs deleted file mode 100644 index 6702171..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8103_Formatter.cs +++ /dev/null @@ -1,68 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessageBody; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8103_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8103 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103 jT808_0x8103 = new JT808_0x8103 - { - ParamList = new List(), - CustomParamList = new List() - }; - var paramCount = reader.ReadByte();//参数总数 - try - { - for (int i = 0; i < paramCount; i++) - { - var paramId = reader.ReadVirtualUInt32();//参数ID - if (config.JT808_0X8103_Factory.ParamMethods.TryGetValue(paramId, out Type type)) - { - object attachImplObj = config.GetMessagePackFormatterByType(type); - dynamic attachImpl = JT808MessagePackFormatterResolverExtensions.JT808DynamicDeserialize(attachImplObj, ref reader, config); - jT808_0x8103.ParamList.Add(attachImpl); - } - else if (config.JT808_0X8103_Custom_Factory.ParamMethods.TryGetValue(paramId, out Type customType)) - { - object attachImplObj = config.GetMessagePackFormatterByType(customType); - dynamic attachImpl = JT808MessagePackFormatterResolverExtensions.JT808DynamicDeserialize(attachImplObj, ref reader, config); - jT808_0x8103.CustomParamList.Add(attachImpl); - } - } - } - catch (Exception ex) - { - - } - return jT808_0x8103; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103 value, IJT808Config config) - { - writer.WriteByte(value.ParamCount); - try - { - foreach (var item in value.ParamList) - { - object attachImplObj = config.GetMessagePackFormatterByType(item.GetType()); - JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(attachImplObj, ref writer, item, config); - } - if (value.CustomParamList != null) - { - foreach (var item in value.CustomParamList) - { - object attachImplObj = config.GetMessagePackFormatterByType(item.GetType()); - JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(attachImplObj, ref writer, item, config); - } - } - } - catch (Exception ex) { } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8105_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8105_Formatter.cs deleted file mode 100644 index 84d7eff..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8105_Formatter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8105_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8105 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8105 jT808_0x8105 = new JT808_0x8105 - { - CommandWord = reader.ReadByte() - }; - if (jT808_0x8105.CommandWord == 1 || jT808_0x8105.CommandWord == 2) - { - jT808_0x8105.CommandValue = new CommandParams(); - jT808_0x8105.CommandValue.SetCommandParams(reader.ReadRemainStringContent()); - } - return jT808_0x8105; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8105 value, IJT808Config config) - { - writer.WriteByte(value.CommandWord); - if (value.CommandWord == 1 || value.CommandWord == 2) - { - writer.WriteString(value.CommandValue.ToString()); - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8106_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8106_Formatter.cs deleted file mode 100644 index f86a1e1..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8106_Formatter.cs +++ /dev/null @@ -1,32 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8106_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8106 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8106 jT808_0X8106 = new JT808_0x8106(); - jT808_0X8106.ParameterCount = reader.ReadByte(); - jT808_0X8106.Parameters = new uint[jT808_0X8106.ParameterCount]; - for (int i = 0; i < jT808_0X8106.ParameterCount; i++) - { - jT808_0X8106.Parameters.SetValue(reader.ReadUInt32(), i); - } - return jT808_0X8106; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8106 value, IJT808Config config) - { - writer.WriteByte(value.ParameterCount); - for (int i = 0; i < value.ParameterCount; i++) - { - writer.WriteUInt32(value.Parameters[i]); - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8108_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8108_Formatter.cs deleted file mode 100644 index 63180a6..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8108_Formatter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8108_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8108 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8108 jT808_0X8108 = new JT808_0x8108(); - jT808_0X8108.UpgradeType = (JT808UpgradeType)reader.ReadByte(); - jT808_0X8108.MakerId = reader.ReadString(5); - jT808_0X8108.VersionNumLength = reader.ReadByte(); - jT808_0X8108.VersionNum = reader.ReadString(jT808_0X8108.VersionNumLength); - jT808_0X8108.UpgradePackageLength = reader.ReadInt32(); - jT808_0X8108.UpgradePackage = reader.ReadArray(jT808_0X8108.UpgradePackageLength).ToArray(); - return jT808_0X8108; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8108 value, IJT808Config config) - { - writer.WriteByte((byte)value.UpgradeType); - writer.WriteString(value.MakerId.PadRight(5, '0')); - writer.WriteByte((byte)value.VersionNum.Length); - writer.WriteString(value.VersionNum); - writer.WriteInt32(value.UpgradePackage.Length); - writer.WriteArray(value.UpgradePackage); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8202_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8202_Formatter.cs deleted file mode 100644 index e562aa9..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8202_Formatter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8202_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8202 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8202 jT808_0X8202 = new JT808_0x8202(); - jT808_0X8202.Interval = reader.ReadUInt16(); - jT808_0X8202.LocationTrackingValidity = reader.ReadInt32(); - return jT808_0X8202; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8202 value, IJT808Config config) - { - writer.WriteUInt16(value.Interval); - writer.WriteInt32(value.LocationTrackingValidity); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8203_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8203_Formatter.cs deleted file mode 100644 index 8c8dd6c..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8203_Formatter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8203_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8203 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8203 jT808_0X8203 = new JT808_0x8203(); - jT808_0X8203.AlarmMsgNum = reader.ReadUInt16(); - jT808_0X8203.ManualConfirmAlarmType = reader.ReadUInt32(); - return jT808_0X8203; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8203 value, IJT808Config config) - { - writer.WriteUInt16(value.AlarmMsgNum); - writer.WriteUInt32(value.ManualConfirmAlarmType); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8300_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8300_Formatter.cs deleted file mode 100644 index 9410829..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8300_Formatter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8300_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8300 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8300 jT808_0X8300 = new JT808_0x8300(); - jT808_0X8300.TextFlag = reader.ReadByte(); - jT808_0X8300.TextInfo = reader.ReadRemainStringContent(); - return jT808_0X8300; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8300 value, IJT808Config config) - { - writer.WriteByte(value.TextFlag); - writer.WriteString(value.TextInfo); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8301_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8301_Formatter.cs deleted file mode 100644 index a8ad2ad..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8301_Formatter.cs +++ /dev/null @@ -1,48 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Metadata; -using JT808.Protocol.MessageBody; -using System; -using System.Collections.Generic; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8301_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8301 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8301 jT808_0X8301 = new JT808_0x8301(); - jT808_0X8301.SettingType = reader.ReadByte(); - jT808_0X8301.SettingCount = reader.ReadByte(); - jT808_0X8301.EventItems = new List(); - for (var i = 0; i < jT808_0X8301.SettingCount; i++) - { - JT808EventProperty jT808EventProperty = new JT808EventProperty(); - jT808EventProperty.EventId = reader.ReadByte(); - jT808EventProperty.EventContentLength = reader.ReadByte(); - jT808EventProperty.EventContent = reader.ReadString(jT808EventProperty.EventContentLength); - jT808_0X8301.EventItems.Add(jT808EventProperty); - } - return jT808_0X8301; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8301 value, IJT808Config config) - { - writer.WriteByte(value.SettingType); - if (value.EventItems != null && value.EventItems.Count > 0) - { - writer.WriteByte((byte)value.EventItems.Count); - foreach (var item in value.EventItems) - { - writer.WriteByte(item.EventId); - // 先计算内容长度(汉字为两个字节) - writer.Skip(1, out int eventPosition); - writer.WriteString(item.EventContent); - byte eventLength = (byte)(writer.GetCurrentPosition() - eventPosition - 1); - writer.WriteByteReturn(eventLength, eventPosition); - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8302_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8302_Formatter.cs deleted file mode 100644 index df9320e..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8302_Formatter.cs +++ /dev/null @@ -1,58 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; -using System.Collections.Generic; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8302_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8302 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8302 jT808_0X8302 = new JT808_0x8302(); - jT808_0X8302.Flag = reader.ReadByte(); - jT808_0X8302.IssueContentLength = reader.ReadByte(); - jT808_0X8302.Issue = reader.ReadString(jT808_0X8302.IssueContentLength); - jT808_0X8302.Answers = new List(); - while (reader.ReadCurrentRemainContentLength() > 0) - { - try - { - JT808_0x8302.Answer answer = new JT808_0x8302.Answer(); - answer.Id = reader.ReadByte(); - answer.ContentLength = reader.ReadUInt16(); - answer.Content = reader.ReadString(answer.ContentLength); - jT808_0X8302.Answers.Add(answer); - } - catch (Exception ex) - { - break; - } - } - return jT808_0X8302; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8302 value, IJT808Config config) - { - writer.WriteByte(value.Flag); - // 先计算内容长度(汉字为两个字节) - writer.Skip(1, out int issuePosition); - writer.WriteString(value.Issue); - ushort issueLength = (ushort)(writer.GetCurrentPosition() - issuePosition - 1); - writer.WriteByteReturn((byte)issueLength, issuePosition); - if(value.Answers!=null && value.Answers.Count > 0) - { - foreach(var item in value.Answers) - { - writer.WriteByte(item.Id); - writer.Skip(2, out int answerPosition); - writer.WriteString(item.Content); - ushort answerLength = (ushort)(writer.GetCurrentPosition() - answerPosition - 2); - writer.WriteUInt16Return(answerLength, answerPosition); - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8303_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8303_Formatter.cs deleted file mode 100644 index 8865b10..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8303_Formatter.cs +++ /dev/null @@ -1,45 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.Metadata; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8303_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8303 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8303 jT808_0X8303 = new JT808_0x8303(); - jT808_0X8303.SettingType = reader.ReadByte(); - jT808_0X8303.InformationItemCount = reader.ReadByte(); - jT808_0X8303.InformationItems = new List(); - for (var i = 0; i < jT808_0X8303.InformationItemCount; i++) - { - JT808InformationItemProperty jT808InformationItemProperty = new JT808InformationItemProperty(); - jT808InformationItemProperty.InformationType = reader.ReadByte(); - jT808InformationItemProperty.InformationLength = reader.ReadUInt16(); - jT808InformationItemProperty.InformationName = reader.ReadString(jT808InformationItemProperty.InformationLength); - jT808_0X8303.InformationItems.Add(jT808InformationItemProperty); - } - return jT808_0X8303; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8303 value, IJT808Config config) - { - writer.WriteByte(value.SettingType); - writer.WriteByte((byte)value.InformationItems.Count); - foreach (var item in value.InformationItems) - { - writer.WriteByte(item.InformationType); - // 先计算内容长度(汉字为两个字节) - writer.Skip(2, out int position); - writer.WriteString(item.InformationName); - ushort length = (ushort)(writer.GetCurrentPosition() - position - 2); - writer.WriteUInt16Return(length, position); - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8304_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8304_Formatter.cs deleted file mode 100644 index 25e3b91..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8304_Formatter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8304_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8304 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8304 jT808_0X8304 = new JT808_0x8304(); - jT808_0X8304.InformationType = reader.ReadByte(); - jT808_0X8304.InformationLength = reader.ReadUInt16(); - jT808_0X8304.InformationContent = reader.ReadString(jT808_0X8304.InformationLength); - return jT808_0X8304; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8304 value, IJT808Config config) - { - writer.WriteByte(value.InformationType); - // 先计算内容长度(汉字为两个字节) - writer.Skip(2, out int position); - writer.WriteString(value.InformationContent); - ushort length =(ushort)( writer.GetCurrentPosition() - position - 2); - writer.WriteUInt16Return(length, position); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8400_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8400_Formatter.cs deleted file mode 100644 index 4a31d2c..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8400_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8400_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8400 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8400 jT808_0X8400 = new JT808_0x8400(); - jT808_0X8400.CallBack = (JT808CallBackType)reader.ReadByte(); - // 最长为 20 字节 - jT808_0X8400.PhoneNumber = reader.ReadRemainStringContent(); - return jT808_0X8400; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8400 value, IJT808Config config) - { - writer.WriteByte((byte)value.CallBack); - writer.WriteString(value.PhoneNumber); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8401_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8401_Formatter.cs deleted file mode 100644 index b394326..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8401_Formatter.cs +++ /dev/null @@ -1,48 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.Extensions; -using JT808.Protocol.Metadata; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8401_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8401 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8401 jT808_0X8401 = new JT808_0x8401(); - jT808_0X8401.SettingTelephoneBook = (JT808SettingTelephoneBook)reader.ReadByte(); - jT808_0X8401.ContactCount = reader.ReadByte(); - List jT808_0X8401s = new List(); - for (var i = 0; i < jT808_0X8401.ContactCount; i++) - { - JT808ContactProperty jT808ContactProperty = new JT808ContactProperty(); - jT808ContactProperty.TelephoneBookContactType = (JT808TelephoneBookContactType)reader.ReadByte(); - jT808ContactProperty.PhoneNumberLength = reader.ReadByte(); - jT808ContactProperty.PhoneNumber = reader.ReadString(jT808ContactProperty.PhoneNumberLength); - jT808ContactProperty.ContactLength = reader.ReadByte(); - jT808ContactProperty.Contact = reader.ReadString(jT808ContactProperty.ContactLength); - jT808_0X8401s.Add(jT808ContactProperty); - } - jT808_0X8401.JT808ContactProperties = jT808_0X8401s; - return jT808_0X8401; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8401 value, IJT808Config config) - { - writer.WriteByte((byte)value.SettingTelephoneBook); - writer.WriteByte((byte)value.JT808ContactProperties.Count); - foreach (var item in value.JT808ContactProperties) - { - writer.WriteByte((byte)item.TelephoneBookContactType); - writer.WriteByte((byte)item.PhoneNumber.Length); - writer.WriteString(item.PhoneNumber); - writer.WriteByte((byte)item.Contact.Length); - writer.WriteString(item.Contact); - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8500_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8500_Formatter.cs deleted file mode 100644 index fc5d0a8..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8500_Formatter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8500_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8500 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8500 jT808_0X8500 = new JT808_0x8500(); - jT808_0X8500.ControlFlag = reader.ReadByte(); - return jT808_0X8500; - } - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8500 value, IJT808Config config) - { - writer.WriteByte(value.ControlFlag); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8600_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8600_Formatter.cs deleted file mode 100644 index c27416a..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8600_Formatter.cs +++ /dev/null @@ -1,87 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Metadata; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8600_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8600 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8600 jT808_0X8600 = new JT808_0x8600(); - jT808_0X8600.SettingAreaProperty = reader.ReadByte(); - jT808_0X8600.AreaCount = reader.ReadByte(); - jT808_0X8600.AreaItems = new List(); - for (var i = 0; i < jT808_0X8600.AreaCount; i++) - { - JT808CircleAreaProperty jT808CircleAreaProperty = new JT808CircleAreaProperty(); - jT808CircleAreaProperty.AreaId = reader.ReadUInt32(); - jT808CircleAreaProperty.AreaProperty = reader.ReadUInt16(); - jT808CircleAreaProperty.CenterPointLat = reader.ReadUInt32(); - jT808CircleAreaProperty.CenterPointLng = reader.ReadUInt32(); - jT808CircleAreaProperty.Radius = reader.ReadUInt32(); - ReadOnlySpan areaProperty16Bit = Convert.ToString(jT808CircleAreaProperty.AreaProperty, 2).PadLeft(16, '0').AsSpan(); - bool bit0Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 1).ToString().Equals("0"); - if (!bit0Flag) - { - jT808CircleAreaProperty.StartTime = reader.ReadDateTime6(); - jT808CircleAreaProperty.EndTime = reader.ReadDateTime6(); - } - bool bit1Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 2, 1).ToString().Equals("0"); - if (!bit1Flag) - { - jT808CircleAreaProperty.HighestSpeed = reader.ReadUInt16(); - jT808CircleAreaProperty.OverspeedDuration = reader.ReadByte(); - } - jT808_0X8600.AreaItems.Add(jT808CircleAreaProperty); - } - return jT808_0X8600; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8600 value, IJT808Config config) - { - writer.WriteByte(value.SettingAreaProperty); - if (value.AreaItems != null) - { - writer.WriteByte((byte)value.AreaItems.Count); - foreach (var item in value.AreaItems) - { - writer.WriteUInt32(item.AreaId); - writer.WriteUInt16(item.AreaProperty); - writer.WriteUInt32(item.CenterPointLat); - writer.WriteUInt32(item.CenterPointLng); - writer.WriteUInt32(item.Radius); - ReadOnlySpan areaProperty16Bit = Convert.ToString(item.AreaProperty, 2).PadLeft(16, '0').AsSpan(); - bool bit0Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 1).ToString().Equals("0"); - if (!bit0Flag) - { - if (item.StartTime.HasValue) - { - writer.WriteDateTime6(item.StartTime.Value); - } - if (item.EndTime.HasValue) - { - writer.WriteDateTime6(item.EndTime.Value); - } - } - bool bit1Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 2, 1).ToString().Equals("0"); - if (!bit1Flag) - { - if (item.HighestSpeed.HasValue) - { - writer.WriteUInt16(item.HighestSpeed.Value); - } - if (item.OverspeedDuration.HasValue) - { - writer.WriteByte(item.OverspeedDuration.Value); - } - } - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8601_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8601_Formatter.cs deleted file mode 100644 index f62638d..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8601_Formatter.cs +++ /dev/null @@ -1,36 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8601_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8601 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8601 jT808_0X8601 = new JT808_0x8601(); - jT808_0X8601.AreaCount = reader.ReadByte(); - jT808_0X8601.AreaIds = new List(); - for (var i = 0; i < jT808_0X8601.AreaCount; i++) - { - jT808_0X8601.AreaIds.Add(reader.ReadUInt32()); - } - return jT808_0X8601; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8601 value, IJT808Config config) - { - if (value.AreaIds != null) - { - writer.WriteByte((byte)value.AreaIds.Count); - foreach (var item in value.AreaIds) - { - writer.WriteUInt32(item); - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8602_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8602_Formatter.cs deleted file mode 100644 index 9d88adb..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8602_Formatter.cs +++ /dev/null @@ -1,89 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Metadata; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8602_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8602 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8602 jT808_0X8602 = new JT808_0x8602(); - jT808_0X8602.SettingAreaProperty = reader.ReadByte(); - jT808_0X8602.AreaCount = reader.ReadByte(); - jT808_0X8602.AreaItems = new List(); - for (var i = 0; i < jT808_0X8602.AreaCount; i++) - { - JT808RectangleAreaProperty jT808CircleAreaProperty = new JT808RectangleAreaProperty(); - jT808CircleAreaProperty.AreaId = reader.ReadUInt32(); - jT808CircleAreaProperty.AreaProperty = reader.ReadUInt16(); - jT808CircleAreaProperty.UpLeftPointLat = reader.ReadUInt32(); - jT808CircleAreaProperty.UpLeftPointLng = reader.ReadUInt32(); - jT808CircleAreaProperty.LowRightPointLat = reader.ReadUInt32(); - jT808CircleAreaProperty.LowRightPointLng = reader.ReadUInt32(); - ReadOnlySpan areaProperty16Bit = Convert.ToString(jT808CircleAreaProperty.AreaProperty, 2).PadLeft(16, '0').AsSpan(); - bool bit0Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 1).ToString().Equals("0"); - if (!bit0Flag) - { - jT808CircleAreaProperty.StartTime = reader.ReadDateTime6(); - jT808CircleAreaProperty.EndTime = reader.ReadDateTime6(); - } - bool bit1Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 2, 1).ToString().Equals("0"); - if (!bit1Flag) - { - jT808CircleAreaProperty.HighestSpeed = reader.ReadUInt16(); - jT808CircleAreaProperty.OverspeedDuration = reader.ReadByte(); - } - jT808_0X8602.AreaItems.Add(jT808CircleAreaProperty); - } - return jT808_0X8602; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8602 value, IJT808Config config) - { - writer.WriteByte( value.SettingAreaProperty); - if (value.AreaItems != null) - { - writer.WriteByte((byte)value.AreaItems.Count); - foreach (var item in value.AreaItems) - { - writer.WriteUInt32( item.AreaId); - writer.WriteUInt16( item.AreaProperty); - writer.WriteUInt32( item.UpLeftPointLat); - writer.WriteUInt32( item.UpLeftPointLng); - writer.WriteUInt32( item.LowRightPointLat); - writer.WriteUInt32( item.LowRightPointLng); - ReadOnlySpan areaProperty16Bit = Convert.ToString(item.AreaProperty, 2).PadLeft(16, '0').AsSpan(); - bool bit0Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 1).ToString().Equals("0"); - if (!bit0Flag) - { - if (item.StartTime.HasValue) - { - writer.WriteDateTime6(item.StartTime.Value); - } - if (item.EndTime.HasValue) - { - writer.WriteDateTime6(item.EndTime.Value); - } - } - bool bit1Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 2, 1).ToString().Equals("0"); - if (!bit1Flag) - { - if (item.HighestSpeed.HasValue) - { - writer.WriteUInt16(item.HighestSpeed.Value); - } - if (item.OverspeedDuration.HasValue) - { - writer.WriteByte( item.OverspeedDuration.Value); - } - } - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8603_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8603_Formatter.cs deleted file mode 100644 index 47bec87..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8603_Formatter.cs +++ /dev/null @@ -1,36 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8603_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8603 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8603 jT808_0X8603 = new JT808_0x8603(); - jT808_0X8603.AreaCount = reader.ReadByte(); - jT808_0X8603.AreaIds = new List(); - for (var i = 0; i < jT808_0X8603.AreaCount; i++) - { - jT808_0X8603.AreaIds.Add(reader.ReadUInt32()); - } - return jT808_0X8603; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8603 value, IJT808Config config) - { - if (value.AreaIds != null) - { - writer.WriteByte((byte)value.AreaIds.Count); - foreach (var item in value.AreaIds) - { - writer.WriteUInt32(item); - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8604_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8604_Formatter.cs deleted file mode 100644 index f7d7f28..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8604_Formatter.cs +++ /dev/null @@ -1,83 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Metadata; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8604_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8604 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8604 jT808_0X8604 = new JT808_0x8604(); - jT808_0X8604.AreaId = reader.ReadUInt32(); - jT808_0X8604.AreaProperty = reader.ReadUInt16(); - ReadOnlySpan areaProperty16Bit = Convert.ToString(jT808_0X8604.AreaProperty, 2).PadLeft(16, '0').AsSpan(); - bool bit0Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 1).ToString().Equals("0"); - if (!bit0Flag) - { - jT808_0X8604.StartTime = reader.ReadDateTime6(); - jT808_0X8604.EndTime = reader.ReadDateTime6(); - } - bool bit1Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 2, 1).ToString().Equals("0"); - if (!bit1Flag) - { - jT808_0X8604.HighestSpeed = reader.ReadUInt16(); - jT808_0X8604.OverspeedDuration = reader.ReadByte(); - } - jT808_0X8604.PeakCount = reader.ReadUInt16(); - jT808_0X8604.PeakItems = new List(); - for (var i = 0; i < jT808_0X8604.PeakCount; i++) - { - var item = new JT808PeakProperty(); - item.Lat = reader.ReadUInt32(); - item.Lng = reader.ReadUInt32(); - jT808_0X8604.PeakItems.Add(item); - } - return jT808_0X8604; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8604 value, IJT808Config config) - { - writer.WriteUInt32(value.AreaId); - writer.WriteUInt16(value.AreaProperty); - ReadOnlySpan areaProperty16Bit = Convert.ToString(value.AreaProperty, 2).PadLeft(16, '0').AsSpan(); - bool bit0Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 1).ToString().Equals("0"); - if (!bit0Flag) - { - if (value.StartTime.HasValue) - { - writer.WriteDateTime6(value.StartTime.Value); - } - if (value.EndTime.HasValue) - { - writer.WriteDateTime6(value.EndTime.Value); - } - } - bool bit1Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 2, 1).ToString().Equals("0"); - if (!bit1Flag) - { - if (value.HighestSpeed.HasValue) - { - writer.WriteUInt16(value.HighestSpeed.Value); - } - if (value.OverspeedDuration.HasValue) - { - writer.WriteByte(value.OverspeedDuration.Value); - } - } - if (value.PeakItems != null && value.PeakItems.Count > 0) - { - writer.WriteUInt16((ushort)value.PeakItems.Count); - foreach (var item in value.PeakItems) - { - writer.WriteUInt32(item.Lat); - writer.WriteUInt32(item.Lng); - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8605_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8605_Formatter.cs deleted file mode 100644 index a3b588b..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8605_Formatter.cs +++ /dev/null @@ -1,36 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8605_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8605 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8605 jT808_0X8605 = new JT808_0x8605(); - jT808_0X8605.AreaCount = reader.ReadByte(); - jT808_0X8605.AreaIds = new List(); - for (var i = 0; i < jT808_0X8605.AreaCount; i++) - { - jT808_0X8605.AreaIds.Add(reader.ReadUInt32()); - } - return jT808_0X8605; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8605 value, IJT808Config config) - { - if (value.AreaIds != null) - { - writer.WriteByte((byte)value.AreaIds.Count); - foreach (var item in value.AreaIds) - { - writer.WriteUInt32(item); - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8606_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8606_Formatter.cs deleted file mode 100644 index 3081e0c..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8606_Formatter.cs +++ /dev/null @@ -1,102 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.Metadata; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8606_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8606 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8606 jT808_0X8606 = new JT808_0x8606(); - jT808_0X8606.RouteId = reader.ReadUInt32(); - jT808_0X8606.RouteProperty = reader.ReadUInt16(); - ReadOnlySpan routeProperty16Bit = Convert.ToString(jT808_0X8606.RouteProperty, 2).PadLeft(16, '0').AsSpan(); - bool bit0Flag = routeProperty16Bit.Slice(routeProperty16Bit.Length - 1).ToString().Equals("0"); - if (!bit0Flag) - { - jT808_0X8606.StartTime = reader.ReadDateTime6(); - jT808_0X8606.EndTime = reader.ReadDateTime6(); - } - jT808_0X8606.InflectionPointCount = reader.ReadUInt16(); - jT808_0X8606.InflectionPointItems = new List(); - for (var i = 0; i < jT808_0X8606.InflectionPointCount; i++) - { - JT808InflectionPointProperty jT808InflectionPointProperty = new JT808InflectionPointProperty(); - jT808InflectionPointProperty.InflectionPointId = reader.ReadUInt32(); - jT808InflectionPointProperty.SectionId = reader.ReadUInt32(); - jT808InflectionPointProperty.InflectionPointLat = reader.ReadUInt32(); - jT808InflectionPointProperty.InflectionPointLng = reader.ReadUInt32(); - jT808InflectionPointProperty.SectionWidth = reader.ReadByte(); - jT808InflectionPointProperty.SectionProperty = reader.ReadByte(); - ReadOnlySpan sectionProperty16Bit = Convert.ToString(jT808InflectionPointProperty.SectionProperty, 2).PadLeft(16, '0').AsSpan(); - bool sectionBit0Flag = sectionProperty16Bit.Slice(sectionProperty16Bit.Length - 1).ToString().Equals("0"); - if (!sectionBit0Flag) - { - jT808InflectionPointProperty.SectionLongDrivingThreshold = reader.ReadUInt16(); - jT808InflectionPointProperty.SectionDrivingUnderThreshold = reader.ReadUInt16(); - } - bool sectionBit1Flag = sectionProperty16Bit.Slice(sectionProperty16Bit.Length - 2, 1).ToString().Equals("0"); - if (!sectionBit1Flag) - { - jT808InflectionPointProperty.SectionHighestSpeed = reader.ReadUInt16(); - jT808InflectionPointProperty.SectionOverspeedDuration = reader.ReadByte(); - } - jT808_0X8606.InflectionPointItems.Add(jT808InflectionPointProperty); - } - return jT808_0X8606; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8606 value, IJT808Config config) - { - writer.WriteUInt32(value.RouteId); - writer.WriteUInt16(value.RouteProperty); - ReadOnlySpan routeProperty16Bit = Convert.ToString(value.RouteProperty, 2).PadLeft(16, '0').AsSpan(); - bool bit0Flag = routeProperty16Bit.Slice(routeProperty16Bit.Length - 1).ToString().Equals("0"); - if (!bit0Flag) - { - if (value.StartTime.HasValue) - writer.WriteDateTime6(value.StartTime.Value); - - if (value.EndTime.HasValue) - writer.WriteDateTime6(value.EndTime.Value); - } - //bool bit1Flag = routeProperty16Bit.Slice(routeProperty16Bit.Length - 2, 1).ToString().Equals("0"); - if (value.InflectionPointItems != null && value.InflectionPointItems.Count > 0) - { - writer.WriteUInt16((ushort)value.InflectionPointItems.Count); - foreach (var item in value.InflectionPointItems) - { - writer.WriteUInt32( item.InflectionPointId); - writer.WriteUInt32( item.SectionId); - writer.WriteUInt32(item.InflectionPointLat); - writer.WriteUInt32(item.InflectionPointLng); - writer.WriteByte(item.SectionWidth); - writer.WriteByte(item.SectionProperty); - - ReadOnlySpan sectionProperty16Bit = Convert.ToString(item.SectionProperty, 2).PadLeft(16, '0').AsSpan(); - bool sectionBit0Flag = sectionProperty16Bit.Slice(sectionProperty16Bit.Length - 1).ToString().Equals("0"); - if (!sectionBit0Flag) - { - if (item.SectionLongDrivingThreshold.HasValue) - writer.WriteUInt16(item.SectionLongDrivingThreshold.Value); - if (item.SectionDrivingUnderThreshold.HasValue) - writer.WriteUInt16(item.SectionDrivingUnderThreshold.Value); - } - bool sectionBit1Flag = sectionProperty16Bit.Slice(sectionProperty16Bit.Length - 2, 1).ToString().Equals("0"); - if (!sectionBit1Flag) - { - if (item.SectionHighestSpeed.HasValue) - writer.WriteUInt16(item.SectionHighestSpeed.Value); - if (item.SectionOverspeedDuration.HasValue) - writer.WriteByte(item.SectionOverspeedDuration.Value); - } - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8607_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8607_Formatter.cs deleted file mode 100644 index 270a4ce..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8607_Formatter.cs +++ /dev/null @@ -1,36 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using System.Collections.Generic; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8607_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8607 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8607 jT808_0X8607 = new JT808_0x8607(); - jT808_0X8607.AreaCount = reader.ReadByte(); - jT808_0X8607.AreaIds = new List(); - for (var i = 0; i < jT808_0X8607.AreaCount; i++) - { - jT808_0X8607.AreaIds.Add(reader.ReadUInt32()); - } - return jT808_0X8607; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8607 value, IJT808Config config) - { - if (value.AreaIds != null) - { - writer.WriteByte((byte)value.AreaIds.Count); - foreach (var item in value.AreaIds) - { - writer.WriteUInt32(item); - } - } - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8800_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8800_Formatter.cs deleted file mode 100644 index 11d3ab5..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8800_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8800_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8800 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8800 jT808_0X8800 = new JT808_0x8800(); - jT808_0X8800.MultimediaId = reader.ReadUInt32(); - jT808_0X8800.RetransmitPackageCount = reader.ReadByte(); - jT808_0X8800.RetransmitPackageIds = reader.ReadArray(jT808_0X8800.RetransmitPackageCount * 2).ToArray(); - return jT808_0X8800; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8800 value, IJT808Config config) - { - writer.WriteUInt32(value.MultimediaId); - writer.WriteByte((byte)(value.RetransmitPackageIds.Length / 2)); - writer.WriteArray(value.RetransmitPackageIds); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8801_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8801_Formatter.cs deleted file mode 100644 index 4ff64fd..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8801_Formatter.cs +++ /dev/null @@ -1,41 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8801_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8801 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8801 jT808_0X8801 = new JT808_0x8801(); - jT808_0X8801.ChannelId = reader.ReadByte(); - jT808_0X8801.ShootingCommand = reader.ReadUInt16(); - jT808_0X8801.VideoTime = reader.ReadUInt16(); - jT808_0X8801.SaveFlag = reader.ReadByte(); - jT808_0X8801.Resolution = reader.ReadByte(); - jT808_0X8801.VideoQuality = reader.ReadByte(); - jT808_0X8801.Lighting = reader.ReadByte(); - jT808_0X8801.Contrast = reader.ReadByte(); - jT808_0X8801.Saturability = reader.ReadByte(); - jT808_0X8801.Chroma = reader.ReadByte(); - return jT808_0X8801; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8801 value, IJT808Config config) - { - writer.WriteByte(value.ChannelId); - writer.WriteUInt16(value.ShootingCommand); - writer.WriteUInt16(value.VideoTime); - writer.WriteByte(value.SaveFlag); - writer.WriteByte(value.Resolution); - writer.WriteByte(value.VideoQuality); - writer.WriteByte(value.Lighting); - writer.WriteByte(value.Contrast); - writer.WriteByte(value.Saturability); - writer.WriteByte(value.Chroma); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8802_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8802_Formatter.cs deleted file mode 100644 index dc03818..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8802_Formatter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8802_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8802 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8802 jT808_0X8802 = new JT808_0x8802(); - jT808_0X8802.MultimediaType = reader.ReadByte(); - jT808_0X8802.ChannelId = reader.ReadByte(); - jT808_0X8802.EventItemCoding = reader.ReadByte(); - jT808_0X8802.StartTime = reader.ReadDateTime6(); - jT808_0X8802.EndTime = reader.ReadDateTime6(); - return jT808_0X8802; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8802 value, IJT808Config config) - { - writer.WriteByte(value.MultimediaType); - writer.WriteByte(value.ChannelId); - writer.WriteByte(value.EventItemCoding); - writer.WriteDateTime6(value.StartTime); - writer.WriteDateTime6(value.EndTime); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8803_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8803_Formatter.cs deleted file mode 100644 index 990477d..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8803_Formatter.cs +++ /dev/null @@ -1,33 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8803_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8803 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8803 jT808_0X8803 = new JT808_0x8803(); - jT808_0X8803.MultimediaType = reader.ReadByte(); - jT808_0X8803.ChannelId = reader.ReadByte(); - jT808_0X8803.EventItemCoding = reader.ReadByte(); - jT808_0X8803.StartTime = reader.ReadDateTime6(); - jT808_0X8803.EndTime = reader.ReadDateTime6(); - jT808_0X8803.MultimediaDeleted = reader.ReadByte(); - return jT808_0X8803; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8803 value, IJT808Config config) - { - writer.WriteByte(value.MultimediaType); - writer.WriteByte(value.ChannelId); - writer.WriteByte(value.EventItemCoding); - writer.WriteDateTime6(value.StartTime); - writer.WriteDateTime6(value.EndTime); - writer.WriteByte(value.MultimediaDeleted); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8804_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8804_Formatter.cs deleted file mode 100644 index 9ccfa4d..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8804_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Enums; -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8804_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8804 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8804 jT808_0X8804 = new JT808_0x8804(); - jT808_0X8804.RecordCmd = (JT808RecordCmd)reader.ReadByte(); - jT808_0X8804.RecordTime = reader.ReadUInt16(); - jT808_0X8804.RecordSave = (JT808RecordSave)reader.ReadByte(); - jT808_0X8804.AudioSampleRate = reader.ReadByte(); - return jT808_0X8804; - } - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8804 value, IJT808Config config) - { - writer.WriteByte((byte)value.RecordCmd); - writer.WriteUInt16(value.RecordTime); - writer.WriteByte((byte)value.RecordSave); - writer.WriteByte(value.AudioSampleRate); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8805_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8805_Formatter.cs deleted file mode 100644 index 351a58c..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8805_Formatter.cs +++ /dev/null @@ -1,25 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8805_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8805 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8805 jT808_0X8805 = new JT808_0x8805(); - jT808_0X8805.MultimediaId = reader.ReadUInt32(); - jT808_0X8805.MultimediaDeleted = reader.ReadByte(); - return jT808_0X8805; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8805 value, IJT808Config config) - { - writer.WriteUInt32(value.MultimediaId); - writer.WriteByte(value.MultimediaDeleted); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8900_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8900_Formatter.cs deleted file mode 100644 index 0f26d0c..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8900_Formatter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using JT808.Protocol.Interfaces; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8900_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8900 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8900 jT808_0X8900 = new JT808_0x8900(); - jT808_0X8900.PassthroughType = reader.ReadByte(); - jT808_0X8900.PassthroughData = reader.ReadContent().ToArray(); - return jT808_0X8900; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8900 value, IJT808Config config) - { - writer.WriteByte(value.PassthroughType); - object obj = config.GetMessagePackFormatterByType(value.JT808_0X8900_BodyBase.GetType()); - JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(obj, ref writer, value.JT808_0X8900_BodyBase, config); - } - } -} diff --git a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8A00_Formatter.cs b/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8A00_Formatter.cs deleted file mode 100644 index b1bc104..0000000 --- a/src/JT808.Protocol/Formatters/MessageBodyFormatters/JT808_0x8A00_Formatter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using JT808.Protocol.Exceptions; -using JT808.Protocol.Interfaces; -using JT808.Protocol.Extensions; -using JT808.Protocol.MessageBody; -using System; -using JT808.Protocol.MessagePack; - -namespace JT808.Protocol.Formatters.MessageBodyFormatters -{ - public class JT808_0x8A00_Formatter : IJT808MessagePackFormatter - { - public JT808_0x8A00 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8A00 jT808_0X8A00 = new JT808_0x8A00(); - jT808_0X8A00.E = reader.ReadUInt32(); - jT808_0X8A00.N = reader.ReadArray(128).ToArray(); - return jT808_0X8A00; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8A00 value, IJT808Config config) - { - writer.WriteUInt32(value.E); - if (value.N.Length != 128) - { - throw new JT808Exception(Enums.JT808ErrorCode.NotEnoughLength, $"{nameof(value.N)}->128"); - } - writer.WriteArray(value.N); - } - } -} diff --git a/src/JT808.Protocol/Interfaces/GlobalConfigBase.cs b/src/JT808.Protocol/Interfaces/GlobalConfigBase.cs index b8d1fda..f955374 100644 --- a/src/JT808.Protocol/Interfaces/GlobalConfigBase.cs +++ b/src/JT808.Protocol/Interfaces/GlobalConfigBase.cs @@ -20,8 +20,8 @@ namespace JT808.Protocol.Interfaces FormatterFactory = new JT808FormatterFactory(); JT808_0X0200_Custom_Factory = new JT808_0x0200_Custom_Factory(); JT808_0X0200_Factory = new JT808_0x0200_Factory(); - //JT808_0X8103_Custom_Factory = new JT808_0x8103_Custom_Factory(); - //JT808_0X8103_Factory = new JT808_0x8103_Factory(); + JT808_0X8103_Custom_Factory = new JT808_0x8103_Custom_Factory(); + JT808_0X8103_Factory = new JT808_0x8103_Factory(); TerminalPhoneNoLength = 12; Trim = true; } @@ -46,8 +46,8 @@ namespace JT808.Protocol.Interfaces foreach (var easb in externalAssemblies) { FormatterFactory.Register(easb); - JT808_0X0200_Custom_Factory?.Register(easb); - JT808_0X8103_Custom_Factory?.Register(easb); + JT808_0X0200_Custom_Factory.Register(easb); + JT808_0X8103_Custom_Factory.Register(easb); } } return this; diff --git a/src/JT808.Protocol/Interfaces/IJT808MsgIdFactory.cs b/src/JT808.Protocol/Interfaces/IJT808MsgIdFactory.cs index 89a0cab..a21871f 100644 --- a/src/JT808.Protocol/Interfaces/IJT808MsgIdFactory.cs +++ b/src/JT808.Protocol/Interfaces/IJT808MsgIdFactory.cs @@ -4,7 +4,7 @@ namespace JT808.Protocol.Interfaces { public interface IJT808MsgIdFactory { - Type GetBodiesImplTypeByMsgId(ushort msgId, string terminalPhoneNo); + object GetBodiesImplInstanceByMsgId(ushort msgId, string terminalPhoneNo); IJT808MsgIdFactory SetMap(ushort msgId, string terminalPhoneNo) where TJT808Bodies : JT808Bodies; IJT808MsgIdFactory SetMap(ushort msgId, string terminalPhoneNo, Type bodiesImplType); diff --git a/src/JT808.Protocol/Internal/JT808MsgIdFactory.cs b/src/JT808.Protocol/Internal/JT808MsgIdFactory.cs index 3dfd454..71b0848 100644 --- a/src/JT808.Protocol/Internal/JT808MsgIdFactory.cs +++ b/src/JT808.Protocol/Internal/JT808MsgIdFactory.cs @@ -1,6 +1,7 @@ using JT808.Protocol.Attributes; using JT808.Protocol.Enums; using JT808.Protocol.Extensions; +using JT808.Protocol.Formatters; using JT808.Protocol.Interfaces; using System; using System.Collections.Generic; @@ -9,14 +10,14 @@ namespace JT808.Protocol.Internal { internal class JT808MsgIdFactory: IJT808MsgIdFactory { - private Dictionary map; + private Dictionary map; - private Dictionary> customMap; + private Dictionary> customMap; internal JT808MsgIdFactory() { - map = new Dictionary(); - customMap = new Dictionary>(StringComparer.OrdinalIgnoreCase); + map = new Dictionary(); + customMap = new Dictionary>(StringComparer.OrdinalIgnoreCase); InitMap(); } @@ -30,23 +31,23 @@ namespace JT808.Protocol.Internal JT808BodiesTypeAttribute jT808BodiesTypeAttribute = msgId.GetAttribute(); if (jT808BodiesTypeAttribute != null) { - map.Add((ushort)msgId, jT808BodiesTypeAttribute.JT808BodiesType); + map.Add((ushort)msgId, Activator.CreateInstance(jT808BodiesTypeAttribute.JT808BodiesType)); } } } } - public Type GetBodiesImplTypeByMsgId(ushort msgId, string terminalPhoneNo) + public object GetBodiesImplInstanceByMsgId(ushort msgId, string terminalPhoneNo) { //判断有无自定义消息Id类型 if (customMap.TryGetValue(terminalPhoneNo, out var dict)) { if (dict != null) { - return dict.TryGetValue(msgId, out Type bodiesImptType)? bodiesImptType:null; + return dict.TryGetValue(msgId, out object bodiesImptType) ? bodiesImptType : null; } } - return map.TryGetValue(msgId, out Type type) ? type : null; + return map.TryGetValue(msgId, out dynamic type) ? type : null; } public IJT808MsgIdFactory SetMap(ushort msgId, string terminalPhoneNo) @@ -54,7 +55,7 @@ namespace JT808.Protocol.Internal { if (!map.ContainsKey(msgId)) { - map.Add(msgId, typeof(TJT808Bodies)); + map.Add(msgId, Activator.CreateInstance(typeof(TJT808Bodies))); } return this; } @@ -63,7 +64,7 @@ namespace JT808.Protocol.Internal { if (!map.ContainsKey(msgId)) { - map.Add(msgId, bodiesImplType); + map.Add(msgId, Activator.CreateInstance(bodiesImplType)); } return this; } @@ -72,11 +73,11 @@ namespace JT808.Protocol.Internal { if (!map.ContainsKey(msgId)) { - map.Add(msgId, typeof(TJT808Bodies)); + map.Add(msgId, Activator.CreateInstance(typeof(TJT808Bodies))); } else { - map[msgId] = typeof(TJT808Bodies); + map[msgId] = Activator.CreateInstance(typeof(TJT808Bodies)); } return this; } @@ -89,15 +90,15 @@ namespace JT808.Protocol.Internal { if (dict == null) { - Dictionary tmp = new Dictionary(); - tmp.Add(msgId, typeof(TJT808Bodies)); + Dictionary tmp = new Dictionary(); + tmp.Add(msgId, Activator.CreateInstance(typeof(TJT808Bodies))); customMap.Add(terminalPhoneNo, tmp); } else { if (!dict.ContainsKey(msgId)) { - dict.Add(msgId, typeof(TJT808Bodies)); + dict.Add(msgId, Activator.CreateInstance(typeof(TJT808Bodies))); } } } @@ -113,8 +114,8 @@ namespace JT808.Protocol.Internal { if (dict == null) { - Dictionary tmp = new Dictionary(); - tmp.Add(msgId, bodiesImplType); + Dictionary tmp = new Dictionary(); + tmp.Add(msgId, Activator.CreateInstance(bodiesImplType)); customMap.Add(terminalPhoneNo, tmp); return this; } @@ -122,7 +123,7 @@ namespace JT808.Protocol.Internal { if (!dict.ContainsKey(msgId)) { - dict.Add(msgId, bodiesImplType); + dict.Add(msgId, Activator.CreateInstance(bodiesImplType)); } } } diff --git a/src/JT808.Protocol/JT808.Protocol.csproj b/src/JT808.Protocol/JT808.Protocol.csproj index 710d85a..787b02d 100644 --- a/src/JT808.Protocol/JT808.Protocol.csproj +++ b/src/JT808.Protocol/JT808.Protocol.csproj @@ -27,6 +27,7 @@ $(OutputPath)$(MSBuildProjectName).xml + 1701;1702;CS1591;CS1572;CS1573;CS1574;CS1570; @@ -48,8 +49,6 @@ - - diff --git a/src/JT808.Protocol/JT808.Protocol.xml b/src/JT808.Protocol/JT808.Protocol.xml index 233ace5..a6559ec 100644 --- a/src/JT808.Protocol/JT808.Protocol.xml +++ b/src/JT808.Protocol/JT808.Protocol.xml @@ -984,6 +984,18 @@ auto-generated + + + 0x0104 - 查询终端参数应答 + auto-generated + + + + + 0x0104 - 查询终端参数应答 + auto-generated + + 0x0107 - 查询终端属性应答 @@ -1236,6 +1248,30 @@ auto-generated + + + 0x8103 - 设置终端参数 + auto-generated + + + + + 0x8103 - 设置终端参数 + auto-generated + + + + + 0x8104 - 查询终端参数 + auto-generated + + + + + 0x8104 - 查询终端参数 + auto-generated + + 0x8105 - 终端控制 @@ -2251,11 +2287,6 @@ 终止符 - - - 头部固定长度 - - 起始符 diff --git a/src/JT808.Protocol/JT808Package.cs b/src/JT808.Protocol/JT808Package.cs index 47af02c..db9e0cd 100644 --- a/src/JT808.Protocol/JT808Package.cs +++ b/src/JT808.Protocol/JT808Package.cs @@ -22,10 +22,6 @@ namespace JT808.Protocol /// public const byte EndFlag = 0x7e; /// - /// 头部固定长度 - /// - public const int FixedHeaderLength = 12; - /// /// 起始符 /// public byte Begin { get; set; } = BeginFlag; @@ -87,8 +83,8 @@ namespace JT808.Protocol // 4.1.判断有无数据体 if (jT808Package.Header.MessageBodyProperty.DataLength > 0) { - Type jT808BodiesImplType = config.MsgIdFactory.GetBodiesImplTypeByMsgId(jT808Package.Header.MsgId, jT808Package.Header.TerminalPhoneNo); - if (jT808BodiesImplType != null) + object instance = config.MsgIdFactory.GetBodiesImplInstanceByMsgId(jT808Package.Header.MsgId, jT808Package.Header.TerminalPhoneNo); + if (instance != null) { if (jT808Package.Header.MessageBodyProperty.IsPackage) { @@ -97,7 +93,6 @@ namespace JT808.Protocol try { //4.2处理第二包之后的分包数据消息体 -#warning 2处理第二包之后的分包数据消息体 JT808SplitPackageBodies jT808SplitPackageBodies = new JT808SplitPackageBodies(); jT808Package.Bodies = jT808SplitPackageBodies.Deserialize(ref reader, config); } @@ -112,7 +107,7 @@ namespace JT808.Protocol { //4.2.处理消息体 jT808Package.Bodies = JT808MessagePackFormatterResolverExtensions.JT808DynamicDeserialize( - config.GetMessagePackFormatterByType(jT808BodiesImplType), + instance, ref reader, config); } catch (Exception ex) @@ -127,7 +122,7 @@ namespace JT808.Protocol { //4.2.处理消息体 jT808Package.Bodies = JT808MessagePackFormatterResolverExtensions.JT808DynamicDeserialize( - config.GetMessagePackFormatterByType(jT808BodiesImplType), + instance, ref reader, config); } catch (Exception ex) @@ -174,8 +169,7 @@ namespace JT808.Protocol { if (!value.Bodies.SkipSerialization) { - JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize( - config.GetMessagePackFormatterByType(value.Bodies.GetType()), + JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(value.Bodies, ref writer, value.Bodies, config); } diff --git a/src/JT808.Protocol/JT808Serializer.cs b/src/JT808.Protocol/JT808Serializer.cs index 58fe85e..8a69c2b 100644 --- a/src/JT808.Protocol/JT808Serializer.cs +++ b/src/JT808.Protocol/JT808Serializer.cs @@ -42,6 +42,21 @@ namespace JT808.Protocol } } + public ReadOnlySpan SerializeReadOnlySpan(JT808Package jT808Package, int minBufferSize = 4096) + { + byte[] buffer = JT808ArrayPool.Rent(minBufferSize); + try + { + JT808MessagePackWriter jT808MessagePackWriter = new JT808MessagePackWriter(buffer); + jT808Package.Serialize(ref jT808MessagePackWriter, jT808Package, jT808Config); + return jT808MessagePackWriter.FlushAndGetEncodingReadOnlySpan(); + } + finally + { + JT808ArrayPool.Return(buffer); + } + } + public JT808Package Deserialize(ReadOnlySpan bytes, int minBufferSize = 4096) { byte[] buffer = JT808ArrayPool.Rent(minBufferSize); @@ -73,6 +88,22 @@ namespace JT808.Protocol } } + public ReadOnlySpan SerializeReadOnlySpan(T obj, int minBufferSize = 4096) + { + byte[] buffer = JT808ArrayPool.Rent(minBufferSize); + try + { + var formatter = jT808Config.GetMessagePackFormatter(); + JT808MessagePackWriter jT808MessagePackWriter = new JT808MessagePackWriter(buffer); + formatter.Serialize(ref jT808MessagePackWriter, obj, jT808Config); + return jT808MessagePackWriter.FlushAndGetEncodingReadOnlySpan(); + } + finally + { + JT808ArrayPool.Return(buffer); + } + } + public T Deserialize(ReadOnlySpan bytes, int minBufferSize = 4096) { byte[] buffer = JT808ArrayPool.Rent(minBufferSize); diff --git a/src/JT808.Protocol/MessagePack/JT808MessagePackWriter.cs b/src/JT808.Protocol/MessagePack/JT808MessagePackWriter.cs index 3e58477..d8d5558 100644 --- a/src/JT808.Protocol/MessagePack/JT808MessagePackWriter.cs +++ b/src/JT808.Protocol/MessagePack/JT808MessagePackWriter.cs @@ -17,6 +17,17 @@ namespace JT808.Protocol.MessagePack { return writer.Written.Slice(writer.BeforeCodingWrittenPosition).ToArray(); } + + public ReadOnlySpan FlushAndGetEncodingReadOnlySpan() + { + return writer.Written.Slice(writer.BeforeCodingWrittenPosition); + } + + public ReadOnlySpan FlushAndGetRealReadOnlySpan() + { + return writer.Written; + } + public byte[] FlushAndGetRealArray() { return writer.Written.ToArray();