mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Formatting fixes
This commit is contained in:
@@ -46,7 +46,7 @@ namespace DiscImageChef.Devices.Windows
|
|||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
const string hextable = "0123456789abcdef";
|
const string hextable = "0123456789abcdef";
|
||||||
|
|
||||||
for (int i = 0; i < hex.Length / 2; i++)
|
for(int i = 0; i < hex.Length / 2; i++)
|
||||||
{
|
{
|
||||||
result.Append((char)(16 * hextable.IndexOf(hex[2 * i]) + hextable.IndexOf(hex[2 * i + 1])));
|
result.Append((char)(16 * hextable.IndexOf(hex[2 * i]) + hextable.IndexOf(hex[2 * i + 1])));
|
||||||
}
|
}
|
||||||
@@ -143,14 +143,14 @@ namespace DiscImageChef.Devices.Windows
|
|||||||
info.Model =
|
info.Model =
|
||||||
StringHandlers.CToString(descriptorB, Encoding.ASCII, start: (int)descriptor.ProductIdOffset);
|
StringHandlers.CToString(descriptorB, Encoding.ASCII, start: (int)descriptor.ProductIdOffset);
|
||||||
// TODO: Get serial number of SCSI and USB devices, probably also FireWire (untested)
|
// TODO: Get serial number of SCSI and USB devices, probably also FireWire (untested)
|
||||||
if (descriptor.SerialNumberOffset > 0)
|
if(descriptor.SerialNumberOffset > 0)
|
||||||
{
|
{
|
||||||
info.Serial =
|
info.Serial =
|
||||||
StringHandlers.CToString(descriptorB, Encoding.ASCII,
|
StringHandlers.CToString(descriptorB, Encoding.ASCII,
|
||||||
start: (int)descriptor.SerialNumberOffset);
|
start: (int)descriptor.SerialNumberOffset);
|
||||||
|
|
||||||
// fix any serial numbers that are returned as hex-strings
|
// fix any serial numbers that are returned as hex-strings
|
||||||
if (Array.TrueForAll(info.Serial.ToCharArray(), (char c) => "0123456789abcdef".IndexOf(c) >= 0)
|
if(Array.TrueForAll(info.Serial.ToCharArray(), (char c) => "0123456789abcdef".IndexOf(c) >= 0)
|
||||||
&& (info.Serial.Length == 40))
|
&& (info.Serial.Length == 40))
|
||||||
{
|
{
|
||||||
info.Serial = HexStringToString(info.Serial).Trim();
|
info.Serial = HexStringToString(info.Serial).Trim();
|
||||||
|
|||||||
Reference in New Issue
Block a user