Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix initialisation response issue with Telegesis and Ember dongles #403

Merged
merged 1 commit into from Sep 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -329,12 +329,7 @@ public ZigBeeStatus initialize() {

zigbeeTransportReceive.setNetworkState(ZigBeeTransportState.INITIALISING);

logger.debug("EZSP dongle initialize done: Initialised {}", initResponse == EmberStatus.EMBER_NOT_JOINED);

// Check if the network is initialised or if we're yet to join
if (initResponse == EmberStatus.EMBER_NOT_JOINED) {
return ZigBeeStatus.BAD_RESPONSE;
}
logger.debug("EZSP dongle initialize done: Initialised {}", initResponse != EmberStatus.EMBER_NOT_JOINED);

return ZigBeeStatus.SUCCESS;
}
Expand Down
Expand Up @@ -372,15 +372,6 @@ public ZigBeeStatus initialize() {
ieeeAddress = productInfo.getIeeeAddress();
}

// Get network information
TelegesisDisplayNetworkInformationCommand networkInfo = new TelegesisDisplayNetworkInformationCommand();
if (frameHandler.sendRequest(networkInfo) == null || networkInfo.getStatus() != TelegesisStatusCode.SUCCESS) {
return ZigBeeStatus.BAD_RESPONSE;
}
if (networkInfo.getDevice() != TelegesisDeviceType.COO) {
return ZigBeeStatus.INVALID_STATE;
}

zigbeeTransportReceive.setNetworkState(ZigBeeTransportState.INITIALISING);

return ZigBeeStatus.SUCCESS;
Expand Down Expand Up @@ -412,6 +403,9 @@ public ZigBeeStatus startup(boolean reinitialize) {
zigbeeTransportReceive.setNetworkState(ZigBeeTransportState.OFFLINE);
return ZigBeeStatus.BAD_RESPONSE;
}
if (networkInfo.getDevice() != TelegesisDeviceType.COO) {
return ZigBeeStatus.INVALID_STATE;
}

radioChannel = ZigBeeChannel.create(networkInfo.getChannel());

Expand Down