Esempio n. 1
0
        public static Capabilities? Get(IntPtr handle)
        {
            var capabilities = new Capabilities();
            var preparsedDataPointer = IntPtr.Zero;

            if (HidD_GetPreparsedData(handle, ref preparsedDataPointer))
            {
                HidP_GetCaps(preparsedDataPointer, ref capabilities);
                HidD_FreePreparsedData(preparsedDataPointer);
                return capabilities;
            }
            else
                return null;
        }
        internal HidDeviceCapabilities(Capabilities capabilities)
        {
            Usage = capabilities.Usage;
            UsagePage = capabilities.UsagePage;
            InputReportByteLength = capabilities.InputReportByteLength;
            OutputReportByteLength = capabilities.OutputReportByteLength;
            FeatureReportByteLength = capabilities.FeatureReportByteLength;
            Reserved = capabilities.Reserved;
            NumberLinkCollectionNodes = capabilities.NumberLinkCollectionNodes;
            NumberInputButtonCaps = capabilities.NumberInputButtonCaps;
            NumberInputValueCaps = capabilities.NumberInputValueCaps;
            NumberInputDataIndices = capabilities.NumberInputDataIndices;
            NumberOutputButtonCaps = capabilities.NumberOutputButtonCaps;
            NumberOutputValueCaps = capabilities.NumberOutputValueCaps;
            NumberOutputDataIndices = capabilities.NumberOutputDataIndices;
            NumberFeatureButtonCaps = capabilities.NumberFeatureButtonCaps;
            NumberFeatureValueCaps = capabilities.NumberFeatureValueCaps;
            NumberFeatureDataIndices = capabilities.NumberFeatureDataIndices;

        }
Esempio n. 3
0
 static internal extern int HidP_GetCaps(IntPtr preparsedData, ref Capabilities capabilities);