diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-29 13:41:15 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-29 13:41:15 +1200 |
commit | f7198adaf371e08a72a837d417b29531c117c6ba (patch) | |
tree | 853fb51b64cd00aaa6e53d4e510bbf69859e7765 /src/org/traccar/protocol/PiligrimProtocolDecoder.java | |
parent | cb0a3831c2d89a22e9f3b68d3ee17f6e2abdd424 (diff) | |
download | trackermap-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/PiligrimProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/PiligrimProtocolDecoder.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/org/traccar/protocol/PiligrimProtocolDecoder.java b/src/org/traccar/protocol/PiligrimProtocolDecoder.java index 652b2cd37..f4eafd833 100644 --- a/src/org/traccar/protocol/PiligrimProtocolDecoder.java +++ b/src/org/traccar/protocol/PiligrimProtocolDecoder.java @@ -20,7 +20,6 @@ import java.nio.charset.Charset; import java.util.Calendar; import java.util.LinkedList; import java.util.List; -import java.util.Properties; import java.util.TimeZone; import org.jboss.netty.buffer.ChannelBuffer; @@ -35,9 +34,6 @@ import org.jboss.netty.handler.codec.http.HttpVersion; import org.jboss.netty.handler.codec.http.QueryStringDecoder; 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 PiligrimProtocolDecoder extends BaseProtocolDecoder { @@ -102,7 +98,7 @@ public class PiligrimProtocolDecoder extends BaseProtocolDecoder { if (type == MSG_GPS || type == MSG_GPS_SENSORS) { Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); + position.setProtocol(getProtocol()); position.setDeviceId(getDeviceId()); // Time @@ -137,7 +133,7 @@ public class PiligrimProtocolDecoder extends BaseProtocolDecoder { // Satellites int satellites = buf.readUnsignedByte(); - extendedInfo.set("satellites", satellites); + position.set("satellites", satellites); position.setValid(satellites >= 3); // Speed @@ -155,18 +151,16 @@ public class PiligrimProtocolDecoder extends BaseProtocolDecoder { // External power double power = buf.readUnsignedByte(); power += buf.readUnsignedByte() << 8; - extendedInfo.set("power", power / 100); + position.set("power", power / 100); // Battery double battery = buf.readUnsignedByte(); battery += buf.readUnsignedByte() << 8; - extendedInfo.set("battery", battery / 100); + position.set("battery", battery / 100); buf.skipBytes(6); } - - position.setExtendedInfo(extendedInfo.toString()); positions.add(position); } else if (type == MSG_EVENTS) { |