mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-10 21:06:33 +00:00
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>
This commit is contained in:
parent
683219dc1c
commit
79ea0fa9a6
@ -335,17 +335,12 @@ export class BoardsConfig extends React.Component<
|
|||||||
ports = this.state.knownPorts;
|
ports = this.state.knownPorts;
|
||||||
} else {
|
} else {
|
||||||
ports = this.state.knownPorts.filter((port) => {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
// All other ports with different protocol are
|
return false;
|
||||||
// only shown if there is a recognized board
|
|
||||||
// connected
|
|
||||||
for (const board of this.availableBoards) {
|
|
||||||
if (board.port?.address === port.address) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return !ports.length ? (
|
return !ports.length ? (
|
||||||
|
@ -438,20 +438,11 @@ export class BoardsServiceProvider implements FrontendApplicationContribution {
|
|||||||
const availableBoards: AvailableBoard[] = [];
|
const availableBoards: AvailableBoard[] = [];
|
||||||
const attachedBoards = this._attachedBoards.filter(({ port }) => !!port);
|
const attachedBoards = this._attachedBoards.filter(({ port }) => !!port);
|
||||||
const availableBoardPorts = availablePorts.filter((port) => {
|
const availableBoardPorts = availablePorts.filter((port) => {
|
||||||
if (port.protocol === 'serial') {
|
if (port.protocol === 'serial' || port.protocol === 'network') {
|
||||||
// We always show all serial ports, even if there
|
// Allow all `serial` and `network` boards.
|
||||||
// is no recognized board connected to it
|
// IDE2 must support better label for unrecognized `network` boards: https://github.com/arduino/arduino-ide/issues/1331
|
||||||
return true;
|
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;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user