/// <summary> /// Handles the error. /// </summary> /// <exception cref="Exception"></exception> private bool HandleError() { CorsairError error = CorsairLightingSDK.GetLastError(); if (error == CorsairError.ServerNotFound) { return(false); } else if (error != CorsairError.Success) { throw new Exception(error + ""); } return(true); }
/// <summary> /// Performs a health check on the provider /// </summary> public void PerformHealthCheck() { var cueRunning = Process.GetProcessesByName("iCUE").Length != 0; while (!cueRunning) { Thread.Sleep(1000); cueRunning = Process.GetProcessesByName("iCUE").Length != 0; } CorsairLightingSDK.GetDeviceCount(); var error = CorsairLightingSDK.GetLastError(); while (error == CorsairError.ServerNotFound || error == CorsairError.ProtocolHandshakeMissing) { CorsairLightingSDK.PerformProtocolHandshake(); Thread.Sleep(1000); error = CorsairLightingSDK.GetLastError(); } }
public CorsairError CorsairGetLastError() { return(CorsairLightingSDK.GetLastError()); }