mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 04:57:15 +00:00
More code issues fixed
This commit is contained in:
1 parent
5633f82b3b
commit
aae509b275
13 files changed
+26
-22
No files matched your search
@@ -139,7 +139,7 @@ public sealed class LightspeedHIDLoader<TLed, TData> : IEnumerable<HIDDeviceDefi
|
||||
getConnectedDevices.Init(LOGITECH_RECEIVER_ADDRESS, LOGITECH_GET_REGISTER_REQUEST);
|
||||
|
||||
stream.Write(getConnectedDevices.AsSpan());
|
||||
stream.Read(response.AsSpan());
|
||||
stream.ReadExactly(response.AsSpan());
|
||||
|
||||
bool wirelessNotifications = (response.Data01 & 1) == 1;
|
||||
if (!wirelessNotifications)
|
||||
@@ -150,7 +150,7 @@ public sealed class LightspeedHIDLoader<TLed, TData> : IEnumerable<HIDDeviceDefi
|
||||
getConnectedDevices.Data1 = 1;
|
||||
|
||||
stream.Write(getConnectedDevices.AsSpan());
|
||||
stream.Read(response.AsSpan());
|
||||
stream.ReadExactly(response.AsSpan());
|
||||
|
||||
if (getConnectedDevices.FeatureIndex == 0x8f)
|
||||
{
|
||||
@@ -164,7 +164,7 @@ public sealed class LightspeedHIDLoader<TLed, TData> : IEnumerable<HIDDeviceDefi
|
||||
getConnectedDevices.FeatureCommand = 0x02;
|
||||
|
||||
stream.Write(getConnectedDevices.AsSpan());
|
||||
stream.Read(response.AsSpan());
|
||||
stream.ReadExactly(response.AsSpan());
|
||||
int deviceCount = response.Data01;
|
||||
if (deviceCount <= 0)
|
||||
return map;
|
||||
@@ -180,7 +180,7 @@ public sealed class LightspeedHIDLoader<TLed, TData> : IEnumerable<HIDDeviceDefi
|
||||
for (int i = 0; i < deviceCount; i++)
|
||||
{
|
||||
FapResponse devices = new();
|
||||
stream.Read(devices.AsSpan());
|
||||
stream.ReadExactly(devices.AsSpan());
|
||||
int wirelessPid = (devices.Data02 << 8) | devices.Data01;
|
||||
if (devices.DeviceIndex != 0xff)
|
||||
map.Add(wirelessPid, devices.DeviceIndex);
|
||||
|
||||
@@ -63,7 +63,7 @@ internal static class _LogitechGSDK
|
||||
if (OperatingSystem.IsWindows())
|
||||
possibleLibraryPaths = Environment.Is64BitProcess ? LogitechDeviceProvider.PossibleX64NativePaths : LogitechDeviceProvider.PossibleX86NativePaths;
|
||||
else
|
||||
possibleLibraryPaths = Enumerable.Empty<string>();
|
||||
possibleLibraryPaths = [];
|
||||
|
||||
return possibleLibraryPaths.Select(Environment.ExpandEnvironmentVariables);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user