@@ -3,18 +3,12 @@ import { Duplex } from 'stream';
3
3
import Debug from 'debug' ;
4
4
import usb from 'usb' ;
5
5
import splitDescriptors from './split-descriptors' ;
6
- // const Duplex = require('stream').Duplex;
7
- // const Debug = require('debug');
8
- // const usb = require('usb');
9
- // const util = require('util');
10
6
11
7
// Two debug levels: one for initialization/teardown messages, and one
12
8
// for logging all data being sent/recv around
13
9
const debugInfo = Debug ( 'usb-cdc-acm:info' ) ;
14
10
const debugData = Debug ( 'usb-cdc-acm:data' ) ;
15
11
16
- // const splitDescriptors = require('./split-descriptors');
17
-
18
12
19
13
// Utility function.
20
14
// Given an interface, assert that it looks like a CDC management interface
@@ -241,7 +235,7 @@ export default class UsbCdcAcm extends Duplex {
241
235
0x22 , // SET_CONTROL_LINE_STATE
242
236
active ? 0x03 : 0x00 , // 0x02 "Activate carrier" & 0x01 "DTE is present"
243
237
this . ifaceCdc . id , // interface index
244
- Buffer . from ( [ ] ) // No data expected back
238
+ Buffer . from ( [ ] ) , // No data expected back
245
239
) ;
246
240
}
247
241
@@ -266,7 +260,7 @@ export default class UsbCdcAcm extends Duplex {
266
260
0x20 , // SET_LINE_CODING
267
261
0x00 , // Always zero
268
262
this . ifaceCdc . id , // interface index
269
- data
263
+ data ,
270
264
) ;
271
265
}
272
266
@@ -324,7 +318,7 @@ export default class UsbCdcAcm extends Duplex {
324
318
wValue ,
325
319
wIndex ,
326
320
dataOrLength ,
327
- ( ( err , data ) => ( err ? rej ( err ) : res ( data ) ) )
321
+ ( ( err , data ) => ( err ? rej ( err ) : res ( data ) ) ) ,
328
322
) ;
329
323
} ) ;
330
324
}
0 commit comments