From c9403e503e269f36b93d97777c98352946e1da2f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 19 Feb 2016 10:51:16 +1300 Subject: Handle IMEI without delimiter (fix #1733) --- src/org/traccar/protocol/Gps103ProtocolDecoder.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java index a45e20ba2..e2aed6309 100644 --- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -118,11 +118,16 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { } // Send response #2 - if (sentence.length() == 15 && Character.isDigit(sentence.charAt(0))) { + if (Character.isDigit(sentence.charAt(0))) { if (channel != null) { channel.write("ON", remoteAddress); } - return null; + int start = sentence.indexOf("imei:"); + if (start >= 0) { + sentence = sentence.substring(start); + } else { + return null; + } } Position position = new Position(); -- cgit v1.2.3