aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-02-19 10:51:16 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-02-19 10:51:16 +1300
commitc9403e503e269f36b93d97777c98352946e1da2f (patch)
treeb0e0460f3b2acb7ace0206883babf616f5352fc3 /src/org/traccar
parent6ea8778be3d7426fa9281f9260081e1863fae4bd (diff)
downloadtrackermap-server-c9403e503e269f36b93d97777c98352946e1da2f.tar.gz
trackermap-server-c9403e503e269f36b93d97777c98352946e1da2f.tar.bz2
trackermap-server-c9403e503e269f36b93d97777c98352946e1da2f.zip
Handle IMEI without delimiter (fix #1733)
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/Gps103ProtocolDecoder.java9
1 files changed, 7 insertions, 2 deletions
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();