use of org.apache.plc4x.java.spi.generation.SerializationException in project plc4x by apache.
the class CANOpenFrameDataHandler method toCAN.
@Override
public Message toCAN(CANOpenFrame frame) {
try {
CANOpenPayload payload = frame.getPayload();
WriteBufferByteBased buffer = new WriteBufferByteBased(payload.getLengthInBytes(), ByteOrder.LITTLE_ENDIAN);
payload.serialize(buffer);
return builder.get().withId(frame.getService().getMin() + frame.getNodeId()).withData(buffer.getData()).create();
} catch (SerializationException e) {
throw new PlcRuntimeException(e);
}
}
Aggregations