@@ -56,12 +56,12 @@ func (p *Port) AddToCommand(cmd *cobra.Command, srv rpc.ArduinoCoreServiceServer
5656// This method allows will bypass the discoveries if:
5757// - a nil instance is passed: in this case the plain port and protocol arguments are returned (even if empty)
5858// - a protocol is specified: in this case the discoveries are not needed to autodetect the protocol.
59- func (p * Port ) GetPortAddressAndProtocol (instance * rpc.Instance , defaultAddress , defaultProtocol string ) (string , string , error ) {
59+ func (p * Port ) GetPortAddressAndProtocol (instance * rpc.Instance , srv rpc. ArduinoCoreServiceServer , defaultAddress , defaultProtocol string ) (string , string , error ) {
6060 if p .protocol != "" || instance == nil {
6161 return p .address , p .protocol , nil
6262 }
6363
64- port , err := p .GetPort (instance , defaultAddress , defaultProtocol )
64+ port , err := p .GetPort (instance , srv , defaultAddress , defaultProtocol )
6565 if err != nil {
6666 return "" , "" , err
6767 }
@@ -70,8 +70,7 @@ func (p *Port) GetPortAddressAndProtocol(instance *rpc.Instance, defaultAddress,
7070
7171// GetPort returns the Port obtained by parsing command line arguments.
7272// The extra metadata for the ports is obtained using the pluggable discoveries.
73- func (p * Port ) GetPort (instance * rpc.Instance , defaultAddress , defaultProtocol string ) (* rpc.Port , error ) {
74-
73+ func (p * Port ) GetPort (instance * rpc.Instance , srv rpc.ArduinoCoreServiceServer , defaultAddress , defaultProtocol string ) (* rpc.Port , error ) {
7574 address := p .address
7675 protocol := p .protocol
7776 if address == "" && (defaultAddress != "" || defaultProtocol != "" ) {
@@ -91,7 +90,10 @@ func (p *Port) GetPort(instance *rpc.Instance, defaultAddress, defaultProtocol s
9190
9291 ctx , cancel := context .WithCancel (context .Background ())
9392 defer cancel ()
94- watcher , err := commands .BoardListWatch (ctx , & rpc.BoardListWatchRequest {Instance : instance })
93+
94+ stream , watcher := commands .BoardListWatchProxyToChan (ctx )
95+ err := srv .BoardListWatch (& rpc.BoardListWatchRequest {Instance : instance }, stream )
96+
9597 if err != nil {
9698 return nil , err
9799 }
0 commit comments