Updated port discovery to support unknown boards

From now on, we do not retrieve the ports from the attached boards.
A board can be unknown but the port is still relevant.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta
2019-10-23 17:47:20 +02:00
parent 8971dc4c5f
commit 4353bfb5b9
12 changed files with 316 additions and 86 deletions

View File

@@ -165,7 +165,10 @@ export class ArduinoFrontendContribution implements TabBarToolbarContribution, C
this.registerSketchesInMenu(this.menuRegistry);
this.boardsService.getAttachedBoards().then(({ boards }) => this.boardsServiceClient.tryReconnect(boards));
Promise.all([
this.boardsService.getAttachedBoards(),
this.boardsService.getAvailablePorts()
]).then(([{ boards }, { ports }]) => this.boardsServiceClient.tryReconnect(boards, ports));
}
registerToolbarItems(registry: TabBarToolbarRegistry): void {
@@ -270,7 +273,7 @@ export class ArduinoFrontendContribution implements TabBarToolbarContribution, C
if (!selectedPort) {
throw new Error('No ports selected. Please select a port.');
}
await this.coreService.upload({ uri: uri.toString(), board: boardsConfig.selectedBoard, port: selectedPort });
await this.coreService.upload({ uri: uri.toString(), board: boardsConfig.selectedBoard, port: selectedPort.address });
} catch (e) {
await this.messageService.error(e.toString());
} finally {