Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a921bce

Browse filesBrowse files
umbynoscmaglie
authored andcommitted
1 parent a3c0204 commit a921bce
Copy full SHA for a921bce

File tree

Expand file treeCollapse file tree

3 files changed

+10
-4
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+10
-4
lines changed

‎cli/firmware/flash.go

Copy file name to clipboardExpand all lines: cli/firmware/flash.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func updateFirmwareWithPlugin(uploader *plugin.FwUploader, fwPath *paths.Path) (
171171
stdout = os.Stdout
172172
stderr = os.Stderr
173173
}
174-
res, err := uploader.FlashFirmware(commonFlags.Address, fwPath, stdout, stderr)
174+
res, err := uploader.FlashFirmware(commonFlags.Address, commonFlags.Fqbn, fwPath, stdout, stderr)
175175
if err != nil {
176176
return nil, fmt.Errorf("couldn't update firmware: %s", err)
177177
}

‎cli/firmware/getversion.go

Copy file name to clipboardExpand all lines: cli/firmware/getversion.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func getVersionWithPlugin(uploader *plugin.FwUploader) *flasher.FlashResult {
8989
stdout = os.Stdout
9090
stderr = os.Stderr
9191
}
92-
res, err := uploader.GetFirmwareVersion(commonFlags.Address, stdout, stderr)
92+
res, err := uploader.GetFirmwareVersion(commonFlags.Address, commonFlags.Fqbn, stdout, stderr)
9393
if err != nil {
9494
feedback.Fatal(fmt.Sprintf("Couldn't get firmware version: %s", err), feedback.ErrGeneric)
9595
}

‎plugin/plugin.go

Copy file name to clipboardExpand all lines: plugin/plugin.go
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,14 @@ func (uploader *FwUploader) QueryAPIVersion() (int, error) {
8484
}
8585

8686
// GetFirmwareVersion runs the plugin to obtain the version of the installed firmware
87-
func (uploader *FwUploader) GetFirmwareVersion(portAddress string, stdout, stderr io.Writer) (*GetFirmwareVersionResult, error) {
87+
func (uploader *FwUploader) GetFirmwareVersion(portAddress, fqbn string, stdout, stderr io.Writer) (*GetFirmwareVersionResult, error) {
8888
args := []string{"firmware", "get-version"}
8989
if portAddress != "" {
9090
args = append(args, "-p", portAddress)
9191
}
92+
if fqbn != "" {
93+
args = append(args, "-b", fqbn)
94+
}
9295
execStdout, execStderr, execErr := uploader.exec(stdout, stderr, args...)
9396

9497
res := &GetFirmwareVersionResult{
@@ -126,11 +129,14 @@ type GetFirmwareVersionResult struct {
126129
}
127130

128131
// FlashFirmware runs the plugin to flash the selected firmware
129-
func (uploader *FwUploader) FlashFirmware(portAddress string, firmwarePath *paths.Path, stdout, stderr io.Writer) (*FlashFirmwareResult, error) {
132+
func (uploader *FwUploader) FlashFirmware(portAddress, fqbn string, firmwarePath *paths.Path, stdout, stderr io.Writer) (*FlashFirmwareResult, error) {
130133
args := []string{"firmware", "flash", firmwarePath.String()}
131134
if portAddress != "" {
132135
args = append(args, "-p", portAddress)
133136
}
137+
if fqbn != "" {
138+
args = append(args, "-b", fqbn)
139+
}
134140
execStdout, execStderr, execErr := uploader.exec(stdout, stderr, args...)
135141

136142
res := &FlashFirmwareResult{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.