Issue metadata
Sign in to add a comment
|
FR: Cancellation of USB transfers |
||||||||||||||||||||||||
Issue descriptionCurrently, there is no way in the chrome.usb API to cancel the submitted transfers. However, this operation is supported by the somewhat popular libusb library (and probably by other libraries too), and the existing software implementation often relies on this functionality - especially for input transfers with a timeout. This means that when porting this software, the cancellation operation has to be somehow emulated. White it's doable (for example, by organizing a pool of queues of received data for each endpoint plus other important fields that form up the "destination" key), the correct implementation of this feature on the app side is quite challenging. It would be great if the chrome.usb API would provide this functionality out of the box instead.
,
Aug 26 2016
There's a lot of plumbing that will need to be put in place for this to work. We need to assign some sort of ID to pending transfers so that API clients can refer to them later to cancel them and make that available through the whole stack. I'd love to use cancellable Promises in WebUSB and will probably wait for those to be available before implementing this in the WebUSB spec. For Chrome Apps we will likely implement some sort of chrome.usb.cancelTransfer() function and the question is simply where and how to communicate the ID to the application. It may actually be better for the app to provide us with an optional ID parameter just because of the way that extensibility in Chrome Extensions APIs works.
,
Aug 29 2016
> For Chrome Apps we will likely implement some sort of > chrome.usb.cancelTransfer() function and the question is simply where > and how to communicate the ID to the application. It may actually be > better for the app to provide us with an optional ID parameter just > because of the way that extensibility in Chrome Extensions APIs works. SGTM. A different approach would be to return some proxy object from the chrome.usb.*Transfer functions, that has a "cancel" method. But I'm not sure that this is supported by the Chrome Extension APIa framework (as the suggested solution is basically a combination of both synchronous and asynchronous result returning).
,
Jun 7 2017
|
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by emaxx@chromium.org
, Aug 25 2016