Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Feb 7, 2018
1 parent da08dbb commit b4f5570
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ Licensed to the Apache Software Foundation (ASF) under one
*/
package org.apache.plc4x.java.ads;

import org.apache.commons.lang3.RandomStringUtils;
import org.apache.plc4x.java.ads.api.commands.ADSWriteRequest;
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.types.AMSNetId;
import org.apache.plc4x.java.ads.api.generic.types.AMSPort;
import org.apache.plc4x.java.ads.api.generic.types.Invoke;
import org.apache.plc4x.java.ads.api.generic.types.Length;
import org.apache.plc4x.java.ads.util.TcpHexDumper;
import org.pcap4j.core.PcapDumper;
import org.pcap4j.core.PcapHandle;
Expand Down Expand Up @@ -53,7 +54,7 @@ public static final void main(String... args) throws Exception {
try (PcapHandle handle = Pcaps.openDead(DataLinkType.EN10MB, 65536);
PcapDumper dumper = handle.dumpOpen(dumpFile.toAbsolutePath().toString())) {

String crhit= "Hallo Christoph das ist eine NachrichtHallo Christoph das ist eine NachrichtHallo Christoph das ist eine NachrichtHallo Christoph das ist eine NachrichtHallo Christoph das ist eine NachrichtHallo Christoph das ist eine NachrichtHallo Christoph das ist eine NachrichtHallo Christoph das ist eine NachrichtHallo Christoph das ist eine Nachricht";
String randomString = RandomStringUtils.randomAscii(1024);

ADSWriteRequest adsWriteRequest = new ADSWriteRequest(
AMSNetId.of("192.168.0.70.1.2"),
Expand All @@ -63,8 +64,8 @@ public static final void main(String... args) throws Exception {
Invoke.of((byte) 0, (byte) 0, (byte) 0, (byte) 0),
IndexGroup.of((byte) 0, (byte) 0, (byte) 0, (byte) 0),
IndexOffset.of((byte) 0, (byte) 0, (byte) 0, (byte) 0),
Length.of(crhit.getBytes().length),
Data.of(crhit.getBytes())
Length.of(randomString.getBytes().length),
Data.of(randomString.getBytes())
);

try (TcpHexDumper tcpHexDumper = TcpHexDumper.runOn(55862); Socket localhost = new Socket("localhost", tcpHexDumper.getPort())) {
Expand Down

0 comments on commit b4f5570

Please sign in to comment.