aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/MegastekFrameDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-06-24 11:32:20 -0700
committerGitHub <noreply@github.com>2021-06-24 11:32:20 -0700
commitcd2f5a5a65e9f5068995831277c37b45df2a20f4 (patch)
tree0d79883b808dd2705acb31310638f5cb424083fb /src/main/java/org/traccar/protocol/MegastekFrameDecoder.java
parent229a96994136ad468264f8a084748c4fc17d35f1 (diff)
parenta7aca62f89a69711ff489dbd7753be005e968aec (diff)
downloadtrackermap-server-cd2f5a5a65e9f5068995831277c37b45df2a20f4.tar.gz
trackermap-server-cd2f5a5a65e9f5068995831277c37b45df2a20f4.tar.bz2
trackermap-server-cd2f5a5a65e9f5068995831277c37b45df2a20f4.zip
Merge pull request #4706 from Elsensee/megastek-fixes
Improve compatibility with megastek devices
Diffstat (limited to 'src/main/java/org/traccar/protocol/MegastekFrameDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/MegastekFrameDecoder.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/MegastekFrameDecoder.java b/src/main/java/org/traccar/protocol/MegastekFrameDecoder.java
index 347fa24b1..a4091436c 100644
--- a/src/main/java/org/traccar/protocol/MegastekFrameDecoder.java
+++ b/src/main/java/org/traccar/protocol/MegastekFrameDecoder.java
@@ -46,6 +46,9 @@ public class MegastekFrameDecoder extends BaseFrameDecoder {
if (delimiter == -1) {
delimiter = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) '!');
}
+ if (delimiter == -1) {
+ delimiter = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) '\n');
+ }
if (delimiter != -1) {
ByteBuf result = buf.readRetainedSlice(delimiter - buf.readerIndex());
buf.skipBytes(1);