Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hallo my friends

I have a project to communicate with a usb device using usb bus. The device has its own driver and a communication protokol Guid . In its guid there is this senetence :"After USB driver is installed any program can communicate with the device by using ‘CreateFile’, ‘ReadFile’ and ‘WriteFile’, common Windows system functions." So I followed the instructions and the Creatfile() function works very well. My problem is with Writefile()and ReadFile functions. It shows always this Error 3758100489 : Can anyone help me ? thank you very much P.s USB path is right 100%
In the guid book there is this note:All messages use Intel style byte ordering where fields larger than one byte are stored in memory so
that the least significant part is in lowest address.
So i tried to use functions to convert to littel Endien too

What I have tried:

I tried to use overlapped parameter in Creatfile() and Writefile() but still have the same problem.
i tried to use many forms of message packet with help from the guid too
Posted
Updated 13-Aug-18 5:15am

1 solution

One odd thing with Windows API error codes is they are most often documented in hexadecimal form. This error code is E0001009 in hex and according to google there are a few different meanings for it. One is USBIO_ERR_NOT_BOUND. Reason: The handle is not bound to a pipe. This error is reported by the USBIO driver. I recommend looking for this error code in any documentation you have for the device.

A couple of tips here: display your error codes in hex. If you use printf or sprintf to deal with them then the format is "%08X" to display the error code in hex.

Also, since most windows machines run on an Intel processor the data will likely be in little endian format already so you shouldn't have to worry about converting it.
 
Share this answer
 
Comments
Member 13947289 22-Aug-18 7:45am    
Thanks Rick
sorry to be late but i was really basy last time:
So You are Right there is a problem with pipe issue :
So I think I have two choises : Createpipe() or CreateNamedpipe();
I have tried Createpipe().. then Writefile() and Readfile() are working without Errors but the device has no reaction.
With CreateNamedpipe() how can i use the usb path to creat the right pipename ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900