aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/FilterHandler.java6
-rw-r--r--src/org/traccar/ServerManager.java1
-rw-r--r--src/org/traccar/database/DataManager.java1
-rw-r--r--src/org/traccar/protocol/CastelProtocolDecoder.java1
-rw-r--r--src/org/traccar/protocol/CellocatorProtocolDecoder.java16
-rw-r--r--src/org/traccar/protocol/EelinkProtocolDecoder.java12
-rw-r--r--src/org/traccar/protocol/FlextrackProtocol.java4
-rw-r--r--src/org/traccar/protocol/FlextrackProtocolDecoder.java15
-rw-r--r--src/org/traccar/protocol/GpsMarkerProtocolDecoder.java11
-rw-r--r--src/org/traccar/protocol/Mta6ProtocolDecoder.java6
-rw-r--r--src/org/traccar/protocol/MxtFrameDecoder.java5
-rw-r--r--src/org/traccar/protocol/NavigilProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/ProgressProtocolDecoder.java6
13 files changed, 20 insertions, 66 deletions
diff --git a/src/org/traccar/FilterHandler.java b/src/org/traccar/FilterHandler.java
index a7d7ed6b2..9eb92135f 100644
--- a/src/org/traccar/FilterHandler.java
+++ b/src/org/traccar/FilterHandler.java
@@ -19,8 +19,6 @@ import org.traccar.helper.DistanceCalculator;
import org.traccar.helper.Log;
import org.traccar.model.Position;
-import java.util.Date;
-
public class FilterHandler extends BaseDataHandler {
private static final long FILTER_FUTURE_LIMIT = 5 * 60 * 1000;
@@ -72,8 +70,8 @@ public class FilterHandler extends BaseDataHandler {
private boolean filterZero(Position position) {
return filterZero &&
- (position.getLatitude() == 0.0) &&
- (position.getLongitude() == 0.0);
+ position.getLatitude() == 0.0 &&
+ position.getLongitude() == 0.0;
}
private boolean filterDuplicate(Position position) {
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index d7fb46070..f337b99cd 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -19,7 +19,6 @@ import java.io.File;
import java.net.URI;
import java.net.URL;
import java.net.URLDecoder;
-import java.sql.SQLException;
import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index 053eb9814..1cd8ebb32 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -24,7 +24,6 @@ import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
-import java.text.ParseException;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
diff --git a/src/org/traccar/protocol/CastelProtocolDecoder.java b/src/org/traccar/protocol/CastelProtocolDecoder.java
index bd20def8b..ceed8f5ef 100644
--- a/src/org/traccar/protocol/CastelProtocolDecoder.java
+++ b/src/org/traccar/protocol/CastelProtocolDecoder.java
@@ -19,7 +19,6 @@ import java.net.SocketAddress;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
import java.util.Calendar;
-import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.TimeZone;
diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java
index 7afe90913..45505a7c7 100644
--- a/src/org/traccar/protocol/CellocatorProtocolDecoder.java
+++ b/src/org/traccar/protocol/CellocatorProtocolDecoder.java
@@ -15,14 +15,12 @@
*/
package org.traccar.protocol;
-import java.nio.ByteOrder;
import java.net.SocketAddress;
+import java.nio.ByteOrder;
import java.util.Calendar;
import java.util.TimeZone;
-
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
-
import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.helper.UnitsConverter;
@@ -35,18 +33,6 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder {
super(protocol);
}
- private String readImei(ChannelBuffer buf) {
- int b = buf.readUnsignedByte();
- StringBuilder imei = new StringBuilder();
- imei.append(b & 0x0F);
- for (int i = 0; i < 7; i++) {
- b = buf.readUnsignedByte();
- imei.append((b & 0xF0) >> 4);
- imei.append(b & 0x0F);
- }
- 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;
diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java
index 08612dafd..52f6a7f63 100644
--- a/src/org/traccar/protocol/EelinkProtocolDecoder.java
+++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java
@@ -32,18 +32,6 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder {
super(protocol);
}
- private String readImei(ChannelBuffer buf) {
- int b = buf.readUnsignedByte();
- StringBuilder imei = new StringBuilder();
- imei.append(b & 0x0F);
- for (int i = 0; i < 7; i++) {
- b = buf.readUnsignedByte();
- imei.append((b & 0xF0) >> 4);
- imei.append(b & 0x0F);
- }
- return imei.toString();
- }
-
private static final int MSG_LOGIN = 0x01;
private static final int MSG_GPS = 0x02;
private static final int MSG_HEARTBEAT = 0x03;
diff --git a/src/org/traccar/protocol/FlextrackProtocol.java b/src/org/traccar/protocol/FlextrackProtocol.java
index 43e81dd5f..0d1b13d8a 100644
--- a/src/org/traccar/protocol/FlextrackProtocol.java
+++ b/src/org/traccar/protocol/FlextrackProtocol.java
@@ -15,17 +15,15 @@
*/
package org.traccar.protocol;
+import java.util.List;
import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.ChannelPipeline;
-import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder;
import org.jboss.netty.handler.codec.string.StringDecoder;
import org.jboss.netty.handler.codec.string.StringEncoder;
import org.traccar.BaseProtocol;
import org.traccar.CharacterDelimiterFrameDecoder;
import org.traccar.TrackerServer;
-import java.util.List;
-
public class FlextrackProtocol extends BaseProtocol {
public FlextrackProtocol() {
diff --git a/src/org/traccar/protocol/FlextrackProtocolDecoder.java b/src/org/traccar/protocol/FlextrackProtocolDecoder.java
index 9723eda02..ec0f0a05c 100644
--- a/src/org/traccar/protocol/FlextrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/FlextrackProtocolDecoder.java
@@ -15,19 +15,16 @@
*/
package org.traccar.protocol;
-import org.jboss.netty.channel.Channel;
-import org.traccar.BaseProtocolDecoder;
-import org.traccar.helper.Crc;
-import org.traccar.helper.PatternUtil;
-import org.traccar.helper.UnitsConverter;
-import org.traccar.model.Event;
-import org.traccar.model.Position;
-
import java.net.SocketAddress;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.jboss.netty.channel.Channel;
+import org.traccar.BaseProtocolDecoder;
+import org.traccar.helper.UnitsConverter;
+import org.traccar.model.Event;
+import org.traccar.model.Position;
public class FlextrackProtocolDecoder extends BaseProtocolDecoder {
@@ -99,8 +96,6 @@ public class FlextrackProtocolDecoder extends BaseProtocolDecoder {
} else if (sentence.contains("UNITSTAT") && hasDeviceId()) {
- String x = PatternUtil.checkPattern(pattern.pattern(), sentence);
-
Matcher parser = pattern.matcher(sentence);
if (!parser.matches()) {
return null;
diff --git a/src/org/traccar/protocol/GpsMarkerProtocolDecoder.java b/src/org/traccar/protocol/GpsMarkerProtocolDecoder.java
index 3c095853f..2b2f286c0 100644
--- a/src/org/traccar/protocol/GpsMarkerProtocolDecoder.java
+++ b/src/org/traccar/protocol/GpsMarkerProtocolDecoder.java
@@ -15,16 +15,15 @@
*/
package org.traccar.protocol;
-import org.jboss.netty.channel.Channel;
-import org.traccar.BaseProtocolDecoder;
-import org.traccar.model.Event;
-import org.traccar.model.Position;
-
import java.net.SocketAddress;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.jboss.netty.channel.Channel;
+import org.traccar.BaseProtocolDecoder;
+import org.traccar.model.Event;
+import org.traccar.model.Position;
public class GpsMarkerProtocolDecoder extends BaseProtocolDecoder {
@@ -52,8 +51,6 @@ public class GpsMarkerProtocolDecoder extends BaseProtocolDecoder {
"(\\d{3})" + // Temperature
".*");
- private static final Pattern handshakePattern = Pattern.compile("##,imei:(\\d+),A");
-
@Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg)
diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java
index 4fb7d0ecd..8827393dc 100644
--- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java
@@ -15,8 +15,8 @@
*/
package org.traccar.protocol;
-import java.nio.charset.Charset;
import java.net.SocketAddress;
+import java.nio.charset.Charset;
import java.util.Calendar;
import java.util.Date;
import java.util.LinkedList;
@@ -31,8 +31,8 @@ import org.jboss.netty.handler.codec.http.HttpResponse;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
import org.jboss.netty.handler.codec.http.HttpVersion;
import org.traccar.BaseProtocolDecoder;
-import org.traccar.helper.BitUtil;
import org.traccar.Protocol;
+import org.traccar.helper.BitUtil;
import org.traccar.helper.ChannelBufferTools;
import org.traccar.model.Event;
import org.traccar.model.Position;
@@ -301,7 +301,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
short offset = buf.readUnsignedByte(); // dataOffset
short packetCount = buf.readUnsignedByte();
buf.readUnsignedByte(); // reserved
- short parameters = buf.readUnsignedByte(); // TODO: handle timezone
+ buf.readUnsignedByte(); // TODO: handle timezone
buf.skipBytes(offset - 5);
// Send response
diff --git a/src/org/traccar/protocol/MxtFrameDecoder.java b/src/org/traccar/protocol/MxtFrameDecoder.java
index 23dc64d01..92723ec16 100644
--- a/src/org/traccar/protocol/MxtFrameDecoder.java
+++ b/src/org/traccar/protocol/MxtFrameDecoder.java
@@ -15,14 +15,13 @@
*/
package org.traccar.protocol;
+import java.nio.ByteOrder;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.frame.FrameDecoder;
-import java.nio.ByteOrder;
-
public class MxtFrameDecoder extends FrameDecoder {
@Override
@@ -48,8 +47,6 @@ public class MxtFrameDecoder extends FrameDecoder {
}
}
- String s = ChannelBuffers.hexDump(result);
-
return result;
}
diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java
index 3e38890d4..686c8a691 100644
--- a/src/org/traccar/protocol/NavigilProtocolDecoder.java
+++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java
@@ -188,7 +188,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
short flags = buf.readUnsignedByte();
position.setValid((flags & 0x80) == 0x80 && (flags & 0x40) == 0x40);
- int x = buf.readUnsignedByte(); // satellites in fix
+ position.set(Event.KEY_SATELLITES, buf.readUnsignedByte());
buf.readUnsignedInt(); // distance
return position;
}
diff --git a/src/org/traccar/protocol/ProgressProtocolDecoder.java b/src/org/traccar/protocol/ProgressProtocolDecoder.java
index b8f3e48ca..4ff7e8f68 100644
--- a/src/org/traccar/protocol/ProgressProtocolDecoder.java
+++ b/src/org/traccar/protocol/ProgressProtocolDecoder.java
@@ -15,18 +15,16 @@
*/
package org.traccar.protocol;
+import java.net.SocketAddress;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
-import java.net.SocketAddress;
import java.util.Calendar;
import java.util.LinkedList;
import java.util.List;
import java.util.TimeZone;
-
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
-
import org.traccar.BaseProtocolDecoder;
import org.traccar.model.Event;
import org.traccar.model.Position;
@@ -74,7 +72,7 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder {
// Authentication
if (type == MSG_IDENT || type == MSG_IDENT_FULL) {
- long id = buf.readUnsignedInt();
+ buf.readUnsignedInt(); // id
int length = buf.readUnsignedShort();
buf.skipBytes(length);
length = buf.readUnsignedShort();