Skip to content

Commit 226dffc

Browse files
committed
Added board config detection in 'commands.identify' function
1 parent 8160eba commit 226dffc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

commands/board/list.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"time"
2727

2828
"github.com/arduino/arduino-cli/arduino"
29+
"github.com/arduino/arduino-cli/arduino/cores"
2930
"github.com/arduino/arduino-cli/arduino/cores/packagemanager"
3031
"github.com/arduino/arduino-cli/arduino/discovery"
3132
"github.com/arduino/arduino-cli/commands"
@@ -124,13 +125,19 @@ func identify(pm *packagemanager.PackageManager, port *discovery.Port) ([]*rpc.B
124125
// first query installed cores through the Package Manager
125126
logrus.Debug("Querying installed cores for board identification...")
126127
for _, board := range pm.IdentifyBoard(port.Properties) {
128+
fqbn, err := cores.ParseFQBN(board.FQBN())
129+
if err != nil {
130+
return nil, &arduino.InvalidFQBNError{Cause: err}
131+
}
132+
fqbn.Configs = board.IdentifyBoardConfiguration(port.Properties)
133+
127134
// We need the Platform maintaner for sorting so we set it here
128135
platform := &rpc.Platform{
129136
Maintainer: board.PlatformRelease.Platform.Package.Maintainer,
130137
}
131138
boards = append(boards, &rpc.BoardListItem{
132139
Name: board.Name(),
133-
Fqbn: board.FQBN(),
140+
Fqbn: fqbn.String(),
134141
Platform: platform,
135142
})
136143
}

0 commit comments

Comments
 (0)