使用USB HID设备 [英] using a USB HID device

查看:114
本文介绍了使用USB HID设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Python与USB HID设备接口(不是键盘或鼠标,只是使用HID驱动程序以避免需要的b / b)特定的司机)。这可能是纯粹的Python在

Windows上,甚至更好,以便携的方式吗?


Wouter van Ooijen


- ------------------------------------
http://www.voti.nl

PICmicro芯片,程序员,咨询

解决方案

Wouter van Ooijen( www .voti.nl )写道:

我想使用Python与USB HID设备接口(不是键盘或鼠标,只是使用HID驱动程序的东西)避免需要特定的驱动程序)。这可能是在Windows上的纯Python中,还是以便携方式更好?




这些设备的Win32 API是什么?如果它很简单

CreateFile / ReadFile / WriteFile / DeviceIoControl,那么你应该使用PythonWin扩展在纯Python中完成它。


同样,在Unix上,你可以使用设备节点和fcntl模块。


我不认为有一个独立于平台的Python模块用于

这样的设备,但你可以使用这些构建块编写自己的抽象层




HTH,
Martin


wo **** @ voti .nl (Wouter van Ooijen( www.voti.nl))在消息新闻中:< 40 ***************** @ news.xs4all.nl> ...

我想使用Python与USB HID设备(不是键盘或鼠标,只是使用HID驱动程序以避免需要特定驱动程序的东西)。这可以在Windows上以纯Python形式实现,甚至可以通过便携方式实现更好吗?

Wouter van Ooijen

- ------- -----------------------------
http://www.voti.nl
PICmicro芯片,程序员,咨询




我有开发了Windows的例程,使用Windows SCSIPASSTHROUGH层来处理大容量存储

设备。我发现USB

设备不使用这一层,因此我也在调查使用python访问USB设备的
。到目前为止它看起来像一个单独的

驱动程序以及需要的接口DLL。


Sam Schulenburg


>>我想使用Python与USB HID设备接口(不是

键盘或鼠标,只是使用HID驱动程序以避免需要的东西对于特定的驱动程序)。这可能是在Windows上的纯Python中,还是以便携方式更好?



这些设备的Win32 API是什么?



说实话,我没有最微弱的想法。我希望

一些抽象层(可以是一个便携式的)就像串口

端口一样。

Wouter van Ooijen


- ------------------------------------
http://www.voti.nl

PICmicro芯片,程序员,咨询


I want to use Python to interface with an USB HID device (not a
keyboard or mouse, just something that uses the HID driver to avoid
the need for a specific driver). Is this possible in pure Python on
Windows, or even better, in a portable way?

Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting

解决方案

Wouter van Ooijen (www.voti.nl) wrote:

I want to use Python to interface with an USB HID device (not a
keyboard or mouse, just something that uses the HID driver to avoid
the need for a specific driver). Is this possible in pure Python on
Windows, or even better, in a portable way?



What is the Win32 API for such devices? If it is plain
CreateFile/ReadFile/WriteFile/DeviceIoControl, you should be
able to do it in pure Python, using the PythonWin extensions.

Likewise, on Unix, you can use device nodes, and the fcntl module.

I don''t think there is a platform-independent Python module for
such devices, yet, but you could write your own abstraction layer
using those building blocks.

HTH,
Martin


wo****@voti.nl (Wouter van Ooijen (www.voti.nl)) wrote in message news:<40*****************@news.xs4all.nl>...

I want to use Python to interface with an USB HID device (not a
keyboard or mouse, just something that uses the HID driver to avoid
the need for a specific driver). Is this possible in pure Python on
Windows, or even better, in a portable way?

Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting



I have developed routines for Windows that address mass storage
devices using the Windows SCSIPASSTHROUGH layer. I found that USB
devices do not use this layer, and as a result I am also investigating
using python to access USB devices. So far it looks like a seperate
driver along with a interfaceing DLL will needed.

Sam Schulenburg


>> I want to use Python to interface with an USB HID device (not a

keyboard or mouse, just something that uses the HID driver to avoid
the need for a specific driver). Is this possible in pure Python on
Windows, or even better, in a portable way?



What is the Win32 API for such devices?



To be honest, I don''t have the faintest idea. I hoped there would be
some abstraction layer (freferrably a portable one) like for serial
ports.
Wouter van Ooijen

-- ------------------------------------
http://www.voti.nl
PICmicro chips, programmers, consulting


这篇关于使用USB HID设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