1
0
mirror of https://github.com/DarthAffe/CUE.NET.git synced 2025-12-12 08:48:30 +00:00
CUE.NET/Wrapper/CorsairProtocolDetails.cs

67 lines
2.4 KiB
C#

// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
using System;
using System.Runtime.InteropServices;
using CUE.NET.Native;
namespace CUE.NET.Wrapper
{
/// <summary>
/// Managed wrapper for CorsairProtocolDetails.
/// </summary>
public class CorsairProtocolDetails
{
#region Properties & Fields
/// <summary>
/// String containing version of SDK(like “1.0.0.1”).
/// Always contains valid value even if there was no CUE found.
/// </summary>
public string SdkVersion { get; }
/// <summary>
/// String containing version of CUE(like “1.0.0.1”) or NULL if CUE was not found.
/// </summary>
public string ServerVersion { get; }
/// <summary>
/// Integer that specifies version of protocol that is implemented by current SDK.
/// Numbering starts from 1.
/// Always contains valid value even if there was no CUE found.
/// </summary>
public int SdkProtocolVersion { get; }
/// <summary>
/// Integer that specifies version of protocol that is implemented by CUE.
/// Numbering starts from 1.
/// If CUE was not found then this value will be 0.
/// </summary>
public int ServerProtocolVersion { get; }
/// <summary>
/// Boolean that specifies if there were breaking changes between version of protocol implemented by server and client.
/// </summary>
public byte BreakingChanges { get; }
#endregion
#region Constructors
/// <summary>
/// Internal constructor of managed CorsairProtocolDetails.
/// </summary>
/// <param name="nativeDetails">The native CorsairProtocolDetails-struct</param>
internal CorsairProtocolDetails(_CorsairProtocolDetails nativeDetails)
{
this.SdkVersion = nativeDetails.sdkVersion == IntPtr.Zero ? null : Marshal.PtrToStringAuto(nativeDetails.sdkVersion);
this.ServerVersion = nativeDetails.serverVersion == IntPtr.Zero ? null : Marshal.PtrToStringAuto(nativeDetails.serverVersion);
this.SdkProtocolVersion = nativeDetails.sdkProtocolVersion;
this.ServerProtocolVersion = nativeDetails.serverProtocolVersion;
this.BreakingChanges = nativeDetails.breakingChanges;
}
#endregion
}
}