From b649267945e0830719cb1dea2142b04c5fc26d53 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Tue, 16 Aug 2022 16:43:04 +0200 Subject: [PATCH 1/2] Fixed typos. Signed-off-by: Akos Kitta --- .../src/browser/boards/boards-service-provider.ts | 7 ++++--- .../src/common/protocol/boards-service.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arduino-ide-extension/src/browser/boards/boards-service-provider.ts b/arduino-ide-extension/src/browser/boards/boards-service-provider.ts index dc4e66834..1433ee3f0 100644 --- a/arduino-ide-extension/src/browser/boards/boards-service-provider.ts +++ b/arduino-ide-extension/src/browser/boards/boards-service-provider.ts @@ -66,10 +66,11 @@ export class BoardsServiceProvider implements FrontendApplicationContribution { protected _availableBoards: AvailableBoard[] = []; /** - * Unlike `onAttachedBoardsChanged` this even fires when the user modifies the selected board in the IDE.\ - * This even also fires, when the boards package was not available for the currently selected board, + * Unlike `onAttachedBoardsChanged` this event fires when the user modifies the selected board in the IDE.\ + * This event also fires, when the boards package was not available for the currently selected board, * and the user installs the board package. Note: installing a board package will set the `fqbn` of the - * currently selected board.\ + * currently selected board. + * * This event is also emitted when the board package for the currently selected board was uninstalled. */ readonly onBoardsConfigChanged = this.onBoardsConfigChangedEmitter.event; diff --git a/arduino-ide-extension/src/common/protocol/boards-service.ts b/arduino-ide-extension/src/common/protocol/boards-service.ts index 41809626f..e33a55171 100644 --- a/arduino-ide-extension/src/common/protocol/boards-service.ts +++ b/arduino-ide-extension/src/common/protocol/boards-service.ts @@ -142,7 +142,7 @@ export interface BoardsService export interface Port { // id is the combination of address and protocol // formatted like "
|" used - // to univocally recognize a port + // to uniquely recognize a port readonly id: string; readonly address: string; readonly addressLabel: string; From 8a413bcc737ba0bfa73aef249cd52ae9fe813fc6 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Tue, 16 Aug 2022 16:43:32 +0200 Subject: [PATCH 2/2] Show all network and serial ports. Otherwise, unrecognized network boards are ignored by IDE2. Closes #1327 Signed-off-by: Akos Kitta --- .../src/browser/boards/boards-config.tsx | 13 ++++--------- .../src/browser/boards/boards-service-provider.ts | 15 +++------------ 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/arduino-ide-extension/src/browser/boards/boards-config.tsx b/arduino-ide-extension/src/browser/boards/boards-config.tsx index 4449c5cf1..b5c13d7d7 100644 --- a/arduino-ide-extension/src/browser/boards/boards-config.tsx +++ b/arduino-ide-extension/src/browser/boards/boards-config.tsx @@ -335,17 +335,12 @@ export class BoardsConfig extends React.Component< ports = this.state.knownPorts; } else { ports = this.state.knownPorts.filter((port) => { - if (port.protocol === 'serial') { + if (port.protocol === 'serial' || port.protocol === 'network') { + // Allow all `serial` and `network` boards. + // IDE2 must support better label for unrecognized `network` boards: https://github.com/arduino/arduino-ide/issues/1331 return true; } - // All other ports with different protocol are - // only shown if there is a recognized board - // connected - for (const board of this.availableBoards) { - if (board.port?.address === port.address) { - return true; - } - } + return false; }); } return !ports.length ? ( diff --git a/arduino-ide-extension/src/browser/boards/boards-service-provider.ts b/arduino-ide-extension/src/browser/boards/boards-service-provider.ts index 1433ee3f0..542449f15 100644 --- a/arduino-ide-extension/src/browser/boards/boards-service-provider.ts +++ b/arduino-ide-extension/src/browser/boards/boards-service-provider.ts @@ -438,20 +438,11 @@ export class BoardsServiceProvider implements FrontendApplicationContribution { const availableBoards: AvailableBoard[] = []; const attachedBoards = this._attachedBoards.filter(({ port }) => !!port); const availableBoardPorts = availablePorts.filter((port) => { - if (port.protocol === 'serial') { - // We always show all serial ports, even if there - // is no recognized board connected to it + if (port.protocol === 'serial' || port.protocol === 'network') { + // Allow all `serial` and `network` boards. + // IDE2 must support better label for unrecognized `network` boards: https://github.com/arduino/arduino-ide/issues/1331 return true; } - - // All other ports with different protocol are - // only shown if there is a recognized board - // connected - for (const board of attachedBoards) { - if (board.port?.address === port.address) { - return true; - } - } return false; });