From 9feb2168fda27b89b20f5c1cac68547107a8589d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 8 Nov 2015 15:05:44 +1300 Subject: Clean up Java code formatting --- src/org/traccar/protocol/EelinkProtocolDecoder.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/org/traccar/protocol/EelinkProtocolDecoder.java') diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java index 0106e6049..6d77abc1b 100644 --- a/src/org/traccar/protocol/EelinkProtocolDecoder.java +++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java @@ -54,8 +54,7 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder { @Override protected Object decode( - Channel channel, SocketAddress remoteAddress, Object msg) - throws Exception { + Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { ChannelBuffer buf = (ChannelBuffer) msg; @@ -75,24 +74,20 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder { } else if (hasDeviceId() && (type == MSG_GPS || type == MSG_ALARM || type == MSG_STATE || type == MSG_SMS)) { - // Create new position Position position = new Position(); position.setDeviceId(getDeviceId()); position.setProtocol(getProtocolName()); position.set(Event.KEY_INDEX, index); - // Location position.setTime(new Date(buf.readUnsignedInt() * 1000)); position.setLatitude(buf.readInt() / 1800000.0); position.setLongitude(buf.readInt() / 1800000.0); position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte())); position.setCourse(buf.readUnsignedShort()); - // Cell position.set(Event.KEY_CELL, ChannelBuffers.hexDump(buf.readBytes(9))); - // Validity position.setValid((buf.readUnsignedByte() & 0x01) != 0); if (type == MSG_ALARM) { @@ -102,7 +97,9 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder { if (type == MSG_STATE) { position.set(Event.KEY_STATUS, buf.readUnsignedByte()); } + return position; + } return null; -- cgit v1.2.3