-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Initial work on an IEC 60870-5-104 driver
- Loading branch information
Showing
9 changed files
with
952 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
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. | ||
--> | ||
<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"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.apache.plc4x</groupId> | ||
<artifactId>plc4x-protocols</artifactId> | ||
<version>0.11.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>plc4x-protocols-iec-60870</artifactId> | ||
|
||
<name>Protocols: IEC-60870</name> | ||
<description>Base protocol specifications for the IEC-60870 protocol family</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.plc4x</groupId> | ||
<artifactId>plc4x-code-generation-protocol-base-mspec</artifactId> | ||
<version>0.11.0-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-classic</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
42 changes: 42 additions & 0 deletions
42
.../iec-60870/src/main/java/org/apache/plc4x/protocol/iec608705104/IEC608705104Protocol.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* 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 | ||
* | ||
* http://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.protocol.iec608705104; | ||
|
||
import org.apache.plc4x.plugins.codegenerator.language.mspec.parser.MessageFormatParser; | ||
import org.apache.plc4x.plugins.codegenerator.language.mspec.protocol.ProtocolHelpers; | ||
import org.apache.plc4x.plugins.codegenerator.language.mspec.protocol.ValidatableTypeContext; | ||
import org.apache.plc4x.plugins.codegenerator.protocol.Protocol; | ||
import org.apache.plc4x.plugins.codegenerator.protocol.TypeContext; | ||
import org.apache.plc4x.plugins.codegenerator.types.exceptions.GenerationException; | ||
|
||
public class IEC608705104Protocol implements Protocol, ProtocolHelpers { | ||
|
||
@Override | ||
public String getName() { | ||
return "iec-60870-5-104"; | ||
} | ||
|
||
@Override | ||
public TypeContext getTypeContext() throws GenerationException { | ||
ValidatableTypeContext typeContext = new MessageFormatParser().parse(getMspecStream("iec-60870-5-104")); | ||
typeContext.validate(); | ||
return typeContext; | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
...main/resources/META-INF/services/org.apache.plc4x.plugins.codegenerator.protocol.Protocol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# | ||
# 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. | ||
# | ||
org.apache.plc4x.protocol.iec608705104.IEC608705104Protocol |
Oops, something went wrong.