我是靠谱客的博主 幽默茉莉,最近开发中收集的这篇文章主要介绍android usb bulktransfer,usb otg应用程序挂起在bulktransfer调用上,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

我正在尝试调试一个Android应用程序,它正在处理通过USB OTG连接的设备-该应用程序的名称是OTG磁盘资源管理器Pro 3.02。

我正在智能手机上调试它,没有根访问权限,但我能够将调试消息重定向到文件中。所以我有日志。问题是应用程序在日志中不时挂起以下内容:

2019-01-31 07:58:11 :: Download :: Download Start

2019-01-31 07:58:11 :: Download :: Thread Start

2019-01-31 07:58:11 :: ODE :: >==< Download Start!!! >==<

2019-01-31 07:58:11 :: Download :: Download Start:smth.mp3

2019-01-31 07:58:11 :: Download :: CopyFileToUSB Start:smth.mp3

2019-01-31 07:58:11 :: ODE :: >==< PATH:/storage/emulated/0/ADM/smth.mp3 >==<

2019-01-31 07:58:11 :: ODE :: >==< get file entry >==<

2019-01-31 07:58:11 :: Download :: File is Local:smth.mp3

2019-01-31 07:58:11 :: ODE :: >==< get file ok, length= 12130124 >==<

2019-01-31 07:58:13 :: FTDI_USB :: >==< Data Read:55 53 42 53 28 03 00 00 00 00 00 00 00 >==<

2019-01-31 07:58:23 :: FTDI_USB :: >==< Data Read:55 53 42 53 2a 03 00 00 00 00 00 00 00 >==<

2019-01-31 07:58:24 :: FTDI_USB :: >==< [Send CBW Fail] 55 53 42 43 2d 03 00 00 00 40 00 00 00 00 0a 2a 00 00 44 00 10 00 00 10 00 00 00 00 00 00 00 get return bytes:-1 >==<

2019-01-31 07:58:24 :: FTDI_USB :: >==< Data Read:55 53 42 53 2a 03 00 00 00 00 00 00 00 >==<

2019-01-31 07:58:25 :: FTDI_USB :: >==< [Send CBW Fail] 55 53 42 43 2e 03 00 00 00 40 00 00 00 00 0a 2a 00 00 44 00 20 00 00 10 00 00 00 00 00 00 00 get return bytes:-1 >==<

2019-01-31 07:58:25 :: FTDI_USB :: >==< Data Read:55 53 42 53 2a 03 00 00 00 00 00 00 00 >==<

2019-01-31 07:58:25 :: FTDI_USB :: >==< [Send CBW Fail] 55 53 42 43 2f 03 00 00 00 40 00 00 00 00 0a 2a 00 00 44 00 30 00 00 10 00 00 00 00 00 00 00 get return bytes:-1 >==<

2019-01-31 07:58:25 :: FTDI_USB :: >==< Data Read:55 53 42 53 2a 03 00 00 00 00 00 00 00 >==<

2019-01-31 07:58:26 :: FTDI_USB :: >==< [Send CBW Fail] 55 53 42 43 30 03 00 00 00 40 00 00 00 00 0a 2a 00 00 44 00 40 00 00 10 00 00 00 00 00 00 00 get return bytes:-1 >==<

2019-01-31 07:58:26 :: FTDI_USB :: >==< Data Read:55 53 42 53 2a 03 00 00 00 00 00 00 00 >==<

2019-01-31 07:58:27 :: FTDI_USB :: >==< [Send CBW Fail] 55 53 42 43 31 03 00 00 00 40 00 00 00 00 0a 2a 00 00 44 00 50 00 00 10 00 00 00 00 00 00 00 get return bytes:-1 >==<

2019-01-31 07:58:27 :: FTDI_USB :: >==< Data Read:55 53 42 53 2a 03 00 00 00 00 00 00 00 >==<

