Skip to content

Commit de22563

Browse files
Force requestPort every connect. Try to stream results on connect.
1 parent d2cbf43 commit de22563

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

kernel/src/kernel.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ export class EmbeddedKernel extends BaseKernel {
5757

5858
console.log("[Kernel] executeRequest - Processing code");
5959
const { code } = content;
60-
console.log("GOT CODE AT KERNEL LEVEL: ", code);
61-
console.log("Type of CODE AT KERNEL LEVEL: ", typeof code);
6260

6361
console.log('Before reconnect check');
6462
if (code.includes(reconnectString)) {
@@ -68,7 +66,9 @@ export class EmbeddedKernel extends BaseKernel {
6866
console.log('Device disconnected');
6967
await this.serviceContainer.deviceService.connect();
7068
console.log('Device connected');
69+
this.stream("Device Connected!")
7170
}
71+
this.stream("Device Try Connect Done!")
7272
console.log('After reconnect check');
7373

7474
try {
@@ -86,6 +86,8 @@ export class EmbeddedKernel extends BaseKernel {
8686
};
8787
}
8888

89+
90+
8991
console.log("[Kernel] executeRequest - Executing command via ConsoleService");
9092
// Execute the command and handle the output
9193
const result = await this.serviceContainer.consoleService.executeCommand(code, (content) => {

kernel/src/services/DeviceService.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ export class DeviceService {
2121
}
2222

2323
async connect(): Promise<void> {
24-
if (!this.port) {
25-
await this.requestPort();
26-
}
24+
await this.requestPort();
2725

2826
if (!this.port) {
2927
throw new Error('No port selected');

0 commit comments

Comments
 (0)