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/CellocatorProtocolDecoder.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/CellocatorProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/CellocatorProtocolDecoder.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/CellocatorProtocolDecoder.java b/src/org/traccar/protocol/CellocatorProtocolDecoder.java index aabda6f51..3ca7853e0 100644 --- a/src/org/traccar/protocol/CellocatorProtocolDecoder.java +++ b/src/org/traccar/protocol/CellocatorProtocolDecoder.java @@ -25,6 +25,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 CellocatorProtocolDecoder extends BaseProtocolDecoder { @@ -102,7 +103,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { // Parse location if (type == MSG_CLIENT_STATUS) { Position position = new Position(); - StringBuilder extendedInfo = new StringBuilder("<protocol>cellocator</protocol>"); + ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("cellocator"); // Device identifier try { @@ -117,9 +118,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedByte(); // protocol version // Status - extendedInfo.append("<status>"); - extendedInfo.append(buf.getUnsignedByte(buf.readerIndex()) & 0x0f); - extendedInfo.append("</status>"); + extendedInfo.set("status", buf.getUnsignedByte(buf.readerIndex()) & 0x0f); int operator = (buf.readUnsignedByte() & 0xf0) << 4; operator += buf.readUnsignedByte(); @@ -131,7 +130,7 @@ public class CellocatorProtocolDecoder extends BaseProtocolDecoder { operator <<= 8; operator += buf.readUnsignedByte(); - extendedInfo.append("<operator>").append(operator).append("</operator>"); + extendedInfo.set("operator", operator); buf.readUnsignedInt(); // ADC buf.readUnsignedMedium(); // milage |