UsbConnection.bulkTransfer returns “-1”. What does it mean?

て烟熏妆下的殇ゞ 提交于 2019-12-05 17:17:27

Well, after diving into log i was able to handle it - don't close/open usb few times in a row

From the documentation for bulkTransfer():

Returns

length of data transferred (or zero) for success, or negative value for failure

So if you're getting -1, then it means your data transfer has failed. You could look into the logcat, or work with breakpoints to figure out why.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!