fix(picker): use release JSON for OTA and logging
This commit is contained in:
1 parent
5f02575933
commit
3ef490c9f8
4 files changed
+75
-4
No files matched your search
@@ -576,6 +576,39 @@
|
||||
});
|
||||
}
|
||||
|
||||
function applyReleaseRuntimeCapabilities(profile, controls) {
|
||||
if (["none", "lora-receiver", "lora-source"].includes(controls.otaRole)) {
|
||||
profile.ota = controls.otaRole;
|
||||
}
|
||||
|
||||
const modes = controls.loggingModes;
|
||||
const source = controls.loggingSource;
|
||||
const sourceMatches = !source || (typeof source === "string" &&
|
||||
/^[0-9a-f]{40}$/i.test(source) && profile.files.length > 0 &&
|
||||
profile.files.every(function (file) {
|
||||
return file.name.toLowerCase().replace(/\.(bin|hex|uf2|zip)$/i, "")
|
||||
.replace(/-merged$/, "")
|
||||
.endsWith("-" + source.slice(0, 8).toLowerCase());
|
||||
}));
|
||||
if (sourceMatches && Array.isArray(modes)) {
|
||||
const key = modes.join(",");
|
||||
if (key === "none") {
|
||||
profile.logging = "none";
|
||||
profile.loggingModes = ["none"];
|
||||
} else if (key === "none,usb" && controls.loggingControl === "usb.logging") {
|
||||
profile.logging = "usb-runtime";
|
||||
profile.loggingModes = modes.slice();
|
||||
} else if (key === "none,usb,wifi,both" &&
|
||||
controls.loggingControl === "logging.output") {
|
||||
profile.logging = "runtime";
|
||||
profile.loggingModes = modes.slice();
|
||||
}
|
||||
}
|
||||
if (typeof controls.dedicatedUsbLogging === "boolean") {
|
||||
profile.dedicatedUsbLogging = controls.dedicatedUsbLogging;
|
||||
}
|
||||
}
|
||||
|
||||
function hardwareFamilyFor(hardware, hardwareNames) {
|
||||
const value = String(hardware || "");
|
||||
const lowerValue = value.toLowerCase();
|
||||
@@ -723,7 +756,9 @@
|
||||
if (controlData && controlData.familyTag === releaseSet.familyTag &&
|
||||
controlData.profiles && controlData.profiles[profile.target]) {
|
||||
profile.controls = controlData.profiles[profile.target];
|
||||
if (isFullCompanion(profile) && profile.controls.mqtt) {
|
||||
applyReleaseRuntimeCapabilities(profile, profile.controls);
|
||||
if (isFullCompanion(profile) && profile.controls.mqtt &&
|
||||
!Array.isArray(profile.controls.loggingModes)) {
|
||||
profile.loggingModes = ["none", "usb", "wifi", "both"];
|
||||
}
|
||||
if (profile.controls.rs232 && profile.role === "repeater" && profile.mode === "standard") {
|
||||
|
||||
@@ -17,7 +17,7 @@ The picker reads public release metadata from GitHub. It does not upload device
|
||||
information. Hardware names, target names, and download links come directly
|
||||
from the published firmware assets.
|
||||
|
||||
<div class="firmware-picker" data-firmware-picker data-release-repo="mikecarper/MeshCore" data-controls-url="../_data/firmware_controls.json?v=1.17.1.6" data-share-url="https://mikecarper.github.io/MeshCore/firmware_picker/">
|
||||
<div class="firmware-picker" data-firmware-picker data-release-repo="mikecarper/MeshCore" data-controls-url="../_data/firmware_controls.json?v=1.17.1.6-runtime-2" data-share-url="https://mikecarper.github.io/MeshCore/firmware_picker/">
|
||||
<div class="firmware-picker-intro" role="note">
|
||||
<strong>Current release set</strong>
|
||||
<p data-role="release-set">Loading release information...</p>
|
||||
@@ -438,6 +438,11 @@ Hardware-specific controls are enabled only when `_data/firmware_controls.json`
|
||||
matches the selected release family and exact target. If that metadata is
|
||||
missing or belongs to another release, the picker retains basic role/logging
|
||||
directions and links the complete guide without inventing hardware support.
|
||||
For 1.17.1.6, that JSON also records the verified LoRa OTA role of each image
|
||||
and USB logging modes where the packaged application was checked. Logging
|
||||
metadata is tied to the source hash of its firmware file. The normal iKoka
|
||||
30 dBm repeater has USB logging and LoRa OTA; its compact no-external-sensors
|
||||
image has LoRa OTA without logging.
|
||||
Capacity directions come from each qualified profile's recorded reductions and
|
||||
are tied to the source hash of the selected download. The older 1.17.1.5 USB
|
||||
sleep workaround stays limited to that release.
|
||||
|
||||
Reference in new issue
Block a user