You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2018/08/09 12:57:29 UTC
[incubator-plc4x] 02/02: removed obsolete supported datatype
checking code
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
commit 07b60074675da67a8cc92f00df2a4459254eabea
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Thu Aug 9 14:57:22 2018 +0200
removed obsolete supported datatype checking code
---
.../java/modbus/netty/Plc4XModbusProtocol.java | 23 +---------------------
1 file changed, 1 insertion(+), 22 deletions(-)
diff --git a/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocol.java b/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocol.java
index cfdb168..5a42e6b 100644
--- a/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocol.java
+++ b/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocol.java
@@ -46,6 +46,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicInteger;
+
public class Plc4XModbusProtocol extends MessageToMessageCodec<ModbusTcpPayload, PlcRequestContainer<PlcRequest, PlcResponse>> {
private static final Logger LOGGER = LoggerFactory.getLogger(Plc4XModbusProtocol.class);
@@ -75,7 +76,6 @@ public class Plc4XModbusProtocol extends MessageToMessageCodec<ModbusTcpPayload,
// TODO: for higher datatypes float, double etc we might need to split the bytes into chunks
int quantity = writeRequestItem.getSize();
short unitId = 0;
- checkSupportedDataType(writeRequestItem.getValues());
ModbusAddress address = (ModbusAddress) writeRequestItem.getAddress();
ModbusPdu modbusRequest;
@@ -248,27 +248,6 @@ public class Plc4XModbusProtocol extends MessageToMessageCodec<ModbusTcpPayload,
super.exceptionCaught(ctx, cause);
}
- private void checkSupportedDataType(List<?> values) {
- if (values == null || values.size() == 0) {
- return;
- }
- for (Object value : values) {
- if (
- !(value instanceof Boolean)
- && !(value instanceof Byte)
- && !(value instanceof byte[])
- && !(value instanceof Byte[])
- && !(value instanceof Short)
- && !(value instanceof Integer)
- && !(value instanceof BigInteger)
- && !(value instanceof Float)
- && !(value instanceof Double)
- ) {
- throw new PlcRuntimeException("Unsupported datatype detected " + value.getClass());
- }
- }
- }
-
////////////////////////////////////////////////////////////////////////////////
// Encoding helpers.
////////////////////////////////////////////////////////////////////////////////