aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-01-08 18:59:38 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-01-08 18:59:45 -0800
commit7472cc0f97cf3d58fa9674881114f59fc5287676 (patch)
treebd49e7fc5f152e9e705d46f75d9194db22db0beb /src
parent1d10aeb4671943f851026cb248e7ef24a022174c (diff)
downloadtrackermap-server-7472cc0f97cf3d58fa9674881114f59fc5287676.tar.gz
trackermap-server-7472cc0f97cf3d58fa9674881114f59fc5287676.tar.bz2
trackermap-server-7472cc0f97cf3d58fa9674881114f59fc5287676.zip
Add ITS login response
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/ItsProtocolDecoder.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/ItsProtocolDecoder.java b/src/org/traccar/protocol/ItsProtocolDecoder.java
index d3cdb14c3..000e7759f 100644
--- a/src/org/traccar/protocol/ItsProtocolDecoder.java
+++ b/src/org/traccar/protocol/ItsProtocolDecoder.java
@@ -18,6 +18,7 @@ package org.traccar.protocol;
import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
+import org.traccar.NetworkMessage;
import org.traccar.Protocol;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
@@ -72,7 +73,13 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder {
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
- Parser parser = new Parser(PATTERN, (String) msg);
+ String sentence = (String) msg;
+
+ if (channel != null && sentence.startsWith("$,01,")) {
+ channel.writeAndFlush(new NetworkMessage("$,01,", remoteAddress));
+ }
+
+ Parser parser = new Parser(PATTERN, sentence);
if (!parser.matches()) {
return null;
}