Transfer error when trying to use WebUSB

611 views
Skip to first unread message

Filipe Rodrigues

unread,
Jan 28, 2018, 5:42:31 PM1/28/18
to Chromium-dev
Hello,

I tried to use WebUsb to do a bulkTransfer to a USB Device (CCID Smartcard) but the transfer fails with an error

Here is all the information that I have:

 - When using usbmon with Wireshark, the USB packets are sent to a wrong interface (numbered 0xffff)
 - Chrome device log (chrome://device-log/) shows the following message : "Low-level transfer error: Value too large for defined data type (75)"
 
My code is:


        <script>
       
var device;

       
var startListening = function() {
          console
.log('Listening ...');
          navigator
.usb.requestDevice({ filters: [{ 'vendorId': 0x03eb, 'productId': 0x206D }] })
         
.then(selectedDevice => {
             device
= selectedDevice;
             console
.log('Opening device');
             
return device.open(); // Begin a session.
           
})
         
.then(() => device.selectConfiguration(1)) // Select configuration #1 for the device.
         
.then(() => device.claimInterface(0)) // Request exclusive control over interface #0.
         
.then(() => console.log('interfaces:', device.configuration.interfaces))
         
.then(() => device.transferOut(0x01, new Uint8Array([0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00])))
         
.then(() => device.transferIn(0x02, 2))
         
.then(result => {
            let decoder
= new TextDecoder();
            console
.log('Received: ' + decoder.decode(result.data));
         
})
         
.catch(error => { console.log(error); });
       
};



        window
.onload = function(e){
            console
.log("window.onload")
           
var button = document.getElementById('request-device');
             button
.addEventListener('click', startListening);
       
}
       
</script>

Are we missing a CCID class driver?

Thanks,

Filipe
Reply all
Reply to author
Forward
0 new messages