diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-04 13:20:46 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-04 13:20:46 +1300 |
commit | d4dbf85d9536bfec85252a58fc552e2bad42ff17 (patch) | |
tree | 4a849426c2cd60538b152138b147abef47b40966 /src/org/traccar/protocol/CellocatorProtocolDecoder.java | |
parent | 9218bc65b9673b24d2866aae3d5bbe1a5388bab0 (diff) | |
download | trackermap-server-d4dbf85d9536bfec85252a58fc552e2bad42ff17.tar.gz trackermap-server-d4dbf85d9536bfec85252a58fc552e2bad42ff17.tar.bz2 trackermap-server-d4dbf85d9536bfec85252a58fc552e2bad42ff17.zip |
Remove trailing whitespaces from code
Diffstat (limited to 'src/org/traccar/protocol/CellocatorProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/CellocatorProtocolDecoder.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java index 4aab9c207..7afe90913 100644 --- a/src/org/traccar/protocol/CellocatorProtocolDecoder.java +++ b/src/org/traccar/protocol/CellocatorProtocolDecoder.java @@ -17,7 +17,7 @@ package org.traccar.protocol; import java.nio.ByteOrder; import java.net.SocketAddress; -import java.util.Calendar; +import java.util.Calendar; import java.util.TimeZone; import org.jboss.netty.buffer.ChannelBuffer; @@ -46,7 +46,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { } return imei.toString(); } - + static final int MSG_CLIENT_STATUS = 0; static final int MSG_CLIENT_PROGRAMMING = 3; static final int MSG_CLIENT_SERIAL_LOG = 7; @@ -54,9 +54,9 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { static final int MSG_CLIENT_MODULAR = 9; private static final int MSG_SERVER_ACKNOWLEDGE = 4; - + private byte commandCount; - + private void sendReply(Channel channel, long deviceId, byte packetNumber) { ChannelBuffer reply = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, 28); reply.writeByte('M'); @@ -81,7 +81,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { channel.write(reply); } } - + @Override protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) @@ -92,7 +92,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { buf.skipBytes(4); // system code int type = buf.readUnsignedByte(); long deviceUniqueId = buf.readUnsignedInt(); - + if (type != MSG_CLIENT_SERIAL) { buf.readUnsignedShort(); // communication control } @@ -105,7 +105,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { if (type == MSG_CLIENT_STATUS) { Position position = new Position(); position.setProtocol(getProtocolName()); - + // Device identifier if (!identify(String.valueOf(deviceUniqueId), channel)) { return null; @@ -118,23 +118,23 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { // Status position.set(Event.KEY_STATUS, buf.getUnsignedByte(buf.readerIndex()) & 0x0f); - + int operator = (buf.readUnsignedByte() & 0xf0) << 4; operator += buf.readUnsignedByte(); - + buf.readUnsignedByte(); // reason data buf.readUnsignedByte(); // reason buf.readUnsignedByte(); // mode buf.readUnsignedInt(); // IO - + operator <<= 8; operator += buf.readUnsignedByte(); position.set("operator", operator); - + buf.readUnsignedInt(); // ADC buf.readUnsignedMedium(); // Odometer buf.skipBytes(6); // multi-purpose data - + buf.readUnsignedShort(); // gps fix buf.readUnsignedByte(); // location status buf.readUnsignedByte(); // mode 1 @@ -148,7 +148,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { position.setAltitude(buf.readInt() * 0.01); position.setSpeed(UnitsConverter.knotsFromMps(buf.readInt() * 0.01)); position.setCourse(buf.readUnsignedShort() / Math.PI * 180.0 / 1000.0); - + // Time Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC")); time.clear(); |