private static void ReadFromNiaSync() { Byte[] inputReportBuffer = new Byte[56]; Boolean success = false; GenericHid.Hid.InputReportViaInterruptTransfer myInputReport = new GenericHid.Hid.InputReportViaInterruptTransfer(); myInputReport.Read(hidHandle, readHandle, writeHandle, ref NiaDetected, ref inputReportBuffer, ref success); if (success) { Interpret(inputReportBuffer); } }
/// <summary> /// Retrieves Input report data and status information. /// Used for asynchronous reads from the device. /// </summary> private void ReadFromNiaSync() { byte[] inputReportBuffer = new Byte[56]; bool success = false; GenericHid.Hid.InputReportViaInterruptTransfer myInputReport = new GenericHid.Hid.InputReportViaInterruptTransfer(); myInputReport.Read(hidHandle, readHandle, writeHandle, ref NiaDetected, ref inputReportBuffer, ref success); ShowMS(DateTime.Now.Millisecond); if (success) { if (RecordingCheckBox.Checked) recording.Add(inputReportBuffer); Interpret(inputReportBuffer); } }