相关疑难解决方法(0)

在android中使用串口RS-232?

我想在Android设备上使用JavaComm API类通过串口发送信号,这就是我想象的方式:

1- Android设备将是:Archos 3.2,它具有Android 2.2和USB主机模式.

2-包括我的Android应用程序的RxTx lib包.并使用Android NDK包含RxTx本机代码.

3-一根短电缆,即usb - > serial.

你能解释一下我可能遇到的问题吗?

java embedded android serial-port communication

18
推荐指数
1
解决办法
6万
查看次数

getDeviceList() 始终为空

我正在尝试将 Arduino 板与我的 Odys Neo x8 平板电脑一起使用,但似乎 UsbManager 无法识别该设备。我通过 OTG 适配器将 arduino 连接到平板电脑,以便平板电脑在主机模式下工作,Arduino 成功从设备接收电源。我正在获取平板电脑上可用 USB 设备的列表,如下所示:

sUsbController = new UsbController(this, mConnectionHandler, 0, 0);
        HashMap<String, UsbDevice> devlist = sUsbController.mUsbManager.getDeviceList();
        TextView t = ((TextView)findViewById(R.id.textView));
        t.setText("Found " + Integer.toString(devlist.size()) + " devices");
Run Code Online (Sandbox Code Playgroud)

在类 UsbController 中:

mUsbManager = (UsbManager) mApplicationContext
            .getSystemService(Context.USB_SERVICE);
Run Code Online (Sandbox Code Playgroud)

但不幸的是,即使我开始使用 VID 和 PID(两个零)进行过滤,该列表仍然是空的。对于如何解决这个问题,有任何的建议吗?

usb android arduino device

5
推荐指数
1
解决办法
5048
查看次数

标签 统计

android ×2

arduino ×1

communication ×1

device ×1

embedded ×1

java ×1

serial-port ×1

usb ×1