diff --git a/src/meshDevice.ts b/src/meshDevice.ts index 41d32b5..18a2a01 100755 --- a/src/meshDevice.ts +++ b/src/meshDevice.ts @@ -533,6 +533,29 @@ export abstract class MeshDevice { ); } + /** + * Removes a node from the internal NodeDB of the radio by node number + */ + public async removeNodeByNum(nodeNum: number): Promise { + this.log.debug( + Types.Emitter[Types.Emitter.RemoveNodeByNum], + `📻 Removing Node ${nodeNum} from NodeDB`, + ); + + const removeNodeByNum = new Protobuf.Admin.AdminMessage({ + payloadVariant: { + case: "removeByNodenum", + value: nodeNum, + }, + }); + + return await this.sendPacket( + removeNodeByNum.toBinary(), + Protobuf.Portnums.PortNum.ADMIN_APP, + "self", + ); + } + /** Shuts down the current node after the specified amount of time has elapsed. */ public async shutdown(time: number): Promise { this.log.debug( diff --git a/src/types.ts b/src/types.ts index 7da0ae5..9407bb2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -114,6 +114,7 @@ export enum Emitter { RebootOta = 29, FactoryReset = 30, EnterDfuMode = 31, + RemoveNodeByNum = 32, } export interface LogEvent {