From b69adfd3adbf655789c1716d0bd829e8dcb51b45 Mon Sep 17 00:00:00 2001 From: jLynx Date: Sun, 25 Feb 2024 15:53:30 +1300 Subject: [PATCH] Now correctly update to latest stable --- src/components/Controller/Controller.tsx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/Controller/Controller.tsx b/src/components/Controller/Controller.tsx index 077d455..5378ebe 100644 --- a/src/components/Controller/Controller.tsx +++ b/src/components/Controller/Controller.tsx @@ -267,6 +267,24 @@ const Controller = () => { alert("Firmware update complete! Please wait for your device to reboot."); }; + const flashLatestStableFirmware = async () => { + const fileBlob = await downloadFileFromUrl( + "https://hackrf.app/api/fetch_stable_firmware" + ); + + console.log("Downloading firmware update...", fileBlob.filename); + + await uploadFile( + `/FIRMWARE/${fileBlob.filename}`, + new Uint8Array(await fileBlob.blob.arrayBuffer()), + setUpdateStatus + ); + + await write(`flash /FIRMWARE/${fileBlob.filename}`, false, true); + console.log("DONE! firmware complete. Rebooting..."); + alert("Firmware update complete! Please wait for your device to reboot."); + }; + const handleScroll = (e: React.WheelEvent) => { // Disabled for the moment // e.preventDefault(); @@ -604,7 +622,7 @@ const Controller = () => {

Select from the available options: