diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-21 00:31:53 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-21 00:31:53 +1200 |
commit | ce1a5a24bbf0a74335cab0799c2d0acdcdde761c (patch) | |
tree | b79ff4074bb031dc07cd1fcffcd30f0b321d48f8 /src/org/traccar | |
parent | 27d1708b0e8062b143e4ca0ea818a6f0301e9a3e (diff) | |
download | traccar-server-ce1a5a24bbf0a74335cab0799c2d0acdcdde761c.tar.gz traccar-server-ce1a5a24bbf0a74335cab0799c2d0acdcdde761c.tar.bz2 traccar-server-ce1a5a24bbf0a74335cab0799c2d0acdcdde761c.zip |
Support newer Wialon protocol versions
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/WialonProtocolDecoder.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/WialonProtocolDecoder.java b/src/org/traccar/protocol/WialonProtocolDecoder.java index a07dfc7c9..90b7e7847 100644 --- a/src/org/traccar/protocol/WialonProtocolDecoder.java +++ b/src/org/traccar/protocol/WialonProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2014 Anton Tananaev (anton@traccar.org) + * Copyright 2013 - 2017 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -136,7 +136,9 @@ public class WialonProtocolDecoder extends BaseProtocolDecoder { if (sentence.startsWith("#L#")) { - String imei = sentence.substring(3, sentence.indexOf(';')); + String[] values = sentence.substring(3).split(";"); + + String imei = values[0].indexOf('.') >= 0 ? values[1] : values[0]; DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, imei); if (deviceSession != null) { sendResponse(channel, "#AL#", 1); |