Aura init fix

This commit is contained in:
Serge
2023-11-21 12:43:10 +01:00
parent d9b615ce2d
commit bb796b8818
2 changed files with 10 additions and 12 deletions

View File

@@ -89,20 +89,18 @@ public static class AsusHid
var devices = FindDevices(AURA_ID); var devices = FindDevices(AURA_ID);
if (devices is null) return; if (devices is null) return;
try foreach (var device in devices)
{ using (var stream = device.Open())
foreach (var device in devices) foreach (var data in dataList)
using (var stream = device.Open()) try
foreach (var data in dataList)
{ {
stream.Write(data); stream.Write(data);
Logger.WriteLine($"{log} {device.ProductID.ToString("X")}: {BitConverter.ToString(data)}"); Logger.WriteLine($"{log} {device.ProductID.ToString("X")}: {BitConverter.ToString(data)}");
} }
} catch (Exception ex)
catch (Exception ex) {
{ Logger.WriteLine($"Error writing {log} {device.ProductID.ToString("X")}: {ex.Message} {BitConverter.ToString(data)} ");
Logger.WriteLine($"Error writing {log}: {ex.Message} "); }
}
} }

View File

@@ -250,8 +250,8 @@ namespace GHelper.USB
new byte[] { AsusHid.AURA_ID, 0xb9 }, new byte[] { AsusHid.AURA_ID, 0xb9 },
Encoding.ASCII.GetBytes("]ASUS Tech.Inc."), Encoding.ASCII.GetBytes("]ASUS Tech.Inc."),
new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1a }, new byte[] { AsusHid.AURA_ID, 0x05, 0x20, 0x31, 0, 0x1a },
Encoding.ASCII.GetBytes("^ASUS Tech.Inc."), //Encoding.ASCII.GetBytes("^ASUS Tech.Inc."),
new byte[] { 0x5e, 0x05, 0x20, 0x31, 0, 0x1a } //new byte[] { 0x5e, 0x05, 0x20, 0x31, 0, 0x1a }
}); });
}); });
} }