aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/GalileoProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-05-02 22:16:14 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-05-02 22:16:14 +1200
commit81beb5afb946d8c9ccfa2bbdfcfe884771a5bd3b (patch)
treece4d0b24f1c82381da30472844052f8cfdc1a164 /src/org/traccar/protocol/GalileoProtocolDecoder.java
parentf367b71b9c081416f6d64f6efd9844cd05f047ea (diff)
downloadtrackermap-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/GalileoProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/GalileoProtocolDecoder.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/org/traccar/protocol/GalileoProtocolDecoder.java b/src/org/traccar/protocol/GalileoProtocolDecoder.java
index 62669eb1c..d56bc0f6d 100644
--- a/src/org/traccar/protocol/GalileoProtocolDecoder.java
+++ b/src/org/traccar/protocol/GalileoProtocolDecoder.java
@@ -29,6 +29,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 GalileoProtocolDecoder extends BaseProtocolDecoder {
@@ -98,7 +99,7 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
// Create new position
Position position = new Position();
- StringBuilder extendedInfo = new StringBuilder("<protocol>galileo</protocol>");
+ ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("galileo");
while (buf.readerIndex() < length) {
int tag = buf.readUnsignedByte();
@@ -134,9 +135,7 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
break;
case TAG_STATUS:
- extendedInfo.append("<status>");
- extendedInfo.append(buf.readUnsignedShort());
- extendedInfo.append("</status>");
+ extendedInfo.set("status", buf.readUnsignedShort());
break;
case TAG_POWER:
@@ -144,15 +143,11 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
break;
case TAG_BATTERY:
- extendedInfo.append("<battery>");
- extendedInfo.append(buf.readUnsignedShort());
- extendedInfo.append("</battery>");
+ extendedInfo.set("battery", buf.readUnsignedShort());
break;
case TAG_MILAGE:
- extendedInfo.append("<milage>");
- extendedInfo.append(buf.readUnsignedInt());
- extendedInfo.append("</milage>");
+ extendedInfo.set("milage", buf.readUnsignedInt());
break;
default: