Skip to content

Commit 9c91f40

Browse files
committed
feat: Made sure the UMAS java code is generated correctly from the v1 spec while the python code remains at v0
1 parent bb9c49c commit 9c91f40

78 files changed

Lines changed: 13146 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

plc4j/drivers/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
<module>profinet-ng</module>
5959
<module>s7</module>
6060
<module>simulated</module>
61+
<module>umas</module>
6162
<module>all</module>
6263
</modules>
6364

plc4j/drivers/umas/pom.xml

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
https://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
20+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
23+
<parent>
24+
<groupId>org.apache.plc4x</groupId>
25+
<artifactId>plc4j-drivers</artifactId>
26+
<version>0.14.0-SNAPSHOT</version>
27+
</parent>
28+
29+
<artifactId>plc4j-driver-umas</artifactId>
30+
31+
<name>PLC4J: Driver: UMAS</name>
32+
<description>Implementation of a PLC4x driver able to speak using the UMAS protocol (Schneider Electric Modicon PLCs via Modbus/TCP Function Code 90).</description>
33+
34+
<properties>
35+
<project.build.outputTimestamp>2025-08-02T13:55:11Z</project.build.outputTimestamp>
36+
</properties>
37+
38+
<build>
39+
<plugins>
40+
<plugin>
41+
<groupId>org.apache.karaf.tooling</groupId>
42+
<artifactId>karaf-maven-plugin</artifactId>
43+
<executions>
44+
<execution>
45+
<id>generate-feature-xml</id>
46+
<phase>compile</phase>
47+
<goals>
48+
<!-- Generate the feature.xml -->
49+
<goal>features-generate-descriptor</goal>
50+
<!-- Check the feature.xml -->
51+
<goal>verify</goal>
52+
</goals>
53+
<configuration>
54+
<enableGeneration>true</enableGeneration>
55+
<aggregateFeatures>true</aggregateFeatures>
56+
</configuration>
57+
</execution>
58+
<execution>
59+
<id>build-kar</id>
60+
<phase>package</phase>
61+
<goals>
62+
<!--
63+
Build a kar archive (Jar containing the feature.xml
64+
as well as the module content and it's dependencies.
65+
-->
66+
<goal>kar</goal>
67+
</goals>
68+
</execution>
69+
</executions>
70+
</plugin>
71+
<plugin>
72+
<groupId>org.apache.felix</groupId>
73+
<artifactId>maven-bundle-plugin</artifactId>
74+
<extensions>true</extensions>
75+
<configuration>
76+
<instructions>
77+
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
78+
<Bundle-Activator>org.apache.plc4x.java.osgi.DriverActivator</Bundle-Activator>
79+
<Export-Service>org.apache.plc4x.java.api.PlcDriver,org.apache.plc4x.java.umas.readwrite.UmasDriver
80+
</Export-Service>
81+
<Import-Package>
82+
*
83+
</Import-Package>
84+
<SPI-consumer>*</SPI-consumer>
85+
</instructions>
86+
</configuration>
87+
</plugin>
88+
</plugins>
89+
</build>
90+
91+
<dependencies>
92+
<dependency>
93+
<groupId>org.apache.plc4x</groupId>
94+
<artifactId>plc4j-api</artifactId>
95+
<version>0.14.0-SNAPSHOT</version>
96+
</dependency>
97+
<dependency>
98+
<groupId>org.apache.plc4x</groupId>
99+
<artifactId>plc4j-spi</artifactId>
100+
<version>0.14.0-SNAPSHOT</version>
101+
</dependency>
102+
103+
<!--dependency>
104+
<groupId>org.apache.plc4x</groupId>
105+
<artifactId>plc4j-transport-tcp</artifactId>
106+
<version>0.14.0-SNAPSHOT</version>
107+
</dependency>
108+
109+
<dependency>
110+
<groupId>io.netty</groupId>
111+
<artifactId>netty-buffer</artifactId>
112+
</dependency>
113+
<dependency>
114+
<groupId>io.netty</groupId>
115+
<artifactId>netty-transport</artifactId>
116+
</dependency-->
117+
118+
<dependency>
119+
<groupId>org.slf4j</groupId>
120+
<artifactId>slf4j-api</artifactId>
121+
</dependency>
122+
<dependency>
123+
<groupId>ch.qos.logback</groupId>
124+
<artifactId>logback-classic</artifactId>
125+
</dependency>
126+
127+
<dependency>
128+
<groupId>org.apache.plc4x</groupId>
129+
<artifactId>plc4j-utils-test-utils</artifactId>
130+
<version>0.14.0-SNAPSHOT</version>
131+
<scope>test</scope>
132+
</dependency>
133+
134+
<dependency>
135+
<groupId>org.skyscreamer</groupId>
136+
<artifactId>jsonassert</artifactId>
137+
<version>1.5.3</version>
138+
<scope>test</scope>
139+
</dependency>
140+
141+
<dependency>
142+
<groupId>org.apache.plc4x</groupId>
143+
<artifactId>plc4x-protocols-umas</artifactId>
144+
<version>0.14.0-SNAPSHOT</version>
145+
<classifier>tests</classifier>
146+
<type>test-jar</type>
147+
<scope>test</scope>
148+
</dependency>
149+
</dependencies>
150+
151+
<profiles>
152+
<profile>
153+
<id>update-generated-code</id>
154+
<build>
155+
<plugins>
156+
<plugin>
157+
<groupId>org.apache.plc4x.plugins</groupId>
158+
<artifactId>plc4x-maven-plugin</artifactId>
159+
<executions>
160+
<execution>
161+
<id>generate-driver</id>
162+
<phase>generate-sources</phase>
163+
<goals>
164+
<goal>generate-driver</goal>
165+
</goals>
166+
<configuration>
167+
<protocolName>umas</protocolName>
168+
<protocolVersion>1</protocolVersion>
169+
<languageName>java</languageName>
170+
<outputFlavor>read-write</outputFlavor>
171+
<outputDir>src/main/generated</outputDir>
172+
</configuration>
173+
</execution>
174+
</executions>
175+
</plugin>
176+
</plugins>
177+
</build>
178+
179+
<dependencies>
180+
<dependency>
181+
<groupId>org.apache.plc4x</groupId>
182+
<artifactId>plc4x-code-generation-language-java</artifactId>
183+
<version>0.14.0-SNAPSHOT</version>
184+
<!-- Scope is 'provided' as this way it's not shipped with the driver -->
185+
<scope>provided</scope>
186+
</dependency>
187+
188+
<dependency>
189+
<groupId>org.apache.plc4x</groupId>
190+
<artifactId>plc4x-protocols-umas</artifactId>
191+
<version>0.14.0-SNAPSHOT</version>
192+
<!-- Scope is 'provided' as this way it's not shipped with the driver -->
193+
<scope>provided</scope>
194+
</dependency>
195+
</dependencies>
196+
</profile>
197+
</profiles>
198+
199+
</project>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* https://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.plc4x.java.umas.readwrite;
20+
21+
import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*;
22+
import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*;
23+
import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*;
24+
import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*;
25+
import static org.apache.plc4x.java.spi.generation.StaticHelper.*;
26+
27+
import java.time.*;
28+
import java.util.*;
29+
import org.apache.plc4x.java.api.exceptions.*;
30+
import org.apache.plc4x.java.api.value.*;
31+
import org.apache.plc4x.java.spi.codegen.*;
32+
import org.apache.plc4x.java.spi.codegen.fields.*;
33+
import org.apache.plc4x.java.spi.codegen.io.*;
34+
import org.apache.plc4x.java.spi.generation.*;
35+
36+
// Code generated by code-generation. DO NOT EDIT.
37+
38+
public class Constants {
39+
40+
// Constant values.
41+
public static final Integer UMASTCPDEFAULTPORT = 502;
42+
}

0 commit comments

Comments
 (0)