Skip to content

Commit

Permalink
Fixed json usb device list not deserializing
Browse files Browse the repository at this point in the history
  • Loading branch information
1-max-1 committed Jun 24, 2023
1 parent c6e13f1 commit 5538f06
Showing 1 changed file with 9 additions and 28 deletions.
37 changes: 9 additions & 28 deletions WASMSerialTerminal/Models/USBDeviceStructures.cs
Original file line number Diff line number Diff line change
@@ -1,37 +1,18 @@
using System.Collections.Immutable;

namespace WASMSerialTerminal {
namespace WASMSerialTerminal {
internal class USBDevice {
public string ID { get; private set; }
public string Name { get; private set; }

public USBDevice(string id, string name) {
ID = id;
Name = name;
}
public required string ID { get; set; }
public required string Name { get; set; }
}

internal class USBVendor {
public string ID { get; private set; }
public string Name { get; private set; }
public ImmutableArray<USBDevice> Devices { get; private set; }

public USBVendor(string iD, string name, ImmutableArray<USBDevice> devices) {
ID = iD;
Name = name;
Devices = devices;
}
public required string ID { get; set; }
public required string Name { get; set; }
public required List<USBDevice> Devices { get; set; }
}

internal class USBVendorList {
public ImmutableArray<USBVendor> Vendors { get; private set; }
public string Version { get; private set; }
public string Date { get; private set; }

public USBVendorList(ImmutableArray<USBVendor> vendors, string version, string date) {
Vendors = vendors;
Version = version;
Date = date;
}
public required List<USBVendor> Vendors { get; set; }
public required string Version { get; set; }
public required string Date { get; set; }
}
}

0 comments on commit 5538f06

Please sign in to comment.