diff options
-rw-r--r-- | src/org/traccar/protocol/V680ProtocolDecoder.java | 4 | ||||
-rw-r--r-- | test/org/traccar/protocol/V680ProtocolDecoderTest.java | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/V680ProtocolDecoder.java b/src/org/traccar/protocol/V680ProtocolDecoder.java index 53843c23d..570069116 100644 --- a/src/org/traccar/protocol/V680ProtocolDecoder.java +++ b/src/org/traccar/protocol/V680ProtocolDecoder.java @@ -38,7 +38,7 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder { static private Pattern pattern = Pattern.compile( "(?:#(\\d+)#" + // IMEI "([^#]*)#)?" + // User - "([01])#" + // Fix + "(\\d+)#" + // Fix "([^#]+)#" + // Password "[^#]+#" + "(\\d+)#" + // Packet number @@ -101,7 +101,7 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder { extendedInfo.set("user", parser.group(index++)); // Validity - position.setValid(parser.group(index++).compareTo("1") == 0 ? true : false); + position.setValid(Integer.valueOf(parser.group(index++)) > 0 ? true : false); // Password extendedInfo.set("password", parser.group(index++)); diff --git a/test/org/traccar/protocol/V680ProtocolDecoderTest.java b/test/org/traccar/protocol/V680ProtocolDecoderTest.java index 89c4c8747..f3ee5f968 100644 --- a/test/org/traccar/protocol/V680ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/V680ProtocolDecoderTest.java @@ -41,6 +41,9 @@ public class V680ProtocolDecoderTest { assertNotNull(decoder.decode(null, null, "#352897045085282##0#0000#AUT#1#72400510730208,00d36307,10734fc4#4647.8922,W,2339.1956,S,2.60,63.74#200413#094310.000##")); + + assertNotNull(decoder.decode(null, null, + "#352165050199210##13#0000#AUT#1#72400605471305,054712fd,054712ff#05144.0008,W,3005.5011,S,0.11,201.46#260713#172647.000##")); } |