From ce1a5a24bbf0a74335cab0799c2d0acdcdde761c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 21 Apr 2017 00:31:53 +1200 Subject: Support newer Wialon protocol versions --- src/org/traccar/protocol/WialonProtocolDecoder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3