[英]Android Tablet can't find USB device via USB port but can via OTG cable
I have an Android tablet which has a mini-USB port and a USB port, and I want to write an app communicate with a USB key. 我有一个Android平板电脑,它有一个迷你USB端口和一个USB端口,我想写一个应用程序与USB密钥通信。 I have written a demo to find out the USB key, but there is no response. 我写了一个演示来找出USB密钥,但是没有回复。
What disturbs me is that if I run this demo on my another tablet which only has a mini-USB port but support USB OTG, it can find the key via an OTG cable. 令我不安的是,如果我在另一台只有迷你USB端口但支持USB OTG的平板电脑上运行此演示,它可以通过OTG电缆找到密钥。 When I insert the USB key into the USB port, there is no response. 当我将USB密钥插入USB端口时,没有响应。 I want to know what the difference is. 我想知道区别是什么。
Can't I use the USB Host API to find the key in USB port? 我不能使用USB Host API在USB端口中找到密钥吗? And what's the difference between communication with USB device in the mini-USB port via OTG cable and in the USB port directly? 通过OTG电缆和USB端口直接与迷你USB端口中的USB设备通信有什么区别?
Well OTG cables have certain pins shorted out inorder to tell the device that it should switch to USB Host Mode (the tablet provides the power). 好的OTG电缆有一些引脚短路,以告诉设备它应该切换到USB主机模式(平板电脑提供电源)。 The USB port may be OTG capable but only if you have the OTG cable. USB端口可能支持OTG,但仅限于您使用OTG电缆。 Typically the USB ports on tablets are set up as accessory ports, meaning that they draw power, not provide it. 通常,平板电脑上的USB端口设置为附件端口,这意味着它们会提供电源,而不是提供电源。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.