Skip to content

feat: check WiFi firmware version before flashing#387

Open
tylerkron wants to merge 7 commits intomainfrom
feature/wifi-version-check-before-update
Open

feat: check WiFi firmware version before flashing#387
tylerkron wants to merge 7 commits intomainfrom
feature/wifi-version-check-before-update

Conversation

@tylerkron
Copy link
Contributor

@tylerkron tylerkron commented Feb 28, 2026

Summary

Fixes #185.

Before downloading and flashing the WiFi module firmware, the app now:

  1. Queries the device's current WiFi chip version via ILanChipInfoProvider.GetLanChipInfoAsync()
  2. Fetches the latest GitHub release metadata (lightweight, no download) via IFirmwareDownloadService.GetLatestWifiReleaseAsync()
  3. If the device is already up to date, skips the download and flash entirely — the progress bar jumps to 100% with a status message like "WiFi firmware already up to date (19.7.7)."
  4. If an update is available, shows the version info before downloading: "WiFi update available (19.7.7 → 19.8.0). Downloading..."

Implementation

Bumps Daqifi.Core to 0.18.3 (released as daqifi/daqifi-core#141) which adds ILanChipInfoProvider, GetLanChipInfoAsync, and IFirmwareDownloadService.GetLatestWifiReleaseAsync.

The version-check capability propagates through the firmware update delegation chain:

FirmwareUpdateService.UpdateWifiModuleAsync(coreDevice)
  └─ coreDevice is ILanChipInfoProvider ?
       CoreStreamingDeviceAdapter  ← now implements ILanChipInfoProvider
         └─ _desktopDevice is ILanChipInfoProvider ?
              SerialStreamingDevice  ← now implements ILanChipInfoProvider
                └─ _coreDevice.GetLanChipInfoAsync()
                     Core.DaqifiStreamingDevice  (implements ILanChipInfoProvider)

Graceful degradation: if the version strings can't be parsed, or the metadata fetch fails, the existing download + flash path runs unchanged.

Test plan

  • Build solution — confirms Build succeeded. 0 Error(s)
  • Connect a USB/Serial device and trigger firmware update — verify "Checking WiFi firmware version..." appears in status
  • When device is already on latest: status shows "already up to date (X.Y.Z)", WiFi progress bar goes to 100%, no firmware downloaded
  • When device is outdated: status shows "WiFi update available (old → new). Downloading...", then proceeds with existing flash flow

🤖 Generated with Claude Code

@tylerkron tylerkron requested a review from a team as a code owner February 28, 2026 19:49
Before downloading and flashing the WiFi module firmware, query the
device for its current WiFi chip version using GetLanChipInfoAsync and
compare it against the latest GitHub release via GetLatestWifiReleaseAsync.
If the device is already running the latest version, skip the download
and flash entirely and report 100 % progress immediately.

Changes:
- Bump Daqifi.Core to 0.18.3 (adds ILanChipInfoProvider, GetLanChipInfoAsync,
  and IFirmwareDownloadService.GetLatestWifiReleaseAsync)
- SerialStreamingDevice implements ILanChipInfoProvider, delegating to
  its underlying Core DaqifiStreamingDevice
- CoreStreamingDeviceAdapter implements ILanChipInfoProvider, delegating
  to the wrapped desktop device
- DaqifiViewModel.UpdateWifiModuleAsync performs a version check before
  downloading; shows "already up to date" status or "X → Y" version info
- Add IsWifiVersionCurrent helper using FirmwareVersion comparison

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tylerkron tylerkron force-pushed the feature/wifi-version-check-before-update branch from 1cc6102 to 2064c3a Compare February 28, 2026 19:52
tylerkron and others added 6 commits March 1, 2026 21:59
When GetLanChipInfoAsync returns null (device still initializing after a
PIC32 firmware flash), bail out early rather than proceeding with the
WiFi flash. Force-flashing without version confirmation was putting the
device into WiFi bridge mode unnecessarily, leaving it in a broken state
when the flash tool subsequently failed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Allows building against a local Daqifi.Core project instead of the
published NuGet package by passing -p:DaqifiCoreProjectPath=<path>.
Falls back to the pinned NuGet version when the property is not set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

📊 Code Coverage Report

Summary

Summary
Generated on: 3/3/2026 - 5:38:09 AM
Coverage date: 3/3/2026 - 5:37:57 AM - 3/3/2026 - 5:38:05 AM
Parser: MultiReport (4x Cobertura)
Assemblies: 4
Classes: 107
Files: 140
Line coverage: 10.2% (551 of 5389)
Covered lines: 551
Uncovered lines: 4838
Coverable lines: 5389
Total lines: 17143
Branch coverage: 10.3% (199 of 1919)
Covered branches: 199
Total branches: 1919
Method coverage: Feature is only available for sponsors

Coverage

DAQiFi - 9.7%
Name Line Branch
DAQiFi 9.7% 10.2%
Daqifi.Desktop.App 2.3% 0%
Daqifi.Desktop.Channel.AbstractChannel 22.7% 25%
Daqifi.Desktop.Channel.AnalogChannel 42.5% 25%
Daqifi.Desktop.Channel.Channel 11.5% 0%
Daqifi.Desktop.Channel.ChannelColorManager 100% 100%
Daqifi.Desktop.Channel.DataSample 90.4%
Daqifi.Desktop.Channel.DigitalChannel 0% 0%
Daqifi.Desktop.Commands.CompositeCommand 0% 0%
Daqifi.Desktop.Commands.HostCommands 0%
Daqifi.Desktop.Commands.WeakEventHandlerManager 0% 0%
Daqifi.Desktop.Configuration.FirewallConfiguration 90.6% 66.6%
Daqifi.Desktop.Configuration.WindowsFirewallWrapper 64% 68.4%
Daqifi.Desktop.ConnectionManager 39.6% 50%
Daqifi.Desktop.Converters.BoolToActiveStatusConverter 0% 0%
Daqifi.Desktop.Converters.BoolToConnectionStatusConverter 0% 0%
Daqifi.Desktop.Converters.BoolToStatusColorConverter 0% 0%
Daqifi.Desktop.Converters.ConnectionTypeToColorConverter 0% 0%
Daqifi.Desktop.Converters.ConnectionTypeToUsbConverter 0% 0%
Daqifi.Desktop.Converters.InvertedBoolToVisibilityConverter 0% 0%
Daqifi.Desktop.Converters.ListToStringConverter 0% 0%
Daqifi.Desktop.Converters.NotNullToVisibilityConverter 0% 0%
Daqifi.Desktop.Converters.OxyColorToBrushConverter 0% 0%
Daqifi.Desktop.Converters.StringRightConverter 0% 0%
Daqifi.Desktop.Device.AbstractStreamingDevice 6.8% 4.1%
Daqifi.Desktop.Device.DeviceInfoConverter 0% 0%
Daqifi.Desktop.Device.DeviceMessage 0%
Daqifi.Desktop.Device.Firmware.BootloaderSessionStreamingDeviceAdapter 0% 0%
Daqifi.Desktop.Device.Firmware.CoreStreamingDeviceAdapter 0% 0%
Daqifi.Desktop.Device.Firmware.WifiPromptDelayProcessRunner 0% 0%
Daqifi.Desktop.Device.NativeMethods 0%
Daqifi.Desktop.Device.SerialDevice.SerialDeviceHelper 0% 0%
Daqifi.Desktop.Device.SerialDevice.SerialStreamingDevice 7.4% 8.1%
Daqifi.Desktop.Device.SerialDevice.UsbDevice 0% 0%
Daqifi.Desktop.Device.WiFiDevice.DaqifiStreamingDevice 17.5% 0%
Daqifi.Desktop.DialogService.DialogService 0% 0%
Daqifi.Desktop.DialogService.ServiceLocator 0% 0%
Daqifi.Desktop.DuplicateDeviceCheckResult 100%
Daqifi.Desktop.Exporter.OptimizedLoggingSessionExporter 29.7% 32.9%
Daqifi.Desktop.Exporter.SampleData 0%
Daqifi.Desktop.Helpers.BooleanConverter`1 0% 0%
Daqifi.Desktop.Helpers.BooleanToInverseBoolConverter 0% 0%
Daqifi.Desktop.Helpers.BooleanToVisibilityConverter 0%
Daqifi.Desktop.Helpers.EnumDescriptionConverter 100% 100%
Daqifi.Desktop.Helpers.IntToVisibilityConverter 0% 0%
Daqifi.Desktop.Helpers.MyMultiValueConverter 0%
Daqifi.Desktop.Helpers.NaturalSortHelper 100% 100%
Daqifi.Desktop.Helpers.VersionHelper 98.2% 66.2%
Daqifi.Desktop.Logger.DatabaseLogger 0% 0%
Daqifi.Desktop.Logger.LoggedSeriesLegendItem 0% 0%
Daqifi.Desktop.Logger.LoggingContext 0%
Daqifi.Desktop.Logger.LoggingManager 0% 0%
Daqifi.Desktop.Logger.LoggingSession 26.6% 0%
Daqifi.Desktop.Logger.PlotLogger 0% 0%
Daqifi.Desktop.Logger.SummaryLogger 0% 0%
Daqifi.Desktop.MainWindow 0% 0%
Daqifi.Desktop.Migrations.InitialSQLiteMigration 0%
Daqifi.Desktop.Migrations.LoggingContextModelSnapshot 0%
Daqifi.Desktop.Models.AddProfileModel 0%
Daqifi.Desktop.Models.DaqifiSettings 86.3% 100%
Daqifi.Desktop.Models.DebugDataCollection 0% 0%
Daqifi.Desktop.Models.DebugDataModel 0% 0%
Daqifi.Desktop.Models.Notifications 0%
Daqifi.Desktop.Models.SdCardFile 0%
Daqifi.Desktop.Services.WindowsPrincipalAdminChecker 0%
Daqifi.Desktop.Services.WpfMessageBoxService 0%
Daqifi.Desktop.UpdateVersion.VersionNotification 0% 0%
Daqifi.Desktop.View.AddChannelDialog 0% 0%
Daqifi.Desktop.View.AddProfileConfirmationDialog 0% 0%
Daqifi.Desktop.View.AddprofileDialog 0% 0%
Daqifi.Desktop.View.ConnectionDialog 0% 0%
Daqifi.Desktop.View.DebugWindow 0% 0%
Daqifi.Desktop.View.DeviceLogsView 0% 0%
Daqifi.Desktop.View.DuplicateDeviceDialog 0% 0%
Daqifi.Desktop.View.ErrorDialog 0% 0%
Daqifi.Desktop.View.ExportDialog 0% 0%
Daqifi.Desktop.View.FirmwareDialog 0% 0%
Daqifi.Desktop.View.Flyouts.ChannelsFlyout 0% 0%
Daqifi.Desktop.View.Flyouts.DevicesFlyout 0% 0%
Daqifi.Desktop.View.Flyouts.FirmwareFlyout 0% 0%
Daqifi.Desktop.View.Flyouts.LiveGraphFlyout 0% 0%
Daqifi.Desktop.View.Flyouts.LoggedSessionFlyout 0% 0%
Daqifi.Desktop.View.Flyouts.NotificationsFlyout 0% 0%
Daqifi.Desktop.View.Flyouts.SummaryFlyout 0% 0%
Daqifi.Desktop.View.Flyouts.UpdateProfileFlyout 0% 0%
Daqifi.Desktop.View.SelectColorDialog 0% 0%
Daqifi.Desktop.View.SettingsDialog 0% 0%
Daqifi.Desktop.View.SuccessDialog 0% 0%
Daqifi.Desktop.ViewModels.AddChannelDialogViewModel 0% 0%
Daqifi.Desktop.ViewModels.AddProfileConfirmationDialogViewModel 0% 0%
Daqifi.Desktop.ViewModels.AddProfileDialogViewModel 0% 0%
Daqifi.Desktop.ViewModels.ConnectionDialogViewModel 0% 0%
Daqifi.Desktop.ViewModels.DaqifiViewModel 0% 0%
Daqifi.Desktop.ViewModels.DeviceLogsViewModel 0% 0%
Daqifi.Desktop.ViewModels.DeviceSettingsViewModel 0% 0%
Daqifi.Desktop.ViewModels.DuplicateDeviceDialogViewModel 0%
Daqifi.Desktop.ViewModels.ErrorDialogViewModel 0%
Daqifi.Desktop.ViewModels.ExportDialogViewModel 0% 0%
Daqifi.Desktop.ViewModels.FirmwareDialogViewModel 0% 0%
Daqifi.Desktop.ViewModels.SelectColorDialogViewModel 0% 0%
Daqifi.Desktop.ViewModels.SettingsViewModel 0%
Daqifi.Desktop.ViewModels.SuccessDialogViewModel 0%
Daqifi.Desktop.WindowViewModelMapping.IWindowViewModelMappingsContract 0%
Daqifi.Desktop.WindowViewModelMapping.WindowViewModelMappings 0%
Daqifi.Desktop.Common - 39.3%
Name Line Branch
Daqifi.Desktop.Common 39.3% 27.7%
Daqifi.Desktop.Common.Loggers.AppLogger 36.8% 27.7%
Daqifi.Desktop.Common.Loggers.NoOpLogger 75%
Daqifi.Desktop.DataModel - 100%
Name Line Branch
Daqifi.Desktop.DataModel 100% ****
Daqifi.Desktop.DataModel.Device.DeviceInfo 100%
Daqifi.Desktop.IO - 0%
Name Line Branch
Daqifi.Desktop.IO 0% ****
Daqifi.Desktop.IO.Messages.MessageEventArgs`1 0%

Coverage report generated by ReportGeneratorView full report in build artifacts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: check WiFi module firmware version before updating

1 participant