Skip to content

Commit 01d3d02

Browse files
Mattia Bertorellocmaglie
Mattia Bertorello
authored andcommitted
Use the BoardCloudResolver instead of the Platform class to get cloud vid pid
1 parent bcb8e90 commit 01d3d02

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

arduino-core/src/cc/arduino/packages/discoverers/serial/SerialDiscovery.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,14 @@
2929

3030
package cc.arduino.packages.discoverers.serial;
3131

32-
import java.util.ArrayList;
33-
import java.util.List;
34-
import java.util.Map;
35-
import java.util.Timer;
36-
import java.util.TimerTask;
37-
3832
import cc.arduino.packages.BoardPort;
3933
import cc.arduino.packages.Discovery;
4034
import processing.app.BaseNoGui;
4135
import processing.app.Platform;
4236
import processing.app.debug.TargetBoard;
37+
import processing.app.helpers.BoardCloudResolver;
38+
39+
import java.util.*;
4340

4441
public class SerialDiscovery implements Discovery, Runnable {
4542

@@ -50,6 +47,7 @@ public class SerialDiscovery implements Discovery, Runnable {
5047
public boolean uploadInProgress = false;
5148
public boolean pausePolling = false;
5249
private BoardPort oldUploadBoardPort = null;
50+
private final BoardCloudResolver boardCloudResolver = new BoardCloudResolver();
5351

5452

5553
@Override
@@ -203,7 +201,7 @@ public synchronized void forceRefresh() {
203201
boardPort.getPrefs().put("vid", parts[1]);
204202
boardPort.getPrefs().put("pid", parts[2]);
205203
// ask Cloud API to match the board with known VID/PID pair
206-
platform.getBoardWithMatchingVidPidFromCloud(parts[1], parts[2]);
204+
boardCloudResolver.getBoardBy(parts[1], parts[2]);
207205
} else {
208206
boardPort.getPrefs().put("vid", "0000");
209207
boardPort.getPrefs().put("pid", "0000");

0 commit comments

Comments
 (0)