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/Ev603ProtocolDecoder.java | |
parent | f367b71b9c081416f6d64f6efd9844cd05f047ea (diff) | |
download | traccar-server-81beb5afb946d8c9ccfa2bbdfcfe884771a5bd3b.tar.gz traccar-server-81beb5afb946d8c9ccfa2bbdfcfe884771a5bd3b.tar.bz2 traccar-server-81beb5afb946d8c9ccfa2bbdfcfe884771a5bd3b.zip |
Fix extended info XML format
Diffstat (limited to 'src/org/traccar/protocol/Ev603ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Ev603ProtocolDecoder.java | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/org/traccar/protocol/Ev603ProtocolDecoder.java b/src/org/traccar/protocol/Ev603ProtocolDecoder.java index e80717cdf..322d7dd61 100644 --- a/src/org/traccar/protocol/Ev603ProtocolDecoder.java +++ b/src/org/traccar/protocol/Ev603ProtocolDecoder.java @@ -25,28 +25,17 @@ 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;
-/**
- * Ev603 Protocol Decoder
- */
public class Ev603ProtocolDecoder extends BaseProtocolDecoder{
- /**
- * Device ID
- */
private Long deviceId;
- /**
- * Initialize
- */
public Ev603ProtocolDecoder(ServerManager serverManager) {
super(serverManager);
}
- /**
- * Regular expressions pattern
- */
static private Pattern pattern = Pattern.compile(
"!A," + // Type
"(\\d{2})\\/(\\d{2})\\/(\\d{2})," + // Date dd/mm/YY
@@ -57,9 +46,7 @@ public class Ev603ProtocolDecoder extends BaseProtocolDecoder{ "(\\d+\\.?\\d+)," + // Course
".*");
- /**
- * Decode message
- */
+ @Override
protected Object decode(
ChannelHandlerContext ctx, Channel channel, Object msg)
throws Exception {
@@ -87,7 +74,7 @@ public class Ev603ProtocolDecoder extends BaseProtocolDecoder{ // Create new position
Position position = new Position();
position.setDeviceId(deviceId);
- StringBuilder extendedInfo = new StringBuilder("<protocol>ev603</protocol>");
+ ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter("ev603");
Integer index = 1;
// Date
|