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); }
internal HidDataReceivedEventArgs(byte[] data) { report = new HidInReport(data); }