Skip to content

Commit

Permalink
fixed usage of wrong Type
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Feb 2, 2018
1 parent eb4482f commit f609240
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ Licensed to the Apache Software Foundation (ASF) under one
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.
Expand Down Expand Up @@ -57,7 +57,6 @@ public ADSWriteRequest(AMSTCPHeader amstcpHeader, AMSHeader amsHeader, IndexGrou
this.data = data;
}


@Override
public ADSData getAdsData() {
return buildADSData(indexGroup, indexOffset, length, data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit f609240

Please sign in to comment.