如何对USB RNDIS进行编程?

发布于 2024-10-02 09:51:33 字数 394 浏览 4 评论 0原文

我正在使用一块运行 Linux 的控制器板。我想通过 USB 将我的设备连接到主机(Windows 操作系统)。

我决定使用 RNDIS 类进行主机和设备之间的通信。我在设备端(linux)准备好了驱动程序。当我将设备连接到 Windows 主机时,它会将硬件检测为 RNDIS/CDC 未知设备。现在,对于 Windows 上的驱动程序开发,我使用“Jungo windriver 10.10”。它生成了 INF 文件,并且我的设备已在系统上成功检测到。

现在我如何开始主机和设备之间的通信?我想提一下,我是编程新手,没有 Windows 端编程经验。

可以肯定的是,我必须在两侧(设备 Linux 和主机 Windows)开发应用程序驱动程序,

有人可以指导我如何继续吗?

提前致谢....

I am using one controller board with Linux running on it. I want to interface my device to the Host computer (Windows OS) through USB.

I have decided to use RNDIS class for communication between host and device. I have driver ready at device side (linux). When i connect my device to the Windows host it detects the hardware as RNDIS/CDC unknown device. Now for the driver development at windows i used "Jungo windriver 10.10". It generated the INF file and my device was successfully detected on system.

Now how can i start communication between host and device? I would like to mention that I am newbie in programming and no experience in Windows side programming.

It is for sure that i will have to develop application driver on both side (Device-Linux and host-windows)

Can someone guide me how can i proceed on this?

Thanks in advance....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

野味少女 2024-10-09 09:51:33

首先,RNDIS 作为 Windows XP 及以上版本的标准交付,不是 Jungo 的主机堆栈,而是 MS 的。

其次,你知道你在设备端准备了什么驱动吗?是 Jungo RNDIS 目标侧堆栈吗?

要在 RNDIS 设备的主机和目标之间进行通信,请尝试 MS 的以下两个链接,帮助您了解控制和数据通道以及 EP 设置:

http://207.46.16.248/en-us/library/ee483123(WinEmbedded.60).aspx
http://download.microsoft.com/download/B/0/B/B0B199DB-41E6-400F-90CD-C350D0C14A53/%5BMS-RNDIS%5D.pdf

RNDIS 使用两个通道,一个控制通道和一个数据通道。初始通信从控制通道开始,然后数据开始在数据通道上流动,该通道使用两个 BULK 端点 IN 和 OUT。

但是,您应该注意 RNDIS 规范要求之后
向控制通道端点提交 RNDIS 控制消息,主机甚至在中断端点上也会监听。

First, RNDIS as standard delivery available on windows xp onwards, not Jungo's host stack, but MS's.

Secondly, do you know what driver you have ready on the device side? Is it Jungo RNDIS target side stack?

To communicate between host and target for RNDIS device, try the following two links from MS help you understand the control and data channel, as well as the EP set up:

http://207.46.16.248/en-us/library/ee483123(WinEmbedded.60).aspx
http://download.microsoft.com/download/B/0/B/B0B199DB-41E6-400F-90CD-C350D0C14A53/%5BMS-RNDIS%5D.pdf

RNDIS uses two channels, one control channel and one data channel. The initial communication starts from control channel then data starts flowing on the data channel, which uses two BULK endpoints, IN and OUT.

However, you should pay attention to the fact that RNDIS spec requires that after
submitting RNDIS control message to control channel endpoint the host will listen for even on the interrupt endpoint.

最美不过初阳 2024-10-09 09:51:33

据我了解,Windows 上传通用 USB 客户端驱动程序(Jungo 驱动程序)用于连接您的 Linux 设备。因此接下来您需要打开端点上的连接(可能是进出批量端点),格式化数据(您发送的)在该端点上RNDIS 协议的格式。您需要确定您的 Linux 设备是否确实公开了 RNDIS 接口。如需帮助,我可以建议使用 USB 记录器。尝试将您的 Linux 设备连接到 Windows 或 Linux,您知道该设备已被某个驱动程序识别,并且连接,然后记录 USB 上发生的情况。看起来你开始研究 USB 接口,它是不同的协议,我认为最好从一些现成的东西开始,尝试搜索和学习人们如何解析、理解和编写 USB 协议,例如 kinect 设备。

As i understand Windows upload Generic USB Client Driver (Jungo Driver) for the connection of you linux device.So next you will need to open Connection over endpoints probably in and out bulk endpoints, format data ( that you send) over this endpoints in the format of RNDIS protocol. You need to be sure if your linux device is really expose RNDIS interface. For assistance i can advice to use usb logger. Try connect your linux device to Windows or Linux where you know that device been recognized by some driver and there connection then make logs of what happens on usb. It seems like you start to research usb interface and it's different protocols i think it better to start from some ready stuff, try to search and learn how people parse, understand and write usb protocols for example for kinect device.

你的往事 2024-10-09 09:51:33

已经有模块可以帮助您将 Linux mc 连接到 win pc。例如,尝试查找 g_file_storage 模块,它可以让您从 linux mc 挂载文件系统映像到 win pc 作为独立磁盘,您可以在上面进行格式化、文件输入输出等操作。希望您能在 google 上找到更多信息...:)
谢谢,
阿杰

there're already modules which can help you while connecting a linux mc to win pc. Try to look up for g_file_storage module, for example, that can let you mount a file system image from linux mc to win pc as a saperate disk on which you can do formatting, file input output etc. Hope you'll find more on google... :)
thanks,
AJ

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