Compare commits

...

17 Commits

Author SHA1 Message Date
Stefan Feuerhahn c5acb251b7 Merge branch 'master' of github.com:beanit/openiec61850 2 years ago
Stefan Feuerhahn 0d652ed0d0 updated windows batch script to work with Java 17 2 years ago
sfeuerhahn 0508da4073
Merge pull request #35 from SteffenBrauns/patch-1
Bugfix NPE in ClientAssociation#close()
2 years ago
SteffenBrauns 6d8859f6f6
Bugfix NPE in ClientAssociation#close()
Added null check for reportListener
2 years ago
sfeuerhahn f9f34cde0c
Merge pull request #23 from pavel-ch/master
ClientAssociation: store servicesSupported from InitiateResponsePDU for a later access
4 years ago
pavel-ch fa62271c46 Merge branch 'master' of https://github.com/beanit/iec61850bean 4 years ago
pavel-ch cb903a3f61 ClientAssociation: storing servicesSupported from InitiateResponsePDU for a later access 4 years ago
Stefan Feuerhahn 77c7b009b4 removed unnecessary setters, removed exposing proposedParameterCbbBitString 5 years ago
Matthias Kruse e0770f03e6 reverted change of other commit 5 years ago
Matthias Kruse ef06aea374 fixed #10 5 years ago
Matthias Kruse 0afb4f56a1 fixes #18 5 years ago
Stefan Feuerhahn eccb578588 updated errorprone version to 2.5.1 5 years ago
Stefan Feuerhahn 1f01fcac02 enhanced SequenceNumber class 5 years ago
Stefan Feuerhahn 05d75db9db upgraded gradle plugin dependency versions and java dependency versions 5 years ago
Stefan Feuerhahn cd11b7c9ff fixed setting reportTimestamp field in OptFlds class, thanks to Krzysztof Pasierbski 5 years ago
Stefan Feuerhahn 24cee0d77e removed unnecessary files from gradle tar task 5 years ago
Stefan Feuerhahn fc8ec39ed9 set version to 1.9.1-SNAPSHOT 5 years ago

@ -1,6 +1,7 @@
::BATCH file for windows
::BATCH file to windows
@echo off
set BATDIR=%~dp0
set LIBDIR="%BATDIR%..\build\libs-all"
set LIBDIR="%BATDIR%..\build\libs-all\*"
java -Djava.ext.dirs=%LIBDIR% com.beanit.iec61850bean.app.ConsoleClient %*
java -cp %LIBDIR% com.beanit.iec61850bean.app.ConsoleClient %*

@ -1,6 +1,8 @@
::BATCH file to windows
@echo off
set BATDIR=%~dp0
set LIBDIR="%BATDIR%..\build\libs-all"
set LIBDIR="%BATDIR%..\build\libs-all\*"
java -Dlogback.configurationFile=logback.xml -cp %LIBDIR% com.beanit.iec61850bean.app.ConsoleServer %*
java -Dlogback.configurationFile=logback.xml -Djava.ext.dirs=%LIBDIR% com.beanit.iec61850bean.app.ConsoleServer %*

@ -1,6 +1,7 @@
::BATCH file to windows
@echo off
set BATDIR=%~dp0
set LIBDIR="%BATDIR%..\build\libs-all"
set LIBDIR="%BATDIR%..\build\libs-all\*"
java -Djava.ext.dirs=%LIBDIR% com.beanit.iec61850bean.clientgui.ClientGui %*
java -cp %LIBDIR% com.beanit.iec61850bean.clientgui.ClientGui %*

