Normalized thread names (#9581)
Related to #8216 Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
This commit is contained in:
committed by
GitHub
parent
79dfb43e42
commit
ac3f907b36
@@ -68,7 +68,8 @@ public class CaddxCommunicator implements SerialPortEventListener {
|
||||
private boolean unStuff = false;
|
||||
private int tempAsciiByte = 0;
|
||||
|
||||
public CaddxCommunicator(SerialPortManager portManager, CaddxProtocol protocol, String serialPortName, int baudRate)
|
||||
public CaddxCommunicator(String uid, SerialPortManager portManager, CaddxProtocol protocol, String serialPortName,
|
||||
int baudRate)
|
||||
throws UnsupportedCommOperationException, PortInUseException, IOException, TooManyListenersException {
|
||||
this.portManager = portManager;
|
||||
this.protocol = protocol;
|
||||
@@ -101,7 +102,7 @@ public class CaddxCommunicator implements SerialPortEventListener {
|
||||
serialPort.notifyOnDataAvailable(true);
|
||||
serialPort.addEventListener(this);
|
||||
|
||||
communicator = new Thread(this::messageDispatchLoop, "Caddx Communicator");
|
||||
communicator = new Thread(this::messageDispatchLoop, "OH-binding-" + uid + "-caddxCommunicator");
|
||||
communicator.setDaemon(true);
|
||||
communicator.start();
|
||||
|
||||
|
||||
@@ -128,7 +128,8 @@ public class CaddxBridgeHandler extends BaseBridgeHandler implements CaddxPanelL
|
||||
protocol);
|
||||
|
||||
try {
|
||||
communicator = new CaddxCommunicator(portManager, protocol, serialPortName, baudRate);
|
||||
communicator = new CaddxCommunicator(getThing().getUID().getAsString(), portManager, protocol,
|
||||
serialPortName, baudRate);
|
||||
} catch (IOException | TooManyListenersException | UnsupportedCommOperationException | PortInUseException e) {
|
||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
|
||||
"Communication cannot be initialized. " + e.toString());
|
||||
|
||||
Reference in New Issue
Block a user