I'm sending an out bulk transfer, and I stall it in the device (I write the code on both end of the cable) to abort the action. I'm sending a home-made control transfert SET_FEATURE ENDPOINT_HALT to the endpoint and when the abort is complete, I follow up with a CLEAR_FEATURE ENDPOINT_HALT to recover the endpoint and use it again. In the embedded debugger I can confirm it has been cleared in the device. But in the browser, any subsequent transfer on the endpoint will end up with the very unhelpful "Transfer failed" message (code 1).
if (errorCode == 4) {
var ENDPOINT_HALT = 0;
var CLEAR_FEATURE = 0x01;
controlTransfer(currentDevice, {direction: 'out', recipient: 'endpoint', requestType: 'standard',
request: CLEAR_FEATURE, value: ENDPOINT_HALT, index: 1, data: new ArrayBuffer(0)}, genericErrorFilter());
}
From what I found on the Internet, libusb has a special function for clearing a stall on the host side, to tell the kernel that the endpoint has been recovered, and it should reflect that in its internal structures. This function is not exposed in chrome.usb.
Is there a way to recover from a stall in Chrome? Or is there an alternative recoverable way from the device to stop an ongoing out bulk transfer?
I'm using Mac OS X and Chrome Canary.
You can try a interruptTransfer on your catched stall message
chrome.experimental.usb.interruptTransfer(integer device,
string direction,
integer endpoint,
string data,
function callback)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With