Skip to content

Commit

Permalink
Minor updates following comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cdjackson committed Dec 5, 2024
1 parent a9f1cf1 commit 109d174
Showing 1 changed file with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2091,23 +2091,6 @@ public ZigBeeStatus restoreBackup(UUID uuid) {
}
logger.debug("RestoreBackup: Backup read from {}", uuid);

switch (getNetworkState()) {
case UNINITIALISED:
break;
case INITIALISING:
break;
case ONLINE:
break;
case OFFLINE:
break;
case SHUTDOWN:
break;
default:
break;
}

logger.debug("RestoreBackup: Taking network down");

// Take the network offline for reconfiguration
transport.setNetworkState(ZigBeeNetworkState.UNINITIALISED);

Expand Down Expand Up @@ -2147,11 +2130,14 @@ public ZigBeeStatus restoreBackup(UUID uuid) {
}

// Set the network configuration
setZigBeePanId(backup.getPan());
setZigBeeExtendedPanId(backup.getEpan());
setZigBeeChannel(backup.getChannel());
setZigBeeNetworkKey(backup.getNetworkKey());
setZigBeeLinkKey(backup.getLinkKey());
if (setZigBeePanId(backup.getPan()) != ZigBeeStatus.SUCCESS
|| setZigBeeExtendedPanId(backup.getEpan()) != ZigBeeStatus.SUCCESS
|| setZigBeeChannel(backup.getChannel()) != ZigBeeStatus.SUCCESS
|| setZigBeeNetworkKey(backup.getNetworkKey()) != ZigBeeStatus.SUCCESS
|| setZigBeeLinkKey(backup.getLinkKey()) != ZigBeeStatus.SUCCESS) {
setNetworkState(ZigBeeNetworkState.OFFLINE);
return ZigBeeStatus.FAILURE;
}

// Remove all existing nodes
for (ZigBeeNode node : networkNodes.values()) {
Expand Down

0 comments on commit 109d174

Please sign in to comment.