This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/s7strings
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/feature/s7strings by this push:
new bb1922389f fix: Fixed some tests.
bb1922389f is described below
commit bb1922389fcde14b1174cae3b7e22572aa4fb663
Author: Christofer Dutz <[email protected]>
AuthorDate: Thu Nov 30 19:51:34 2023 +0100
fix: Fixed some tests.
---
.../apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git
a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java
b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java
index 4b176256e1..efec77a2fc 100644
---
a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java
+++
b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java
@@ -252,8 +252,8 @@ public class S7ProtocolLogic extends
Plc4xProtocolBase<TPKTPacket> {
DefaultPlcReadRequest request = (DefaultPlcReadRequest) readRequest;
CompletableFuture<S7Message> responseFuture;
if (request.getTagNames().stream().anyMatch(t -> request.getTag(t)
instanceof S7SzlTag)) {
+ // TODO: Is it correct, that there can only be one szl tag?
S7SzlTag szlTag = (S7SzlTag) request.getTags().get(0);
- // TODO: Is the tpduReference of 1 correct here?
S7Message s7Message = new S7MessageUserData(getTpduId(),
new S7ParameterUserData(List.of(
new S7ParameterUserDataItemCPUFunctions(
@@ -440,26 +440,20 @@ public class S7ProtocolLogic extends
Plc4xProtocolBase<TPKTPacket> {
valuesResponse.put(Integer.toString(msgParameter.getSequenceNumber()),
decodeEventSubscriptionResponse(Integer.toString(msgParameter.getSequenceNumber()),
subscriptionRequest, futures.get("DATA_").get()));
-
} catch (Exception ex) {
logger.warn(ex.toString());
}
-
try {
HashMap<String, ResponseItem<PlcSubscriptionHandle>> values =
new HashMap<>();
-
valuesResponse.forEach((s, p) -> {
if (p != null)
values.putAll(((DefaultPlcSubscriptionResponse)
p).getValues());
});
-
response.complete(new
DefaultPlcSubscriptionResponse(subscriptionRequest, values));
-
} catch (Exception ex) {
logger.warn(ex.getMessage());
}
-
});
t1.start();