Skip to content

Commit

Permalink
修复9008始终转圈
Browse files Browse the repository at this point in the history
  • Loading branch information
mujianwu committed Aug 2, 2024
1 parent 3298801 commit c7c74f7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions UotanToolbox/Common/GetDevicesInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,33 +314,33 @@ public static async Task<Dictionary<string, string>> DevicesInfo(string devicena
{
if (thisdevice.Contains("QDLoader"))
{
devices["Status"] = "9008";
status = "9008";
}
else if (thisdevice.Contains("900E ("))
{
devices["Status"] = "900E";
status = "900E";
}
else if (thisdevice.Contains("901D ("))
{
devices["Status"] = "901D";
status = "901D";
}
else if (thisdevice.Contains("9091 ("))
{
devices["Status"] = "9091";
status = "9091";
}
}
}
if (devicename.Contains("ttyUSB"))
{
devices["Status"] = "9008";
status = "9008";
}
else if (devicename == "Unknown device")
if (devicename == "Unknown device")
{
string statusPattern = deviceLines.FirstOrDefault(line => line.EndsWith(":900e") || line.EndsWith(":901d") || line.EndsWith(":9091"));

if (statusPattern != null)
{
devices["Status"] = statusPattern.Substring(statusPattern.LastIndexOf(':') + 1);
status = statusPattern.Substring(statusPattern.LastIndexOf(':') + 1);
}
}
devices.Add("Status", status);
Expand Down

0 comments on commit c7c74f7

Please sign in to comment.