mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-22 08:22:04 +03:00
Trying to fix macosx system_profiler parser
This commit is contained in:
@ -51,7 +51,14 @@ public class SystemProfilerParser {
|
||||
if ((matcher = serialNumberRegex.matcher(line)).matches()) {
|
||||
device.put(SERIAL_NUMBER, matcher.group(1));
|
||||
} else if ((matcher = locationRegex.matcher(line)).matches()) {
|
||||
device.put(DEVICE_PATH, devicePrefix + matcher.group(1).substring(2, 6) + "1");
|
||||
String devicePath = devicePrefix;
|
||||
String suffix = matcher.group(1).substring(2, 6);
|
||||
try {
|
||||
devicePath = devicePath + (Integer.parseInt(suffix) + 1);
|
||||
} catch (NumberFormatException e) {
|
||||
devicePath = devicePath + suffix + "1";
|
||||
}
|
||||
device.put(DEVICE_PATH, devicePath);
|
||||
} else if ((matcher = pidRegex.matcher(line)).matches()) {
|
||||
device.put(PID, matcher.group(1));
|
||||
} else if ((matcher = vidRegex.matcher(line)).matches()) {
|
||||
|
Reference in New Issue
Block a user