From 30cf4d484307ad89ce538bae36c47c91eb430536 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 9 Oct 2015 22:33:56 +1300 Subject: Fix some check style issues --- src/org/traccar/protocol/WialonProtocolDecoder.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/org/traccar/protocol/WialonProtocolDecoder.java') diff --git a/src/org/traccar/protocol/WialonProtocolDecoder.java b/src/org/traccar/protocol/WialonProtocolDecoder.java index 09e766e56..47158808c 100644 --- a/src/org/traccar/protocol/WialonProtocolDecoder.java +++ b/src/org/traccar/protocol/WialonProtocolDecoder.java @@ -169,21 +169,20 @@ public class WialonProtocolDecoder extends BaseProtocolDecoder { String sentence = (String) msg; - // Detect device ID if (sentence.startsWith("#L#")) { + + // Detect device ID String imei = sentence.substring(3, sentence.indexOf(';')); if (identify(imei, channel)) { sendResponse(channel, "#AL#", 1); } - } - // Heartbeat - else if (sentence.startsWith("#P#")) { + } else if (sentence.startsWith("#P#")) { + + // Heartbeat sendResponse(channel, "#AP#", null); - } - // Parse message - else if (sentence.startsWith("#SD#") || sentence.startsWith("#D#")) { + } else if (sentence.startsWith("#SD#") || sentence.startsWith("#D#")) { Position position = decodePosition( sentence.substring(sentence.indexOf('#', 1) + 1)); @@ -192,9 +191,8 @@ public class WialonProtocolDecoder extends BaseProtocolDecoder { sendResponse(channel, "#AD#", 1); return position; } - } - else if (sentence.startsWith("#B#")) { + } else if (sentence.startsWith("#B#")) { String[] messages = sentence.substring(sentence.indexOf('#', 1) + 1).split("\\|"); List positions = new LinkedList<>(); -- cgit v1.2.3