Answer the question
In order to leave comments, you need to log in
Working with a USB device?
I have a code that returns a list of USB devices, with physical paths obtained by the SetupDiGetInterfaceDeviceDetail function.
Devices connected: webcam, mouse, barcode scanner, flash drive.
Physical addresses are normally obtained, devices open at these addresses without errors.
But then, I can’t read anything from these devices
The full code is here: files.pihel.jino.ru/files/2e6d893fe1333553bfdd30d7...
This part is of particular interest:
while(1) {<br/>
memset(inBuffer, 0, 2);<br/>
bResult = ReadFile(hUsbLink,inBuffer, 1,&readed,&ovl_wht);<br/>
if (bResult) {<br/>
_tprintf(TEXT("%s"), inBuffer);<br/>
strcat(sBuffer, inBuffer);<br/>
} else {<br/>
le = GetLastError();<br/>
printf("error code: %u ", le);<br/>
}<br/>
}<br/>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question