diff options
author | Abyss777 <abyss@fox5.ru> | 2016-08-19 19:49:11 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-08-19 19:49:11 +0500 |
commit | aaa16c01263847221c7cfec95d722b283dcfd35e (patch) | |
tree | 0b40718962f549b6ab963cf93e9de7cf3c105b13 /src/org/traccar/protocol/WialonProtocolDecoder.java | |
parent | 3826a93f1009942e22ec80c1e13be71e8e917b01 (diff) | |
download | trackermap-server-aaa16c01263847221c7cfec95d722b283dcfd35e.tar.gz trackermap-server-aaa16c01263847221c7cfec95d722b283dcfd35e.tar.bz2 trackermap-server-aaa16c01263847221c7cfec95d722b283dcfd35e.zip |
- Added commands to WialonProtocol
- Added more additional fields to CommandDialog
Diffstat (limited to 'src/org/traccar/protocol/WialonProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/WialonProtocolDecoder.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/WialonProtocolDecoder.java b/src/org/traccar/protocol/WialonProtocolDecoder.java index 627b93b1c..0043354d5 100644 --- a/src/org/traccar/protocol/WialonProtocolDecoder.java +++ b/src/org/traccar/protocol/WialonProtocolDecoder.java @@ -24,6 +24,7 @@ import org.traccar.helper.PatternBuilder; import org.traccar.model.Position; import java.net.SocketAddress; +import java.util.Date; import java.util.LinkedList; import java.util.List; import java.util.regex.Matcher; @@ -171,6 +172,18 @@ public class WialonProtocolDecoder extends BaseProtocolDecoder { return positions; } + } else if (sentence.startsWith("#M#")) { + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress); + if (deviceSession != null) { + Position position = new Position(); + position.setProtocol(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + getLastLocation(position, new Date()); + position.setValid(false); + position.set(Position.KEY_RESULT, sentence.substring(sentence.indexOf('#', 1) + 1)); + sendResponse(channel, "#AM#", 1); + return position; + } } return null; |