aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-24 22:37:09 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-24 22:37:09 +1300
commitab8fc4daef86295f9bab39890aa6de2e51342400 (patch)
tree0886ad035e26ffa50e58cfbee58ac4112ec91789 /src/org/traccar
parentb1b5e5ce805064229f0c22ee7e898efa32d22e1a (diff)
downloadtrackermap-server-ab8fc4daef86295f9bab39890aa6de2e51342400.tar.gz
trackermap-server-ab8fc4daef86295f9bab39890aa6de2e51342400.tar.bz2
trackermap-server-ab8fc4daef86295f9bab39890aa6de2e51342400.zip
Fix exception in TK103 protocol (fix #2598)
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/Tk103ProtocolDecoder.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
index 9d04483c1..d3bc0efdc 100644
--- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
@@ -113,9 +113,11 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
String type = sentence.substring(12, 16);
if (type.equals("BP00") || type.equals("BP05")) {
String content = sentence.substring(16);
- getDeviceSession(channel, remoteAddress, content.substring(0, 15));
+ if (content.length() >= 15) {
+ getDeviceSession(channel, remoteAddress, content.substring(0, 15));
+ }
if (type.equals("BP00")) {
- channel.write("(" + id + "AP01" + content.substring(15) + ")");
+ channel.write("(" + id + "AP01HSO)");
return null;
} else if (type.equals("BP05")) {
channel.write("(" + id + "AP05)");