aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/XirgoProtocolDecoder.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/XirgoProtocolDecoder.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/XirgoProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/XirgoProtocolDecoder.java21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/org/traccar/protocol/XirgoProtocolDecoder.java b/src/org/traccar/protocol/XirgoProtocolDecoder.java
index cec36c866..813a7a995 100644
--- a/src/org/traccar/protocol/XirgoProtocolDecoder.java
+++ b/src/org/traccar/protocol/XirgoProtocolDecoder.java
@@ -17,7 +17,6 @@ package org.traccar.protocol;
import java.net.SocketAddress;
import java.util.Calendar;
-import java.util.Properties;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -26,9 +25,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 XirgoProtocolDecoder extends BaseProtocolDecoder {
@@ -71,7 +67,7 @@ public class XirgoProtocolDecoder extends BaseProtocolDecoder {
// Create new position
Position position = new Position();
- ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol());
+ position.setProtocol(getProtocol());
Integer index = 1;
@@ -81,7 +77,7 @@ public class XirgoProtocolDecoder extends BaseProtocolDecoder {
}
position.setDeviceId(getDeviceId());
- extendedInfo.set("event", parser.group(index++));
+ position.set("event", parser.group(index++));
// Date
Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
@@ -102,18 +98,15 @@ public class XirgoProtocolDecoder extends BaseProtocolDecoder {
position.setCourse(Double.valueOf(parser.group(index++)));
// Additional data
- extendedInfo.set("satellites", parser.group(index++));
- extendedInfo.set("hdop", parser.group(index++));
- extendedInfo.set("battery", parser.group(index++));
- extendedInfo.set("gsm", parser.group(index++));
- extendedInfo.set("milage", parser.group(index++));
+ position.set("satellites", parser.group(index++));
+ position.set("hdop", parser.group(index++));
+ position.set("battery", parser.group(index++));
+ position.set("gsm", parser.group(index++));
+ position.set("milage", parser.group(index++));
// Validity
position.setValid(Integer.valueOf(parser.group(index++)) == 1);
- // Extended info
- position.setExtendedInfo(extendedInfo.toString());
-
return position;
}