Skip to content

Commit

Permalink
Modify the retrieval of nwkUpdateID in ZStack.
Browse files Browse the repository at this point in the history
  • Loading branch information
danyinhao committed Feb 6, 2025
1 parent 5b7d829 commit 276214f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/adapter/z-stack/adapter/zStackAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,11 @@ export class ZStackAdapter extends Adapter {

public async getNetworkParameters(): Promise<NetworkParameters> {
const result = await this.znp.requestWithReply(Subsystem.ZDO, 'extNwkInfo', {});
const nwkUpdateID = (await this.adapterManager.nv.readItem(NvItemsIds.NIB, 0, Structs.nib))?.nwkUpdateId ?? 0;
const NIB = await this.adapterManager.nv.readItem(NvItemsIds.NIB, 0, Structs.nib);
let nwkUpdateID = 0;
if (NIB) {
nwkUpdateID = NIB.nwkUpdateId;
}
return {
panID: result.payload.panid as number,
extendedPanID: result.payload.extendedpanid as string, // read as IEEEADDR, so `0x${string}`
Expand Down

0 comments on commit 276214f

Please sign in to comment.