mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-02 23:02:37 -08:00
Remove the need for restart before OTA on newer firmware (#1627)
This commit is contained in:
1 parent
d74b26fbda
commit
5f1167f0de
1 file changed
+28
-15
@@ -222,22 +222,35 @@ class FirmwareUpdateHandler(private val server: VRServer) :
|
||||
LogManager.info("[FirmwareUpdateHandler] Device is already updating, skipping")
|
||||
}
|
||||
|
||||
onStatusChange(
|
||||
UpdateStatusEvent(
|
||||
val udpDevice: UDPDevice? =
|
||||
(server.deviceManager.devices.find { device -> device is UDPDevice && device.id == deviceId.id }) as UDPDevice?
|
||||
if (udpDevice === null) {
|
||||
error("invalid state - device does not exist")
|
||||
}
|
||||
|
||||
if (udpDevice.protocolVersion <= 20) {
|
||||
onStatusChange(
|
||||
UpdateStatusEvent(
|
||||
deviceId,
|
||||
FirmwareUpdateStatus.NEED_MANUAL_REBOOT,
|
||||
),
|
||||
)
|
||||
watchRestartQueue.add(
|
||||
Pair(deviceId) {
|
||||
mainScope.launch {
|
||||
startFirmwareUpdateJob(
|
||||
request,
|
||||
deviceId,
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
} else {
|
||||
startFirmwareUpdateJob(
|
||||
request,
|
||||
deviceId,
|
||||
FirmwareUpdateStatus.NEED_MANUAL_REBOOT,
|
||||
),
|
||||
)
|
||||
watchRestartQueue.add(
|
||||
Pair(deviceId) {
|
||||
mainScope.launch {
|
||||
startFirmwareUpdateJob(
|
||||
request,
|
||||
deviceId,
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if (updatingDevicesStatus[deviceId] != null) {
|
||||
LogManager.info("[FirmwareUpdateHandler] Device is already updating, skipping")
|
||||
|
||||
Reference in new issue
Block a user