feat: added disconnect method to core lib (#712)

This commit is contained in:
Dan Ditomaso
2025-07-15 09:08:32 -04:00
committed by GitHub
parent dd3f3f0499
commit 5fb5693792
5 changed files with 154 additions and 14 deletions
+7
View File
@@ -818,6 +818,13 @@ export class MeshDevice {
this.queue.clear();
}
/** Disconnects from the device **/
public async disconnect(): Promise<void> {
this.log.debug(Emitter[Emitter.Disconnect], "🔌 Disconnecting from device");
this.complete();
await this.transport.toDevice.close();
}
/**
* Gets called when a MeshPacket is received from device
*/