@@ -139,7 +139,7 @@ func identifyViaCloudAPI(props *properties.Map, settings *configuration.Settings
139
139
}
140
140
141
141
// 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 ) {
143
143
boards := []* rpc.BoardListItem {}
144
144
if port .Properties == nil {
145
145
return boards , nil
@@ -170,7 +170,7 @@ func identify(pme *packagemanager.Explorer, port *discovery.Port, settings *conf
170
170
171
171
// if installed cores didn't recognize the board, try querying
172
172
// the builder API if the board is a USB device port
173
- if len (boards ) == 0 {
173
+ if len (boards ) == 0 && ! skipCloudAPI {
174
174
items , err := identifyViaCloudAPI (port .Properties , settings )
175
175
if err != nil {
176
176
// this is bad, but keep going
@@ -225,7 +225,7 @@ func (s *arduinoCoreServerImpl) BoardList(ctx context.Context, req *rpc.BoardLis
225
225
226
226
ports := []* rpc.DetectedPort {}
227
227
for _ , port := range dm .List () {
228
- boards , err := identify (pme , port , s .settings )
228
+ boards , err := identify (pme , port , s .settings , req . GetSkipCloudApiForBoardDetection () )
229
229
if err != nil {
230
230
warnings = append (warnings , err .Error ())
231
231
}
@@ -298,7 +298,7 @@ func (s *arduinoCoreServerImpl) BoardListWatch(req *rpc.BoardListWatchRequest, s
298
298
299
299
boardsError := ""
300
300
if event .Type == "add" {
301
- boards , err := identify (pme , event .Port , s .settings )
301
+ boards , err := identify (pme , event .Port , s .settings , req . GetSkipCloudApiForBoardDetection () )
302
302
if err != nil {
303
303
boardsError = err .Error ()
304
304
}
0 commit comments