如何模拟串口进行测试

发布于 2024-09-30 03:42:03 字数 153 浏览 0 评论 0原文

我需要编写一个设备模拟器用于通过串行端口连接的测试目的。我知道有一些应用程序可以做到这一点,但这并不能真正帮助我的好奇心,哈哈。我想知道如何在 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

随遇而安 2024-10-07 03:42:03

您始终可以在软件中编写虚拟串行端口并将应用程序连接到该端口。有 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文