Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ec44ad1

Browse files
cmaglieumbynos
authored andcommittedJun 17, 2020
Added external programmer support (#720)
* Added scaffolding for external programmer support * Added programmers extraction in arduino/cores module * Implemented programmers list command * Print upload command line in verbose mode * Added programmer option to compile command * External programmer implementation * Factored function runTool in upload This will turn out useful for burn-bootloader that requires to run two actions in a row ("erase" and "bootloader"). * Implemented burn-bootloader * Increased tracing log * Test fix * Added BurnBootloder action * Make the upload port parameter mandatory only when really needed * Fixed nil pointer exception when burning-bootloader * Added sanity check on upload parameters
1 parent 4a5330a commit ec44ad1

File tree

20 files changed

+1198
-268
lines changed

20 files changed

+1198
-268
lines changed
 

‎arduino/cores/cores.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ type PlatformRelease struct {
4040
Resource *resources.DownloadResource
4141
Version *semver.Version
4242
BoardsManifest []*BoardManifest
43-
Dependencies ToolDependencies // The Dependency entries to load tools.
44-
Platform *Platform `json:"-"`
45-
Properties *properties.Map `json:"-"`
46-
Boards map[string]*Board `json:"-"`
47-
Programmers map[string]*properties.Map `json:"-"`
48-
Menus *properties.Map `json:"-"`
49-
InstallDir *paths.Path `json:"-"`
50-
IsIDEBundled bool `json:"-"`
43+
Dependencies ToolDependencies // The Dependency entries to load tools.
44+
Platform *Platform `json:"-"`
45+
Properties *properties.Map `json:"-"`
46+
Boards map[string]*Board `json:"-"`
47+
Programmers map[string]*Programmer `json:"-"`
48+
Menus *properties.Map `json:"-"`
49+
InstallDir *paths.Path `json:"-"`
50+
IsIDEBundled bool `json:"-"`
5151
}
5252

5353
// BoardManifest contains information about a board. These metadata are usually
@@ -117,7 +117,7 @@ func (platform *Platform) GetOrCreateRelease(version *semver.Version) (*Platform
117117
Version: version,
118118
Boards: map[string]*Board{},
119119
Properties: properties.NewMap(),
120-
Programmers: map[string]*properties.Map{},
120+
Programmers: map[string]*Programmer{},
121121
Platform: platform,
122122
}
123123
platform.Releases[tag] = release

‎arduino/cores/packagemanager/loader.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ func (pm *PackageManager) loadPlatformRelease(platform *cores.PlatformRelease, p
284284

285285
// Create programmers properties
286286
if programmersProperties, err := properties.SafeLoad(programmersTxtPath.String()); err == nil {
287-
platform.Programmers = properties.MergeMapsOfProperties(
288-
map[string]*properties.Map{},
289-
platform.Programmers, // TODO: Very weird, why not an empty one?
290-
programmersProperties.FirstLevelOf())
287+
for programmerID, programmerProperties := range programmersProperties.FirstLevelOf() {
288+
platform.Programmers[programmerID] = pm.loadProgrammer(programmerProperties)
289+
platform.Programmers[programmerID].PlatformRelease = platform
290+
}
291291
} else {
292292
return err
293293
}
@@ -299,6 +299,13 @@ func (pm *PackageManager) loadPlatformRelease(platform *cores.PlatformRelease, p
299299
return nil
300300
}
301301

302+
func (pm *PackageManager) loadProgrammer(programmerProperties *properties.Map) *cores.Programmer {
303+
return &cores.Programmer{
304+
Name: programmerProperties.Get("name"),
305+
Properties: programmerProperties,
306+
}
307+
}
308+
302309
func (pm *PackageManager) loadBoards(platform *cores.PlatformRelease) error {
303310
if platform.InstallDir == nil {
304311
return fmt.Errorf("platform not installed")

‎arduino/cores/programmers.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
16+
package cores
17+
18+
import "github.com/arduino/go-properties-orderedmap"
19+
20+
// Programmer represents an external programmer
21+
type Programmer struct {
22+
Name string
23+
Properties *properties.Map
24+
PlatformRelease *PlatformRelease
25+
}

‎cli/burnbootloader/burnbootloader.go

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
16+
package burnbootloader
17+
18+
import (
19+
"context"
20+
"os"
21+
22+
"github.com/arduino/arduino-cli/cli/errorcodes"
23+
"github.com/arduino/arduino-cli/cli/feedback"
24+
"github.com/arduino/arduino-cli/cli/instance"
25+
"github.com/arduino/arduino-cli/commands/upload"
26+
rpc "github.com/arduino/arduino-cli/rpc/commands"
27+
"github.com/arduino/arduino-cli/table"
28+
"github.com/arduino/go-paths-helper"
29+
"github.com/sirupsen/logrus"
30+
"github.com/spf13/cobra"
31+
)
32+
33+
var (
34+
fqbn string
35+
port string
36+
verbose bool
37+
verify bool
38+
importDir string
39+
programmer string
40+
burnBootloader bool
41+
)
42+
43+
// NewCommand created a new `burn-bootloader` command
44+
func NewCommand() *cobra.Command {
45+
burnBootloaderCommand := &cobra.Command{
46+
Use: "burn-bootloader",
47+
Short: "Upload the bootloader.",
48+
Long: "Upload the bootloader on the board using an external programmer.",
49+
Example: " " + os.Args[0] + " burn-bootloader -b arduino:avr:uno -P atmel-ice",
50+
Args: cobra.MaximumNArgs(1),
51+
Run: run,
52+
}
53+
54+
burnBootloaderCommand.Flags().StringVarP(&fqbn, "fqbn", "b", "", "Fully Qualified Board Name, e.g.: arduino:avr:uno")
55+
burnBootloaderCommand.Flags().StringVarP(&port, "port", "p", "", "Upload port, e.g.: COM10 or /dev/ttyACM0")
56+
burnBootloaderCommand.Flags().BoolVarP(&verify, "verify", "t", false, "Verify uploaded binary after the upload.")
57+
burnBootloaderCommand.Flags().BoolVarP(&verbose, "verbose", "v", false, "Turns on verbose mode.")
58+
burnBootloaderCommand.Flags().StringVarP(&programmer, "programmer", "P", "", "Use the specified programmer to upload or 'list' to list supported programmers.")
59+
60+
return burnBootloaderCommand
61+
}
62+
63+
func run(command *cobra.Command, args []string) {
64+
instance, err := instance.CreateInstance()
65+
if err != nil {
66+
feedback.Errorf("Error during Upload: %v", err)
67+
os.Exit(errorcodes.ErrGeneric)
68+
}
69+
70+
if programmer == "list" {
71+
resp, err := upload.ListProgrammersAvailableForUpload(context.Background(), &rpc.ListProgrammersAvailableForUploadReq{
72+
Instance: instance,
73+
Fqbn: fqbn,
74+
})
75+
if err != nil {
76+
feedback.Errorf("Error listing programmers: %v", err)
77+
os.Exit(errorcodes.ErrGeneric)
78+
}
79+
feedback.PrintResult(&programmersList{
80+
Programmers: resp.GetProgrammers(),
81+
})
82+
os.Exit(0)
83+
}
84+
85+
if _, err := upload.BurnBootloader(context.Background(), &rpc.BurnBootloaderReq{
86+
Instance: instance,
87+
Fqbn: fqbn,
88+
Port: port,
89+
Verbose: verbose,
90+
Verify: verify,
91+
Programmer: programmer,
92+
}, os.Stdout, os.Stderr); err != nil {
93+
feedback.Errorf("Error during Upload: %v", err)
94+
os.Exit(errorcodes.ErrGeneric)
95+
}
96+
os.Exit(0)
97+
}
98+
99+
// initSketchPath returns the current working directory
100+
func initSketchPath(sketchPath *paths.Path) *paths.Path {
101+
if sketchPath != nil {
102+
return sketchPath
103+
}
104+
105+
wd, err := paths.Getwd()
106+
if err != nil {
107+
feedback.Errorf("Couldn't get current working directory: %v", err)
108+
os.Exit(errorcodes.ErrGeneric)
109+
}
110+
logrus.Infof("Reading sketch from dir: %s", wd)
111+
return wd
112+
}
113+
114+
type programmersList struct {
115+
Programmers []*rpc.Programmer
116+
}
117+
118+
func (p *programmersList) Data() interface{} {
119+
return p.Programmers
120+
}
121+
122+
func (p *programmersList) String() string {
123+
t := table.New()
124+
t.SetHeader("ID", "Programmer Name", "Platform")
125+
for _, prog := range p.Programmers {
126+
t.AddRow(prog.GetId(), prog.GetName(), prog.GetPlatform())
127+
}
128+
return t.Render()
129+
}

‎cli/cli.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"strings"
2323

2424
"github.com/arduino/arduino-cli/cli/board"
25+
"github.com/arduino/arduino-cli/cli/burnbootloader"
2526
"github.com/arduino/arduino-cli/cli/cache"
2627
"github.com/arduino/arduino-cli/cli/compile"
2728
"github.com/arduino/arduino-cli/cli/completion"
@@ -87,6 +88,7 @@ func createCliCommandTree(cmd *cobra.Command) {
8788
cmd.AddCommand(sketch.NewCommand())
8889
cmd.AddCommand(upload.NewCommand())
8990
cmd.AddCommand(debug.NewCommand())
91+
cmd.AddCommand(burnbootloader.NewCommand())
9092
cmd.AddCommand(version.NewCommand())
9193

9294
cmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Print the logs on the standard output.")

‎cli/compile/compile.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ var (
5050
dryRun bool // Use this flag to now write the output file
5151
libraries []string // List of custom libraries paths separated by commas. Or can be used multiple times for multiple libraries paths.
5252
optimizeForDebug bool // Optimize compile output for debug, not for release
53+
programmer string // Use the specified programmer to upload
5354
)
5455

5556
// NewCommand created a new `compile` command
@@ -84,6 +85,7 @@ func NewCommand() *cobra.Command {
8485
command.Flags().StringSliceVar(&libraries, "libraries", []string{},
8586
"List of custom libraries paths separated by commas. Or can be used multiple times for multiple libraries paths.")
8687
command.Flags().BoolVar(&optimizeForDebug, "optimize-for-debug", false, "Optional, optimize compile output for debug, not for release.")
88+
command.Flags().StringVarP(&programmer, "programmer", "P", "", "Optional, use the specified programmer to upload.")
8789

8890
return command
8991
}
@@ -135,6 +137,7 @@ func run(cmd *cobra.Command, args []string) {
135137
Verbose: verbose,
136138
Verify: verify,
137139
ImportDir: exportDir,
140+
Programmer: programmer,
138141
}, os.Stdout, os.Stderr)
139142

140143
if err != nil {

‎cli/upload/upload.go

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,20 @@ import (
2424
"github.com/arduino/arduino-cli/cli/instance"
2525
"github.com/arduino/arduino-cli/commands/upload"
2626
rpc "github.com/arduino/arduino-cli/rpc/commands"
27+
"github.com/arduino/arduino-cli/table"
2728
"github.com/arduino/go-paths-helper"
2829
"github.com/sirupsen/logrus"
2930
"github.com/spf13/cobra"
3031
)
3132

3233
var (
33-
fqbn string
34-
port string
35-
verbose bool
36-
verify bool
37-
importDir string
34+
fqbn string
35+
port string
36+
verbose bool
37+
verify bool
38+
importDir string
39+
programmer string
40+
burnBootloader bool
3841
)
3942

4043
// NewCommand created a new `upload` command
@@ -53,6 +56,7 @@ func NewCommand() *cobra.Command {
5356
uploadCommand.Flags().StringVarP(&importDir, "input-dir", "", "", "Direcory containing binaries to upload.")
5457
uploadCommand.Flags().BoolVarP(&verify, "verify", "t", false, "Verify uploaded binary after the upload.")
5558
uploadCommand.Flags().BoolVarP(&verbose, "verbose", "v", false, "Optional, turns on verbose mode.")
59+
uploadCommand.Flags().StringVarP(&programmer, "programmer", "P", "", "Optional, use the specified programmer to upload or 'list' to list supported programmers.")
5660

5761
return uploadCommand
5862
}
@@ -64,12 +68,44 @@ func run(command *cobra.Command, args []string) {
6468
os.Exit(errorcodes.ErrGeneric)
6569
}
6670

71+
if programmer == "list" {
72+
resp, err := upload.ListProgrammersAvailableForUpload(context.Background(), &rpc.ListProgrammersAvailableForUploadReq{
73+
Instance: instance,
74+
Fqbn: fqbn,
75+
})
76+
if err != nil {
77+
feedback.Errorf("Error listing programmers: %v", err)
78+
os.Exit(errorcodes.ErrGeneric)
79+
}
80+
feedback.PrintResult(&programmersList{
81+
Programmers: resp.GetProgrammers(),
82+
})
83+
os.Exit(0)
84+
}
85+
6786
var path *paths.Path
6887
if len(args) > 0 {
6988
path = paths.New(args[0])
7089
}
7190
sketchPath := initSketchPath(path)
7291

92+
if burnBootloader {
93+
if _, err := upload.Upload(context.Background(), &rpc.UploadReq{
94+
Instance: instance,
95+
Fqbn: fqbn,
96+
SketchPath: sketchPath.String(),
97+
Port: port,
98+
Verbose: verbose,
99+
Verify: verify,
100+
ImportDir: importDir,
101+
Programmer: programmer,
102+
}, os.Stdout, os.Stderr); err != nil {
103+
feedback.Errorf("Error during Upload: %v", err)
104+
os.Exit(errorcodes.ErrGeneric)
105+
}
106+
os.Exit(0)
107+
}
108+
73109
if _, err := upload.Upload(context.Background(), &rpc.UploadReq{
74110
Instance: instance,
75111
Fqbn: fqbn,
@@ -78,6 +114,7 @@ func run(command *cobra.Command, args []string) {
78114
Verbose: verbose,
79115
Verify: verify,
80116
ImportDir: importDir,
117+
Programmer: programmer,
81118
}, os.Stdout, os.Stderr); err != nil {
82119
feedback.Errorf("Error during Upload: %v", err)
83120
os.Exit(errorcodes.ErrGeneric)
@@ -98,3 +135,20 @@ func initSketchPath(sketchPath *paths.Path) *paths.Path {
98135
logrus.Infof("Reading sketch from dir: %s", wd)
99136
return wd
100137
}
138+
139+
type programmersList struct {
140+
Programmers []*rpc.Programmer
141+
}
142+
143+
func (p *programmersList) Data() interface{} {
144+
return p.Programmers
145+
}
146+
147+
func (p *programmersList) String() string {
148+
t := table.New()
149+
t.SetHeader("ID", "Programmer Name", "Platform")
150+
for _, prog := range p.Programmers {
151+
t.AddRow(prog.GetId(), prog.GetName(), prog.GetPlatform())
152+
}
153+
return t.Render()
154+
}

‎commands/daemon/daemon.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,24 @@ func (s *ArduinoCoreServerImpl) Upload(req *rpc.UploadReq, stream rpc.ArduinoCor
216216
return stream.Send(resp)
217217
}
218218

219+
// BurnBootloader FIXMEDOC
220+
func (s *ArduinoCoreServerImpl) BurnBootloader(req *rpc.BurnBootloaderReq, stream rpc.ArduinoCore_BurnBootloaderServer) error {
221+
resp, err := upload.BurnBootloader(
222+
stream.Context(), req,
223+
utils.FeedStreamTo(func(data []byte) { stream.Send(&rpc.BurnBootloaderResp{OutStream: data}) }),
224+
utils.FeedStreamTo(func(data []byte) { stream.Send(&rpc.BurnBootloaderResp{ErrStream: data}) }),
225+
)
226+
if err != nil {
227+
return err
228+
}
229+
return stream.Send(resp)
230+
}
231+
232+
// ListProgrammersAvailableForUpload FIXMEDOC
233+
func (s *ArduinoCoreServerImpl) ListProgrammersAvailableForUpload(ctx context.Context, req *rpc.ListProgrammersAvailableForUploadReq) (*rpc.ListProgrammersAvailableForUploadResp, error) {
234+
return upload.ListProgrammersAvailableForUpload(ctx, req)
235+
}
236+
219237
// LibraryDownload FIXMEDOC
220238
func (s *ArduinoCoreServerImpl) LibraryDownload(req *rpc.LibraryDownloadReq, stream rpc.ArduinoCore_LibraryDownloadServer) error {
221239
resp, err := lib.LibraryDownload(

‎commands/upload/burnbootloader.go

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
16+
package upload
17+
18+
import (
19+
"context"
20+
"io"
21+
22+
"github.com/arduino/arduino-cli/commands"
23+
rpc "github.com/arduino/arduino-cli/rpc/commands"
24+
"github.com/sirupsen/logrus"
25+
)
26+
27+
// BurnBootloader FIXMEDOC
28+
func BurnBootloader(ctx context.Context, req *rpc.BurnBootloaderReq, outStream io.Writer, errStream io.Writer) (*rpc.BurnBootloaderResp, error) {
29+
logrus.
30+
WithField("fqbn", req.GetFqbn()).
31+
WithField("port", req.GetPort()).
32+
WithField("programmer", req.GetProgrammer()).
33+
Trace("BurnBootloader started", req.GetFqbn())
34+
35+
pm := commands.GetPackageManager(req.GetInstance().GetId())
36+
37+
err := runProgramAction(
38+
pm,
39+
nil, // sketch
40+
"", // importDir
41+
req.GetFqbn(),
42+
req.GetPort(),
43+
req.GetProgrammer(),
44+
req.GetVerbose(),
45+
req.GetVerify(),
46+
true, // burnBootloader
47+
outStream,
48+
errStream,
49+
)
50+
if err != nil {
51+
return nil, err
52+
}
53+
return &rpc.BurnBootloaderResp{}, nil
54+
}

‎commands/upload/programmers_list.go

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
16+
package upload
17+
18+
import (
19+
"context"
20+
"fmt"
21+
22+
"github.com/arduino/arduino-cli/arduino/cores"
23+
"github.com/arduino/arduino-cli/commands"
24+
rpc "github.com/arduino/arduino-cli/rpc/commands"
25+
)
26+
27+
// ListProgrammersAvailableForUpload FIXMEDOC
28+
func ListProgrammersAvailableForUpload(ctx context.Context, req *rpc.ListProgrammersAvailableForUploadReq) (*rpc.ListProgrammersAvailableForUploadResp, error) {
29+
pm := commands.GetPackageManager(req.GetInstance().GetId())
30+
31+
fqbnIn := req.GetFqbn()
32+
if fqbnIn == "" {
33+
return nil, fmt.Errorf("no Fully Qualified Board Name provided")
34+
}
35+
fqbn, err := cores.ParseFQBN(fqbnIn)
36+
if err != nil {
37+
return nil, fmt.Errorf("incorrect FQBN: %s", err)
38+
}
39+
40+
// Find target platforms
41+
_, platform, _, _, refPlatform, err := pm.ResolveFQBN(fqbn)
42+
if err != nil {
43+
return nil, fmt.Errorf("incorrect FQBN: %s", err)
44+
}
45+
46+
result := []*rpc.Programmer{}
47+
createRPCProgrammer := func(id string, programmer *cores.Programmer) *rpc.Programmer {
48+
return &rpc.Programmer{
49+
Id: id,
50+
Platform: programmer.PlatformRelease.String(),
51+
Name: programmer.Name,
52+
}
53+
}
54+
if refPlatform != platform {
55+
for id, programmer := range refPlatform.Programmers {
56+
result = append(result, createRPCProgrammer(id, programmer))
57+
}
58+
}
59+
for id, programmer := range platform.Programmers {
60+
result = append(result, createRPCProgrammer(id, programmer))
61+
}
62+
63+
return &rpc.ListProgrammersAvailableForUploadResp{
64+
Programmers: result,
65+
}, nil
66+
}

‎commands/upload/upload.go

Lines changed: 241 additions & 106 deletions
Large diffs are not rendered by default.

‎go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/GeertJohan/go.rice v1.0.0
88
github.com/arduino/board-discovery v0.0.0-20180823133458-1ba29327fb0c
99
github.com/arduino/go-paths-helper v1.2.0
10-
github.com/arduino/go-properties-orderedmap v1.0.0
10+
github.com/arduino/go-properties-orderedmap v1.2.0
1111
github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b
1212
github.com/arduino/go-win32-utils v0.0.0-20180330194947-ed041402e83b
1313
github.com/cmaglie/pb v1.0.27

‎go.sum

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ github.com/arduino/go-paths-helper v1.0.1 h1:utYXLM2RfFlc9qp/MJTIYp3t6ux/xM6mWje
1818
github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
1919
github.com/arduino/go-paths-helper v1.2.0 h1:qDW93PR5IZUN/jzO4rCtexiwF8P4OIcOmcSgAYLZfY4=
2020
github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
21-
github.com/arduino/go-properties-orderedmap v1.0.0 h1:caaM25TQZKkytoKQUsgqtOVbrM5i8Gb427JmW0KL05s=
22-
github.com/arduino/go-properties-orderedmap v1.0.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk=
21+
github.com/arduino/go-properties-orderedmap v1.2.0 h1:H7sub5hjAtFLZYd/NVWBOr6Jw7U1CnamYvNSM3dDdyE=
22+
github.com/arduino/go-properties-orderedmap v1.2.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk=
2323
github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b h1:9hDi4F2st6dbLC3y4i02zFT5quS4X6iioWifGlVwfy4=
2424
github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b/go.mod h1:uwGy5PpN4lqW97FiLnbcx+xx8jly5YuPMJWfVwwjJiQ=
2525
github.com/arduino/go-win32-utils v0.0.0-20180330194947-ed041402e83b h1:3PjgYG5gVPA7cipp7vIR2lF96KkEJIFBJ+ANnuv6J20=
@@ -80,7 +80,6 @@ github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4er
8080
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
8181
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
8282
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
83-
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
8483
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
8584
github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
8685
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
@@ -101,7 +100,6 @@ github.com/imjasonmiller/godice v0.1.2 h1:T1/sW/HoDzFeuwzOOuQjmeMELz9CzZ53I2CnD+
101100
github.com/imjasonmiller/godice v0.1.2/go.mod h1:8cTkdnVI+NglU2d6sv+ilYcNaJ5VSTBwvMbFULJd/QQ=
102101
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
103102
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
104-
github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
105103
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
106104
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
107105
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
@@ -125,7 +123,6 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
125123
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
126124
github.com/leonelquinteros/gotext v1.4.0 h1:2NHPCto5IoMXbrT0bldPrxj0qM5asOCwtb1aUQZ1tys=
127125
github.com/leonelquinteros/gotext v1.4.0/go.mod h1:yZGXREmoGTtBvZHNcc+Yfug49G/2spuF/i/Qlsvz1Us=
128-
github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=
129126
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
130127
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
131128
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
@@ -143,12 +140,10 @@ github.com/mdlayher/netlink v0.0.0-20190313131330-258ea9dff42c/go.mod h1:eQB3mZE
143140
github.com/mdlayher/taskstats v0.0.0-20190313225729-7cbba52ee072/go.mod h1:sGdS7A6CAETR53zkdjGkgoFlh1vSm7MtX+i8XfEsTMA=
144141
github.com/miekg/dns v1.0.5 h1:MQBGf2JEJDu0rg9WOpQZzeO+zW8UKwgkvP3R1dUU1Yw=
145142
github.com/miekg/dns v1.0.5/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
146-
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
147143
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
148144
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
149145
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
150146
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
151-
github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229 h1:E2B8qYyeSgv5MXpmzZXRNp8IAQ4vjxIjhpAf5hv/tAg=
152147
github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E=
153148
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
154149
github.com/oleksandr/bonjour v0.0.0-20160508152359-5dcf00d8b228 h1:Cvfd2dOlXIPTeEkOT/h8PyK4phBngOM4at9/jlgy7d4=
@@ -210,16 +205,13 @@ github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9
210205
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
211206
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
212207
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
213-
github.com/spf13/viper v1.3.2 h1:VUFqw5KcqRf7i70GOzW7N+Q7+gxVBkSSqiXB12+JQ4M=
214208
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
215209
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
216210
github.com/spf13/viper v1.6.2 h1:7aKfF+e8/k68gda3LOjo5RxiUqddoFxVq4BKBPrxk5E=
217211
github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k=
218212
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
219-
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
220213
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
221214
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
222-
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
223215
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
224216
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
225217
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
@@ -228,9 +220,7 @@ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69
228220
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
229221
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
230222
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
231-
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
232223
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
233-
github.com/valyala/fasttemplate v1.0.1 h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8=
234224
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
235225
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
236226
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
@@ -255,14 +245,12 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
255245
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
256246
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
257247
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
258-
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0=
259248
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
260249
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
261250
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
262251
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
263252
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
264253
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
265-
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
266254
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
267255
golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
268256
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
@@ -281,13 +269,10 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h
281269
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
282270
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
283271
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
284-
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
285272
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
286-
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 h1:ZBzSG/7F4eNKz2L3GE9o300RX0Az1Bw5HF7PDraD+qU=
287273
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
288274
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
289275
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
290-
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
291276
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
292277
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
293278
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
@@ -297,14 +282,11 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
297282
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
298283
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
299284
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
300-
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384 h1:TFlARGu6Czu1z7q93HTxcP1P+/ZFC/IKythI5RzrnRg=
301285
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
302-
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A=
303286
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
304287
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
305288
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
306289
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
307-
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE=
308290
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
309291
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90 h1:7THRSvPuzF1bql5kyFzX0JM0vpGhwuhskgJrJsbZ80Y=
310292
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
@@ -314,7 +296,6 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
314296
google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg=
315297
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
316298
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
317-
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
318299
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
319300
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
320301
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
@@ -326,7 +307,6 @@ gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3M
326307
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
327308
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
328309
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
329-
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
330310
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
331311
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
332312
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

‎legacy/builder/test/hardware_loader_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestLoadHardware(t *testing.T) {
6262
require.Equal(t, "-v", avrPlatform.Releases[""].Properties.Get("tools.avrdude.bootloader.params.verbose"))
6363
require.Equal(t, "/my/personal/avrdude", avrPlatform.Releases[""].Properties.Get("tools.avrdude.cmd.path"))
6464

65-
require.Equal(t, "AVRISP mkII", avrPlatform.Releases[""].Programmers["avrispmkii"].Get("name"))
65+
require.Equal(t, "AVRISP mkII", avrPlatform.Releases[""].Programmers["avrispmkii"].Name)
6666

6767
//require.Equal(t, "{runtime.tools.ctags.path}", packages.Properties.Get("tools.ctags.path"])
6868
//require.Equal(t, "\"{cmd.path}\" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives \"{source_file}\"", packages.Properties.Get("tools.ctags.pattern"])
@@ -114,7 +114,7 @@ func TestLoadHardwareMixingUserHardwareFolder(t *testing.T) {
114114
require.Equal(t, "-v", avrPlatform.Properties.Get("tools.avrdude.bootloader.params.verbose"))
115115
require.Equal(t, "/my/personal/avrdude", avrPlatform.Properties.Get("tools.avrdude.cmd.path"))
116116

117-
require.Equal(t, "AVRISP mkII", avrPlatform.Programmers["avrispmkii"].Get("name"))
117+
require.Equal(t, "AVRISP mkII", avrPlatform.Programmers["avrispmkii"].Name)
118118

119119
require.Equal(t, "-w -x c++ -M -MG -MP", avrPlatform.Properties.Get("preproc.includes.flags"))
120120
require.Equal(t, "-w -x c++ -E -CC", avrPlatform.Properties.Get("preproc.macros.flags"))
@@ -177,8 +177,8 @@ func TestLoadHardwareWithBoardManagerFolderStructure(t *testing.T) {
177177

178178
require.Equal(t, 3, len(samdPlatform.Programmers))
179179

180-
require.Equal(t, "Atmel EDBG", samdPlatform.Programmers["edbg"].Get("name"))
181-
require.Equal(t, "openocd", samdPlatform.Programmers["edbg"].Get("program.tool"))
180+
require.Equal(t, "Atmel EDBG", samdPlatform.Programmers["edbg"].Name)
181+
require.Equal(t, "openocd", samdPlatform.Programmers["edbg"].Properties.Get("program.tool"))
182182

183183
avrRedBearPlatform := packages["RedBearLab"].Platforms["avr"].Releases["1.0.0"]
184184
require.Equal(t, 3, len(avrRedBearPlatform.Boards))

‎rpc/commands/commands.pb.go

Lines changed: 170 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎rpc/commands/commands.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ service ArduinoCore {
8585
// Upload a compiled sketch to an Arduino board.
8686
rpc Upload(UploadReq) returns (stream UploadResp);
8787

88+
rpc ListProgrammersAvailableForUpload(ListProgrammersAvailableForUploadReq) returns (ListProgrammersAvailableForUploadResp);
89+
90+
// Burn bootloader to a board.
91+
rpc BurnBootloader(BurnBootloaderReq) returns (stream BurnBootloaderResp);
92+
8893
// Search for a platform in the platforms indexes.
8994
rpc PlatformSearch(PlatformSearchReq) returns (PlatformSearchResp);
9095

‎rpc/commands/compile.pb.go

Lines changed: 39 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎rpc/commands/compile.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ message CompileReq {
4040
bool optimizeForDebug = 16; // Optimize compile output for debug, not for release.
4141
bool dryRun = 17; // When set to `true` the compiled binary will not be copied to the export directory.
4242
string export_dir = 18; // Optional: save the build artifacts in this directory, the directory must exist.
43+
string programmer = 19; // External programmer for upload
4344
}
4445

4546
message CompileResp {

‎rpc/commands/upload.pb.go

Lines changed: 319 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎rpc/commands/upload.proto

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,50 @@ message UploadReq {
4343
// Custom path to a directory containing compiled files. When `import_dir` is
4444
// not specified, the standard build directory under `sketch_path` is used.
4545
string import_dir = 8;
46+
string programmer = 9;
4647
}
4748

4849
message UploadResp {
4950
// The output of the upload process.
5051
bytes out_stream = 1;
5152
// The error output of the upload process.
5253
bytes err_stream = 2;
53-
}
54+
}
55+
56+
message BurnBootloaderReq {
57+
// Arduino Core Service instance from the `Init` response.
58+
Instance instance = 1;
59+
// Fully qualified board name of the target board (e.g., `arduino:avr:uno`).
60+
string fqbn = 2;
61+
// The port of the programmer used to program the bootloader.
62+
string port = 3;
63+
// Whether to turn on verbose output during the programming.
64+
bool verbose = 4;
65+
// After programming, verify the contents of the memory on the board match the
66+
// uploaded binary.
67+
bool verify = 5;
68+
// The programmer to use for burning bootloader.
69+
string programmer = 6;
70+
}
71+
72+
message BurnBootloaderResp {
73+
// The output of the burn bootloader process.
74+
bytes out_stream = 1;
75+
// The error output of the burn bootloader process.
76+
bytes err_stream = 2;
77+
}
78+
79+
message ListProgrammersAvailableForUploadReq {
80+
Instance instance = 1;
81+
string fqbn = 2;
82+
}
83+
84+
message ListProgrammersAvailableForUploadResp {
85+
repeated Programmer programmers = 1;
86+
}
87+
88+
message Programmer {
89+
string platform = 1;
90+
string id = 2;
91+
string name = 3;
92+
}

0 commit comments

Comments
 (0)
Please sign in to comment.