File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1206,20 +1206,27 @@ class G2coreAPI extends EventEmitter {
1206
1206
1207
1207
for ( let i = 0 ; i < results . length ; i ++ ) {
1208
1208
let item = results [ i ] ;
1209
+ let x ;
1209
1210
1210
1211
if ( process . platform === 'win32' ) {
1211
1212
// Windows:
1212
1213
// pnpId: USB\VID_1D50&PID_606D&MI_00\6&3B3CEA53&0&0000
1213
1214
// pnpId: USB\VID_1D50&PID_606D&MI_02\6&3B3CEA53&0&0002
1215
+ // pnpId: USB\VID_1D50&PID_606D\0084-D639-0084-08C6
1214
1216
1215
1217
// WARNING -- explicit test against VIP/PID combo.
1216
- if ( ( x = item . pnpId . match ( / ^ U S B \\ V I D _ ( [ 0 - 9 A - F a - f ] + ) & P I D _ ( [ 0 - 9 A - F a - f ] + ) & M I _ ( [ 0 - 9 ] + ) \\ ( .* ) $ / ) ) && // eslint-disable-line
1218
+ if ( ( x = item . pnpId . match ( / ^ U S B \\ V I D _ ( [ 0 - 9 A - F a - f ] + ) & P I D _ ( [ 0 - 9 A - F a - f ] + ) (?: (?: & M I _ ( [ 0 - 9 ] + ) \\ ( .* ) ) | (?: \\ ( . * ) ) ) $ / ) ) && // eslint-disable-line
1217
1219
( x [ 1 ] == '1D50' ) && ( x [ 2 ] == '606D' )
1218
1220
) {
1221
+ let serialNumber ;
1219
1222
// let vendor = x[1]; // never used
1220
1223
// let pid = x[2]; // never used
1221
- let theRest = x [ 4 ] . split ( '&' ) ;
1222
- let serialNumber = theRest [ 1 ] ;
1224
+ if ( x [ 4 ] ) {
1225
+ let theRest = x [ 4 ] . split ( '&' ) ;
1226
+ serialNumber = theRest [ 1 ] ;
1227
+ } else {
1228
+ serialNumber = x [ 5 ] ;
1229
+ }
1223
1230
1224
1231
if (
1225
1232
( g2s . length > 0 ) &&
You can’t perform that action at this time.
0 commit comments