From c674d90bc41e1a4b03fcc1779e711f8d8b79bf90 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 7 Dec 2016 15:11:04 +1300 Subject: Implement Xexun commands (fix #2639) --- src/org/traccar/protocol/XexunProtocol.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/org/traccar/protocol/XexunProtocol.java') diff --git a/src/org/traccar/protocol/XexunProtocol.java b/src/org/traccar/protocol/XexunProtocol.java index 2aea2f246..a52d9ff45 100644 --- a/src/org/traccar/protocol/XexunProtocol.java +++ b/src/org/traccar/protocol/XexunProtocol.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2016 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. @@ -23,6 +23,7 @@ import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.Context; import org.traccar.TrackerServer; +import org.traccar.model.Command; import java.util.List; @@ -30,6 +31,9 @@ public class XexunProtocol extends BaseProtocol { public XexunProtocol() { super("xexun"); + setSupportedCommands( + Command.TYPE_ENGINE_STOP, + Command.TYPE_ENGINE_RESUME); } @Override @@ -43,8 +47,9 @@ public class XexunProtocol extends BaseProtocol { } else { pipeline.addLast("frameDecoder", new XexunFrameDecoder()); } - pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("objectEncoder", new XexunProtocolEncoder()); pipeline.addLast("objectDecoder", new XexunProtocolDecoder(XexunProtocol.this, full)); } }); -- cgit v1.2.3