Skip to content

Commit 2ae3694

Browse files
committed
Fixed parsing for SystemProfiler on Macosx El Capitan
Should alleviate #3928
1 parent 28ad89d commit 2ae3694

File tree

3 files changed

+122
-1
lines changed

3 files changed

+122
-1
lines changed

app/test/processing/app/macosx/SystemProfilerParserTest.java

+4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ public void shouldCorrectlyParse() throws Exception {
7474

7575
output = getFileContent("system_profiler_output8.txt");
7676
assertEquals("0X03EB_0X2157", extractVIDAndPID(output, "/dev/tty.usbmodemfd132"));
77+
78+
// OSX El Capitan
79+
output = getFileContent("system_profiler_output9.txt");
80+
assertEquals("0X2341_0X8036", extractVIDAndPID(output, "/dev/tty.usbmodemFA121"));
7781
}
7882

7983
private String getFileContent(String filename) throws IOException {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
USB:
2+
3+
USB 2.0 Bus:
4+
5+
Host Controller Driver: AppleUSBEHCIPCI
6+
PCI Device ID: 0x1c2d
7+
PCI Revision ID: 0x0005
8+
PCI Vendor ID: 0x8086
9+
10+
Hub:
11+
12+
Product ID: 0x2513
13+
Vendor ID: 0x0424 (SMSC)
14+
Version: b.b3
15+
Speed: Up to 480 Mb/sec
16+
Location ID: 0xfa100000 / 1
17+
Current Available (mA): 1000
18+
Current Required (mA): 2
19+
Extra Operating Current (mA): 0
20+
Built-In: Yes
21+
22+
Arduino Leonardo:
23+
24+
Product ID: 0x8036
25+
Vendor ID: 0x2341
26+
Version: 1.00
27+
Speed: Up to 12 Mb/sec
28+
Manufacturer: Arduino LLC
29+
Location ID: 0xfa120000 / 3
30+
Current Available (mA): 1000
31+
Current Required (mA): 500
32+
Extra Operating Current (mA): 0
33+
34+
BRCM20702 Hub:
35+
36+
Product ID: 0x4500
37+
Vendor ID: 0x0a5c (Broadcom Corp.)
38+
Version: 1.00
39+
Speed: Up to 12 Mb/sec
40+
Manufacturer: Apple Inc.
41+
Location ID: 0xfa110000 / 4
42+
Current Available (mA): 1000
43+
Current Required (mA): 94
44+
Extra Operating Current (mA): 0
45+
Built-In: Yes
46+
47+
Bluetooth USB Host Controller:
48+
49+
Product ID: 0x8281
50+
Vendor ID: 0x05ac (Apple Inc.)
51+
Version: 1.51
52+
Speed: Up to 12 Mb/sec
53+
Manufacturer: Apple Inc.
54+
Location ID: 0xfa113000 / 2
55+
Current Available (mA): 1000
56+
Current Required (mA): 0
57+
Extra Operating Current (mA): 0
58+
Built-In: Yes
59+
60+
USB 2.0 Bus:
61+
62+
Host Controller Driver: AppleUSBEHCIPCI
63+
PCI Device ID: 0x1c26
64+
PCI Revision ID: 0x0005
65+
PCI Vendor ID: 0x8086
66+
67+
Hub:
68+
69+
Product ID: 0x2513
70+
Vendor ID: 0x0424 (SMSC)
71+
Version: b.b3
72+
Speed: Up to 480 Mb/sec
73+
Location ID: 0xfd100000 / 1
74+
Current Available (mA): 1000
75+
Current Required (mA): 2
76+
Extra Operating Current (mA): 0
77+
Built-In: Yes
78+
79+
USB Keyboard:
80+
81+
Product ID: 0x2000
82+
Vendor ID: 0x040b (Weltrend Semiconductor)
83+
Version: 2.05
84+
Speed: Up to 1.5 Mb/sec
85+
Manufacturer: Generic
86+
Location ID: 0xfd130000 / 4
87+
Current Available (mA): 1000
88+
Current Required (mA): 100
89+
Extra Operating Current (mA): 0
90+
91+
USB OPTICAL MOUSE:
92+
93+
Product ID: 0x2510
94+
Vendor ID: 0x093a (Pixart Imaging, Inc.)
95+
Version: 1.00
96+
Speed: Up to 1.5 Mb/sec
97+
Manufacturer: PIXART
98+
Location ID: 0xfd120000 / 3
99+
Current Available (mA): 1000
100+
Current Required (mA): 100
101+
Extra Operating Current (mA): 0
102+
103+
IR Receiver:
104+
105+
Product ID: 0x8242
106+
Vendor ID: 0x05ac (Apple Inc.)
107+
Version: 0.16
108+
Speed: Up to 1.5 Mb/sec
109+
Manufacturer: Apple Computer, Inc.
110+
Location ID: 0xfd110000 / 2
111+
Current Available (mA): 1000
112+
Current Required (mA): 100
113+
Extra Operating Current (mA): 0
114+
Built-In: Yes
115+
116+
117+

arduino-core/src/processing/app/macosx/SystemProfilerParser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public synchronized static String extractVIDAndPID(String output, String serial)
7373
String computedDevicePath = device.get(DEVICE_PATH);
7474
String computedDevicePathMinusChar = computedDevicePath.substring(0, computedDevicePath.length() - 1);
7575
String serialMinusChar = serial.substring(0, serial.length() - 1);
76-
if (computedDevicePath.equals(serial) || computedDevicePathMinusChar.equals(serialMinusChar)) {
76+
if (computedDevicePath.equalsIgnoreCase(serial) || computedDevicePathMinusChar.equalsIgnoreCase(serialMinusChar)) {
7777
return (device.get(VID) + "_" + device.get(PID)).toUpperCase();
7878
}
7979
}

0 commit comments

Comments
 (0)