diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-04-29 22:52:33 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-04-29 22:52:33 -0700 |
commit | 74d366e3dc82e1a5854efd905b6a72201dbde89c (patch) | |
tree | b7eaf0ab5d7bf5aa513cb9c888f385082ce9aae6 /src | |
parent | 6e0c20ed4dcdd7087b3c6adec312ac5796274ba1 (diff) | |
download | traccar-server-74d366e3dc82e1a5854efd905b6a72201dbde89c.tar.gz traccar-server-74d366e3dc82e1a5854efd905b6a72201dbde89c.tar.bz2 traccar-server-74d366e3dc82e1a5854efd905b6a72201dbde89c.zip |
Decode additional fields
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/RadarProtocolDecoder.java | 6 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/RadarProtocolDecoderTest.java | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/RadarProtocolDecoder.java b/src/main/java/org/traccar/protocol/RadarProtocolDecoder.java index 765171e9c..b56a081c7 100644 --- a/src/main/java/org/traccar/protocol/RadarProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/RadarProtocolDecoder.java @@ -172,6 +172,12 @@ public class RadarProtocolDecoder extends BaseProtocolDecoder { if (mask.get(50)) { buf.readShort(); // tilt } + if (mask.get(51)) { + buf.readUnsignedInt(); // partial hours + } + if (mask.get(52)) { + buf.readUnsignedInt(); // accumulated hours + } if (position.getDeviceTime() != null && position.getFixTime() != null) { positions.add(position); diff --git a/src/test/java/org/traccar/protocol/RadarProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/RadarProtocolDecoderTest.java index 3289474d1..7dfdd7c21 100644 --- a/src/test/java/org/traccar/protocol/RadarProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/RadarProtocolDecoderTest.java @@ -1,18 +1,16 @@ package org.traccar.protocol; -import org.junit.Ignore; import org.junit.Test; import org.traccar.ProtocolTest; public class RadarProtocolDecoderTest extends ProtocolTest { - @Ignore @Test public void testDecode() throws Exception { RadarProtocolDecoder decoder = new RadarProtocolDecoder(null); - verifyPosition(decoder, binary( + verifyPositions(decoder, binary( "361800011459015cb497554c01c101ff003500050038000207ff831c04c01f1c00555cb464895cb46487ff7f04eafeffdbd80000079402ead0000000110000000000120d2aff150000000000000002000a00050002436c61726f0000000000008b00000003764500037653005207ff831c04c01f1c00555cb4648a5cb46489ff7f04eafeffdbd80000079402ead0000000010000000000120e00ff150000000000000002000800060002436c61726f0000000000008d00000003764600037654000207ff831c04c01f1c00555cb464d85cb464d7ff7f04eafeffdbd80000079402ead0000000110000000000120e2aff150000000000000002000700070003436c61726f0000000000008d000000037694000376a2005207ff831c04c01f1c00555cb464d95cb464d9ff7f04eafeffdbd80000079402eac0000000010000000000120e00ff150000000000000002000700070003436c61726f0000000000008d000000037695000376a3000207ff831c04c01f1c00555cb465065cb46504ff7f04eafeffdbd80000079402ead0000000110000000000120e2aff150000000000000000000500060005436c61726f0000000000008d0000000376c2000376d07ed7")); } |