From cdf892cd39c528929284728562beef3220e91cf3 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 22 Nov 2020 16:41:39 -0800 Subject: Decode fault codes --- src/test/java/org/traccar/protocol/HuaShengProtocolDecoderTest.java | 4 ++++ src/test/java/org/traccar/protocol/KhdProtocolDecoderTest.java | 3 +++ 2 files changed, 7 insertions(+) (limited to 'src/test/java/org/traccar/protocol') diff --git a/src/test/java/org/traccar/protocol/HuaShengProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/HuaShengProtocolDecoderTest.java index 9ba31e08a..7348ec547 100644 --- a/src/test/java/org/traccar/protocol/HuaShengProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/HuaShengProtocolDecoderTest.java @@ -17,6 +17,10 @@ public class HuaShengProtocolDecoderTest extends ProtocolTest { verifyNull(decoder, binary( "c000000077aa0200000000000e000100143347315f48312e315f56312e30372e54000300133335353835353035303434303635380004000b3531323030303000050005010006000400070004000800050000090018383936313032353431343533333239313833360d000a000f796573696e7465726e6574c0")); + verifyAttribute(decoder, binary( + "C00000001CAA120000000000020001001001000200030043008200C100C0"), + Position.KEY_DTCS, "P0100 P0200 P0300 C0300 B0200 U0100"); + verifyAttribute(decoder, binary( "c000000049aa0000000000028e8800000032303038323630373534323800e1d47fffcd163d0000000000f30000000100157703f8000046000000000aade0ffffffff0011000800000496c0"), Position.KEY_HOURS, 58.7); diff --git a/src/test/java/org/traccar/protocol/KhdProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/KhdProtocolDecoderTest.java index 62b6070b6..aa80c1cd9 100644 --- a/src/test/java/org/traccar/protocol/KhdProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/KhdProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class KhdProtocolDecoderTest extends ProtocolTest { KhdProtocolDecoder decoder = new KhdProtocolDecoder(null); + verifyPosition(decoder, binary( + "2929a3003420b2ab46201115115601800115110350825100000133fb00df4bfdff0d000000000000000900000c180887d9ffffffffffff960d")); + verifyNull(decoder, binary( "2929b1000605162935b80d")); -- cgit v1.2.3