@@ -20,7 +20,6 @@ import (
20
20
"time"
21
21
22
22
"github.com/arduino/arduino-cli/arduino"
23
- "github.com/arduino/arduino-cli/arduino/discovery"
24
23
"github.com/arduino/arduino-cli/commands"
25
24
"github.com/arduino/arduino-cli/commands/board"
26
25
"github.com/arduino/arduino-cli/internal/cli/feedback"
@@ -70,8 +69,7 @@ func (p *Port) GetPortAddressAndProtocol(instance *rpc.Instance, defaultAddress,
70
69
71
70
// GetPort returns the Port obtained by parsing command line arguments.
72
71
// The extra metadata for the ports is obtained using the pluggable discoveries.
73
- func (p * Port ) GetPort (instance * rpc.Instance , defaultAddress , defaultProtocol string ) (* discovery.Port , error ) {
74
- // TODO: REMOVE discovery from here (use board.List instead)
72
+ func (p * Port ) GetPort (instance * rpc.Instance , defaultAddress , defaultProtocol string ) (* rpc.Port , error ) {
75
73
76
74
address := p .address
77
75
protocol := p .protocol
@@ -84,7 +82,7 @@ func (p *Port) GetPort(instance *rpc.Instance, defaultAddress, defaultProtocol s
84
82
// the attached board without specifying explictly a port.
85
83
// Tools that work this way must be specified using the property
86
84
// "BOARD_ID.upload.tool.default" in the platform's boards.txt.
87
- return & discovery .Port {
85
+ return & rpc .Port {
88
86
Protocol : "default" ,
89
87
}, nil
90
88
}
@@ -113,13 +111,13 @@ func (p *Port) GetPort(instance *rpc.Instance, defaultAddress, defaultProtocol s
113
111
}
114
112
port := portEvent .Port
115
113
if (protocol == "" || protocol == port .Protocol ) && address == port .Address {
116
- return port , nil
114
+ return port . ToRPC () , nil
117
115
}
118
116
119
117
case <- deadline :
120
118
// No matching port found
121
119
if protocol == "" {
122
- return & discovery .Port {
120
+ return & rpc .Port {
123
121
Address : address ,
124
122
Protocol : "serial" ,
125
123
}, nil
0 commit comments