Skip to content

Commit

Permalink
fix(plc4j/codegen): fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Jan 26, 2022
1 parent 9179cf1 commit c9d4dd4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion plc4go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ require (
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20211102192858-4dd72447c267 // indirect
golang.org/x/tools v0.1.8 // indirect
golang.org/x/tools v0.1.9 // indirect
gotest.tools/gotestsum v1.7.0 // indirect
)
2 changes: 2 additions & 0 deletions plc4go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
golang.org/x/tools v0.1.8 h1:P1HhGGuLW4aAclzjtmJdf0mJOjVUZUzOTqkAkWL+l6w=
golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
golang.org/x/tools v0.1.9 h1:j9KsMiaP1c3B0OTQGth0/k+miLGTgLsAFUCrF2vLcF8=
golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import io.netty.channel.socket.nio.NioServerSocketChannel;
import org.apache.plc4x.java.s7.readwrite.S7Driver;
import org.apache.plc4x.java.s7.readwrite.TPKTPacket;
import org.apache.plc4x.java.s7.readwrite.io.TPKTPacketIO;
import org.apache.plc4x.java.spi.connection.GeneratedProtocolMessageCodec;
import org.apache.plc4x.java.spi.generation.ByteOrder;
import org.apache.plc4x.simulator.exceptions.SimulatorExcepiton;
Expand Down Expand Up @@ -71,7 +70,7 @@ public void start() throws SimulatorExcepiton {
@Override
public void initChannel(SocketChannel channel) {
ChannelPipeline pipeline = channel.pipeline();
pipeline.addLast(new GeneratedProtocolMessageCodec<>(TPKTPacket.class, new TPKTPacketIO(), ByteOrder.BIG_ENDIAN, null,
pipeline.addLast(new GeneratedProtocolMessageCodec<>(TPKTPacket.class, TPKTPacket::staticParse, ByteOrder.BIG_ENDIAN, null,
new S7Driver.ByteLengthEstimator(),
new S7Driver.CorruptPackageCleaner()));
pipeline.addLast(new S7Step7ServerAdapter(context));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.plc4x.java.df1.field.Df1FieldHandler;
import org.apache.plc4x.java.df1.protocol.Df1ProtocolLogic;
import org.apache.plc4x.java.df1.readwrite.DF1Command;
import org.apache.plc4x.java.df1.readwrite.io.DF1CommandIO;
import org.apache.plc4x.java.spi.configuration.Configuration;
import org.apache.plc4x.java.spi.connection.GeneratedDriverBase;
import org.apache.plc4x.java.spi.connection.ProtocolStackConfigurer;
Expand Down Expand Up @@ -65,7 +64,7 @@ protected PlcValueHandler getValueHandler() {

@Override
protected ProtocolStackConfigurer<DF1Command> getStackConfigurer() {
return SingleProtocolStackConfigurer.builder(DF1Command.class, DF1CommandIO.class)
return SingleProtocolStackConfigurer.builder(DF1Command.class, DF1Command::staticParse)
.withProtocol(Df1ProtocolLogic.class)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.apache.plc4x.java.df1.readwrite.DF1Command;
import org.apache.plc4x.java.df1.readwrite.DF1Symbol;
import org.apache.plc4x.java.df1.readwrite.DF1SymbolMessageFrame;
import org.apache.plc4x.java.df1.readwrite.io.DF1SymbolIO;
import org.apache.plc4x.java.spi.generation.ReadBuffer;
import org.apache.plc4x.java.spi.generation.ReadBufferByteBased;
import org.apache.plc4x.java.spi.generation.WriteBufferByteBased;
Expand All @@ -43,12 +42,10 @@ public class Df1Protocol extends ByteToMessageCodec<DF1Command> {

private final short localAddr;
private final short remoteAddr;
private final DF1SymbolIO df1SymbolIO;

public Df1Protocol(short localAddr, short remoteAddr) {
this.localAddr = localAddr;
this.remoteAddr = remoteAddr;
df1SymbolIO = new DF1SymbolIO();
}

@Override
Expand Down Expand Up @@ -141,7 +138,7 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) t
in.readBytes(data);
ReadBuffer readBuffer = new ReadBufferByteBased(data);

resp = DF1SymbolIO.staticParse(readBuffer);
resp = DF1Symbol.staticParse(readBuffer);

// } while (readWasSucessfull);
// // TODO if unableto read
Expand Down

0 comments on commit c9d4dd4

Please sign in to comment.