aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Muratov <binakot@gmail.com>2017-07-13 09:10:57 +0300
committerIvan Muratov <binakot@gmail.com>2017-07-13 09:10:57 +0300
commitf643173b6b2c52a3896d6ee13578edd86f9eb3e7 (patch)
tree7516026071e88fd1fdc37fd7d00372f08f57710a
parent93227f9bffdfce2f1d60a61ea88f4eb152dfada5 (diff)
downloadtrackermap-server-f643173b6b2c52a3896d6ee13578edd86f9eb3e7.tar.gz
trackermap-server-f643173b6b2c52a3896d6ee13578edd86f9eb3e7.tar.bz2
trackermap-server-f643173b6b2c52a3896d6ee13578edd86f9eb3e7.zip
Fix build issues.
[ERROR] src/org/traccar/protocol/Arnavi4FrameDecoder.java:[13,49] (whitespace) WhitespaceAfter: 'typecast' is not followed by whitespace. [ERROR] src/org/traccar/protocol/Arnavi4ProtocolDecoder.java:[18] (imports) AvoidStarImport: Using the '.*' form of import should be avoided - org.traccar.protocol.Arnavi4FrameDecoder.*. [ERROR] src/org/traccar/protocol/Arnavi4ProtocolDecoder.java:[102] (sizes) LineLength: Line is longer than 120 characters (found 125). [ERROR] src/org/traccar/protocol/Arnavi4ProtocolDecoder.java:[135,41] (blocks) AvoidNestedBlocks: Avoid nested blocks.
-rw-r--r--src/org/traccar/protocol/Arnavi4FrameDecoder.java2
-rw-r--r--src/org/traccar/protocol/Arnavi4ProtocolDecoder.java16
2 files changed, 10 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/Arnavi4FrameDecoder.java b/src/org/traccar/protocol/Arnavi4FrameDecoder.java
index eaf829cc3..97bf75a20 100644
--- a/src/org/traccar/protocol/Arnavi4FrameDecoder.java
+++ b/src/org/traccar/protocol/Arnavi4FrameDecoder.java
@@ -10,7 +10,7 @@ import org.jboss.netty.handler.codec.frame.FrameDecoder;
*/
public class Arnavi4FrameDecoder extends FrameDecoder {
- static final byte HEADER_START_SIGN = (byte)0xFF;
+ static final byte HEADER_START_SIGN = (byte) 0xFF;
static final byte HEADER_VERSION_1 = 0x22;
static final byte HEADER_VERSION_2 = 0x23;
static final int HEADER_LENGTH = 10;
diff --git a/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java b/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java
index 46caebb71..c5ec3f31f 100644
--- a/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java
@@ -15,7 +15,11 @@ import java.util.Date;
import java.util.LinkedList;
import java.util.List;
-import static org.traccar.protocol.Arnavi4FrameDecoder.*;
+import static org.traccar.protocol.Arnavi4FrameDecoder.HEADER_START_SIGN;
+import static org.traccar.protocol.Arnavi4FrameDecoder.HEADER_VERSION_1;
+import static org.traccar.protocol.Arnavi4FrameDecoder.HEADER_VERSION_2;
+import static org.traccar.protocol.Arnavi4FrameDecoder.PACKAGE_START_SIGN;
+import static org.traccar.protocol.Arnavi4FrameDecoder.PACKAGE_END_SIGN;
/**
* Created by Ivan Muratov @binakot on 11.07.2017.
@@ -99,9 +103,9 @@ public class Arnavi4ProtocolDecoder extends BaseProtocolDecoder {
} else if (version == HEADER_VERSION_2) {
response = ChannelBuffers.dynamicBuffer(ByteOrder.LITTLE_ENDIAN, 9);
response.writeBytes(new byte[]{0x7B, 0x04, 0x00});
- byte[] timestampBytes = ByteBuffer.allocate(4).putInt((int) (System.currentTimeMillis() / 1000)).array();
- response.writeByte(Checksum.modulo256(timestampBytes));
- response.writeBytes(timestampBytes);
+ byte[] timeBytes = ByteBuffer.allocate(4).putInt((int) (System.currentTimeMillis() / 1000)).array();
+ response.writeByte(Checksum.modulo256(timeBytes));
+ response.writeBytes(timeBytes);
response.writeByte(0x7D);
} else {
@@ -132,7 +136,7 @@ public class Arnavi4ProtocolDecoder extends BaseProtocolDecoder {
case RECORD_DATA:
case RECORD_TEXT:
case RECORD_FILE:
- case RECORD_BINARY: {
+ case RECORD_BINARY:
int length = buf.readUnsignedShort();
long timestamp = buf.readUnsignedInt() * 1000;
ChannelBuffer recordBuf = buf.readBytes(length);
@@ -142,9 +146,7 @@ public class Arnavi4ProtocolDecoder extends BaseProtocolDecoder {
}
buf.readUnsignedByte(); // crc
-
break;
- }
default:
throw new IllegalArgumentException("unsupported record type");