File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import (
23
23
24
24
"github.com/arduino/arduino-cli/cli/globals"
25
25
"github.com/arduino/arduino-cli/executils"
26
+ rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
26
27
"github.com/arduino/go-properties-orderedmap"
27
28
"github.com/pkg/errors"
28
29
)
@@ -62,6 +63,17 @@ type Port struct {
62
63
Properties * properties.Map `json:"properties"`
63
64
}
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
+
65
77
func (p * Port ) String () string {
66
78
if p == nil {
67
79
return "none"
You can’t perform that action at this time.
0 commit comments