You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by jm...@apache.org on 2018/01/13 23:04:36 UTC
[incubator-plc4x] 03/06: added unknown tdpu code
This is an automated email from the ASF dual-hosted git repository.
jmclean pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
commit 74f4140e1092bb8f7aab1ae98d3bf7fb8d7c0825
Author: Justin Mclean <jm...@apache.org>
AuthorDate: Sun Jan 14 09:59:07 2018 +1100
added unknown tdpu code
---
.../org/apache/plc4x/java/isotp/netty/model/types/TpduCode.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/isotp/netty/model/types/TpduCode.java b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/isotp/netty/model/types/TpduCode.java
index 4193fef..2a568ee 100644
--- a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/isotp/netty/model/types/TpduCode.java
+++ b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/isotp/netty/model/types/TpduCode.java
@@ -31,7 +31,8 @@ public enum TpduCode {
EXPEDITED_DATA((byte) 0x10),
EXPEDITED_DATA_ACKNOWLEDGEMENT((byte) 0x20),
REJECT((byte) 0x50),
- TPDU_ERROR((byte) 0x70);
+ TPDU_ERROR((byte) 0x70),
+ TPDU_UNKNOWN((byte) 0xFF);
private static Map<Byte, TpduCode> map = null;
@@ -52,7 +53,10 @@ public enum TpduCode {
map.put(tpduCode.code, tpduCode);
}
}
- return map.get(code);
+ if (map.containsKey(code)) {
+ return map.get(code);
+ }
+ return TpduCode.TPDU_UNKNOWN;
}
}
--
To stop receiving notification emails like this one, please contact
"commits@plc4x.apache.org" <co...@plc4x.apache.org>.