Skip to content

Commit

Permalink
feat: add methods to reset SPAN of one or all nodes (#7105)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone authored Aug 13, 2024
1 parent 4f5b4c3 commit 9a805f2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/zwave-js/src/lib/driver/Driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6985,4 +6985,22 @@ ${handlers.length} left`,
};
}
}

/**
* Resets the S2 singlecast encryption state (SPAN) for the given node, which forces
* a re-synchronization on the next communication attempt.
*/
public resetSPAN(nodeId: number): void {
this.getSecurityManager2(nodeId)?.deleteNonce(nodeId);
}

/**
* Resets the S2 singlecast encryption state (SPAN) for all nodes, which forces
* a re-synchronization on the next communication attempt.
*/
public resetAllSPANs(): void {
for (const nodeId of this.controller.nodes.keys()) {
this.resetSPAN(nodeId);
}
}
}

0 comments on commit 9a805f2

Please sign in to comment.