Skip to content

Commit

Permalink
Fix monitor service id creation (#1025)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Iannaccone authored Jun 8, 2022
1 parent 585a82b commit 726628e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ArduinoFirmwareUploaderImpl implements ArduinoFirmwareUploader {
fqbn: firmware.board_fqbn,
};
try {
this.monitorManager.notifyUploadStarted(board, port);
await this.monitorManager.notifyUploadStarted(board, port);
output = await this.runCommand([
'firmware',
'flash',
Expand Down
4 changes: 3 additions & 1 deletion arduino-ide-extension/src/node/monitor-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ export class MonitorManager extends CoreClientAware {
* @returns a unique monitor ID
*/
private monitorID(board: Board, port: Port): MonitorID {
return `${board.fqbn}-${port.address}-${port.protocol}`;
const splitFqbn = board?.fqbn?.split(':') || [];
const shortenedFqbn = splitFqbn.slice(0, 3).join(':') || '';
return `${shortenedFqbn}-${port.address}-${port.protocol}`;
}
}

0 comments on commit 726628e

Please sign in to comment.