diff options
Diffstat (limited to 'src/org/traccar/protocol/At2000FrameDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/At2000FrameDecoder.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/At2000FrameDecoder.java b/src/org/traccar/protocol/At2000FrameDecoder.java index f87dc3885..af257d0fb 100644 --- a/src/org/traccar/protocol/At2000FrameDecoder.java +++ b/src/org/traccar/protocol/At2000FrameDecoder.java @@ -65,12 +65,11 @@ public class At2000FrameDecoder extends FrameDecoder { length = (length / BLOCK_LENGTH + 1) * BLOCK_LENGTH; } - if (buf.readableBytes() >= length || buf.readableBytes() % ACK_LENGTH == 0) { - if (buf != currentBuffer || buf.readableBytes() > acknowledgedBytes) { - sendResponse(channel); - currentBuffer = buf; - acknowledgedBytes = buf.readableBytes(); - } + if ((buf.readableBytes() >= length || buf.readableBytes() % ACK_LENGTH == 0) + && (buf != currentBuffer || buf.readableBytes() > acknowledgedBytes)) { + sendResponse(channel); + currentBuffer = buf; + acknowledgedBytes = buf.readableBytes(); } if (buf.readableBytes() >= length) { |