USB串行虚拟COM端口:读取不起作用 [英] USB Serial Virtual COM port : Read not working

查看:117
本文介绍了USB串行虚拟COM端口:读取不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Everyone,



我不是在这里再写一切,因为下面的链接讨论了更多的深度。



请帮忙。

Thx,

-Varun



http :?//social.msdn.microsoft.com/Forums/en-US/b65e4ff9-a7ce-4818-8e36-9db75fe8f49f/usb-serial-virtual-com-port-read-not-working论坛= vcgeneral [ ^ ]

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[^]

推荐答案

尝试打开DTR引脚。当该引脚处于非活动状态时,设备可能会忽略输入。
Try turning on the DTR pin. The device may ignore input when that pin is inactive.


嗨大家好,



问题已解决。我不得不添加等待直到InQueue> 0(表示接收缓冲区中至少有1个字节)或超时(安全出口)结束。它会阻止呼叫,但目前我的应用程序还可以。 waitComm()在这里对我不起作用。



样本片段:



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++;
    }


这篇关于USB串行虚拟COM端口:读取不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