aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Tr20ProtocolDecoder.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/Tr20ProtocolDecoder.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/Tr20ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Tr20ProtocolDecoder.java15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/org/traccar/protocol/Tr20ProtocolDecoder.java b/src/org/traccar/protocol/Tr20ProtocolDecoder.java
index 95935cd29..5b48566b7 100644
--- a/src/org/traccar/protocol/Tr20ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tr20ProtocolDecoder.java
@@ -24,16 +24,11 @@ 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;
-/**
- * TR20 tracker protocol decoder
- */
public class Tr20ProtocolDecoder extends BaseProtocolDecoder {
- /**
- * Initialize
- */
public Tr20ProtocolDecoder(ServerManager serverManager) {
super(serverManager);
}
@@ -41,8 +36,6 @@ public class Tr20ProtocolDecoder extends BaseProtocolDecoder {
static private Pattern patternPing = Pattern.compile(
"\\%\\%[^,]+,(\\d+)");
- //%%TR-10,A,050916070549,N2240.8887E11359.2994,0,000,NA,D3800000,150,CFG:resend|
- //%%123456789012345,A,120101121800,N6000.0000E13000.0000,0,000,0,01034802,150,[Message]
static private Pattern patternData = Pattern.compile(
"\\%\\%" +
"([^,]+)," + // Id
@@ -57,9 +50,7 @@ public class Tr20ProtocolDecoder extends BaseProtocolDecoder {
"(\\d+)," + // Course
".*");
- /**
- * Decode message
- */
+ @Override
protected Object decode(
ChannelHandlerContext ctx, Channel channel, Object msg)
throws Exception {
@@ -86,7 +77,7 @@ public class Tr20ProtocolDecoder extends BaseProtocolDecoder {
// Create new position
Position position = new Position();
- StringBuilder extendedInfo = new StringBuilder("<protocol>tr20</protocol>");
+ ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("tr20");
Integer index = 1;