@ -6,9 +6,9 @@ plugins {
signing
eclipse
id("biz.aQute.bnd.builder") version "5.1.1"
id("com.diffplug.gradle.spotless") version "4.4.0"
id("io.codearte.nexus-staging") version "0.21.2"
id("net.ltgt.errorprone") version "1.2.1"
id("com.diffplug.spotless") version "5.9.0"
id("io.codearte.nexus-staging") version "0.22.0"
id("net.ltgt.errorprone") version "1.3.0"
}
var cfgJavaVersion = JavaVersion.VERSION_1_8
@ -21,7 +21,7 @@ val sonatypeStagingProfileId: String? by project
//----------- project specific configuration start --------------------
val cfgVersion = "1.9.0"
val cfgVersion = "1.9.1-SNAPSHOT"
val cfgGroup = "com.beanit"
val cfgCopyToRoot = false
val cfgSignPom = true
@ -40,8 +40,6 @@ tasks.register<Tar>("tar") {
into(project.name) {
from("./") {
include("build.gradle.kts")
include("configuration.gradle.kts")
include("settings.gradle.kts")
include("LICENSE.txt")
include("doc/**")
include("bin/**")
@ -132,7 +130,7 @@ configure(javaProjects) {
apply(plugin = "signing")
apply(plugin = "eclipse")
apply(plugin = "biz.aQute.bnd.builder")
apply(plugin = "com.diffplug.gradle.spotless")
apply(plugin = "com.diffplug.spotless")
apply(plugin = "net.ltgt.errorprone")
tasks.publish {
@ -151,9 +149,9 @@ configure(javaProjects) {
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.6.2")
testImplementation("com.tngtech.archunit:archunit-junit5:0.14.1")
errorprone("com.google.errorprone:error_prone_core:2.4.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.7.0")
testImplementation("com.tngtech.archunit:archunit-junit5:0.15.0")
errorprone("com.google.errorprone:error_prone_core:2.5.1")
}
tasks.test {

@ -61,7 +61,7 @@ public final class BdaOptFlds extends BdaBitString {
if (reportTimestamp) {
value[0] = (byte) (value[0] | 0x20);
} else {
value[0] = (byte) (value[0] & 0x2f);
value[0] = (byte) (value[0] & 0xdf);
}
}

@ -110,6 +110,7 @@ public final class ClientAssociation {
private int responseTimeout;
private int invokeId = 0;
private byte[] servicesSupported = null;
private int negotiatedMaxPduSize;
private ClientEventListener reportListener = null;
@ -390,6 +391,16 @@ public final class ClientAssociation {
return invokeId;
}
/**
* Gets the ServicesSupported. The 11-byte array of bit flags is available after InitiateResponse
* is received from the server, otherwise null is returned
*
* @return the ServicesSupported byte array, or null.
*/
public byte[] getServicesSupported() {
return servicesSupported;
}
private ConfirmedServiceResponse encodeWriteReadDecode(ConfirmedServiceRequest serviceRequest)
throws ServiceError, IOException {
@ -567,7 +578,7 @@ public final class ClientAssociation {
throw new IOException("Unsupported version number was negotiated.");
}
byte[] servicesSupported =
servicesSupported =
initiateResponsePdu.getInitResponseDetail().getServicesSupportedCalled().value;
if ((servicesSupported[0] & 0x40) != 0x40) {
throw new IOException("Obligatory services are not supported by the server.");
@ -2099,15 +2110,17 @@ public final class ClientAssociation {
closed = true;
acseAssociation.close();
lastIOException = e;
Thread t1 =
new Thread(
new Runnable() {
@Override
public void run() {
reportListener.associationClosed(lastIOException);
}
});
t1.start();
if (reportListener != null) {
Thread t1 =
new Thread(
new Runnable() {
@Override
public void run() {
reportListener.associationClosed(lastIOException);
}
});
t1.start();
}
MMSpdu mmsPdu = new MMSpdu();
mmsPdu.setConfirmedRequestPDU(new ConfirmedRequestPDU());

@ -33,11 +33,11 @@ public final class ClientSap {
private static final byte[] DEFAULT_TSEL_LOCAL = new byte[] {0, 0};
private static final byte[] DEFAULT_TSEL_REMOTE = new byte[] {0, 1};
private static final int DEFAUTL_TPDU_SIZE_PARAMETER = 10; // size = 1024
private final int proposedMaxServOutstandingCalling = 5;
private final int proposedMaxServOutstandingCalled = 5;
private final int proposedDataStructureNestingLevel = 10;
private static final int DEFAULT_TPDU_SIZE_PARAMETER = 10; // size = 1024
private final ClientAcseSap acseSap;
private int proposedMaxServOutstandingCalling = 5;
private int proposedMaxServOutstandingCalled = 5;
private int proposedDataStructureNestingLevel = 10;
private int proposedMaxMmsPduSize = 65000;
private byte[] servicesSupportedCalling =
new byte[] {(byte) 0xee, 0x1c, 0, 0, 0x04, 0x08, 0, 0, 0x79, (byte) 0xef, 0x18};
@ -49,7 +49,7 @@ public final class ClientSap {
acseSap = new ClientAcseSap();
acseSap.tSap.tSelLocal = DEFAULT_TSEL_LOCAL;
acseSap.tSap.tSelRemote = DEFAULT_TSEL_REMOTE;
acseSap.tSap.setMaxTPDUSizeParam(DEFAUTL_TPDU_SIZE_PARAMETER);
acseSap.tSap.setMaxTPDUSizeParam(DEFAULT_TPDU_SIZE_PARAMETER);
}
/**
@ -62,7 +62,7 @@ public final class ClientSap {
acseSap = new ClientAcseSap(socketFactory);
acseSap.tSap.tSelLocal = DEFAULT_TSEL_LOCAL;
acseSap.tSap.tSelRemote = DEFAULT_TSEL_REMOTE;
acseSap.tSap.setMaxTPDUSizeParam(DEFAUTL_TPDU_SIZE_PARAMETER);
acseSap.tSap.setMaxTPDUSizeParam(DEFAULT_TPDU_SIZE_PARAMETER);
}
/**
@ -91,6 +91,18 @@ public final class ClientSap {
}
}
public void setProposedMaxServOutstandingCalling(int proposedMaxServOutstandingCalling) {
this.proposedMaxServOutstandingCalling = proposedMaxServOutstandingCalling;
}
public void setProposedMaxServOutstandingCalled(int proposedMaxServOutstandingCalled) {
this.proposedMaxServOutstandingCalled = proposedMaxServOutstandingCalled;
}
public void setProposedDataStructureNestingLevel(int proposedDataStructureNestingLevel) {
this.proposedDataStructureNestingLevel = proposedDataStructureNestingLevel;
}
/**
* Gets the ServicesSupportedCalling parameter.
*

@ -28,20 +28,25 @@ public class SequenceNumber {
public static int getIncrement(int value, int minValue, int maxValue) {
assert (value >= minValue) && (value <= maxValue);
if (value == maxValue) {
return minValue;
} else {
return ++value;
}
return (value == maxValue) ? minValue : value + 1;
}
public int getAndIncrement() {
int oldValue = value;
if (value == maxValue) {
value = minValue;
} else {
++value;
}
value = (value == maxValue) ? minValue : value + 1;
return oldValue;
}
public int get() {
return value;
}
public void increment() {
value = (value == maxValue) ? minValue : value + 1;
}
public int incrementAndGet() {
value = (value == maxValue) ? minValue : value + 1;
return value;
}
}

Loading…
Cancel
Save