@@ -200,21 +200,18 @@ class UsbCdcAcm extends Duplex {
200
200
this . out . transfer ( data , callback ) ;
201
201
}
202
202
203
-
204
203
_final ( ) {
205
204
debug ( '_final' ) ;
206
205
}
207
206
208
207
// _writev(){}
209
208
210
209
_destroy ( ) {
211
- debug ( '_destroy' ) ;
212
- // this._stopPolling();
213
-
210
+ debug ( '_destroy' ) ;
214
211
215
- // Close all resources, waiting for everything,
216
- // reattach kernel drivers if they were attached before,
217
- // then emit a 'close' event.
212
+ // Set line state as unused, close all resources, release interfaces
213
+ // (waiting until they are released), reattach kernel drivers if they
214
+ // were attached before, then emit a 'close' event.
218
215
219
216
this . _controlLineState ( false )
220
217
. then ( ( ) => {
@@ -244,16 +241,6 @@ class UsbCdcAcm extends Duplex {
244
241
} ) ;
245
242
} ) ;
246
243
247
- // util.promisify(this.ctr.removeAllListeners.bind(this))()
248
- // .then(util.promisify(this.in.removeAllListeners.bind(this)))
249
- // .then(util.promisify(this.out.removeAllListeners.bind(this)))
250
- // .then(util.promisify(this.ifaceCdc.release.bind(this)))
251
- // .then(util.promisify(this.ifaceData.release.bind(this)))
252
- // .then(()=>{
253
- // debug('All resources released');
254
- // this.emit('close');
255
- // });
256
-
257
244
}
258
245
259
246
@@ -280,7 +267,7 @@ class UsbCdcAcm extends Duplex {
280
267
const data = new Buffer ( [
281
268
0 , 0 , 0 , 0 , // Four bytes for the bitrate, will be filled in later.
282
269
0 , // Stop bits. 0 means "1 stop bit"
283
- 0 , // Parity. 0 meand "no parity
270
+ 0 , // Parity. 0 means "no parity"
284
271
8 // Number of data bits
285
272
] ) ;
286
273
0 commit comments