You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this.messageService.info(`Disconnected ${Board.toString(board,{useFqbn: false})} from ${Port.toString(port)}.`);
82
+
this.messageService.info(`Disconnected ${Board.toString(board,{useFqbn: false})} from ${Port.toString(port)}.`,options);
77
83
break;
78
84
}
79
85
caseundefined: {
80
-
const{ board, port }=config;
81
-
this.messageService.error(`Unexpected error. Reconnecting ${Board.toString(board)} on port ${Port.toString(port)}.`);
86
+
this.messageService.error(`Unexpected error. Reconnecting ${Board.toString(board)} on port ${Port.toString(port)}.`,options);
82
87
console.error(JSON.stringify(error));
83
-
shouldReconnect=this.connected;
88
+
shouldReconnect=this.connected&&this.autoConnect;
89
+
break;
84
90
}
85
91
}
86
92
constoldState=this.state;
87
93
this.state=undefined;
88
94
this.onConnectionChangedEmitter.fire(this.state);
89
95
if(shouldReconnect){
90
-
awaitthis.connect(oldState.config);
96
+
if(this.monitorErrors.length>=10){
97
+
this.messageService.warn(`Failed to reconnect ${Board.toString(board,{useFqbn: false})} to the the serial-monitor after 10 consecutive attempts. The ${Port.toString(port)} serial port is busy. after 10 consecutive attempts.`);
98
+
this.monitorErrors.length=0;
99
+
}else{
100
+
constattempts=(this.monitorErrors.length||1);
101
+
if(this.reconnectTimeout!==undefined){
102
+
// Clear the previous timer.
103
+
window.clearTimeout(this.reconnectTimeout);
104
+
}
105
+
consttimeout=attempts*1000;
106
+
this.messageService.warn(`Reconnecting ${Board.toString(board,{useFqbn: false})} to ${Port.toString(port)} in ${attempts} seconds...`,{ timeout });
0 commit comments