We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c548aa1 commit 6f509d6Copy full SHA for 6f509d6
arduino/discovery/discovery.go
@@ -23,6 +23,7 @@ import (
23
24
"github.com/arduino/arduino-cli/cli/globals"
25
"github.com/arduino/arduino-cli/executils"
26
+ rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
27
"github.com/arduino/go-properties-orderedmap"
28
"github.com/pkg/errors"
29
)
@@ -62,6 +63,17 @@ type Port struct {
62
63
Properties *properties.Map `json:"properties"`
64
}
65
66
+// ToRPC converts Port into rpc.Port
67
+func (p *Port) ToRPC() *rpc.Port {
68
+ return &rpc.Port{
69
+ Address: p.Address,
70
+ Label: p.AddressLabel,
71
+ Protocol: p.Protocol,
72
+ ProtocolLabel: p.ProtocolLabel,
73
+ Properties: p.Properties.AsMap(),
74
+ }
75
+}
76
+
77
func (p *Port) String() string {
78
if p == nil {
79
return "none"
0 commit comments