问题描述
我在Android的USB通讯新的,我想与RS232设备进行通信我的Android手机。首先,我有一个OTG线一个和USB转RS232转换器(型号:DIGITUS USB转串口适配器)。
I am new in USB communication in Android and I want to communicate my android phone with an rs232 device. Firstly , i have an OTG cable an and USB to RS232 converter (model : Digitus USB to serial adaptor).
现在,我尝试沟通我的电脑,并使用这些电缆我的Android手机。我的第一个问题是,这种方式正确,或者我应该使用另外一件事,如我的电脑的Android手机之间ardunio?
Now, i try to communicate my computer and my android phone using these cables. My first question is, Is that way correct or should i use another thing such as ardunio between android phone with my computer?
在我的code,我定义我的Android手机的USB主机和我从我的电脑的RS232接口发送数据,但我从来没有在android手机得到任何数据。在这种sutiation,应我的Android手机是一个USB主机设备,如怎么办?
In my code , i defined my android phone an usb host and i send data from my computer's rs232 port but i never get any data in android phone. In this sutiation ,should my android phone be an usb host device like i do?
请注意:我的Android手机是三星注2:
Note : My android phone is Samsung Note 2.
我知道,我的英文不好对不起this.If你不知道我可以写详细的问题。
I know, My english is not good sorry for this.If you don't understood the problem i can write detail.
推荐答案
您想您的注2与电脑连接?那么你为什么不与亚行做到这一点?
加入互联网的权限,您的应用程序,您的PC上激活端口转发,并创建一个TCP套接字。
You want to connect your Note 2 with your computer? So why dont you do this with adb?Add internet-permission to your app, activate port forwarding on your pc and create a tcp socket.
这篇关于Android的RS232通讯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!