Package org.emrick.project.dev
Class FirmwareRelease
java.lang.Object
org.emrick.project.dev.FirmwareRelease
The Heltec Receiver firmware published from the firmware repo's main branch to the Emrick Flash site
(the same files the web flasher uses). Releases are downloaded into the user's Emrick Designer folder
(firmware/receiver/<commit>/) so a previously downloaded version can still be flashed without internet.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classmanifest.json, in esp-web-tools format plus commit/date/sha256static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Fileprivate final booleanprivate static final com.google.gson.Gsonprivate static final HttpClientprivate static Stringprivate static FirmwareReleaseprivate final FirmwareRelease.Manifeststatic final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateFirmwareRelease(FirmwareRelease.Manifest manifest, File directory, boolean fromCacheOnly) -
Method Summary
Modifier and TypeMethodDescriptionprivate static FirmwareReleasecachedFallback(Exception cause) private static Filecommit()date()(package private) static voidprivate static Stringprivate static voiddownload(FirmwareRelease.Manifest manifest, File dir) Downloads every part into a temporary folder, verifies checksums, then moves it into place.(package private) static voiddownloadFile(String url, File dest) static FirmwareReleaseChecks the flash site for the latest release and downloads it if it isn't cached yet.file(FirmwareRelease.Part part) private static booleanisComplete(File dir, FirmwareRelease.Manifest m) booleanstatic Stringstatic FirmwareReleaseprivate static FirmwareReleaseparts()(package private) static Stringprivate static voidversion()
-
Field Details
-
MANIFEST_URL
- See Also:
-
GSON
private static final com.google.gson.Gson GSON -
HTTP
-
latestKnown
-
lastProblem
-
manifest
-
directory
-
fromCacheOnly
private final boolean fromCacheOnly
-
-
Constructor Details
-
FirmwareRelease
-
-
Method Details
-
commit
-
date
-
version
- Returns:
- e.g. "abc1234 (10-03-2026)"
-
isFromCacheOnly
public boolean isFromCacheOnly()- Returns:
- true when the latest release couldn't be checked and this is the newest downloaded one
-
parts
-
file
-
latestKnown
- Returns:
- the most recent release found by
fetchLatest()this session (or the newest cached one)
-
cacheRoot
-
fetchLatest
Checks the flash site for the latest release and downloads it if it isn't cached yet. If the site can't be reached, falls back to the newest release downloaded before.- Returns:
- the release to flash
- Throws:
IOException- if the site can't be reached and nothing was ever downloaded
-
lastProblem
- Returns:
- why the last check for the latest firmware failed, in plain words, or null if it succeeded
-
describe
-
cachedFallback
- Throws:
IOException
-
newestCached
- Returns:
- the cached release with the newest date, or null if nothing complete is cached
-
validate
-
isComplete
-
download
Downloads every part into a temporary folder, verifies checksums, then moves it into place.- Throws:
IOException
-
downloadFile
- Throws:
IOException
-
sha256
- Throws:
IOException
-
deleteRecursively
-