diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-07-15 20:59:32 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-07-15 20:59:32 -0700 |
commit | b0339ffbb2756a2ef601270f5b163015b57e8773 (patch) | |
tree | c4806f531bdc1deb9c199c02e59d518f5a5bed91 /src/main/java/org/traccar/protocol/EasyTrackProtocol.java | |
parent | 03de8348981e36ffcc88196de79a679ec5d1d82d (diff) | |
download | trackermap-server-b0339ffbb2756a2ef601270f5b163015b57e8773.tar.gz trackermap-server-b0339ffbb2756a2ef601270f5b163015b57e8773.tar.bz2 trackermap-server-b0339ffbb2756a2ef601270f5b163015b57e8773.zip |
Implement EasyTrack encoder
Diffstat (limited to 'src/main/java/org/traccar/protocol/EasyTrackProtocol.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/EasyTrackProtocol.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/EasyTrackProtocol.java b/src/main/java/org/traccar/protocol/EasyTrackProtocol.java index 74c636d06..4626156a5 100644 --- a/src/main/java/org/traccar/protocol/EasyTrackProtocol.java +++ b/src/main/java/org/traccar/protocol/EasyTrackProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2020 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,16 +21,23 @@ import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.PipelineBuilder; import org.traccar.TrackerServer; +import org.traccar.model.Command; public class EasyTrackProtocol extends BaseProtocol { public EasyTrackProtocol() { + setSupportedDataCommands( + Command.TYPE_ENGINE_STOP, + Command.TYPE_ENGINE_RESUME, + Command.TYPE_ALARM_ARM, + Command.TYPE_ALARM_DISARM); addServer(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast(new CharacterDelimiterFrameDecoder(1024, "#", "\r\n")); pipeline.addLast(new StringDecoder()); pipeline.addLast(new StringEncoder()); + pipeline.addLast(new EasyTrackProtocolEncoder(EasyTrackProtocol.this)); pipeline.addLast(new EasyTrackProtocolDecoder(EasyTrackProtocol.this)); } }); |