private static bool GetFanCoolersGetStatus(int busId, out PrivateFanCoolersStatusV1 info) { info = PrivateFanCoolersStatusV1.Create(); if (NvapiNativeMethods.NvFanCoolersGetStatus == null) { return(false); } if (_nvFanCoolersGetStatusNotSupporteds.Contains(busId)) { return(false); } try { if (!HandlesByBusId.TryGetValue(busId, out NvPhysicalGpuHandle handle)) { return(false); } var r = NvapiNativeMethods.NvFanCoolersGetStatus(handle, ref info); if (r != NvStatus.NVAPI_OK) { if (r == NvStatus.NVAPI_NOT_SUPPORTED || r == NvStatus.NVAPI_FIRMWARE_REVISION_NOT_SUPPORTED) { _nvFanCoolersGetStatusNotSupporteds.Add(busId); } NTMinerConsole.DevError(() => $"{nameof(NvapiNativeMethods.NvFanCoolersGetStatus)} {r.ToString()}"); return(false); } return(true); } catch { } return(false); }
private bool GetFanCoolersGetStatus(int busId, out PrivateFanCoolersStatusV1 info) { info = new PrivateFanCoolersStatusV1(); if (NvapiNativeMethods.NvFanCoolersGetStatus == null) { return(false); } if (_nvFanCoolersGetStatusNotSupporteds.Contains(busId)) { return(false); } info.version = (uint)(VERSION1 | (Marshal.SizeOf(typeof(PrivateFanCoolersStatusV1)))); try { if (!HandlesByBusId.TryGetValue(busId, out NvPhysicalGpuHandle handle)) { return(false); } var r = NvapiNativeMethods.NvFanCoolersGetStatus(handle, ref info); if (r != NvStatus.NVAPI_OK) { if (r == NvStatus.NVAPI_NOT_SUPPORTED || r == NvStatus.NVAPI_FIRMWARE_REVISION_NOT_SUPPORTED) { _nvFanCoolersGetStatusNotSupporteds.Add(busId); } Write.DevError($"{nameof(NvapiNativeMethods.NvFanCoolersGetStatus)} {r.ToString()}"); return(false); } return(true); } catch { } return(false); }