Skip to content

Commit

Permalink
fix(plc4j/canopen): Fixed a bug introduced by my recent refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdutz committed Feb 7, 2022
1 parent 8ebd924 commit 5b81e70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public SDODownloadConversation(CANConversation delegate, int nodeId, int answerN
this.indexAddress = indexAddress;

try {
WriteBufferByteBased writeBuffer = new WriteBufferByteBased(DataItem.getLengthInBytes(value, type, null));
WriteBufferByteBased writeBuffer = new WriteBufferByteBased(DataItem.getLengthInBytes(value, type, null), ByteOrder.LITTLE_ENDIAN);
DataItem.staticSerialize(writeBuffer, value, type, null, ByteOrder.LITTLE_ENDIAN);
data = writeBuffer.getData();
} catch (SerializationException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private void writeInternally(DefaultPlcWriteRequest writeRequest, CANOpenPDOFiel
try {
String fieldName = writeRequest.getFieldNames().iterator().next();

WriteBufferByteBased writeBuffer = new WriteBufferByteBased(DataItem.getLengthInBytes(writeValue, field.getCanOpenDataType(), writeValue.getLength()));
WriteBufferByteBased writeBuffer = new WriteBufferByteBased(DataItem.getLengthInBytes(writeValue, field.getCanOpenDataType(), writeValue.getLength()), ByteOrder.LITTLE_ENDIAN);
DataItem.staticSerialize(writeBuffer, writeValue, field.getCanOpenDataType(), writeValue.getLength(), ByteOrder.LITTLE_ENDIAN);
final CANOpenPDOPayload payload = new CANOpenPDOPayload(new CANOpenPDO(writeBuffer.getData()));
context.sendToWire(new CANOpenFrame((short) field.getNodeId(), field.getService(), payload));
Expand Down

0 comments on commit 5b81e70

Please sign in to comment.