2019-01-31 07:58:28 :: FTDI_USB :: >==< [Send CBW Fail] 55 53 42 43 32 03 00 00 00 40 00 00 00 00 0a 2a 00 00 44 00 60 00 00 10 00 00 00 00 00 00 00 get return bytes:-1 >==<

2019-01-31 07:58:28 :: FTDI_USB :: >==< Data Read:55 53 42 53 2a 03 00 00 00 00 00 00 00 >==<

2019-01-31 07:58:29 :: FTDI_USB :: >==< [Send CBW Fail] 55 53 42 43 33 03 00 00 00 40 00 00 00 00 0a 2a 00 00 44 00 70 00 00 10 00 00 00 00 00 00 00 get return bytes:-1 >==<

可以看到,“发送CBW失败”只是重复。

下面是与此相关联的反编译java代码:

private synchronized void m3393d() { ByteBuffer byteBuffer = this.f1928i;

int i = this.f1941v;

this.f1941v = i + 1;

byteBuffer.putInt(4, i);

int length = this.f1928i.array().length;

i = this.f1922c.bulkTransfer(this.f1927h, this.f1928i.array(), length, 800);

if (i != length) {

m3390a("[Send CBW Fail] " + m3388a(this.f1928i.array()) + " get return bytes:" + i);

throw new aq("Send Command Failed", -1);

}

}

此外,日志中的设备信息:

2019-01-31 07:55:44 :: ODE :: >==< USB Attached! >==<

2019-01-31 07:55:45 :: ODE :: >==< enumerating >==<

2019-01-31 07:55:45 :: ODE :: >==< Found device: 0781:74E8 Class 00:00 >==<

2019-01-31 07:55:45 :: ODE :: >==< Device under: /dev/bus/usb/001/007 >==<

2019-01-31 07:55:45 :: ODE :: >==< No permission >==<

2019-01-31 07:55:45 :: ODE :: >==< no more devices found >==<

2019-01-31 07:55:52 :: ODE :: >==< Permission granted >==<

2019-01-31 07:55:52 :: ODE :: >==< Premission:true >==<

2019-01-31 07:55:52 :: ODE :: >==< Interface Count: 1 >==<

2019-01-31 07:55:52 :: ODE :: >==< connecting... >==<

2019-01-31 07:55:52 :: ODE :: >==< Got interface! >==<

2019-01-31 07:55:52 :: ODE :: >==< Claimed interface! >==<

2019-01-31 07:55:52 :: ODE :: >==< Class: 0x08 >==<

2019-01-31 07:55:52 :: ODE :: >==< Sub Class: 0x05 >==<

2019-01-31 07:55:52 :: ODE :: >==< Protocol: 0x50 >==<

2019-01-31 07:55:52 :: ODE :: >==< EP: 0x81 >==<

2019-01-31 07:55:52 :: ODE :: >==< Bulk Endpoint >==<

2019-01-31 07:55:52 :: ODE :: >==< [IN] >==<

2019-01-31 07:55:52 :: ODE :: >==< EP: 0x02 >==<

2019-01-31 07:55:52 :: ODE :: >==< Bulk Endpoint >==<

2019-01-31 07:55:52 :: ODE :: >==< [OUT] >==<

2019-01-31 07:55:52 :: ODE :: >==< USBInterface#0 >==<

2019-01-31 07:55:52 :: FTDI_USB :: >==< readcapacity >==<

2019-01-31 07:55:52 :: FTDI_USB :: >==< Capacity Result:00 fc cf ff 00 00 04 00 >==<

2019-01-31 07:55:52 :: FTDI_USB :: >==< Sectors, Sector Size:16568319, 1024 >==<

2019-01-31 07:55:52 :: ODE :: >==< Sectorsize:1024 >==<

那么问题是什么呢?

最后

以上就是幽默茉莉为你收集整理的android usb bulktransfer,usb otg应用程序挂起在bulktransfer调用上的全部内容,希望文章能够帮你解决android usb bulktransfer,usb otg应用程序挂起在bulktransfer调用上所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(73)

评论列表共有 0 条评论

立即
投稿
返回
顶部