Skip to content

Commit 808982b

Browse files
committed
Set subnet/device address of first service container
1 parent 12bdb2d commit 808982b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/tuwien/auto/calimero/server/knxnetip/KNXnetIPServer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,11 @@ public final boolean addServiceContainer(final ServiceContainer sc)
344344
return false;
345345
}
346346
final InterfaceObjectServer io = getInterfaceObjectServer();
347+
if (svcContainers.isEmpty()) {
348+
final byte[] device = sc.getMediumSettings().getDeviceAddress().toByteArray();
349+
setProperty(DEVICE_OBJECT, objectInstance, PID.SUBNET_ADDRESS, device[0]);
350+
setProperty(DEVICE_OBJECT, objectInstance, PID.DEVICE_ADDRESS, device[1]);
351+
}
347352
setProperty(InterfaceObject.CEMI_SERVER_OBJECT, 1, PID.MEDIUM_TYPE, (byte) 0,
348353
(byte) sc.getMediumSettings().getMedium());
349354
// add new KNXnet/IP parameter object for this service container

0 commit comments

Comments
 (0)