Mac OS analog to /dev/ttyUSBxx

 ̄綄美尐妖づ 提交于 2019-12-13 11:39:41

问题


I used to linux USB port naming, aka /dev/ttyUSBxx and currently trying to write some test software to read/wrtie raw data to USB ports on iMac, but i find it hard to detect to which port my usb hardware is connected. I have tried up to a using /dev/ttys"x" but no luck.

In the system information i see the hardware attached at Location ID: 0xfa120000 / 6 maybe this can help somehow?


回答1:


OS X doesn't create a /dev entry for raw access to USB devices, and there's no way to access them as TTY devices.

Partly this is a different in philosophy between Linux and BSD, partly it's a difference in driver-writing technology, and partly it's a matter of already having a well-defined hierarchy (the IOKit Registry) that would have to be mapped to the /dev hierarchy in some complicated way.

At any rate, if you want to learn how you should access USB devices on a Mac, start with QA1370. If you're looking to do a quick port of some linux code without actually learning IOKit/IOUSB, it's probably going to be impossible. If you're looking for something else, you'll need to give more info about what you're trying to do.




回答2:


I have a SheevaPlug that acts as a USB serial device and that appears as /dev/tty.usbserial-XXXX.




回答3:


If your USB device has an FTDI chip internally, installing VCP drivers from FTDI might help.



来源:https://stackoverflow.com/questions/11784248/mac-os-analog-to-dev-ttyusbxx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!