diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-05-02 22:16:14 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-05-02 22:16:14 +1200 |
commit | 81beb5afb946d8c9ccfa2bbdfcfe884771a5bd3b (patch) | |
tree | ce4d0b24f1c82381da30472844052f8cfdc1a164 /src/org/traccar/protocol/V680ProtocolDecoder.java | |
parent | f367b71b9c081416f6d64f6efd9844cd05f047ea (diff) | |
download | trackermap-server-81beb5afb946d8c9ccfa2bbdfcfe884771a5bd3b.tar.gz trackermap-server-81beb5afb946d8c9ccfa2bbdfcfe884771a5bd3b.tar.bz2 trackermap-server-81beb5afb946d8c9ccfa2bbdfcfe884771a5bd3b.zip |
Fix extended info XML format
Diffstat (limited to 'src/org/traccar/protocol/V680ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/V680ProtocolDecoder.java | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/org/traccar/protocol/V680ProtocolDecoder.java b/src/org/traccar/protocol/V680ProtocolDecoder.java index 40549857a..205036ebb 100644 --- a/src/org/traccar/protocol/V680ProtocolDecoder.java +++ b/src/org/traccar/protocol/V680ProtocolDecoder.java @@ -24,6 +24,7 @@ import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.ServerManager; import org.traccar.helper.Log; +import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class V680ProtocolDecoder extends BaseProtocolDecoder { @@ -67,7 +68,7 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - StringBuilder extendedInfo = new StringBuilder("<protocol>V680</protocol>"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("v680"); Integer index = 1; // Get device by IMEI @@ -80,27 +81,19 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder { } // User - extendedInfo.append("<user>"); - extendedInfo.append(parser.group(index++)); - extendedInfo.append("</user>"); + extendedInfo.set("user", parser.group(index++)); // Validity position.setValid(parser.group(index++).compareTo("1") == 0 ? true : false); // Password - extendedInfo.append("<password>"); - extendedInfo.append(parser.group(index++)); - extendedInfo.append("</password>"); + extendedInfo.set("password", parser.group(index++)); // Packet number - extendedInfo.append("<packet>"); - extendedInfo.append(parser.group(index++)); - extendedInfo.append("</packet>"); + extendedInfo.set("packet", parser.group(index++)); // GSM base station - extendedInfo.append("<gsm>"); - extendedInfo.append(parser.group(index++)); - extendedInfo.append("</gsm>"); + extendedInfo.set("gsm", parser.group(index++)); // Longitude Double lonlitude = Double.valueOf(parser.group(index++)); |