mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Aura Tweaks
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.141</AssemblyVersion>
|
<AssemblyVersion>0.142</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ public static class AsusHid
|
|||||||
static int[] deviceIds = { 0x1a30, 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0, 0x18c6, 0x1abe };
|
static int[] deviceIds = { 0x1a30, 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0, 0x18c6, 0x1abe };
|
||||||
|
|
||||||
static HidStream? auraStream;
|
static HidStream? auraStream;
|
||||||
static int featureLength;
|
|
||||||
|
|
||||||
public static IEnumerable<HidDevice>? FindDevices(byte reportId)
|
public static IEnumerable<HidDevice>? FindDevices(byte reportId)
|
||||||
{
|
{
|
||||||
@@ -95,10 +94,7 @@ public static class AsusHid
|
|||||||
foreach (var data in dataList)
|
foreach (var data in dataList)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var payload = new byte[device.GetMaxFeatureReportLength()];
|
stream.Write(data);
|
||||||
Array.Copy(data, payload, data.Length);
|
|
||||||
stream.SetFeature(payload);
|
|
||||||
//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)
|
||||||
@@ -111,20 +107,12 @@ public static class AsusHid
|
|||||||
public static void WriteAura(byte[] data)
|
public static void WriteAura(byte[] data)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (auraStream == null)
|
if (auraStream == null) auraStream = FindHidStream(AURA_ID);
|
||||||
{
|
if (auraStream == null) return;
|
||||||
auraStream = FindHidStream(AURA_ID);
|
|
||||||
if (auraStream == null) return;
|
|
||||||
|
|
||||||
featureLength = auraStream.Device.GetMaxFeatureReportLength();
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var payload = new byte[featureLength];
|
auraStream.Write(data);
|
||||||
Array.Copy(data, payload, data.Length);
|
|
||||||
auraStream.SetFeature(payload);
|
|
||||||
//auraStream.Write(data);
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -84,8 +84,6 @@ namespace GHelper.USB
|
|||||||
|
|
||||||
static public bool isSingleColor = false;
|
static public bool isSingleColor = false;
|
||||||
|
|
||||||
static bool isOldHeatmap = AppConfig.Is("old_heatmap");
|
|
||||||
|
|
||||||
static System.Timers.Timer timer = new System.Timers.Timer(1000);
|
static System.Timers.Timer timer = new System.Timers.Timer(1000);
|
||||||
|
|
||||||
private static Dictionary<AuraMode, string> _modesSingleColor = new Dictionary<AuraMode, string>
|
private static Dictionary<AuraMode, string> _modesSingleColor = new Dictionary<AuraMode, string>
|
||||||
@@ -543,11 +541,11 @@ namespace GHelper.USB
|
|||||||
|
|
||||||
if (init)
|
if (init)
|
||||||
{
|
{
|
||||||
Init();
|
//Init();
|
||||||
AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xbc, 1 });
|
AsusHid.WriteAura(new byte[] { AsusHid.AURA_ID, 0xbc, 1 });
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] buffer = new byte[64];
|
byte[] buffer = new byte[12];
|
||||||
buffer[0] = AsusHid.AURA_ID;
|
buffer[0] = AsusHid.AURA_ID;
|
||||||
buffer[1] = 0xbc;
|
buffer[1] = 0xbc;
|
||||||
buffer[2] = 1;
|
buffer[2] = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user