diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/Context.java | 3 | ||||
-rw-r--r-- | src/org/traccar/protocol/RoboTrackFrameDecoder.java | 2 | ||||
-rw-r--r-- | src/org/traccar/protocol/SabertekFrameDecoder.java | 2 |
3 files changed, 2 insertions, 5 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 2afdde3b9..d607baf3e 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -87,9 +87,6 @@ import javax.ws.rs.client.ClientBuilder; public final class Context { - private static final String USER_AGENT = - "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0"; - private Context() { } diff --git a/src/org/traccar/protocol/RoboTrackFrameDecoder.java b/src/org/traccar/protocol/RoboTrackFrameDecoder.java index aecbaaa3b..85ed6c76f 100644 --- a/src/org/traccar/protocol/RoboTrackFrameDecoder.java +++ b/src/org/traccar/protocol/RoboTrackFrameDecoder.java @@ -23,7 +23,7 @@ import org.traccar.BaseFrameDecoder; public class RoboTrackFrameDecoder extends BaseFrameDecoder { private int messageLength(ByteBuf buf) { - switch ((int) buf.getByte(buf.readerIndex())) { + switch (buf.getUnsignedByte(buf.readerIndex())) { case RoboTrackProtocolDecoder.MSG_ID: return 69; case RoboTrackProtocolDecoder.MSG_ACK: diff --git a/src/org/traccar/protocol/SabertekFrameDecoder.java b/src/org/traccar/protocol/SabertekFrameDecoder.java index 771ef9cfb..ad5000bf8 100644 --- a/src/org/traccar/protocol/SabertekFrameDecoder.java +++ b/src/org/traccar/protocol/SabertekFrameDecoder.java @@ -29,7 +29,7 @@ public class SabertekFrameDecoder extends BaseFrameDecoder { int beginIndex = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) 0x02); if (beginIndex >= 0) { int endIndex = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) 0x03); - if (beginIndex >= 0) { + if (endIndex >= 0) { buf.readerIndex(beginIndex + 1); ByteBuf frame = buf.readRetainedSlice(endIndex - beginIndex - 1); buf.readerIndex(endIndex + 1); |