this line
success = await _myHid.SendOutputReportViaInterruptTransfer(_deviceData, _hidHandle, outputReportBuffer);
gives me this error Error
The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'. S:\blissbox\SOURCE_FILES\Bliss-Box_api\managed dx attempt\BBAPI.cs 40
here is my method.
internal async Task<Boolean> SendOutputReportViaInterruptTransfer
(FileStream fileStreamDeviceData, SafeFileHandle hidHandle, Byte[] outputReportBuffer)
{
try
{
var success = false;
// Begin writing the Output report.
Task t = fileStreamDeviceData.WriteAsync(outputReportBuffer, 0, outputReportBuffer.Length);
await t;
// Gets to here only if the write operation completed before a timeout.
Debug.Print("Asynchronous write completed");
// The operation has one of these completion states:
switch (t.Status)
{
case TaskStatus.RanToCompletion:
success = true;
Debug.Print("Output report written to device");
break;
case TaskStatus.Canceled:
Debug.Print("Task canceled");
break;
case TaskStatus.Faulted:
Debug.Print("Unhandled exception");
break;
}
return success;
}
catch (Exception ex)
{
DisplayException(ModuleName, ex);
throw;
}
}
What did I do wrong?