1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-31 17:53:39 +00:00

Compare commits

..

No commits in common. "53cc40002c3f780ea7e930694dbd7d29469fef30" and "790f55224d9fa77a58da34fe888f353b25159b2a" have entirely different histories.

4 changed files with 2 additions and 16 deletions

View File

@ -156,7 +156,7 @@ namespace RGB.NET.Devices.Corsair
int channelDeviceInfoStructSize = Marshal.SizeOf(typeof(_CorsairChannelDeviceInfo)); int channelDeviceInfoStructSize = Marshal.SizeOf(typeof(_CorsairChannelDeviceInfo));
IntPtr channelDeviceInfoPtr = channelInfo.devices; IntPtr channelDeviceInfoPtr = channelInfo.devices;
for (int device = 0; (device < channelInfo.devicesCount) && (ledOffset < nativeDeviceInfo.ledsCount); device++) for (int device = 0; device < channelInfo.devicesCount; device++)
{ {
_CorsairChannelDeviceInfo channelDeviceInfo = (_CorsairChannelDeviceInfo)Marshal.PtrToStructure(channelDeviceInfoPtr, typeof(_CorsairChannelDeviceInfo))!; _CorsairChannelDeviceInfo channelDeviceInfo = (_CorsairChannelDeviceInfo)Marshal.PtrToStructure(channelDeviceInfoPtr, typeof(_CorsairChannelDeviceInfo))!;

View File

@ -81,7 +81,7 @@ namespace RGB.NET.Devices.Corsair
switch (channelDeviceInfo.type) switch (channelDeviceInfo.type)
{ {
case CorsairChannelDeviceType.Invalid: case CorsairChannelDeviceType.Invalid:
return model; return "Invalid";
case CorsairChannelDeviceType.FanHD: case CorsairChannelDeviceType.FanHD:
return "HD Fan"; return "HD Fan";

View File

@ -36,12 +36,6 @@ namespace RGB.NET.Devices.Corsair
/// <inheritdoc /> /// <inheritdoc />
public string Model { get; } public string Model { get; }
/// <summary>
/// Returns the unique ID provided by the Corsair-SDK.
/// Returns string.Empty for Custom devices.
/// </summary>
public string DeviceId { get; }
/// <inheritdoc /> /// <inheritdoc />
public object? LayoutMetadata { get; set; } public object? LayoutMetadata { get; set; }
@ -66,7 +60,6 @@ namespace RGB.NET.Devices.Corsair
this.DeviceType = deviceType; this.DeviceType = deviceType;
this.CorsairDeviceType = nativeInfo.type; this.CorsairDeviceType = nativeInfo.type;
this.Model = nativeInfo.model == IntPtr.Zero ? string.Empty : Regex.Replace(Marshal.PtrToStringAnsi(nativeInfo.model) ?? string.Empty, " ?DEMO", string.Empty, RegexOptions.IgnoreCase); this.Model = nativeInfo.model == IntPtr.Zero ? string.Empty : Regex.Replace(Marshal.PtrToStringAnsi(nativeInfo.model) ?? string.Empty, " ?DEMO", string.Empty, RegexOptions.IgnoreCase);
this.DeviceId = nativeInfo.deviceId ?? string.Empty;
this.CapsMask = (CorsairDeviceCaps)nativeInfo.capsMask; this.CapsMask = (CorsairDeviceCaps)nativeInfo.capsMask;
DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model); DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model);
@ -85,7 +78,6 @@ namespace RGB.NET.Devices.Corsair
this.DeviceType = deviceType; this.DeviceType = deviceType;
this.CorsairDeviceType = nativeInfo.type; this.CorsairDeviceType = nativeInfo.type;
this.Model = modelName; this.Model = modelName;
this.DeviceId = nativeInfo.deviceId ?? string.Empty;
this.CapsMask = (CorsairDeviceCaps)nativeInfo.capsMask; this.CapsMask = (CorsairDeviceCaps)nativeInfo.capsMask;
DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model); DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model);

View File

@ -48,11 +48,5 @@ namespace RGB.NET.Devices.Corsair.Native
/// CUE-SDK: structure that describes channels of the DIY-devices /// CUE-SDK: structure that describes channels of the DIY-devices
/// </summary> /// </summary>
internal _CorsairChannelsInfo? channels; internal _CorsairChannelsInfo? channels;
/// <summary>
/// CUE-SDK: null-terminated string that contains unique device identifier that uniquely identifies device at least within session
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
internal string? deviceId;
} }
} }