@@ -42,18 +42,15 @@ export class UsbApi extends AbstractApi {
42
42
}
43
43
44
44
this . usbInterface . onconnect = event => {
45
- this . devices = [ ...this . devices , ...this . createDevices ( [ event . device ] ) ] ;
45
+ const [ _hidDevices , nonHidDevices ] = this . filterDevices ( [ event . device ] ) ;
46
+ this . devices = [ ...this . devices , ...this . createDevices ( nonHidDevices ) ] ;
46
47
this . emit ( 'transport-interface-change' , this . devicesToDescriptors ( ) ) ;
47
48
} ;
48
49
49
50
this . usbInterface . ondisconnect = event => {
50
51
const { device } = event ;
51
52
if ( ! device . serialNumber ) {
52
- // this should never happen, if it does, it means, that there is something that passes
53
- // filters (TREZOR_USB_DESCRIPTORS) but does not have serial number. this could indicate error in fw
54
- this . emit ( 'transport-interface-error' , ERRORS . DEVICE_UNREADABLE ) ;
55
- this . logger . error ( 'device does not have serial number' ) ;
56
-
53
+ // trezor devices have serial number 468E58AE386B5D2EA8C572A2 or 000000000000000000000000 (for bootloader devices)
57
54
return ;
58
55
}
59
56
@@ -97,7 +94,6 @@ export class UsbApi extends AbstractApi {
97
94
try {
98
95
const devices = await this . usbInterface . getDevices ( ) ;
99
96
const [ hidDevices , nonHidDevices ] = this . filterDevices ( devices ) ;
100
-
101
97
if ( hidDevices . length ) {
102
98
// hidDevices that do not support webusb. these are very very old. we used to emit unreadable
103
99
// device for these but I am not sure if it is still worth the effort.
0 commit comments