Skip to content

Commit

Permalink
Now correctly update to latest stable
Browse files Browse the repository at this point in the history
  • Loading branch information
jLynx committed Feb 25, 2024
1 parent da8e8a1 commit b69adfd
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/components/Controller/Controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -604,7 +622,7 @@ const Controller = () => {

<p className="mt-3">Select from the available options:</p>
<button
onClick={() => flashLatestNightlyFirmware()}
onClick={() => flashLatestStableFirmware()}
disabled={disableTransmitAction}
className="rounded bg-blue-400 p-2 text-white disabled:opacity-50"
>
Expand Down

0 comments on commit b69adfd

Please sign in to comment.