aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/NoranProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-04-29 13:41:15 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-04-29 13:41:15 +1200
commitf7198adaf371e08a72a837d417b29531c117c6ba (patch)
tree853fb51b64cd00aaa6e53d4e510bbf69859e7765 /src/org/traccar/protocol/NoranProtocolDecoder.java
parentcb0a3831c2d89a22e9f3b68d3ee17f6e2abdd424 (diff)
downloadtrackermap-server-f7198adaf371e08a72a837d417b29531c117c6ba.tar.gz
trackermap-server-f7198adaf371e08a72a837d417b29531c117c6ba.tar.bz2
trackermap-server-f7198adaf371e08a72a837d417b29531c117c6ba.zip
Store other data in position
Diffstat (limited to 'src/org/traccar/protocol/NoranProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/NoranProtocolDecoder.java14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/org/traccar/protocol/NoranProtocolDecoder.java b/src/org/traccar/protocol/NoranProtocolDecoder.java
index 5021f6cd4..a93f16872 100644
--- a/src/org/traccar/protocol/NoranProtocolDecoder.java
+++ b/src/org/traccar/protocol/NoranProtocolDecoder.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.Properties;
import java.util.TimeZone;
import org.jboss.netty.buffer.ChannelBuffer;
@@ -28,9 +27,6 @@ import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.traccar.BaseProtocolDecoder;
-import org.traccar.database.DataManager;
-import org.traccar.helper.Log;
-import org.traccar.model.ExtendedInfoFormatter;
import org.traccar.model.Position;
public class NoranProtocolDecoder extends BaseProtocolDecoder {
@@ -76,7 +72,7 @@ public class NoranProtocolDecoder extends BaseProtocolDecoder {
// Create new position
Position position = new Position();
- ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol());
+ position.setProtocol(getProtocol());
if (type == MSG_CONTROL_RESPONSE) {
buf.readUnsignedInt(); // GIS ip
@@ -88,7 +84,7 @@ public class NoranProtocolDecoder extends BaseProtocolDecoder {
position.setValid((flags & 0x01) != 0);
// Alarm type
- extendedInfo.set("alarm", buf.readUnsignedByte());
+ position.set("alarm", buf.readUnsignedByte());
// Location
position.setSpeed(buf.readUnsignedByte());
@@ -116,12 +112,10 @@ public class NoranProtocolDecoder extends BaseProtocolDecoder {
position.setDeviceId(getDeviceId());
// IO status
- extendedInfo.set("io", buf.readUnsignedByte());
+ position.set("io", buf.readUnsignedByte());
// Fuel
- extendedInfo.set("fuel", buf.readUnsignedByte());
-
- position.setExtendedInfo(extendedInfo.toString());
+ position.set("fuel", buf.readUnsignedByte());
return position;
}