Skip to content

Commit

Permalink
Added board config detection in 'commands.identify' function
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Oct 14, 2022
1 parent 14a424b commit ccceb6c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion commands/board/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"time"

"github.com/arduino/arduino-cli/arduino"
"github.com/arduino/arduino-cli/arduino/cores"
"github.com/arduino/arduino-cli/arduino/cores/packagemanager"
"github.com/arduino/arduino-cli/arduino/discovery"
"github.com/arduino/arduino-cli/arduino/httpclient"
Expand Down Expand Up @@ -124,13 +125,19 @@ func identify(pme *packagemanager.Explorer, port *discovery.Port) ([]*rpc.BoardL
// first query installed cores through the Package Manager
logrus.Debug("Querying installed cores for board identification...")
for _, board := range pme.IdentifyBoard(port.Properties) {
fqbn, err := cores.ParseFQBN(board.FQBN())
if err != nil {
return nil, &arduino.InvalidFQBNError{Cause: err}
}
fqbn.Configs = board.IdentifyBoardConfiguration(port.Properties)

// We need the Platform maintaner for sorting so we set it here
platform := &rpc.Platform{
Maintainer: board.PlatformRelease.Platform.Package.Maintainer,
}
boards = append(boards, &rpc.BoardListItem{
Name: board.Name(),
Fqbn: board.FQBN(),
Fqbn: fqbn.String(),
Platform: platform,
})
}
Expand Down

0 comments on commit ccceb6c

Please sign in to comment.