示例#1
0
        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);
        }
示例#2
0
 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;
 }