USB-串行端口. [英] USB - Serial Port.

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

问题描述

我有通过USB串行COM端口连接到PC的设备.
突然我拔出了电缆.
而且我还处理USBDeviceRemoved事件.我从这里得到的
用于检测USB设备的USB库 [

I have Device which is connect to PC via USB Serial COM Port.
And Suddenly i pulled-out the Cable.
And I also handle the USBDeviceRemoved event. Which i have get from this
A USB Library to Detect USB Devices[^]

But i can''t close the existing connection using .CLOSE() method
(eg. _serialPort.close())

It Gives me Error: Device is not connected and also i can''t connect after joint the cable again. It also gives me Error: COMx does not Exist.
(Through this process i do not want to close my application).

Is there any way to close connection forcefully?

推荐答案

这个问题是最近才出现的.
如果您非常仔细地研究了有关SerialPort的msdn页面,那么您会发现一些非常有趣的东西...
http://msdn.microsoft.com/en-us/library/system. io.ports.serialport.aspx [ ^ ]

在社区内容下方,给定的链接为:
http://code.mbx.wh01.ipv.no/examples/SerialPortFixer.html [ ^ ]

祝你好运!
This question came along very recently.

If you would have studied the msdn page about the SerialPort very closely you would find something that is very interesting to you...
http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx[^]

It''s below under community content, the given link is:
http://code.mbx.wh01.ipv.no/examples/SerialPortFixer.html[^]

Good luck!


这篇关于USB-串行端口.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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