@@ -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 {
@@ -192,14 +204,20 @@ func (uploader *FwUploader) exec(stdout, stderr io.Writer, args ...string) (*byt
192
204
}
193
205
194
206
// FlashCertificates writes the given certificates bundle in PEM format.
195
- func (uploader * FwUploader ) FlashCertificates (portAddress , fqbn string , certsPath * paths.Path , stdout , stderr io.Writer ) (* FlashCertificatesResult , error ) {
207
+ func (uploader * FwUploader ) FlashCertificates (portAddress , fqbn , LogLevel string , verbose bool , certsPath * paths.Path , stdout , stderr io.Writer ) (* FlashCertificatesResult , error ) {
196
208
args := []string {"cert" , "flash" , certsPath .String ()}
197
209
if portAddress != "" {
198
210
args = append (args , "-p" , portAddress )
199
211
}
200
212
if fqbn != "" {
201
213
args = append (args , "-b" , fqbn )
202
214
}
215
+ if verbose {
216
+ args = append (args , "-v" )
217
+ }
218
+ if LogLevel != "" {
219
+ args = append (args , "--log-level" , LogLevel )
220
+ }
203
221
execStdout , execStderr , execErr := uploader .exec (stdout , stderr , args ... )
204
222
205
223
res := & FlashCertificatesResult {
0 commit comments