Click here to Skip to main content
15,882,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone,

I am not writing everything again here, because lot more depth is discussed at link below.

Please help.
Thx,
-Varun

http://social.msdn.microsoft.com/Forums/en-US/b65e4ff9-a7ce-4818-8e36-9db75fe8f49f/usb-serial-virtual-com-port-read-not-working?forum=vcgeneral[^]
Posted
Comments
Rage 10-Mar-14 9:08am    
Is your handle valid ?
Some stabs in the dark
Have you open the stream with GENERIC_ALL ?
Have you tried reading without writing before (configure your hw to poll out values) ?

Try turning on the DTR pin. The device may ignore input when that pin is inactive.
 
Share this answer
 
v2
Hi Guys,

Issue is solved. I had to add wait till InQueue > 0 (it means there is atleast 1 byte in receive buffer) or timeout (as safety exit) is over. it would be blocking call but it is OK for my application at the moment. waitComm() did not work well for me here.

sample snippet:

while(1)
    {
        ClearCommError((HANDLE)*h_drv, (LPDWORD)&Err, &CST);

        if((CST.cbInQue >0)||(count >1000000))
        break;

        count++;
    }
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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