Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
afeb1a4
fix(plc4j/profinet): Fix to remove spaces from the generated connecti…
hutcheb Sep 4, 2022
b55c5d2
fix(plc4j(profinet): Connections are working for my setup
hutcheb Sep 8, 2022
bf77f0d
fix(plc4j(profinet): Add Dummy Advanced Connection Write Request
hutcheb Sep 8, 2022
83becf0
fix(plc4j(profinet): Started to add the LLDP broadcast
hutcheb Sep 8, 2022
bb01815
fix(plc4j(profinet): Continued to add the LLDP broadcast
hutcheb Sep 8, 2022
d133842
fix(plc4j(profinet): Finished the connection setup.
hutcheb Sep 9, 2022
dcdad31
feat(plc4j/profinet): Fixed a few minor issues and added the Applicat…
hutcheb Sep 11, 2022
6f5b27b
feat(plc4j/profinet): Escape spaces using %20
hutcheb Sep 11, 2022
d1c18db
feat(plc4j/): split out dcp and lldp tasks, so they can be processed …
hutcheb Sep 16, 2022
40d4cc6
fix(plc4j/profinet): Identified that the Application Ready request co…
hutcheb Sep 18, 2022
f90225b
fix(plc4j/profinet): Cleaned up the message send and receive interface
hutcheb Sep 18, 2022
36b3260
chore(plc4j/profinet): escape the device name and type within the con…
hutcheb Sep 11, 2022
e99d97c
fix(plc4j/profinet): Continued to split device logic out.
hutcheb Oct 6, 2022
ab2f676
feat(plc4j/profinet): Add outline of GSDML parser.
hutcheb Oct 7, 2022
2a082c7
feat(plc4j/profinet): Finished major components of parser
hutcheb Oct 8, 2022
c76b3fa
feat(plc4j/profinet): Add External text Data
hutcheb Oct 8, 2022
de05676
feat(plc4j/profinet): Generated Getters
hutcheb Oct 8, 2022
5a02fc4
feat(plc4j/profinet): Add Dummy GSDML file
hutcheb Oct 8, 2022
2f603d1
feat(plc4j/profinet): Added basic test case
hutcheb Oct 8, 2022
a0e1b6c
feat(plc4j/profinet): Add GSD directory Configuration Parameter and c…
hutcheb Oct 10, 2022
3b9fd08
feat(plc4j/profinet): Standardize the mac address key to uppercase
hutcheb Oct 10, 2022
deb29c3
feat(plc4j/profinet): Need to Review the UDP checksum field.
hutcheb Oct 10, 2022
75ee0a7
feat(plc4j/profinet): Add dummy checksum field in IPv4 packets
hutcheb Oct 11, 2022
0f3f803
feat(plc4j/profinet): Mistake leaving request as a response in mspec
hutcheb Oct 11, 2022
82aaf1f
feat(plc4j/profinet): Add reading gsd directory and starting to add s…
hutcheb Oct 11, 2022
815ad4e
feat(plc4j/profinet): Splitting out connection request, using default…
hutcheb Oct 12, 2022
686c862
feat(plc4j/profinet): Realised that the pcap promiscuous mode handles…
hutcheb Oct 15, 2022
2a41dbb
feat(plc4j/profinet): Add support for UDP packets, this allows us to …
hutcheb Oct 17, 2022
8853e94
feat(plc4j/profinet): Fixed parsing of PnIo_CyclicServiceDataUnit int…
hutcheb Oct 19, 2022
9eec832
feat(plc4j/profinet): Cleaned up a little and added the IODataObject …
hutcheb Oct 19, 2022
7eb6f1b
feat(plc4j/profinet): Started to add the submodules to the configurat…
hutcheb Oct 19, 2022
a350699
feat(plc4j/profinet): Add support for optional modules in the connect…
hutcheb Nov 18, 2022
9a2f931
feat(plc4j/profinet): Add support for writing records during startup
hutcheb Nov 19, 2022
6f5cde9
feat(plc4j/profinet): Add datahold factor to configuration
hutcheb Nov 19, 2022
2f92d8c
fix(plc4j/profinet): Fix failing tests
hutcheb Nov 25, 2022
26cdfe2
feat(plc4j/profinet): Started to add the browse functionality, which …
hutcheb Nov 25, 2022
4c55368
feat(plc4j/profinet): Add more browse functionality.
hutcheb Nov 25, 2022
c2438ad
feat(plc4j/profinet): Started to standardize the way the GSD file is …
hutcheb Dec 26, 2022
edd9073
feat(plc4j/profinet): Updated the parsing of the submodule connection…
hutcheb Dec 29, 2022
04f295e
feat(plc4j/profinet): Fixed the cyclic comms after refactoring for ta…
hutcheb Dec 29, 2022
25a6a5b
feat(plc4j/profinet): add metadata to browse tags
hutcheb Jan 2, 2023
3abb335
Merge branch 'develop' into plc4j/profinet
hutcheb Jan 5, 2023
3c3cbc5
fix(plc4j/profinet): Fix issues after merging develop
hutcheb Jan 5, 2023
1d13e47
fix(plc4j/profinet): Finished removing the BaseConfiguration class, t…
hutcheb Jan 7, 2023
b506734
fix(plc4j/profinet): fix dependency check and remove manual test
hutcheb Jan 7, 2023
5b1ccfc
fix(plc4j/profinet): fix disabled test for gsdfiles
hutcheb Jan 7, 2023
2640bf2
fix(plc4j/profinet): Add support for checking if a submodule is found…
hutcheb Jan 7, 2023
1c82162
fix(plc4j/profinet): update tests for browsing
hutcheb Jan 7, 2023
434a04c
fix(plc4j/profinet): Continued filling out the browse structure.
hutcheb Jan 9, 2023
5281fee
fix(plc4j/profinet): Minor change to support older Java versions
hutcheb Jan 10, 2023
ff39093
fix(plc4j/profinet): Refactoring the configuration to allow for an ea…
hutcheb Jan 12, 2023
fcd47ba
fix(plc4j/profinet): Refactoring the configuration to allow for an ea…
hutcheb Jan 12, 2023
9bd97c1
fix(plc4j/profinet): Refactoring the submodules, this stops us from h…
hutcheb Jan 12, 2023
41ac28b
fix(plc4j/profinet): Continue refactoring
hutcheb Jan 16, 2023
6d142a3
fix(readme): Flattening the tags returned by browsing.
hutcheb Jan 17, 2023
ecd9c67
Merge branch 'develop' into plc4j/profinet
hutcheb Jan 18, 2023
55cd1be
Merge branch 'develop' into plc4j/profinet
hutcheb Jan 18, 2023
c305854
fix(plc4j/profinet): Expanded supported data types.
hutcheb Jan 18, 2023
8369c9b
Merge branch 'develop' into plc4j/profinet
hutcheb Jan 18, 2023
264ec81
Merge branch 'develop' into plc4j/profinet
hutcheb Jan 21, 2023
76ddf6e
fix(plc4j/profinet): Add extra tests for browsing tags
hutcheb Jan 21, 2023
f503227
fix(plc4j/profinet): Fix issues after refactoring.
hutcheb Jan 23, 2023
e506434
fix(plc4j/profinet): Add support for parsing returned data as well as…
hutcheb Jan 23, 2023
eb56517
fix(plc4j/profinet): Add the subscription logic.
hutcheb Jan 25, 2023
cd850a3
fix(plc4j/profinet): Starting to add error handling cases
hutcheb Jan 26, 2023
988e10d
Merge branch 'develop' into plc4j/profinet
hutcheb Jan 26, 2023
6813ce6
fix(plc4j/profinet): Fixed issue with cycle timer as well as included…
hutcheb Jan 26, 2023
04b6b48
fix(plc4j/profinet): Fixed up some files that were changed accidentally
hutcheb Jan 26, 2023
024bc49
fix(plc4j): don't exclude the template folder in .idea
hutcheb Jan 26, 2023
5f2d981
fix(plc4j/profinet): update manual profinet test
hutcheb Jan 26, 2023
ce74594
fix(plc4j/profinet): Cleaned up and changed to using states for each …
hutcheb Jan 27, 2023
df297ff
fix(plc4j/profinet): Fixing exception handling.
hutcheb Jan 27, 2023
bf9e1a6
fix(plc4j/profinet): Cleaned up a little
hutcheb Jan 28, 2023
1bbac3d
fix(plc4j/profinet): Add support for individual subscriptions and cha…
hutcheb Jan 29, 2023
8ad0582
fix(plc4j/profinet): Fixed issue with non bit data values and browse …
hutcheb Jan 30, 2023
ca07aad
Merge branch 'develop' into plc4j/profinet
hutcheb Jan 30, 2023
bc2d182
fix(plc4j/profinet): Merged Develop and updated generated classes
hutcheb Jan 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# User-specific stuff:
.idea/**
*/.idea/**
.idea/*.xml
*/.idea/*.xml
*.iml
.vscode/**
.java-version
Expand Down Expand Up @@ -196,3 +196,5 @@ link.txt*/
CMakeFiles/
CMakeCache.txt
DartConfiguration.tcl
/.idea/libraries/
/.idea/inspectionProfiles/
13 changes: 13 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions .idea/fileTemplates/includes/File Header Yml.yml

This file was deleted.

17 changes: 13 additions & 4 deletions plc4j/drivers/profinet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
<languageName>java</languageName>
<outputFlavor>read-write</outputFlavor>
<outputDir>src/main/generated</outputDir>
<options>
<generate-properties-for-parser-arguments>true</generate-properties-for-parser-arguments>
<!-- We want properties that contain the values of reserved fields, if the value differs from the expected one -->
<generate-properties-for-reserved-fields>true</generate-properties-for-reserved-fields>
</options>
</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -149,10 +154,6 @@
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down Expand Up @@ -218,6 +219,14 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.plc4x.java.profinet.readwrite;

import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
import static org.apache.plc4x.java.spi.generation.StaticHelper.*;

import java.time.*;
import java.util.*;
import org.apache.plc4x.java.api.exceptions.*;
import org.apache.plc4x.java.api.value.*;
import org.apache.plc4x.java.spi.codegen.*;
import org.apache.plc4x.java.spi.codegen.fields.*;
import org.apache.plc4x.java.spi.codegen.io.*;
import org.apache.plc4x.java.spi.generation.*;

// Code generated by code-generation. DO NOT EDIT.

public class CheckPeers extends PnIoCm_Block implements Message {

// Accessors for discriminator values.
public PnIoCm_BlockType getBlockType() {
return PnIoCm_BlockType.CHECK_PEERS;
}

// Constant values.
public static final Short NOOFPEERS = 0x01;

// Properties.
protected final short blockVersionHigh;
protected final short blockVersionLow;
protected final PascalString peerPortId;
protected final PascalString peerChassisId;

public CheckPeers(
short blockVersionHigh,
short blockVersionLow,
PascalString peerPortId,
PascalString peerChassisId) {
super();
this.blockVersionHigh = blockVersionHigh;
this.blockVersionLow = blockVersionLow;
this.peerPortId = peerPortId;
this.peerChassisId = peerChassisId;
}

public short getBlockVersionHigh() {
return blockVersionHigh;
}

public short getBlockVersionLow() {
return blockVersionLow;
}

public PascalString getPeerPortId() {
return peerPortId;
}

public PascalString getPeerChassisId() {
return peerChassisId;
}

public short getNoOfPeers() {
return NOOFPEERS;
}

@Override
protected void serializePnIoCm_BlockChild(WriteBuffer writeBuffer) throws SerializationException {
PositionAware positionAware = writeBuffer;
int startPos = positionAware.getPos();
writeBuffer.pushContext("CheckPeers");

// Implicit Field (blockLength) (Used for parsing, but its value is not stored as it's
// implicitly given by the objects content)
int blockLength = (int) ((getLengthInBytes()) - (4));
writeImplicitField(
"blockLength",
blockLength,
writeUnsignedInt(writeBuffer, 16),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));

// Simple Field (blockVersionHigh)
writeSimpleField(
"blockVersionHigh",
blockVersionHigh,
writeUnsignedShort(writeBuffer, 8),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));

// Simple Field (blockVersionLow)
writeSimpleField(
"blockVersionLow",
blockVersionLow,
writeUnsignedShort(writeBuffer, 8),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));

// Const Field (noOfPeers)
writeConstField(
"noOfPeers",
NOOFPEERS,
writeUnsignedShort(writeBuffer, 8),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));

// Simple Field (peerPortId)
writeSimpleField(
"peerPortId",
peerPortId,
new DataWriterComplexDefault<>(writeBuffer),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));

// Simple Field (peerChassisId)
writeSimpleField(
"peerChassisId",
peerChassisId,
new DataWriterComplexDefault<>(writeBuffer),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));

writeBuffer.popContext("CheckPeers");
}

