List of usage examples for io.netty.handler.codec LengthFieldBasedFrameDecoder LengthFieldBasedFrameDecoder
public LengthFieldBasedFrameDecoder(ByteOrder byteOrder, int maxFrameLength, int lengthFieldOffset, int lengthFieldLength, int lengthAdjustment, int initialBytesToStrip, boolean failFast)
From source file:org.traccar.protocol.AdmProtocol.java
License:Apache License
public AdmProtocol() { setSupportedDataCommands(Command.TYPE_GET_DEVICE_STATUS, Command.TYPE_CUSTOM); addServer(new TrackerServer(false, getName()) { @Override/*from w ww. java 2s.c o m*/ protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast( new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 2, 1, -3, 0, true)); pipeline.addLast(new StringEncoder()); pipeline.addLast(new AdmProtocolEncoder()); pipeline.addLast(new AdmProtocolDecoder(AdmProtocol.this)); } }); }
From source file:org.traccar.protocol.ApelProtocol.java
License:Apache License
public ApelProtocol() { addServer(new TrackerServer(false, getName()) { @Override/* w ww.j a va2 s. c o m*/ protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 2, 2, 4, 0, true)); pipeline.addLast(new ApelProtocolDecoder(ApelProtocol.this)); } }); }
From source file:org.traccar.protocol.AutoTrackProtocol.java
License:Apache License
public AutoTrackProtocol() { addServer(new TrackerServer(false, getName()) { @Override//from w w w. ja va 2 s . co m protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 5, 2, 2, 0, true)); pipeline.addLast(new AutoTrackProtocolDecoder(AutoTrackProtocol.this)); } }); }
From source file:org.traccar.protocol.CastelProtocol.java
License:Apache License
public CastelProtocol() { setSupportedDataCommands(Command.TYPE_ENGINE_STOP, Command.TYPE_ENGINE_RESUME); addServer(new TrackerServer(false, getName()) { @Override//from w w w . j av a 2 s . c om protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast( new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 2, 2, -4, 0, true)); pipeline.addLast(new CastelProtocolEncoder()); pipeline.addLast(new CastelProtocolDecoder(CastelProtocol.this)); } }); addServer(new TrackerServer(true, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast(new CastelProtocolEncoder()); pipeline.addLast(new CastelProtocolDecoder(CastelProtocol.this)); } }); }
From source file:org.traccar.protocol.DmtProtocol.java
License:Apache License
public DmtProtocol() { addServer(new TrackerServer(false, getName()) { @Override/*from www .j a v a 2 s. c o m*/ protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 3, 2, 0, 0, true)); pipeline.addLast(new DmtProtocolDecoder(DmtProtocol.this)); } }); }
From source file:org.traccar.protocol.NyitechProtocol.java
License:Apache License
public NyitechProtocol() { addServer(new TrackerServer(false, getName()) { @Override//from w w w. j a v a 2 s. c om protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast( new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 2, 2, -4, 0, true)); pipeline.addLast(new NyitechProtocolDecoder(NyitechProtocol.this)); } }); }
From source file:org.traccar.protocol.ProgressProtocol.java
License:Apache License
public ProgressProtocol() { addServer(new TrackerServer(false, getName()) { @Override//from w ww . ja v a 2s. c om protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 2, 2, 4, 0, true)); pipeline.addLast(new ProgressProtocolDecoder(ProgressProtocol.this)); } }); }
From source file:org.traccar.protocol.RecodaProtocol.java
License:Apache License
public RecodaProtocol() { addServer(new TrackerServer(false, getName()) { @Override/* www . j a v a 2s .c o m*/ protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast( new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 4, 4, -8, 0, true)); pipeline.addLast(new RecodaProtocolDecoder(RecodaProtocol.this)); } }); }
From source file:org.traccar.protocol.RitiProtocol.java
License:Apache License
public RitiProtocol() { addServer(new TrackerServer(false, getName()) { @Override/*w w w. j a v a 2s. c o m*/ protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast( new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 105, 2, 3, 0, true)); pipeline.addLast(new RitiProtocolDecoder(RitiProtocol.this)); } }); }
From source file:org.traccar.protocol.SanulProtocol.java
License:Apache License
public SanulProtocol() { addServer(new TrackerServer(false, getName()) { @Override//from w w w . ja v a 2 s . co m protected void addProtocolHandlers(PipelineBuilder pipeline) { pipeline.addLast(new LengthFieldBasedFrameDecoder(ByteOrder.LITTLE_ENDIAN, 1024, 3, 2, 0, 0, true)); pipeline.addLast(new SanulProtocolDecoder(SanulProtocol.this)); } }); }