示例#1
0
        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));
        }
示例#2
0
 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);
示例#3
0
 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);
示例#4
0
 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);