From c0d85d814cd6ca1cbbcc14ccefef7fb7e875f190 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 6 Oct 2016 13:46:20 +0500 Subject: Simplification and style fix --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index e2ddccaa7..2d28ea199 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -38,7 +38,8 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { } private static final Pattern PATTERN_ACK = new PatternBuilder() - .text("+ACK:GT").expression("...,") + .text("+ACK:GT") + .expression("...,") // type .number("([0-9A-Z]{2}xxxx),") // protocol version .number("(d{15}),") // imei .any().text(",") @@ -639,7 +640,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { Object result; String type = sentence.substring(typeIndex + 3, typeIndex + 6); - if (typeIndex >= 4 && sentence.startsWith("+ACK", typeIndex - 4)) { + if (sentence.startsWith("+ACK")) { result = decodeAck(channel, remoteAddress, sentence, type); } else { switch (type) { -- cgit v1.2.3