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/02/02 15:47:36 UTC
[incubator-plc4x] branch feature/Beckhoff_ADS_protocol updated:
fixed usage of wrong Type
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch feature/Beckhoff_ADS_protocol
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
The following commit(s) were added to refs/heads/feature/Beckhoff_ADS_protocol by this push:
new f609240 fixed usage of wrong Type
f609240 is described below
commit f6092400a91c6b43bbd10a74a2fe3dc9855fe13a
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Fri Feb 2 16:47:32 2018 +0100
fixed usage of wrong Type
---
.../java/org/apache/plc4x/java/ads/api/commands/ADSWriteRequest.java | 3 +--
.../main/java/org/apache/plc4x/java/ads/api/generic/AMSTCPHeader.java | 4 +++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/commands/ADSWriteRequest.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/commands/ADSWriteRequest.java
index fd5a7e5..e6dc483 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/commands/ADSWriteRequest.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/commands/ADSWriteRequest.java
@@ -21,11 +21,11 @@ package org.apache.plc4x.java.ads.api.commands;
import org.apache.plc4x.java.ads.api.commands.types.Data;
import org.apache.plc4x.java.ads.api.commands.types.IndexGroup;
import org.apache.plc4x.java.ads.api.commands.types.IndexOffset;
-import org.apache.plc4x.java.ads.api.commands.types.Length;
import org.apache.plc4x.java.ads.api.generic.ADSData;
import org.apache.plc4x.java.ads.api.generic.AMSHeader;
import org.apache.plc4x.java.ads.api.generic.AMSTCPHeader;
import org.apache.plc4x.java.ads.api.generic.AMSTCPPaket;
+import org.apache.plc4x.java.ads.api.generic.types.Length;
/**
* With ADS Write data can be written to an ADS device. The data are addressed by the Index Group and the Index Offset.
@@ -57,7 +57,6 @@ public class ADSWriteRequest extends AMSTCPPaket {
this.data = data;
}
-
@Override
public ADSData getAdsData() {
return buildADSData(indexGroup, indexOffset, length, data);
diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/generic/AMSTCPHeader.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/generic/AMSTCPHeader.java
index 17df6a6..f207c9e 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/generic/AMSTCPHeader.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/generic/AMSTCPHeader.java
@@ -32,11 +32,13 @@ public class AMSTCPHeader implements ByteReadable {
private final Length length;
- public AMSTCPHeader(Length length) {
+ AMSTCPHeader(Length length) {
this.reserved = Reserved.CONSTANT;
this.length = length;
}
+ // TODO: this should only be used when deserializing.
+ // TODO: When sending this needs to be calculated
public static AMSTCPHeader of(int length) {
return new AMSTCPHeader(Length.of(length));
}
--
To stop receiving notification emails like this one, please contact
sruehl@apache.org.