This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/implement-df1-driver
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/feature/implement-df1-driver
by this push:
new b0397cb - Changed the driver to initialize the buffer with the
correct size.
b0397cb is described below
commit b0397cb27c405c7d27ee35bd4442cf175ad7df04
Author: Christofer Dutz <[email protected]>
AuthorDate: Thu Aug 8 16:39:23 2019 +0200
- Changed the driver to initialize the buffer with the correct size.
---
.../src/main/java/org/apache/plc4x/java/df1/protocol/Df1Protocol.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git
a/sandbox/test-java-df1-driver/src/main/java/org/apache/plc4x/java/df1/protocol/Df1Protocol.java
b/sandbox/test-java-df1-driver/src/main/java/org/apache/plc4x/java/df1/protocol/Df1Protocol.java
index 9818ceb..d9859e0 100644
---
a/sandbox/test-java-df1-driver/src/main/java/org/apache/plc4x/java/df1/protocol/Df1Protocol.java
+++
b/sandbox/test-java-df1-driver/src/main/java/org/apache/plc4x/java/df1/protocol/Df1Protocol.java
@@ -61,8 +61,7 @@ public class Df1Protocol extends
PlcByteToMessageCodec<DF1Command> {
DF1SymbolMessageFrame frame = new DF1SymbolMessageFrame(remoteAddr,
localAddr, msg);
// Serialize the message
- // TODO: Create the buffer with the correct size.
- WriteBuffer writeBuffer = new WriteBuffer(100);
+ WriteBuffer writeBuffer = new WriteBuffer(frame.getLengthInBytes());
df1SymbolIO.serialize(writeBuffer, frame);
byte[] data = writeBuffer.getData();