mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
Fixed parsing for SystemProfiler on Macosx El Capitan
Should alleviate #3928
This commit is contained in:
parent
28ad89d694
commit
2ae36940c6
@ -74,6 +74,10 @@ public class SystemProfilerParserTest {
|
|||||||
|
|
||||||
output = getFileContent("system_profiler_output8.txt");
|
output = getFileContent("system_profiler_output8.txt");
|
||||||
assertEquals("0X03EB_0X2157", extractVIDAndPID(output, "/dev/tty.usbmodemfd132"));
|
assertEquals("0X03EB_0X2157", extractVIDAndPID(output, "/dev/tty.usbmodemfd132"));
|
||||||
|
|
||||||
|
// OSX El Capitan
|
||||||
|
output = getFileContent("system_profiler_output9.txt");
|
||||||
|
assertEquals("0X2341_0X8036", extractVIDAndPID(output, "/dev/tty.usbmodemFA121"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getFileContent(String filename) throws IOException {
|
private String getFileContent(String filename) throws IOException {
|
||||||
|
117
app/test/processing/app/macosx/system_profiler_output9.txt
Normal file
117
app/test/processing/app/macosx/system_profiler_output9.txt
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
USB:
|
||||||
|
|
||||||
|
USB 2.0 Bus:
|
||||||
|
|
||||||
|
Host Controller Driver: AppleUSBEHCIPCI
|
||||||
|
PCI Device ID: 0x1c2d
|
||||||
|
PCI Revision ID: 0x0005
|
||||||
|
PCI Vendor ID: 0x8086
|
||||||
|
|
||||||
|
Hub:
|
||||||
|
|
||||||
|
Product ID: 0x2513
|
||||||
|
Vendor ID: 0x0424 (SMSC)
|
||||||
|
Version: b.b3
|
||||||
|
Speed: Up to 480 Mb/sec
|
||||||
|
Location ID: 0xfa100000 / 1
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 2
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
Built-In: Yes
|
||||||
|
|
||||||
|
Arduino Leonardo:
|
||||||
|
|
||||||
|
Product ID: 0x8036
|
||||||
|
Vendor ID: 0x2341
|
||||||
|
Version: 1.00
|
||||||
|
Speed: Up to 12 Mb/sec
|
||||||
|
Manufacturer: Arduino LLC
|
||||||
|
Location ID: 0xfa120000 / 3
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 500
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
|
||||||
|
BRCM20702 Hub:
|
||||||
|
|
||||||
|
Product ID: 0x4500
|
||||||
|
Vendor ID: 0x0a5c (Broadcom Corp.)
|
||||||
|
Version: 1.00
|
||||||
|
Speed: Up to 12 Mb/sec
|
||||||
|
Manufacturer: Apple Inc.
|
||||||
|
Location ID: 0xfa110000 / 4
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 94
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
Built-In: Yes
|
||||||
|
|
||||||
|
Bluetooth USB Host Controller:
|
||||||
|
|
||||||
|
Product ID: 0x8281
|
||||||
|
Vendor ID: 0x05ac (Apple Inc.)
|
||||||
|
Version: 1.51
|
||||||
|
Speed: Up to 12 Mb/sec
|
||||||
|
Manufacturer: Apple Inc.
|
||||||
|
Location ID: 0xfa113000 / 2
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 0
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
Built-In: Yes
|
||||||
|
|
||||||
|
USB 2.0 Bus:
|
||||||
|
|
||||||
|
Host Controller Driver: AppleUSBEHCIPCI
|
||||||
|
PCI Device ID: 0x1c26
|
||||||
|
PCI Revision ID: 0x0005
|
||||||
|
PCI Vendor ID: 0x8086
|
||||||
|
|
||||||
|
Hub:
|
||||||
|
|
||||||
|
Product ID: 0x2513
|
||||||
|
Vendor ID: 0x0424 (SMSC)
|
||||||
|
Version: b.b3
|
||||||
|
Speed: Up to 480 Mb/sec
|
||||||
|
Location ID: 0xfd100000 / 1
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 2
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
Built-In: Yes
|
||||||
|
|
||||||
|
USB Keyboard:
|
||||||
|
|
||||||
|
Product ID: 0x2000
|
||||||
|
Vendor ID: 0x040b (Weltrend Semiconductor)
|
||||||
|
Version: 2.05
|
||||||
|
Speed: Up to 1.5 Mb/sec
|
||||||
|
Manufacturer: Generic
|
||||||
|
Location ID: 0xfd130000 / 4
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 100
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
|
||||||
|
USB OPTICAL MOUSE:
|
||||||
|
|
||||||
|
Product ID: 0x2510
|
||||||
|
Vendor ID: 0x093a (Pixart Imaging, Inc.)
|
||||||
|
Version: 1.00
|
||||||
|
Speed: Up to 1.5 Mb/sec
|
||||||
|
Manufacturer: PIXART
|
||||||
|
Location ID: 0xfd120000 / 3
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 100
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
|
||||||
|
IR Receiver:
|
||||||
|
|
||||||
|
Product ID: 0x8242
|
||||||
|
Vendor ID: 0x05ac (Apple Inc.)
|
||||||
|
Version: 0.16
|
||||||
|
Speed: Up to 1.5 Mb/sec
|
||||||
|
Manufacturer: Apple Computer, Inc.
|
||||||
|
Location ID: 0xfd110000 / 2
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 100
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
Built-In: Yes
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -73,7 +73,7 @@ public class SystemProfilerParser {
|
|||||||
String computedDevicePath = device.get(DEVICE_PATH);
|
String computedDevicePath = device.get(DEVICE_PATH);
|
||||||
String computedDevicePathMinusChar = computedDevicePath.substring(0, computedDevicePath.length() - 1);
|
String computedDevicePathMinusChar = computedDevicePath.substring(0, computedDevicePath.length() - 1);
|
||||||
String serialMinusChar = serial.substring(0, serial.length() - 1);
|
String serialMinusChar = serial.substring(0, serial.length() - 1);
|
||||||
if (computedDevicePath.equals(serial) || computedDevicePathMinusChar.equals(serialMinusChar)) {
|
if (computedDevicePath.equalsIgnoreCase(serial) || computedDevicePathMinusChar.equalsIgnoreCase(serialMinusChar)) {
|
||||||
return (device.get(VID) + "_" + device.get(PID)).toUpperCase();
|
return (device.get(VID) + "_" + device.get(PID)).toUpperCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user