Skip to content

Commit

Permalink
Check for a changed network address when routing fails
Browse files Browse the repository at this point in the history
  • Loading branch information
deviantintegral committed Sep 11, 2024
1 parent fc229cc commit 2de27ab
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/adapter/z-stack/adapter/zStackAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,22 @@ class ZStackAdapter extends Adapter {
noderelation: match.payload.noderelation,
});
}
// Figure out once if the network address has been changed.
try {
checkedNetworkAddress = true;
const actualNetworkAddress = await this.requestNetworkAddress(ieeeAddr);
if (networkAddress !== actualNetworkAddress) {
logger.debug(`Failed because request was done with wrong network address`, NS);
discoveredRoute = true;
networkAddress = actualNetworkAddress;
await this.discoverRoute(actualNetworkAddress);
} else {
logger.debug('Network address did not change', NS);
}
} catch {
/* empty */
}

// No response could be of invalid route, e.g. when message is send to wrong parent of end device.
await this.discoverRoute(networkAddress);
return this.sendZclFrameToEndpointInternal(
Expand Down

0 comments on commit 2de27ab

Please sign in to comment.