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 ccb4d29 commit a9ade06Copy full SHA for a9ade06
kernel/src/services/DeviceService.ts
@@ -8,7 +8,16 @@ export class DeviceService {
8
private deviceType: string = '';
9
private decoder: TextDecoder = new TextDecoder();
10
11
- constructor() {}
+ constructor() {
12
+ // Contiuously check the port status every 2 seconds to update the connection status/card
13
+ setInterval(() => {
14
+ if (this.port && !this.port.readable && !this.port.writable) {
15
+ console.log('[DeviceService]: Port is not readable or writable, disconnecting...');
16
+ this.disconnect();
17
+ }
18
+ }, 2000);
19
+
20
21
22
// Check if port is available (return true if available)
23
// Don't run if we are already connected from within this tab
0 commit comments