Phase 7: Advanced Features
This issue tracks Phase 7 from the migration plan: migrating advanced device features from daqifi-desktop to daqifi-core.
Success Criteria
7.1 Network Configuration
7.2 SD Card Operations
7.3 Device Configuration Persistence
7.4 Firmware Update Support
7.5 Logging and Diagnostics
Implementation Guidance
Network Configuration Example
public class NetworkConfiguration
{
public string? WifiSsid { get; set; }
public string? WifiPassword { get; set; }
public WifiSecurityMode SecurityMode { get; set; }
public IPAddress? StaticIP { get; set; }
public IPAddress? SubnetMask { get; set; }
public IPAddress? Gateway { get; set; }
}
public interface INetworkConfigurable
{
Task<NetworkConfiguration> GetNetworkConfigAsync();
Task SetNetworkConfigAsync(NetworkConfiguration config);
Task ApplyNetworkConfigAsync(); // Saves and reboots device
}
SD Card Operations Example
public interface ISdCardSupport
{
bool SdCardLoggingEnabled { get; set; }
Task<IEnumerable<SdCardFileInfo>> ListFilesAsync();
Task<byte[]> RetrieveFileAsync(string filename);
Task DeleteFileAsync(string filename);
Task FormatSdCardAsync();
Task<SdCardStatus> GetSdCardStatusAsync();
}
// Usage
var files = await device.ListFilesAsync();
foreach (var file in files)
{
Console.WriteLine($"{file.Name} - {file.Size} bytes - {file.Timestamp}");
}
var data = await device.RetrieveFileAsync("log_2024_10_16.csv");
Firmware Update Example
public interface IFirmwareUpdateSupport
{
string CurrentFirmwareVersion { get; }
Task<bool> EnterBootloaderModeAsync();
Task<FirmwareUpdateResult> UpdateFirmwareAsync(
byte[] firmwareData,
IProgress<int>? progress = null);
Task<bool> VerifyFirmwareAsync();
}
// Usage
var progress = new Progress<int>(p => Console.WriteLine($"Upload progress: {p}%"));
var result = await device.UpdateFirmwareAsync(firmwareBytes, progress);
if (result.Success)
{
Console.WriteLine($"Firmware updated to {result.NewVersion}");
}
Desktop Migration Impact
Once complete, desktop can migrate:
- Network configuration UI → use core's
INetworkConfigurable
- SD card operations → use core's
ISdCardSupport
- Firmware update logic → use core's
IFirmwareUpdateSupport
- Device logging → use core's diagnostic interfaces
- Configuration management → use core's persistence
Testing Requirements
Target Version
Core 0.9.0
Dependencies
- Depends on: Phase 6 (Protocol Implementation)
- Blocks: Phase 8 (Desktop Integration & Adapters)
Related Documentation
Desktop implementation references:
/Device/AbstractStreamingDevice.cs - Network config, SD card operations
/Bootloader/ - Firmware update implementation
/IO/Messages/Consumers/TextMessageConsumer.cs - SD card text responses
- HID library usage for bootloader communication
Notes
- SD card operations use text-based responses (not protobuf), requiring
TextMessageConsumer
- Firmware updates require HID library for bootloader communication
- Network configuration requires device reboot to apply changes
- Some operations may be device-type specific (not all DAQiFi devices support all features)
Phase 7: Advanced Features
This issue tracks Phase 7 from the migration plan: migrating advanced device features from daqifi-desktop to daqifi-core.
Success Criteria
7.1 Network Configuration
7.2 SD Card Operations
7.3 Device Configuration Persistence
7.4 Firmware Update Support
7.5 Logging and Diagnostics
Implementation Guidance
Network Configuration Example
SD Card Operations Example
Firmware Update Example
Desktop Migration Impact
Once complete, desktop can migrate:
INetworkConfigurableISdCardSupportIFirmwareUpdateSupportTesting Requirements
Target Version
Core 0.9.0
Dependencies
Related Documentation
Desktop implementation references:
/Device/AbstractStreamingDevice.cs- Network config, SD card operations/Bootloader/- Firmware update implementation/IO/Messages/Consumers/TextMessageConsumer.cs- SD card text responsesNotes
TextMessageConsumer