@Override
public int getLengthInBytes() {
return (int) Math.ceil((float) getLengthInBits() / 8.0);
}

@Override
public int getLengthInBits() {
int lengthInBits = super.getLengthInBits();
CheckPeers _value = this;

// Implicit Field (blockLength)
lengthInBits += 16;

// Simple field (blockVersionHigh)
lengthInBits += 8;

// Simple field (blockVersionLow)
lengthInBits += 8;

// Const Field (noOfPeers)
lengthInBits += 8;

// Simple field (peerPortId)
lengthInBits += peerPortId.getLengthInBits();

// Simple field (peerChassisId)
lengthInBits += peerChassisId.getLengthInBits();

return lengthInBits;
}

public static PnIoCm_BlockBuilder staticParsePnIoCm_BlockBuilder(ReadBuffer readBuffer)
throws ParseException {
readBuffer.pullContext("CheckPeers");
PositionAware positionAware = readBuffer;
int startPos = positionAware.getPos();
int curPos;

int blockLength =
readImplicitField(
"blockLength",
readUnsignedInt(readBuffer, 16),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));

short blockVersionHigh =
readSimpleField(
"blockVersionHigh",
readUnsignedShort(readBuffer, 8),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));

short blockVersionLow =
readSimpleField(
"blockVersionLow",
readUnsignedShort(readBuffer, 8),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));

