【发布时间】:2015-10-09 00:09:39
【问题描述】:
我捡起一个即将被扔掉的wii架子鼓。它有一个 USB 端口,我想将它连接到我的 macbook 以进行项目。我的目标基本上是能够检测到何时在设备上敲击了某个鼓。根据我目前收集到的信息,我需要执行以下步骤:
- 连接设备并确定它在哪个 tty 端口
- 使用“screen”命令打印来自鼓的数据
- 将屏幕命令中的数据输出到一些代码中,为我的项目生成有用的输出
我想我了解如何执行第 2 步和第 3 步,但我对第 1 步感到困惑。
如果我在终端运行“ioreg -Src IOUSBDevice”,我可以识别设备已连接,但我不知道它在哪个 tty 端口上。 (见下文输出)
此外,一般来说,是否可以从任何连接到 USB 端口的 USB 外围设备将数据打印为字节流?
编辑:我应该补充一点,如果我运行“ls /dev/tty.*”,我看不到任何 tty.usb 项目,只有 tty.bluetooth 的东西。
+-o Harmonix Drum Controller for Nintendo Wii@14200000 <class IOUSBDevice, id $
| {
| "sessionID" = 2111009401078
| "iManufacturer" = 1
| "bNumConfigurations" = 1
| "idProduct" = 5
| "bcdDevice" = 4096
| "Bus Power Available" = 250
| "bMaxPacketSize0" = 64
| "USB Product Name" = "Harmonix Drum Controller for Nintendo Wii"
| "iProduct" = 2
| "iSerialNumber" = 0
| "USB Address" = 4
| "bDeviceClass" = 0
| "locationID" = 337641472
| "bDeviceSubClass" = 0
| "IOUserClientClass" = "IOUSBDeviceUserClientV2"
| "PortNum" = 2
| "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBFamily.$
| "bDeviceProtocol" = 0
| "USB Vendor Name" = "Licensed by Nintendo of America "
| "Device Speed" = 1
| "idVendor" = 7085
| "Requested Power" = 50
| "IOGeneralInterest" = "IOCommand is not serializable"
| "Low Power Displayed" = No
| }
|
+-o IOUSBCompositeDriver <class IOUSBCompositeDriver, id 0x100000ebe, !regis$
+-o IOUSBInterface@0 <class IOUSBInterface, id 0x100000ebf, registered, matc$
+-o IOUSBHIDDriver <class IOUSBHIDDriver, id 0x100000ec2, registered, matc$
+-o IOHIDInterface <class IOHIDInterface, id 0x100000ec4, registered, ma$
+-o IOHIDLibUserClient <class IOHIDLibUserClient, id 0x100000ec5, !regis$
+-o IOHIDLibUserClient <class IOHIDLibUserClient, id 0x100000ec7, !regis$
到目前为止,
【问题讨论】:
-
在此期间您有没有找到一种方法来做到这一点?我也在拼命寻找这个。
标签: macos terminal usb driver device