android usb requestWait not return

后端 未结 2 1959
轮回少年
轮回少年 2021-02-14 04:28
ByteBuffer byteBuffer = ByteBuffer.allocate(9);;    
UsbRequest request = new UsbRequest();
request.initialize(mConnection,mEndpointIntr);
boolean b = request.queue(byte         


        
2条回答
  •  梦谈多话
    2021-02-14 05:18

    The requestWait() in your code will wait for the result of the request.queue(byteBuffer, 9)

    Here are some possible reasons why it is not returning:

    1. Your request queue is on a different endpoint than what your USB device is actually sending data on. Double check that you are listening on the correct interface and endpoint.

    2. On the USB device firmware side, do not create your interrupt endpoint on common interface class such as HID. Create a new vendor specific interface, otherwise kernel may get hold of the interface if it is HID and request queue may fail, this is what happened to me.

提交回复
热议问题