Skip to content

Commit 79ea0fa

Browse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
Show all network and serial ports.
Otherwise, unrecognized network boards are ignored by IDE2. Closes #1327 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent 683219d commit 79ea0fa

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

arduino-ide-extension/src/browser/boards/boards-config.tsx

+4-9
Original file line numberDiff line numberDiff line change
@@ -335,17 +335,12 @@ export class BoardsConfig extends React.Component<
335335
ports = this.state.knownPorts;
336336
} else {
337337
ports = this.state.knownPorts.filter((port) => {
338-
if (port.protocol === 'serial') {
338+
if (port.protocol === 'serial' || port.protocol === 'network') {
339+
// Allow all `serial` and `network` boards.
340+
// IDE2 must support better label for unrecognized `network` boards: https://github.com/arduino/arduino-ide/issues/1331
339341
return true;
340342
}
341-
// All other ports with different protocol are
342-
// only shown if there is a recognized board
343-
// connected
344-
for (const board of this.availableBoards) {
345-
if (board.port?.address === port.address) {
346-
return true;
347-
}
348-
}
343+
return false;
349344
});
350345
}
351346
return !ports.length ? (

arduino-ide-extension/src/browser/boards/boards-service-provider.ts

+3-12
Original file line numberDiff line numberDiff line change
@@ -438,20 +438,11 @@ export class BoardsServiceProvider implements FrontendApplicationContribution {
438438
const availableBoards: AvailableBoard[] = [];
439439
const attachedBoards = this._attachedBoards.filter(({ port }) => !!port);
440440
const availableBoardPorts = availablePorts.filter((port) => {
441-
if (port.protocol === 'serial') {
442-
// We always show all serial ports, even if there
443-
// is no recognized board connected to it
441+
if (port.protocol === 'serial' || port.protocol === 'network') {
442+
// Allow all `serial` and `network` boards.
443+
// IDE2 must support better label for unrecognized `network` boards: https://github.com/arduino/arduino-ide/issues/1331
444444
return true;
445445
}
446-
447-
// All other ports with different protocol are
448-
// only shown if there is a recognized board
449-
// connected
450-
for (const board of attachedBoards) {
451-
if (board.port?.address === port.address) {
452-
return true;
453-
}
454-
}
455446
return false;
456447
});
457448

0 commit comments

Comments
 (0)