Skip to content

Commit

Permalink
Verbose debug logging and status handling of the CoordinatorHandler (#…
Browse files Browse the repository at this point in the history
…297)

* Verbose debug logging and status handling of the CoordinatorHandler

Signed-off-by: Stefan Triller <stefan.triller@telekom.de>

* Revert check for duplicate ONLINE notification

Signed-off-by: Stefan Triller <stefan.triller@telekom.de>
  • Loading branch information
triller-telekom authored and cdjackson committed Nov 14, 2018
1 parent 51ec6bd commit db97db8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Expand Up @@ -173,12 +173,15 @@ public void initialize() {

if (getConfig().get(CONFIGURATION_INITIALIZE) != null) {
initializeNetwork = (Boolean) getConfig().get(CONFIGURATION_INITIALIZE);
logger.debug("Config: {} found, initializeNetwork={}", CONFIGURATION_INITIALIZE, initializeNetwork);
} else {
initializeNetwork = true;
logger.debug("Config: {} not found, initializeNetwork={} ", CONFIGURATION_INITIALIZE, initializeNetwork);
}

if (extendedPanId == null || extendedPanId.equals(new ExtendedPanId()) || panId == 0) {
initializeNetwork = true;
logger.debug("ExtendedPanId or PanId not set: initializeNetwork={}", initializeNetwork);
}

// Process the network key
Expand Down Expand Up @@ -395,11 +398,14 @@ private void initialiseZigBee() {
return;
}

// Get the initial network configuration
// Show the initial network configuration for debugging
ZigBeeChannel currentChannel = networkManager.getZigBeeChannel();
int currentPanId = networkManager.getZigBeePanId();
ExtendedPanId currentExtendedPanId = networkManager.getZigBeeExtendedPanId();

logger.debug("ZigBee Initialise: Previous device configuration was: channel={}, PanID={}, EPanId={}",
currentChannel, currentPanId, currentExtendedPanId);

if (initializeNetwork) {
logger.debug("Link key initialise {}", linkKey);
logger.debug("Network key initialise {}", networkKey);
Expand All @@ -412,6 +418,7 @@ private void initialiseZigBee() {

if (getConfig().get(CONFIGURATION_TRUSTCENTREMODE) != null) {
String mode = (String) getConfig().get(CONFIGURATION_TRUSTCENTREMODE);
logger.debug("Config: {}={}", CONFIGURATION_TRUSTCENTREMODE, mode);
TrustCentreJoinMode linkMode = TrustCentreJoinMode.valueOf(mode);
transportConfig.addOption(TransportConfigOption.TRUST_CENTRE_JOIN_MODE, linkMode);
}
Expand Down Expand Up @@ -731,6 +738,7 @@ public Collection<ZigBeeEndpoint> getNodeEndpoints(IeeeAddress nodeIeeeAddress)

@Override
public void networkStateUpdated(final ZigBeeTransportState state) {
logger.debug("{}: networkStateUpdated called with state={}", nodeIeeeAddress, state);
switch (state) {
case UNINITIALISED:
break;
Expand Down
Expand Up @@ -129,7 +129,8 @@ public void initialize() {
}
nodeIeeeAddress = new IeeeAddress(configAddress);

updateStatus(ThingStatus.OFFLINE);
// we do not know the current state of the device until our scheduled job has initialized the device
updateStatus(ThingStatus.UNKNOWN);

if (getBridge() != null) {
bridgeStatusChanged(getBridge().getStatusInfo());
Expand Down

0 comments on commit db97db8

Please sign in to comment.