Skip to content

Commit

Permalink
Add Java UDP outstation
Browse files Browse the repository at this point in the history
  • Loading branch information
jadamcrain committed Apr 25, 2024
1 parent c9ca5f7 commit 00548c4
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ private static void run(Runtime runtime, String[] args) {
case "tcp":
runTcp(runtime);
break;
case "udp":
runUdp(runtime);
break;
case "serial":
runSerial(runtime);
break;
Expand Down Expand Up @@ -292,6 +295,26 @@ private static void runTls(Runtime runtime, TlsServerConfig config) {
}
}

private static void runUdp(Runtime runtime) {
// ANCHOR: create_udp
OutstationUdpConfig udpConfig = new OutstationUdpConfig(
"127.0.0.1:20000",
"127.0.0.1:20001"
);

Outstation outstation = Outstation.createUdp(
runtime,
udpConfig,
getOutstationConfig(),
new TestOutstationApplication(),
new TestOutstationInformation(),
new TestControlHandler()
);
// ANCHOR_END: create_udp

runOutstation(outstation);
}

private static void runSerial(Runtime runtime) {
// ANCHOR: create_serial_server
Outstation outstation = Outstation.createSerialSession2(
Expand Down

0 comments on commit 00548c4

Please sign in to comment.