aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/XirgoProtocolDecoder.java
diff options
context:
space:
mode:
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;
}