Example #1
0
        public HidReport ReadInputReport()
        {
            byte[]    buf    = new byte[GetReportLength(HidReportType.Input)];
            HidReport report = new HidInReport(buf);

            if (dev.OpenDeviceForRead())
            {
                if (report.Length == GetReportLength(HidReportType.Input))
                {
                    if (!NativeApi.HidD_GetInputReport(dev.Handle, report.Bytes, report.Length))
                    {
                        throw new Exception("GetInputReport: " + Marshal.GetLastWin32Error().ToString());
                    }
                }
            }
            else
            {
                throw new Exception("Unable to open device for Read");
            }

            return(report);
        }
Example #2
0
 internal HidDataReceivedEventArgs(byte[] data)
 {
     report = new HidInReport(data);
 }
Example #3
0
 internal HidDataReceivedEventArgs(byte[] data)
 {
     report = new HidInReport(data);
 }