mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-03 08:32:52 +00:00
feat: explicit reboot after ota update
This commit is contained in:
@@ -506,11 +506,25 @@ export class CharaDevice {
|
|||||||
return it;
|
return it;
|
||||||
});
|
});
|
||||||
|
|
||||||
await this.suspend();
|
|
||||||
|
|
||||||
if (result !== "OTA OK") {
|
if (result !== "OTA OK") {
|
||||||
throw new Error(result);
|
throw new Error(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const writer2 = this.port.writable!.getWriter();
|
||||||
|
try {
|
||||||
|
await writer2.write(new TextEncoder().encode(`RST REBOOT\r\n`));
|
||||||
|
serialLog.update((it) => {
|
||||||
|
it.push({
|
||||||
|
type: "input",
|
||||||
|
value: "RST REBOOT",
|
||||||
|
});
|
||||||
|
return it;
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
writer2.releaseLock();
|
||||||
|
}
|
||||||
|
|
||||||
|
await this.suspend();
|
||||||
} finally {
|
} finally {
|
||||||
delete this.lock;
|
delete this.lock;
|
||||||
resolveLock!(true);
|
resolveLock!(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user