@@ -84,14 +84,20 @@ func (uploader *FwUploader) QueryAPIVersion() (int, error) {
84
84
}
85
85
86
86
// GetFirmwareVersion runs the plugin to obtain the version of the installed firmware
87
- func (uploader * FwUploader ) GetFirmwareVersion (portAddress , fqbn string , stdout , stderr io.Writer ) (* GetFirmwareVersionResult , error ) {
87
+ func (uploader * FwUploader ) GetFirmwareVersion (portAddress , fqbn , LogLevel string , verbose bool , stdout , stderr io.Writer ) (* GetFirmwareVersionResult , error ) {
88
88
args := []string {"firmware" , "get-version" }
89
89
if portAddress != "" {
90
90
args = append (args , "-p" , portAddress )
91
91
}
92
92
if fqbn != "" {
93
93
args = append (args , "-b" , fqbn )
94
94
}
95
+ if verbose {
96
+ args = append (args , "-v" )
97
+ }
98
+ if LogLevel != "" {
99
+ args = append (args , "--log-level" , LogLevel )
100
+ }
95
101
execStdout , execStderr , execErr := uploader .exec (stdout , stderr , args ... )
96
102
97
103
res := & GetFirmwareVersionResult {
@@ -129,14 +135,20 @@ type GetFirmwareVersionResult struct {
129
135
}
130
136
131
137
// FlashFirmware runs the plugin to flash the selected firmware
132
- func (uploader * FwUploader ) FlashFirmware (portAddress , fqbn string , firmwarePath * paths.Path , stdout , stderr io.Writer ) (* FlashFirmwareResult , error ) {
138
+ func (uploader * FwUploader ) FlashFirmware (portAddress , fqbn , LogLevel string , verbose bool , firmwarePath * paths.Path , stdout , stderr io.Writer ) (* FlashFirmwareResult , error ) {
133
139
args := []string {"firmware" , "flash" , firmwarePath .String ()}
134
140
if portAddress != "" {
135
141
args = append (args , "-p" , portAddress )
136
142
}
137
143
if fqbn != "" {
138
144
args = append (args , "-b" , fqbn )
139
145
}
146
+ if verbose {
147
+ args = append (args , "-v" )
148
+ }
149
+ if LogLevel != "" {
150
+ args = append (args , "--log-level" , LogLevel )
151
+ }
140
152
execStdout , execStderr , execErr := uploader .exec (stdout , stderr , args ... )
141
153
142
154
res := & FlashFirmwareResult {
0 commit comments