We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08f4e48 commit 9d11422Copy full SHA for 9d11422
kernel/src/services/DeviceService.ts
@@ -26,6 +26,7 @@ export class DeviceService {
26
// Try opening and closing the port to check if it's available
27
try {
28
await this.port.open({ baudRate: 115200 });
29
+ await this.port.close();
30
}
31
catch (err) {
32
if (err instanceof DOMException && err.name === 'InvalidStateError') {
@@ -34,14 +35,6 @@ export class DeviceService {
34
35
36
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
-
45
// If we reach here, the port is available
46
console.log('[checkPort]: Port is available');
47
return true;
0 commit comments