com 端口的事件处理
我编写了一个 C++ 代码来使用 com 端口与 USB gsm 调制解调器进行通信。现在我想在调制解调器被拔出或以某种方式断开连接时立即得到通知。我可以通过使用事件处理或任何其他方式来做到这一点吗?如果答案是肯定的,那么如果有人告诉我方法,我将非常感激。提前致谢 :)。
谢谢 阿雷芬
i wrote a c++ code to communicate with usb gsm modem using com ports. now i want to be informed immediately when the modem is pulled out or disconnected somehow. can i do this by using event handling or any other way? if the answer is yes then I'll be very grateful if someone tell me the way. thanks in advance :).
thanks
Arefin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的。 USB 标准非常明确地规定允许拔出设备,并且必须由操作系统管理。由于您没有告诉我们哪个操作系统,我们无法向您指出确切的功能。一般来说,您会查看设备管理功能。
Yes. The USB standard is quite definite about the fact that unplugging of devices is allowed and must be managed by the OS. Since you haven't told us which OS, we can't point you to the precise function. In general, you'd look at the device management functions.
如果您的平台是 Win32,则会出现您可以注册的设备删除消息。我确信 Linux 和其他大型操作系统中也有类似的东西。
If your platform is Win32, there are messages for device removal that you can register for. I'm sure there is something similar in Linux and other large OS.