Skip to content

Commit

Permalink
Minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bmalinowsky committed Jan 27, 2024
1 parent 0d05a42 commit 87377af
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 27 deletions.
3 changes: 1 addition & 2 deletions src/io/calimero/internal/EventListeners.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Calimero 2 - A library for KNX network access
Copyright (c) 2006, 2023 B. Malinowsky
Copyright (c) 2006, 2024 B. Malinowsky
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -76,7 +76,6 @@ public EventListeners(final Class<? extends Annotation> eventAnnotation) {

/**
* Adds the specified event listener {@code l} to this container.
* <p>
* If {@code l} was already added as listener, no action is performed.
*
* @param l the listener to add
Expand Down
13 changes: 1 addition & 12 deletions src/io/calimero/internal/UdpSocketLooper.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Calimero 2 - A library for KNX network access
Copyright (c) 2010, 2022 B. Malinowsky
Copyright (c) 2010, 2024 B. Malinowsky
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -71,17 +71,6 @@ public abstract class UdpSocketLooper
private final boolean closeSocket;
private volatile boolean quit;

/**
* Creates a socket looper for the supplied UDP socket.
*
* @param socket the UDP socket to loop on
* @param closeSocket {@code true} to close the socket on {@link #quit()},
* {@code false} otherwise
*/
public UdpSocketLooper(final DatagramSocket socket, final boolean closeSocket)
{
this(socket, closeSocket, 512, 0, 0);
}

/**
* Creates a socket looper for the supplied UDP socket and timeout parameters.
Expand Down
13 changes: 4 additions & 9 deletions src/io/calimero/link/AbstractMonitor.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Calimero 2 - A library for KNX network access
Copyright (c) 2015, 2022 B. Malinowsky
Copyright (c) 2015, 2024 B. Malinowsky
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -182,10 +182,7 @@ public final KNXMediumSettings getKNXMedium()
}

@Override
public void addMonitorListener(final LinkListener l)
{
notifier.addListener(l);
}
public void addMonitorListener(final LinkListener l) { notifier.addListener(l); }

@Override
public void removeMonitorListener(final LinkListener l)
Expand Down Expand Up @@ -246,17 +243,15 @@ public String toString()
* Invoked on {@link #close()} to execute additional close sequences of the communication
* protocol, or releasing link-specific resources.
*/
protected void onClose()
{}
protected void onClose() {}

/**
* Invoked on {@link #close()} to allow the communication protocol to leave busmonitor mode.
*
* @throws InterruptedException on interrupted thread
*/
@SuppressWarnings("unused")
protected void leaveBusmonitor() throws InterruptedException
{}
protected void leaveBusmonitor() throws InterruptedException {}

void dispatchCustomEvent(final Object event) {
notifier.dispatchCustomEvent(event);
Expand Down
8 changes: 4 additions & 4 deletions src/io/calimero/link/KNXNetworkMonitorUsb.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@
import static io.calimero.serial.usb.UsbConnection.EmiType.Cemi;
import static io.calimero.serial.usb.UsbConnection.EmiType.Emi1;
import static io.calimero.serial.usb.UsbConnection.EmiType.Emi2;
import static java.lang.System.Logger.Level.INFO;
import static java.lang.System.Logger.Level.DEBUG;

import java.lang.System.Logger.Level;
import java.util.EnumSet;

import io.calimero.Connection.BlockingMode;
Expand Down Expand Up @@ -130,12 +129,14 @@ protected KNXNetworkMonitorUsb(final UsbConnection c, final KNXMediumSettings se
// report device descriptor before switching to busmonitor mode
// not all devices provide a device descriptor 0
final DD0 dd0 = conn.deviceDescriptor();
logger.log(Level.DEBUG, "KNX device descriptor 0 (Mask Version): {0}", dd0);
logger.log(DEBUG, "KNX device descriptor 0 (Mask Version): {0}", dd0);
}
catch (final KNXTimeoutException expected) {}

final boolean extBusmon = settings instanceof PLSettings;
enterBusmonitor(extBusmon);
logger.log(DEBUG, "in busmonitor mode - ready to receive");

conn.addConnectionListener(notifier);
conn.addConnectionListener(new KNXListener() {
@Override
Expand All @@ -155,7 +156,6 @@ void connectionStatus(final ConnectionStatus status) {
close();
throw e;
}
logger.log(INFO, "in busmonitor mode - ready to receive");
}

@Override
Expand Down

0 comments on commit 87377af

Please sign in to comment.