aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/GalileoProtocolDecoder.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/GalileoProtocolDecoder.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/GalileoProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/GalileoProtocolDecoder.java16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/org/traccar/protocol/GalileoProtocolDecoder.java b/src/org/traccar/protocol/GalileoProtocolDecoder.java
index 3af06441e..ffd859f45 100644
--- a/src/org/traccar/protocol/GalileoProtocolDecoder.java
+++ b/src/org/traccar/protocol/GalileoProtocolDecoder.java
@@ -25,9 +25,7 @@ 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 GalileoProtocolDecoder extends BaseProtocolDecoder {
@@ -92,21 +90,19 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
Set<Integer> tags = new HashSet<Integer>();
boolean hasLocation = false;
Position position = new Position();
- ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol());
+ position.setProtocol(getProtocol());
while (buf.readerIndex() < length) {
// Check if new message started
int tag = buf.readUnsignedByte();
if (tags.contains(tag)) {
- position.setExtendedInfo(extendedInfo.toString());
if (hasLocation && position.getFixTime() != null) {
positions.add(position);
}
tags.clear();
hasLocation = false;
position = new Position();
- extendedInfo = new ExtendedInfoFormatter(getProtocol());
}
tags.add(tag);
@@ -139,19 +135,19 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
break;
case TAG_STATUS:
- extendedInfo.set("status", buf.readUnsignedShort());
+ position.set("status", buf.readUnsignedShort());
break;
case TAG_POWER:
- extendedInfo.set("power", buf.readUnsignedShort());
+ position.set("power", buf.readUnsignedShort());
break;
case TAG_BATTERY:
- extendedInfo.set("battery", buf.readUnsignedShort());
+ position.set("battery", buf.readUnsignedShort());
break;
case TAG_MILAGE:
- extendedInfo.set("milage", buf.readUnsignedInt());
+ position.set("milage", buf.readUnsignedInt());
break;
default:
@@ -160,8 +156,6 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
}
}
-
- position.setExtendedInfo(extendedInfo.toString());
if (hasLocation && position.getFixTime() != null) {
positions.add(position);
}