Skip to content

Commit 3f0cf12

Browse files
Debug to see if we can detect a special command in the input
1 parent 6bf6b6a commit 3f0cf12

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

kernel/src/services/DeviceService.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Transport } from 'esptool-js';
22

3+
const reconnectString: string = "%connect%"
4+
35
export class DeviceService {
46
private port: SerialPort | null = null;
57
private transport: Transport | null = null;
@@ -136,6 +138,14 @@ export class DeviceService {
136138

137139
await writer.write(ctrl_e);
138140
await writer.write(new_line);
141+
142+
if (code.includes(reconnectString)) {
143+
// Reconnect the device or connect for the first time
144+
145+
console.log('Reconnect command detected, reconnecting device...');
146+
147+
}
148+
139149

140150
const data = encoder.encode(code + "######START REQUEST######");
141151
await writer.write(data);

0 commit comments

Comments
 (0)