aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Avl301ProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/Avl301ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Avl301ProtocolDecoder.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/Avl301ProtocolDecoder.java b/src/org/traccar/protocol/Avl301ProtocolDecoder.java
index 1f1fdd6f8..f0ad97bf8 100644
--- a/src/org/traccar/protocol/Avl301ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Avl301ProtocolDecoder.java
@@ -15,6 +15,9 @@
*/
package org.traccar.protocol;
+import java.net.SocketAddress;
+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;
@@ -22,10 +25,6 @@ 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;
-
public class Avl301ProtocolDecoder extends BaseProtocolDecoder {
public Avl301ProtocolDecoder(Avl301Protocol protocol) {
@@ -114,8 +113,12 @@ public class Avl301ProtocolDecoder extends BaseProtocolDecoder {
int union = buf.readUnsignedShort();
position.setCourse(union & 0x03FF);
position.setValid((union & 0x1000) != 0);
- if ((union & 0x0400) != 0) latitude = -latitude;
- if ((union & 0x0800) != 0) longitude = -longitude;
+ if ((union & 0x0400) != 0) {
+ latitude = -latitude;
+ }
+ if ((union & 0x0800) != 0) {
+ longitude = -longitude;
+ }
position.setLatitude(latitude);
position.setLongitude(longitude);