File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ const BUFFER_R01 = Buffer.from("R\x01");
35
35
const BUFFER_01 = Buffer . from ( "\x01" ) ;
36
36
const BUFFER_03 = Buffer . from ( "\x03" ) ;
37
37
const BUFFER_04 = Buffer . from ( "\x04" ) ;
38
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
39
38
const BUFFER_CR = Buffer . from ( "\r" ) ;
40
39
const BUFFER_TAB = Buffer . from ( "\t" ) ;
41
40
@@ -515,7 +514,10 @@ export async function executeCommandWithResult(
515
514
// call exe without result and then call follow
516
515
await executeCommandWithoutResult ( port , command ) ;
517
516
518
- return follow ( port , timeout , receiver ) ;
517
+ // needs to be awaited here, otherwise it will
518
+ // return the promisse which will run the final block
519
+ // of this try catch as the promisse is awaited somewhere else
520
+ return await follow ( port , timeout , receiver ) ;
519
521
} catch {
520
522
if ( interrupted ) {
521
523
return { data : "" , error : "Interrupted" } ;
Original file line number Diff line number Diff line change @@ -342,6 +342,10 @@ async function handleCommand(command: string): Promise<void> {
342
342
if ( open ) {
343
343
relayInput = true ;
344
344
rl . resume ( ) ;
345
+ // for testing of interrupts
346
+ setTimeout ( ( ) => {
347
+ serialCom . interruptExecution ( ) ;
348
+ } , 5000 ) ;
345
349
}
346
350
} ,
347
351
( data : Buffer ) => {
You can’t perform that action at this time.
0 commit comments