public static NtStatus TryGetValueCaps(HidPreparsedData preparsedData, HidPReportType reportType, out HidPValueCaps[] valueCaps) { var preparsedDataPtr = HidPreparsedData.GetRawValue(preparsedData); var caps = GetCaps(preparsedData); var capsCount = reportType switch { HidPReportType.Input => caps.NumberInputValueCaps, HidPReportType.Output => caps.NumberOutputValueCaps, HidPReportType.Feature => caps.NumberFeatureValueCaps, _ => throw new ArgumentException($"Invalid HidPReportType: {reportType}", nameof(reportType)), }; valueCaps = new HidPValueCaps[capsCount]; return(HidP_GetValueCaps(reportType, valueCaps, ref capsCount, preparsedDataPtr)); }
public static int GetScaledUsageValue(HidPreparsedData preparsedData, HidPReportType reportType, HidPValueCaps valueCaps, ushort usage, byte[] report, int reportLength) => GetScaledUsageValue(preparsedData, reportType, valueCaps.UsagePage, valueCaps.LinkCollection, usage, report, reportLength);
public static byte[] GetUsageValueArray(HidPreparsedData preparsedData, HidPReportType reportType, HidPValueCaps valueCaps, ushort usage, byte[] report, int reportLength) => GetUsageValueArray(preparsedData, reportType, valueCaps.UsagePage, valueCaps.LinkCollection, usage, (ushort)(valueCaps.BitSize * valueCaps.ReportCount), report, reportLength);
public static NtStatus TryGetUsageValue(HidPreparsedData preparsedData, HidPReportType reportType, HidPValueCaps valueCaps, ushort usage, byte[] report, int reportLength, out int usageValue) => TryGetUsageValue(preparsedData, reportType, valueCaps.UsagePage, valueCaps.LinkCollection, usage, report, reportLength, out usageValue);