Skip to content

Commit d2e3929

Browse files
Add binding for output callback
1 parent 98e91f2 commit d2e3929

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

kernel/src/kernel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class EmbeddedKernel extends BaseKernel {
4141

4242
outputResponse(msg: string): void {
4343
console.log("[Kernel] outputResponse - Streaming output:", msg);
44-
44+
4545
msg += '\n';
4646

4747
this.stream({
@@ -74,7 +74,7 @@ export class EmbeddedKernel extends BaseKernel {
7474
// Reconnect the device or connect for the first time
7575
this.outputResponse("Reconnect command detected, reconnecting device...");
7676
await this.serviceContainer.deviceService.disconnect();
77-
await this.serviceContainer.deviceService.connect(this.outputResponse);
77+
await this.serviceContainer.deviceService.connect(this.outputResponse.bind(this));
7878
}
7979

8080
try {

kernel/src/services/DeviceService.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class DeviceService {
7070
}
7171

7272
if (!this.portChecked) {
73-
logCallback('Port cannot be opened.\nIs the port already open in another application or tab?');
73+
logCallback('Port cannot be opened.\nDid you select the correct port?\nIs the port already open in another application or tab?');
7474
return;
7575
}
7676

@@ -92,6 +92,7 @@ export class DeviceService {
9292
throw err;
9393
}
9494

95+
logCallback('Connected!');
9596
const event = new CustomEvent("deviceConnected", {
9697
detail: { msg: "Connected" }
9798
});

0 commit comments

Comments
 (0)