Example usage for io.netty.handler.codec LengthFieldBasedFrameDecoder LengthFieldBasedFrameDecoder

List of usage examples for io.netty.handler.codec LengthFieldBasedFrameDecoder LengthFieldBasedFrameDecoder

Introduction

In this page you can find the example usage for io.netty.handler.codec LengthFieldBasedFrameDecoder LengthFieldBasedFrameDecoder.

Prototype

public LengthFieldBasedFrameDecoder(int maxFrameLength, int lengthFieldOffset, int lengthFieldLength,
        int lengthAdjustment, int initialBytesToStrip) 

Source Link

Document

Creates a new instance.

Usage

From source file:org.traccar.protocol.Avl301Protocol.java

License:Apache License

public Avl301Protocol() {
    addServer(new TrackerServer(false, getName()) {
        @Override//  www . j a va  2s  . c o m
        protected void addProtocolHandlers(PipelineBuilder pipeline) {
            pipeline.addLast(new LengthFieldBasedFrameDecoder(256, 2, 1, -3, 0));
            pipeline.addLast(new Avl301ProtocolDecoder(Avl301Protocol.this));
        }
    });
}

From source file:org.traccar.protocol.CityeasyProtocol.java

License:Apache License

public CityeasyProtocol() {
    setSupportedDataCommands(Command.TYPE_POSITION_SINGLE, Command.TYPE_POSITION_PERIODIC,
            Command.TYPE_POSITION_STOP, Command.TYPE_SET_TIMEZONE);
    addServer(new TrackerServer(false, getName()) {
        @Override//  ww  w  . j av  a  2  s  .  c om
        protected void addProtocolHandlers(PipelineBuilder pipeline) {
            pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 2, 2, -4, 0));
            pipeline.addLast(new CityeasyProtocolEncoder());
            pipeline.addLast(new CityeasyProtocolDecoder(CityeasyProtocol.this));
        }
    });
}

From source file:org.traccar.protocol.ContinentalProtocol.java

License:Apache License

public ContinentalProtocol() {
    addServer(new TrackerServer(false, getName()) {
        @Override//  w  w  w.j a  v  a  2 s  .c  om
        protected void addProtocolHandlers(PipelineBuilder pipeline) {
            pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 2, 2, -4, 0));
            pipeline.addLast(new ContinentalProtocolDecoder(ContinentalProtocol.this));
        }
    });
}

From source file:org.traccar.protocol.EnforaProtocol.java

License:Apache License

public EnforaProtocol() {
    setSupportedDataCommands(Command.TYPE_CUSTOM, Command.TYPE_ENGINE_STOP, Command.TYPE_ENGINE_RESUME);
    addServer(new TrackerServer(false, getName()) {
        @Override//ww  w  . ja  v a2  s.  co m
        protected void addProtocolHandlers(PipelineBuilder pipeline) {
            pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 0, 2, -2, 2));
            pipeline.addLast(new EnforaProtocolEncoder());
            pipeline.addLast(new EnforaProtocolDecoder(EnforaProtocol.this));
        }
    });
    addServer(new TrackerServer(true, getName()) {
        @Override
        protected void addProtocolHandlers(PipelineBuilder pipeline) {
            pipeline.addLast(new EnforaProtocolEncoder());
            pipeline.addLast(new EnforaProtocolDecoder(EnforaProtocol.this));
        }
    });
}

From source file:org.traccar.protocol.Gt02Protocol.java

License:Apache License

public Gt02Protocol() {
    addServer(new TrackerServer(false, getName()) {
        @Override/*ww  w . j a v  a  2  s . co  m*/
        protected void addProtocolHandlers(PipelineBuilder pipeline) {
            pipeline.addLast(new LengthFieldBasedFrameDecoder(256, 2, 1, 2, 0));
            pipeline.addLast(new Gt02ProtocolDecoder(Gt02Protocol.this));
        }
    });
}

From source file:org.traccar.protocol.ObdDongleProtocol.java

License:Apache License

public ObdDongleProtocol() {
    addServer(new TrackerServer(false, getName()) {
        @Override/*from  w  ww  .j a v a  2  s.  c o m*/
        protected void addProtocolHandlers(PipelineBuilder pipeline) {
            pipeline.addLast(new LengthFieldBasedFrameDecoder(1099, 20, 2, 3, 0));
            pipeline.addLast(new ObdDongleProtocolDecoder(ObdDongleProtocol.this));
        }
    });
}

From source file:org.traccar.protocol.RuptelaProtocol.java

License:Apache License

public RuptelaProtocol() {
    setSupportedDataCommands(Command.TYPE_CUSTOM, Command.TYPE_REQUEST_PHOTO, Command.TYPE_CONFIGURATION,
            Command.TYPE_GET_VERSION, Command.TYPE_FIRMWARE_UPDATE, Command.TYPE_OUTPUT_CONTROL,
            Command.TYPE_SET_CONNECTION, Command.TYPE_SET_ODOMETER);
    addServer(new TrackerServer(false, getName()) {
        @Override//from w ww  .  j  a  v a2 s.  co m
        protected void addProtocolHandlers(PipelineBuilder pipeline) {
            pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 0, 2, 2, 0));
            pipeline.addLast(new RuptelaProtocolEncoder());
            pipeline.addLast(new RuptelaProtocolDecoder(RuptelaProtocol.this));
        }
    });
}

From source file:org.traccar.protocol.T800xProtocol.java

License:Apache License

public T800xProtocol() {
    setSupportedDataCommands(Command.TYPE_CUSTOM);
    addServer(new TrackerServer(false, getName()) {
        @Override/*from w w w. j a v  a 2 s. c o  m*/
        protected void addProtocolHandlers(PipelineBuilder pipeline) {
            pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 3, 2, -5, 0));
            pipeline.addLast(new T800xProtocolEncoder());
            pipeline.addLast(new T800xProtocolDecoder(T800xProtocol.this));
        }
    });
}

From source file:org.traccar.protocol.ThinkRaceProtocol.java

License:Apache License

public ThinkRaceProtocol() {
    addServer(new TrackerServer(false, getName()) {
        @Override/*from   w  ww. j  a va2s.  c om*/
        protected void addProtocolHandlers(PipelineBuilder pipeline) {
            pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 2 + 12 + 1 + 1, 2, 2, 0));
            pipeline.addLast(new ThinkRaceProtocolDecoder(ThinkRaceProtocol.this));
        }
    });
}

From source file:org.traccar.protocol.Tk102Protocol.java

License:Apache License

public Tk102Protocol() {
    addServer(new TrackerServer(false, getName()) {
        @Override/* www  .j  a v  a  2  s  . com*/
        protected void addProtocolHandlers(PipelineBuilder pipeline) {
            pipeline.addLast(new LengthFieldBasedFrameDecoder(1024, 1 + 1 + 10, 1, 1, 0));
            pipeline.addLast(new Tk102ProtocolDecoder(Tk102Protocol.this));
        }
    });
}