简体   繁体   English

Android应用程序通过USB电缆的数据引脚发送信号

[英]android app to send a signal through the data pin of the usb cable

I need to send a signal (basically some current) via my android phone through the usb data pin. 我需要通过USB数据引脚通过我的Android手机发送信号(基本上是一些电流)。 Is there any way to do this. 有什么办法可以做到这一点。 I have the basic knowledge of app development and am ready to create my own app. 我具有应用程序开发的基本知识,并准备创建自己的应用程序。 Any help would be appreciated :) 任何帮助,将不胜感激 :)

Unlike some older port designs (serial and parallel ports), USB does not provide for any arbitrary electrical control. 与某些较旧的端口设计(串行和并行端口)不同,USB不提供任何任意的电气控制。 Every pin serves a specific function in the USB protocol and cannot be arbitrarily set. 每个引脚都具有USB协议中的特定功能,不能任意设置。

Some devices may have support for switching to an alternate non-USB mode, but nearly all such modes will similarly not allow for direct control. 某些设备可能支持切换到备用非USB模式,但是几乎所有此类模式都将类似地不允许直接控制。

If your Android phone supports USB host mode, then you could connect a USB-serial (RS232) adapter. 如果您的Android手机支持USB主机模式,则可以连接USB串行(RS232)适配器。 This has two control pins that can be set arbitrarily, RTS and DTR, as well as the actual serial data line. 它具有两个可以任意设置的控制引脚RTS和DTR,以及实际的串行数据线。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM