Android的RS232通讯 [英] Android Rs232 Communication

查看:589
本文介绍了Android的RS232通讯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android的USB通讯新的,我想与RS232设备进行通信我的Andr​​oid手机。首先,我有一个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).

现在,我尝试沟通我的电脑,并使用这些电缆我的Andr​​oid手机。我的第一个问题是,这种方式正确,或者我应该使用另外一件事,如我的电脑的Andr​​oid手机之间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,我定义我的Andr​​oid手机的USB主机和我从我的电脑的RS232接口发送数据,但我从来没有在android手机得到任何数据。在这种sutiation,应我的Andr​​oid手机是一个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?

请注意:我的Andr​​oid手机是三星注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.

ADB命令

这篇关于Android的RS232通讯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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