我正在开发一个Android应用程序,需要与USB设备通信。 我尝试在我的应用程序中使用标准的Google API,但设备列表始终为空。
如果我使用Google API和USB设备信息,情况也是一样的。 Google API搜索到的设备列表为空。
lsusb的结果如下:
Bus 001 Device 001: ID 1d6b:0001
Bus 002 Device 001: ID 1d6b:0002
Bus 003 Device 001: ID 1d6b:0001
Bus 002 Device 002: ID 2226:0014
我的设备是2226:0014。
Eclipse的日志:
I/USB3G(92): event { 'add', '/devices/platform/sw-ehci.1/usb2/2-1', 'usb', '', 189, 133 }
I/USB3G(92): path : '/sys/devices/platform/sw-ehci.1/usb2/2-1'
I/USB3G(92): VID :size 5,vid_path '/sys/devices/platform/sw-ehci.1/usb2/2-1/idVendor',VID '2226
I/USB3G(92): '.
I/USB3G(92): PID :size 5,Pid_path '/sys/devices/platform/sw-ehci.1/usb2/2-1/idProduct',PID '0014
I/USB3G(92): '.
I/USB3G(92): cmd=/system/etc/usb_modeswitch.sh /system/etc/usb_modeswitch.d/2226_0014 &,
I/USB3G(92): excute ret : 0,err:No such file or directory
如果我插入像RS232适配器、蓝牙适配器这样的设备,没有任何反应,并且API和lsusb中也没有显示任何结果。该设备的协议基于ezusb库。 Android版本:4.0.3 内核版本:3.0.8 固件版本:crane_evb-eng 4.0.3 IMLK74k 20120330
是否有一种通过API访问隐藏USB设备的方法,或者我需要编写驱动程序并将其打补丁到固件中来支持此设备?
更新:即使我在system/etc/usb_modeswitch.d/中创建了名为2226_0014的信息文件,其中包含 。
DefaultVendor= 0x2226
DefaultProduct=0x0014
TargetVendor= 0x2226
TargetProductList="0014"
MessageEndpoint="0x00"
NeedResponse=1
CheckSuccess=20
我遇到了相同的错误:"没有这个文件或目录"。