1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-09 22:24:14 +03:00
Files
esp8266/app/src/processing/app/linux/UDevAdmParser.java
2013-06-13 13:19:26 +02:00

21 lines
523 B
Java

package processing.app.linux;
import java.io.IOException;
import java.io.StringReader;
import java.util.Properties;
public class UDevAdmParser {
public String extractVIDAndPID(String output) throws IOException {
Properties properties = new Properties();
properties.load(new StringReader(output));
Object vid = properties.get("ID_VENDOR_ID");
Object pid = properties.get("ID_MODEL_ID");
if (vid == null || pid == null)
return null;
return ("0x" + vid + "_0x" + pid).toUpperCase();
}
}