short noOfPeers =
readConstField(
"noOfPeers",
readUnsignedShort(readBuffer, 8),
CheckPeers.NOOFPEERS,
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));

PascalString peerPortId =
readSimpleField(
"peerPortId",
new DataReaderComplexDefault<>(() -> PascalString.staticParse(readBuffer), readBuffer),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));

PascalString peerChassisId =
readSimpleField(
"peerChassisId",
new DataReaderComplexDefault<>(() -> PascalString.staticParse(readBuffer), readBuffer),
WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN));

readBuffer.closeContext("CheckPeers");
// Create the instance
return new CheckPeersBuilderImpl(blockVersionHigh, blockVersionLow, peerPortId, peerChassisId);
}

public static class CheckPeersBuilderImpl implements PnIoCm_Block.PnIoCm_BlockBuilder {
private final short blockVersionHigh;
private final short blockVersionLow;
private final PascalString peerPortId;
private final PascalString peerChassisId;

public CheckPeersBuilderImpl(
short blockVersionHigh,
short blockVersionLow,
PascalString peerPortId,
PascalString peerChassisId) {
this.blockVersionHigh = blockVersionHigh;
this.blockVersionLow = blockVersionLow;
this.peerPortId = peerPortId;
this.peerChassisId = peerChassisId;
}

public CheckPeers build() {
CheckPeers checkPeers =
new CheckPeers(blockVersionHigh, blockVersionLow, peerPortId, peerChassisId);
return checkPeers;
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof CheckPeers)) {
return false;
}
CheckPeers that = (CheckPeers) o;
return (getBlockVersionHigh() == that.getBlockVersionHigh())
&& (getBlockVersionLow() == that.getBlockVersionLow())
&& (getPeerPortId() == that.getPeerPortId())
&& (getPeerChassisId() == that.getPeerChassisId())
&& super.equals(that)
&& true;
}

@Override
public int hashCode() {
return Objects.hash(
super.hashCode(),
getBlockVersionHigh(),
getBlockVersionLow(),
getPeerPortId(),
getPeerChassisId());
}

@Override
public String toString() {
WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true);
try {
writeBufferBoxBased.writeSerializable(this);
} catch (SerializationException e) {
throw new RuntimeException(e);
}
return "\n" + writeBufferBoxBased.getBox().toString() + "\n";
}
}
Loading