diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-29 13:20:39 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-29 13:20:39 +1200 |
commit | b7327c3addc914c729ca2f9b50cd9a82e6d5d7d2 (patch) | |
tree | aa32e4c8b7cba58329d8cd077ef13c310f32f249 | |
parent | 9d0819b538ab123bcf125f32d02920865090d14d (diff) | |
download | trackermap-server-b7327c3addc914c729ca2f9b50cd9a82e6d5d7d2.tar.gz trackermap-server-b7327c3addc914c729ca2f9b50cd9a82e6d5d7d2.tar.bz2 trackermap-server-b7327c3addc914c729ca2f9b50cd9a82e6d5d7d2.zip |
Combine MTA6 protocols
-rw-r--r-- | debug.xml | 1 | ||||
-rw-r--r-- | src/org/traccar/protocol/Gps103ProtocolDecoder.java | 2 | ||||
-rw-r--r-- | src/org/traccar/protocol/Mta6Protocol.java | 4 | ||||
-rw-r--r-- | src/org/traccar/protocol/XexunProtocol.java | 2 |
4 files changed, 5 insertions, 4 deletions
@@ -235,7 +235,6 @@ <entry key='gpsgate.port'>5026</entry> <entry key='teltonika.port'>5027</entry> <entry key='mta6.port'>5028</entry> - <entry key='mta6can.port'>5029</entry> <entry key='tlt2h.port'>5030</entry> <entry key='syrus.port'>5031</entry> <entry key='wondex.port'>5032</entry> diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java index 3f21beea8..fcfcb3dbb 100644 --- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -73,7 +73,7 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { if (channel != null) { channel.write("LOAD", remoteAddress); Matcher handshakeMatcher = handshakePattern.matcher(sentence); - if(handshakeMatcher.matches()) { + if (handshakeMatcher.matches()) { identify(handshakeMatcher.group(1), channel); } } diff --git a/src/org/traccar/protocol/Mta6Protocol.java b/src/org/traccar/protocol/Mta6Protocol.java index fb610227d..7281c4f1d 100644 --- a/src/org/traccar/protocol/Mta6Protocol.java +++ b/src/org/traccar/protocol/Mta6Protocol.java @@ -20,6 +20,7 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.http.HttpRequestDecoder; import org.jboss.netty.handler.codec.http.HttpResponseEncoder; import org.traccar.BaseProtocol; +import org.traccar.Context; import org.traccar.TrackerServer; import org.traccar.protocol.commands.CommandTemplate; import org.traccar.http.commands.CommandType; @@ -40,7 +41,8 @@ public class Mta6Protocol extends BaseProtocol { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("httpDecoder", new HttpRequestDecoder()); pipeline.addLast("httpEncoder", new HttpResponseEncoder()); - pipeline.addLast("objectDecoder", new Mta6ProtocolDecoder(Mta6Protocol.this, false)); + pipeline.addLast("objectDecoder", new Mta6ProtocolDecoder( + Mta6Protocol.this, !Boolean.valueOf(Context.getProps().getProperty(getName() + ".can")))); } }); } diff --git a/src/org/traccar/protocol/XexunProtocol.java b/src/org/traccar/protocol/XexunProtocol.java index 6ce55b30e..0d4502a3a 100644 --- a/src/org/traccar/protocol/XexunProtocol.java +++ b/src/org/traccar/protocol/XexunProtocol.java @@ -39,7 +39,7 @@ public class XexunProtocol extends BaseProtocol { serverList.add(new TrackerServer(new ServerBootstrap(), this.getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - if (Boolean.valueOf(Context.getProps().getProperty(XexunProtocol.this.getName() + ".extended"))) { + if (Boolean.valueOf(Context.getProps().getProperty(getName() + ".extended"))) { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); // tracker bug \n\r pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("objectDecoder", new Xexun2ProtocolDecoder(XexunProtocol.this)); |