@@ -84,14 +84,20 @@ 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 , 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 ) {
8888 args := []string {"firmware" , "get-version" }
8989 if portAddress != "" {
9090 args = append (args , "-p" , portAddress )
9191 }
9292 if fqbn != "" {
9393 args = append (args , "-b" , fqbn )
9494 }
95+ if verbose {
96+ args = append (args , "-v" )
97+ }
98+ if LogLevel != "" {
99+ args = append (args , "--log-level" , LogLevel )
100+ }
95101 execStdout , execStderr , execErr := uploader .exec (stdout , stderr , args ... )
96102
97103 res := & GetFirmwareVersionResult {
@@ -129,14 +135,20 @@ type GetFirmwareVersionResult struct {
129135}
130136
131137// 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 ) {
133139 args := []string {"firmware" , "flash" , firmwarePath .String ()}
134140 if portAddress != "" {
135141 args = append (args , "-p" , portAddress )
136142 }
137143 if fqbn != "" {
138144 args = append (args , "-b" , fqbn )
139145 }
146+ if verbose {
147+ args = append (args , "-v" )
148+ }
149+ if LogLevel != "" {
150+ args = append (args , "--log-level" , LogLevel )
151+ }
140152 execStdout , execStderr , execErr := uploader .exec (stdout , stderr , args ... )
141153
142154 res := & FlashFirmwareResult {
0 commit comments