Skip to content

Commit

Permalink
Reduce device table service logging levels
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian S committed Jan 12, 2020
1 parent 8b40bb8 commit bd8d1a1
Showing 1 changed file with 11 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ public void setDisableIdentificationRequests(boolean disableIdentificationReques
public void inquiryDeviceExistence() {

if (scanQueueId != -1) {
logger.warn("Inquiry is still in progress ...");
logger.debug("Inquiry is still in progress ...");
return;
}

if (controller.getConnectionStatus() != ConnectionStatus.CONNECTED) {
logger.info("Skip eBUS scan due to connection issues ...");
logger.debug("Skip eBUS scan due to connection issues ...");
return;
}

logger.info("Start eBUS scan ...");
logger.debug("Start eBUS scan ...");

byte masterAddress = deviceTable.getOwnDevice().getMasterAddress();

Expand All @@ -104,17 +104,17 @@ public void inquiryDeviceExistence() {
public void startDeviceScan() {

if (controller.getConnectionStatus() != ConnectionStatus.CONNECTED) {
logger.info("Skip eBUS device scan due to connection issues ...");
logger.debug("Skip eBUS device scan due to connection issues ...");
return;
}

if (scanRunning) {
logger.warn("eBUS scan is already running! Skip start ...");
logger.debug("eBUS scan is already running! Skip start ...");
return;
}

if (scanQueueId != -1) {
logger.warn("Inquiry is still in progress ...");
logger.debug("Inquiry is still in progress ...");
return;
}

Expand All @@ -127,7 +127,6 @@ public void startDeviceScan() {
}

public void stopDeviceScan() {
// scanEnabled = false;
scanRunning = false;
}

Expand All @@ -143,7 +142,7 @@ private synchronized boolean scanDevice2(boolean nextDevice) {
scanSlaveAddress = addr;
}

logger.info("Scan address {} ...", EBusUtils.toHexDumpString(scanSlaveAddress));
logger.debug("Scan address {} ...", EBusUtils.toHexDumpString(scanSlaveAddress));

byte masterAddress = deviceTable.getOwnDevice().getMasterAddress();

Expand All @@ -166,25 +165,6 @@ private synchronized boolean scanDevice2(boolean nextDevice) {
return false;
}

// private void scanDevice(byte slaveAddress) {
//
// logger.info("Scann address {} ...", EBusUtils.toHexDumpString(slaveAddress));
//
// byte masterAddress = deviceTable.getOwnDevice().getMasterAddress();
//
// IEBusCommandMethod command = configurationProvider.getCommandMethodById(EBusConsts.COLLECTION_STD,
// EBusConsts.COMMAND_IDENTIFICATION, IEBusCommandMethod.Method.GET);
//
// try {
// ByteBuffer buffer = EBusCommandUtils.buildMasterTelegram(command, masterAddress, slaveAddress, null);
//
// scanQueueId = controller.addToSendQueue(EBusUtils.toByteArray(buffer), 2);
// } catch (EBusTypeException e) {
// logger.error("error!", e);
// }
//
// }

private Byte nextSlaveAddress(byte slaveAddress) {

if (slaveAddress == (byte) 0xFD) {
Expand Down Expand Up @@ -232,7 +212,7 @@ private void sendSignOfLife() {
public void sendIdentificationRequest(byte slaveAddress) {

if (controller.getConnectionStatus() != ConnectionStatus.CONNECTED) {
logger.info("Skip eBUS identification due to connection issues ...");
logger.debug("Skip eBUS identification due to connection issues ...");
return;
}

Expand Down Expand Up @@ -281,7 +261,7 @@ public void onTelegramReceived(byte[] receivedData, Integer sendQueueId) {

} else {
// inquiry
logger.warn("Scan broadcast has been send out!");
logger.debug("Scan broadcast has been send out!");

}

Expand All @@ -305,7 +285,7 @@ public void onTelegramException(EBusDataException exception, Integer sendQueueId
}

} else {
logger.warn("Scan broadcast failed!");
logger.debug("Scan broadcast failed!");
}

scanQueueId = -1;
Expand Down Expand Up @@ -346,7 +326,7 @@ public void onTelegramResolved(IEBusCommandMethod commandChannel, Map<String, Ob
public void onEBusDeviceUpdate(IEBusDeviceTableListener.TYPE type, IEBusDevice device) {

if (!type.equals(TYPE.UPDATE_ACTIVITY)) {
logger.info("DATA TABLE UPDATE {}", device);
logger.debug("DATA TABLE UPDATE {}", device);
}

// identify new devices
Expand Down

0 comments on commit bd8d1a1

Please sign in to comment.