- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I implemented stream_in with CyAPI.lib. After calling WaitForXfer(), BulkInEndPtEndPt->LastError is equal to ERROR_IO_PENDING(997). I don't quite understand why this is.
TEST_METHOD(Test_StreamIn)
{
CCyUSBDevice *USBDevice = new CCyUSBDevice(NULL);
OVERLAPPED inOvLap;
inOvLap.hEvent = CreateEvent(NULL, false, false, L"CYUSB_IN");
unsigned char inBuf[128];
ZeroMemory(inBuf, 128);
unsigned char buffer[128];
LONG length = 128;
UCHAR *inContext = USBDevice->BulkInEndPt->BeginDataXfer(inBuf, length, &inOvLap);
USBDevice->BulkInEndPt->WaitForXfer(&inOvLap, 100);
USBDevice->BulkInEndPt->FinishDataXfer(inBuf, length, &inOvLap, inContext);
CloseHandle(inOvLap.hEvent);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Error Code 997 occurs if there is no data to be read from the IN endpoint of the device. Please let us know the device being used and the mode of operation (AUTO or MANUAL).
Reasons for Error Code 997:
1. The expected bytes of data have not been transferred within the timeout period.
2. The endpoint sends NAK/ STALL.
Best regards,
Srinath S