Ensure serial port closure

This commit is contained in:
Butterscotch!
2025-09-04 04:33:39 -04:00
parent f0a72645d7
commit 4e1421180c

View File

@@ -117,6 +117,11 @@ class AndroidSerialHandler(val activity: AppCompatActivity) :
}
}
// If this port is still open for whatever reason, close it
if (port.port.isOpen) {
port.port.close()
}
LogManager.info("[SerialHandler] Device removed: ${port.descriptivePortName}")
listeners.forEach { it.onSerialDeviceDeleted(port) }
}