Android的4.0.3。 USB主机 - 通过controlTransfer发送数据 [英] Android 4.0.3. USB Host - sending data via controlTransfer

查看:2992
本文介绍了Android的4.0.3。 USB主机 - 通过controlTransfer发送数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Andr​​oid和刚开始使用Android 4.0.3工作。这使得USB主机连接。我试图通过USB发送一些信号,一个摄像头,让我们说这应该是该相机具有接收和例如一些字符开始录制。我想通过controlTransfer()来做到这一点,但我无法理解这种方法的逻辑的每个部分的意思。我查过很多论坛,却处处我看到它的人保持指的是它,好像它是显而易见的。
什么是请求ID,价值和指数?
或者,也许有一些其他的方法,我不知道这个问题。我知道肯定,你可以通过USB发出一个信号,从Linux终端到摄像头和Android有一个Linux内核,所以也许去将启动终端的方式,做Linux的方法是什么?
感谢您的任何提示:)

I am new to Android and just started working with Android 4.0.3. which enables USB Host connection. I'm trying to send some signal via USB to a camera, let's say it is supposed to be some characters that the camera has to receive and e.g. start recording. I wanted to do it via controlTransfer(), but I am unable to understand what each part of the logic of this method means. I've checked many fora, but everywhere I see it people keep refering to it as if it was obvious. What is the request ID, value and index? Or maybe there is some other approach to the problem that I don't know. I know for sure that you can send a signal via USB from Linux terminal to that camera and as android has a linux kernel so maybe the way to go would be to start a terminal and do it the Linux way? Thanks for any tips :)

推荐答案

controlTransfer()拟通过控制端点(端点0)发送命令。请求ID,索引和值以及USB协议的一部分。请参考 http://www.beyondlogic.org/usbnutshell/usb6.shtml#SetupPacket 了解更多信息。

controlTransfer() intended to send commands via control endpoint (endpoint 0). Request ID, index and value and part of USB protocol. Please refer to http://www.beyondlogic.org/usbnutshell/usb6.shtml#SetupPacket for more information.

你有协议说明你的相机?
我想,你需要使用另一个端点(如摄像头协议所述)字符发送到一个摄像头。

Do you has protocol description for your camera? I suppose, you need to use other endpoint (as described in camera protocol) to send characters to a camera.

这篇关于Android的4.0.3。 USB主机 - 通过controlTransfer发送数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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