Skip to content

Commit 373aa18

Browse files
committed
Allow port/protocol keys in sketch profile
1 parent 863c1ec commit 373aa18

File tree

3 files changed

+47
-12
lines changed

3 files changed

+47
-12
lines changed

internal/arduino/sketch/profiles.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ type Profile struct {
103103
Name string
104104
Notes string `yaml:"notes"`
105105
FQBN string `yaml:"fqbn"`
106+
Port string `yaml:"port"`
107+
Protocol string `yaml:"protocol"`
106108
Programmer string `yaml:"programmer"`
107109
Platforms ProfileRequiredPlatforms `yaml:"platforms"`
108110
Libraries ProfileRequiredLibraries `yaml:"libraries"`
@@ -114,6 +116,8 @@ func (p *Profile) ToRpc() *rpc.SketchProfile {
114116
Name: p.Name,
115117
Fqbn: p.FQBN,
116118
Programmer: p.Programmer,
119+
Port: p.Port,
120+
Protocol: p.Protocol,
117121
}
118122
}
119123

@@ -127,6 +131,12 @@ func (p *Profile) AsYaml() string {
127131
if p.Programmer != "" {
128132
res += fmt.Sprintf(" programmer: %s\n", p.Programmer)
129133
}
134+
if p.Port != "" {
135+
res += fmt.Sprintf(" port: %s\n", p.Port)
136+
}
137+
if p.Protocol != "" {
138+
res += fmt.Sprintf(" protocol: %s\n", p.Protocol)
139+
}
130140
res += p.Platforms.AsYaml()
131141
res += p.Libraries.AsYaml()
132142
return res

rpc/cc/arduino/cli/commands/v1/common.pb.go

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

rpc/cc/arduino/cli/commands/v1/common.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,8 @@ message SketchProfile {
213213
string fqbn = 2;
214214
// Programmer used by the profile
215215
string programmer = 3;
216+
// Default Port in this profile
217+
string port = 4;
218+
// Default Protocol in this profile
219+
string protocol = 5;
216220
}

0 commit comments

Comments
 (0)