mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Split IDE into 2 projects.
BEWARE: HIGHLY EXPERIMENTAL BRANCH
This commit is contained in:
20
arduino-core/src/processing/app/linux/UDevAdmParser.java
Normal file
20
arduino-core/src/processing/app/linux/UDevAdmParser.java
Normal file
@ -0,0 +1,20 @@
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user