来自 USB 的原始数据

发布于 2024-12-20 20:06:09 字数 187 浏览 3 评论 0原文

我以前没有使用过 Visual C++,但是我正在启动一个需要使用它的项目。

我想从 USB 获取原始数据。几乎每个网站都告诉我,我需要先为其编写一个设备驱动程序...我知道!

但我想从简单的开始 - 使用我的无线鼠标接收器,它显然已经安装了一个可以工作的驱动程序。如何使用 Visual C++ 访问接收器向计算机提供的内容?

I haven't used Visual C++ before, however I'm starting a project that will require me to use it.

I want to get raw data from the USB. Almost every website tells me that I need to write a device driver for it first... Well I know that!

But I want to start simple - with my wireless mouse receiver, which obviously has a driver installed, which works. How can I access the contents which that receiver provides to the computer, using Visual C++?

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

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

发布评论

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

评论(1

森林迷了鹿 2024-12-27 20:06:09

这是一个伟大的项目——也充满乐趣。也许您可以从相关的帖子中找到一些资源。我在那里进行了更详细的介绍。但我也会在这里回答一点。

首先,您肯定不想编写驱动程序。编写驱动程序的时代已经过去了。 :) 至少对于你特别想做的事情。正如我在上述帖子中详细介绍的那样,我们现在主要使用 HID 描述符与 HID (usb) 设备进行通信,而不是编写驱动程序。这太棒了,因为它极大地简化了任务。

我强烈建议您或处于相同位置的任何人使用 libusbx 库。在与 HID 设备直接通信方面,它使事情变得非常简单和直接。再次,请参阅该帖子以获得更复杂的答案,但这应该可以做到。祝你好运!

This is a great project - a ton of fun too. Perhaps you can find some resources from this related post. I go into a lot more detail there. But I'll answer a little bit here too.

First off, you definitely don't want to write a driver. The time of writing drivers is mostly behind us. :) At least for what you are trying to do in particular. As I detail in the aforementioned post, we now mostly use HID descriptors to communicate with HID (usb) devices instead of writing drivers. This is awesome because it seriously simplifies the task.

I will highly recommend you or anyone in the same position use the libusbx library. It makes things very simple and straightforward in terms of communicating directly with HID devices. Again, see the post for a much more involved answer, but this should do it. Good luck!

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