thegecko / webusb

Node.js implementation of the WebUSB Specification
https://thegecko.github.io/webusb/
MIT License
183 stars 27 forks source link

Map LIBUSB_TRANSFER_OVERFLOW to "babble" status #41

Closed sandeepmistry closed 5 years ago

sandeepmistry commented 5 years ago

Similar to #37, but resolves LIBUSB_TRANSFER_OVERFLOW errors in controlTransferIn and transferIn to status "babble".

I've also updated the read me to remove the statement always returnsstatus"ok" as now "stalled" (#37) and "babble" are returned.

thegecko commented 5 years ago

Thanks @sandeepmistry, this resolves #3

Should the babble check also be added to controlTransferOut and transferOut?

sandeepmistry commented 5 years ago

Should the babble check also be added to controlTransferOut and transferOut?

I'm not too sure about this, I was able to trigger the LIBUSB_TRANSFER_OVERFLOW error on controlTransferIn and transferIn with a FTDI FT232H when using a transfer length of less than 512 (the endpoint packet size).

Just tried a transferOut with a buffer of 513 bytes in length of 513, and a result of USBOutTransferResult {bytesWritten: 513, status: "ok"} was returned in the browser, this maps to the current Node WebUSB result.

Would you mind removing the // hack comments next to the status: ok returns?

Done :)

thegecko commented 5 years ago

Great, thanks!

I think your checks show we shouldn't worry about babble on the out's. I'm merging this.