如何模拟串口进行测试
我需要编写一个设备模拟器用于通过串行端口连接的测试目的。我知道有一些应用程序可以做到这一点,但这并不能真正帮助我的好奇心,哈哈。我想知道如何在 .net 中编写一个嗅探器来监视串行端口上进出的流量。我也对任何人需要什么建议来完成我的测试感兴趣,但我想要 .net 中的东西,而不是第三方下载。
I neeed to write a device emulator for testing purposes that connects through a serial port. I know there are some apps out there to do this, but that doesn't really help my curiousity, lol. I would like to know how in .net I could write a sniffer to watch the traffic in and out on a serial port. I'm also interested in what suggestions anyone has to accomplish my testing, but I want something in .net and not a 3rd party download.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您始终可以在软件中编写虚拟串行端口并将应用程序连接到该端口。有 GPL 驱动程序源代码,应该可以让您开始了解如何执行此操作:
http://com0com.sourceforge .net/
我可能需要补充一点,编写虚拟设备通常涉及编写驱动程序,这显然是在托管语言中无法做到的。
You can always write a virtual serial port in software and connect your application to that port. There is GPL driver source code out there that should give you a head start on how to do it:
http://com0com.sourceforge.net/
I might have to add, writing a virtual device usually involves writing a driver, something you obviously can't do in a managed language.