protected virtual InputEvent SendDataAndWaitResponse(EventType eventType, byte[] data) { var outputReport = CreateOutputReport(eventType, data); var sync = new ResponseSync(outputReport.MessageId); DataRecieved += sync.OnDataReceived; Write(outputReport); // write the output report sync.ResetEvent.WaitOne(ResponseTimeout); return(sync.Response); }
protected virtual InputEvent SendDataAndWaitResponse(EventType eventType, byte[] data) { var outputReport = CreateOutputReport(eventType,data); var sync = new ResponseSync(outputReport.MessageId); DataRecieved += sync.OnDataReceived; Write(outputReport); // write the output report sync.ResetEvent.WaitOne(ResponseTimeout); return sync.Response; }