diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-26 11:58:08 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-26 11:58:08 +1300 |
commit | 7ee16ab6fe928171ded0e188811a631743285a58 (patch) | |
tree | 3679b75ebc1f8f13e7914d9c114bff058418e6e8 /src/org/traccar/protocol/EnforaProtocolDecoder.java | |
parent | 64aa76a78916310cfbc14ec3ae6083555b95a4a0 (diff) | |
download | trackermap-server-7ee16ab6fe928171ded0e188811a631743285a58.tar.gz trackermap-server-7ee16ab6fe928171ded0e188811a631743285a58.tar.bz2 trackermap-server-7ee16ab6fe928171ded0e188811a631743285a58.zip |
Refactor Riti protocol decoder
Diffstat (limited to 'src/org/traccar/protocol/EnforaProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/EnforaProtocolDecoder.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/EnforaProtocolDecoder.java b/src/org/traccar/protocol/EnforaProtocolDecoder.java index 0c0b5afe9..18f68a32d 100644 --- a/src/org/traccar/protocol/EnforaProtocolDecoder.java +++ b/src/org/traccar/protocol/EnforaProtocolDecoder.java @@ -26,6 +26,7 @@ import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; +import org.traccar.helper.StringFinder; import org.traccar.model.Position; public class EnforaProtocolDecoder extends BaseProtocolDecoder { @@ -77,8 +78,8 @@ public class EnforaProtocolDecoder extends BaseProtocolDecoder { } // Find GPSMC string - Integer start = ChannelBufferTools.find(buf, 0, buf.readableBytes(), "GPRMC"); - if (start == null) { + int start = buf.indexOf(buf.readerIndex(), buf.writerIndex(), new StringFinder("GPRMC")); + if (start == -1) { // Message does not contain GPS data return null; } |