安卓4.0.3。 USB主机 - 用相机通信 [英] Android 4.0.3. USB Host - communication with a camera

查看:116
本文介绍了安卓4.0.3。 USB主机 - 用相机通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一个应用程序,应该是一个远程控制摄像机。为了做到这一点,我需要它来除preT我通过USB传送,就好像我在身体上推的按钮信号。到目前为止,还没有成功。

I am making an app that is supposed to be a remote control for a camera. In order to do this, I need it to interpret the signals I am sending via USB as if I was physically pushing the buttons. So far, no success.

我注意到,当我插上数据线,相机会自动切换到文件传输模式,并作为大容量存储设备。据我所知,相机无法拍摄或当连接到相机,所以我猜这个问题使照片是我必须做出相机不能切换到该模式 - 任何想法我怎么能做到这一点。

I've noticed that when I plug in the cable, camera automatically switches to "file transfer mode" and acts as a mass storage device. To my knowledge cameras cannot film or make photos when connected to the camera so I'm guessing the problem is that I have to make the camera not switch to that mode - any idea how can I do this.

我检查是否可能有一些设备具有不同的接口,但它只能充当一个大容量存储设备。我想通过bulkTransfer发送信号。

I've checked if maybe there are different interfaces that the device has but it can only act as a mass storage device. I am trying to send a signal via bulkTransfer.

我知道,当连接到电脑上,例如在发送如记录等命令是可能的使用Linux下C程序 - 只需要一个简单的写()命令与第一选择正确的描述如FD =打开(的/ dev / ttyUSB0,O_RDWR)。

I know that sending commands such as record etc. is possible when connected to a computer, e.g. using a C program under linux - it only needs a simple write() command with first choosing the right descriptor e.g. fd=open ( " / dev / ttyUSB0 " , O_RDWR).

有谁知道我怎么能得到类似的功能与Android?

Does anyone know how can I get similar functionality with Android?

推荐答案

感觉愚蠢的回答我的问题,但我没有找到一个方法来解决我的问题。当涉及到海量存储功能 - 这实际上是一个选项,在拍照,我有工作的设置菜单中进行选择(我不知道它是如何与其他相机)。当此得到了解决,我还是原来的bulkTransfer()的一个问题 - 我知道我必须通过bulkTransfer()送2个字符的信号,但是当我把它的摄像头没有回应。事实证明,我不得不把它单独转让每次发送。因此,它实际上是两个单字符的批量传输。我不知道为什么它发挥了作用,但它没有,现在我可以通过USB接口来控制我的相机所有的菜单。

It feels stupid to answer my own question, but I did find a way to solve my problem. When it comes to the mass storage functionality - it was actually an option to choose in the setup menu of the camera I am working with (I don't know how it is with other cameras). When this got solved, I still had a problem with the bulkTransfer() - I knew I had to send 2-character signal via bulkTransfer(), but when I sent it the camera did not respond. As it turned out, I had to send it in separate transfer each. So it was in fact two one-character bulk transfers. I don't know why it made a difference, but it did and now I am able to control all the menu of my camera via USB.

这篇关于安卓4.0.3。 USB主机 - 用相机通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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