Skip to content

Commit 9d11422

Browse files
dbg
1 parent 08f4e48 commit 9d11422

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

kernel/src/services/DeviceService.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export class DeviceService {
2626
// Try opening and closing the port to check if it's available
2727
try {
2828
await this.port.open({ baudRate: 115200 });
29+
await this.port.close();
2930
}
3031
catch (err) {
3132
if (err instanceof DOMException && err.name === 'InvalidStateError') {
@@ -34,14 +35,6 @@ export class DeviceService {
3435
}
3536
}
3637

37-
try{
38-
await this.port.close();
39-
}
40-
catch (err) {
41-
console.error('[checkPort]: Failed to close port:', err);
42-
return false;
43-
}
44-
4538
// If we reach here, the port is available
4639
console.log('[checkPort]: Port is available');
4740
return true;

0 commit comments

Comments
 (0)