diff options
-rw-r--r-- | src/org/traccar/protocol/H02ProtocolDecoder.java | 14 | ||||
-rw-r--r-- | test/org/traccar/protocol/H02ProtocolDecoderTest.java | 3 |
2 files changed, 6 insertions, 11 deletions
diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index d09343bcd..1163ac75d 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2013 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,14 +26,8 @@ import org.traccar.ServerManager; import org.traccar.helper.Log; import org.traccar.model.Position; -/** - * H02 tracker protocol decoder - */ public class H02ProtocolDecoder extends BaseProtocolDecoder { - /** - * Initialize - */ public H02ProtocolDecoder(ServerManager serverManager) { super(serverManager); } @@ -47,7 +41,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { "V\\d," + // Version? "(\\d{2})(\\d{2})(\\d{2})," + // Time (HHMMSS) "([AV])," + // Validity - "(\\d{2})(\\d{2}.\\d{4})," + // Latitude (DDMM.MMMM) + "(\\d+)(\\d{2}.\\d{4})," + // Latitude (DDMM.MMMM) "([NS])," + "(\\d+)(\\d{2}.\\d{4})," + // Longitude (DDMM.MMMM) "([EW])," + @@ -56,9 +50,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { "(\\d{2})(\\d{2})(\\d{2})," + // Date (DDMMYY) ".*"); - /** - * Decode message - */ + @Override protected Object decode( ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { diff --git a/test/org/traccar/protocol/H02ProtocolDecoderTest.java b/test/org/traccar/protocol/H02ProtocolDecoderTest.java index 235ef279e..46aee3aee 100644 --- a/test/org/traccar/protocol/H02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/H02ProtocolDecoderTest.java @@ -15,6 +15,9 @@ public class H02ProtocolDecoderTest { assertNotNull(decoder.decode(null, null, "*HQ,123456789012345,V1,155850,A,5214.5346,N,2117.4683,E,0.00,270.90,131012,ffffffff,000000,000000,000000,000000")); + assertNotNull(decoder.decode(null, null, + "*HQ,354188045498669,V1,195200,A,701.8915,S,3450.3399,W,0.00,205.70,050213,ffffffff,000243,000000,000000")); + } } |