mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Compare commits
3 Commits
790f55224d
...
53cc40002c
| Author | SHA1 | Date | |
|---|---|---|---|
| 53cc40002c | |||
| eedeadabda | |||
| 95eeef2d04 |
@ -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; device++)
|
for (int device = 0; (device < channelInfo.devicesCount) && (ledOffset < nativeDeviceInfo.ledsCount); device++)
|
||||||
{
|
{
|
||||||
_CorsairChannelDeviceInfo channelDeviceInfo = (_CorsairChannelDeviceInfo)Marshal.PtrToStructure(channelDeviceInfoPtr, typeof(_CorsairChannelDeviceInfo))!;
|
_CorsairChannelDeviceInfo channelDeviceInfo = (_CorsairChannelDeviceInfo)Marshal.PtrToStructure(channelDeviceInfoPtr, typeof(_CorsairChannelDeviceInfo))!;
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ namespace RGB.NET.Devices.Corsair
|
|||||||
switch (channelDeviceInfo.type)
|
switch (channelDeviceInfo.type)
|
||||||
{
|
{
|
||||||
case CorsairChannelDeviceType.Invalid:
|
case CorsairChannelDeviceType.Invalid:
|
||||||
return "Invalid";
|
return model;
|
||||||
|
|
||||||
case CorsairChannelDeviceType.FanHD:
|
case CorsairChannelDeviceType.FanHD:
|
||||||
return "HD Fan";
|
return "HD Fan";
|
||||||
|
|||||||
@ -36,6 +36,12 @@ 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; }
|
||||||
|
|
||||||
@ -60,6 +66,7 @@ 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);
|
||||||
@ -78,6 +85,7 @@ 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);
|
||||||
|
|||||||
@ -48,5 +48,11 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user