@@ -139,7 +139,7 @@ func identifyViaCloudAPI(props *properties.Map, settings *configuration.Settings
139139}
140140
141141// identify returns a list of boards checking first the installed platforms or the Cloud API
142- func identify (pme * packagemanager.Explorer , port * discovery.Port , settings * configuration.Settings ) ([]* rpc.BoardListItem , error ) {
142+ func identify (pme * packagemanager.Explorer , port * discovery.Port , settings * configuration.Settings , skipCloudAPI bool ) ([]* rpc.BoardListItem , error ) {
143143 boards := []* rpc.BoardListItem {}
144144 if port .Properties == nil {
145145 return boards , nil
@@ -170,7 +170,7 @@ func identify(pme *packagemanager.Explorer, port *discovery.Port, settings *conf
170170
171171 // if installed cores didn't recognize the board, try querying
172172 // the builder API if the board is a USB device port
173- if len (boards ) == 0 {
173+ if len (boards ) == 0 && ! skipCloudAPI {
174174 items , err := identifyViaCloudAPI (port .Properties , settings )
175175 if err != nil {
176176 // this is bad, but keep going
@@ -225,7 +225,7 @@ func (s *arduinoCoreServerImpl) BoardList(ctx context.Context, req *rpc.BoardLis
225225
226226 ports := []* rpc.DetectedPort {}
227227 for _ , port := range dm .List () {
228- boards , err := identify (pme , port , s .settings )
228+ boards , err := identify (pme , port , s .settings , req . GetSkipCloudApiForBoardDetection () )
229229 if err != nil {
230230 warnings = append (warnings , err .Error ())
231231 }
@@ -298,7 +298,7 @@ func (s *arduinoCoreServerImpl) BoardListWatch(req *rpc.BoardListWatchRequest, s
298298
299299 boardsError := ""
300300 if event .Type == "add" {
301- boards , err := identify (pme , event .Port , s .settings )
301+ boards , err := identify (pme , event .Port , s .settings , req . GetSkipCloudApiForBoardDetection () )
302302 if err != nil {
303303 boardsError = err .Error ()
304304 }
0 commit comments