@@ -20,7 +20,6 @@ import (
2020 "time"
2121
2222 "github.com/arduino/arduino-cli/arduino"
23- "github.com/arduino/arduino-cli/arduino/discovery"
2423 "github.com/arduino/arduino-cli/commands"
2524 "github.com/arduino/arduino-cli/commands/board"
2625 "github.com/arduino/arduino-cli/internal/cli/feedback"
@@ -70,8 +69,7 @@ func (p *Port) GetPortAddressAndProtocol(instance *rpc.Instance, defaultAddress,
7069
7170// GetPort returns the Port obtained by parsing command line arguments.
7271// 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 ) {
7573
7674 address := p .address
7775 protocol := p .protocol
@@ -84,7 +82,7 @@ func (p *Port) GetPort(instance *rpc.Instance, defaultAddress, defaultProtocol s
8482 // the attached board without specifying explictly a port.
8583 // Tools that work this way must be specified using the property
8684 // "BOARD_ID.upload.tool.default" in the platform's boards.txt.
87- return & discovery .Port {
85+ return & rpc .Port {
8886 Protocol : "default" ,
8987 }, nil
9088 }
@@ -113,13 +111,13 @@ func (p *Port) GetPort(instance *rpc.Instance, defaultAddress, defaultProtocol s
113111 }
114112 port := portEvent .Port
115113 if (protocol == "" || protocol == port .Protocol ) && address == port .Address {
116- return port , nil
114+ return port . ToRPC () , nil
117115 }
118116
119117 case <- deadline :
120118 // No matching port found
121119 if protocol == "" {
122- return & discovery .Port {
120+ return & rpc .Port {
123121 Address : address ,
124122 Protocol : "serial" ,
125123 }, nil
0 commit comments