diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-11-21 07:06:05 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-11-21 07:06:05 +1300 |
commit | cdaa4672bd59a0a5333b9fefada615b82bd19ab5 (patch) | |
tree | 0c30bce98ea482ae6d92cd1769732fc4ace846a6 /src/org/traccar/protocol/FlespiProtocolDecoder.java | |
parent | fb9cbb2b74dc0060bd0dc5d0b3bfeb958ed6f3b5 (diff) | |
download | trackermap-server-cdaa4672bd59a0a5333b9fefada615b82bd19ab5.tar.gz trackermap-server-cdaa4672bd59a0a5333b9fefada615b82bd19ab5.tar.bz2 trackermap-server-cdaa4672bd59a0a5333b9fefada615b82bd19ab5.zip |
Implement Oyster Sigfox protocol
Diffstat (limited to 'src/org/traccar/protocol/FlespiProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/FlespiProtocolDecoder.java | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/org/traccar/protocol/FlespiProtocolDecoder.java b/src/org/traccar/protocol/FlespiProtocolDecoder.java index 799d78ecb..d122df383 100644 --- a/src/org/traccar/protocol/FlespiProtocolDecoder.java +++ b/src/org/traccar/protocol/FlespiProtocolDecoder.java @@ -16,13 +16,9 @@ package org.traccar.protocol; import org.jboss.netty.channel.Channel; -import org.jboss.netty.handler.codec.http.DefaultHttpResponse; import org.jboss.netty.handler.codec.http.HttpRequest; -import org.jboss.netty.handler.codec.http.HttpResponse; import org.jboss.netty.handler.codec.http.HttpResponseStatus; -import org.jboss.netty.handler.codec.http.HttpVersion; -import org.jboss.netty.handler.codec.http.HttpHeaders; -import org.traccar.BaseProtocolDecoder; +import org.traccar.BaseHttpProtocolDecoder; import org.traccar.DeviceSession; import org.traccar.model.Position; @@ -34,11 +30,11 @@ import javax.json.JsonString; import java.io.StringReader; import java.net.SocketAddress; import java.nio.charset.StandardCharsets; -import java.util.List; -import java.util.LinkedList; import java.util.Date; +import java.util.LinkedList; +import java.util.List; -public class FlespiProtocolDecoder extends BaseProtocolDecoder { +public class FlespiProtocolDecoder extends BaseHttpProtocolDecoder { public FlespiProtocolDecoder(FlespiProtocol protocol) { super(protocol); @@ -72,14 +68,6 @@ public class FlespiProtocolDecoder extends BaseProtocolDecoder { return positions; } - private void sendResponse(Channel channel, HttpResponseStatus status) { - if (channel != null) { - HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, status); - response.headers().add(HttpHeaders.Names.CONTENT_LENGTH, 0); - channel.write(response); - } - } - private void decodePosition(JsonObject object, Position position) { position.setProtocol(getProtocolName()); |