Data from USB ~ Serial Port

限于喜欢 提交于 2019-12-11 16:09:48

问题


I would like to transfer data from a USB Host (of my Laptop or Android Device) to Serial COM port (of a Desktop PC) through a USB - Serial port(DB-9) adapter.

Is there any library existed to do this task??

i have already studied and tried http://developer.android.com/guide/topics/connectivity/usb/host.html but failed.

Can i send data by a using a java program or Android App from my Laptop or Android Device ??

Can i receive data by an app in Desktop PC and show us????

If so please guide me how.


回答1:


Yes, this is possible, the implementation will depend on what device you pick.

Check out the usb-serial-for-android project for the communication from Android to the USB device. This has support for most major USB to UART Bridge devices such as a Silicon Labs, Prolific, FTDI and CDC Class devices.

You can talk to it as a serial device from your laptop computer using normal serial communications such as POSIX method for Linux or OSX or the Commuincations API for Windows.



来源:https://stackoverflow.com/questions/21955375/data-from-usb-serial-port

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