File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
arduino-core/src/cc/arduino/packages/discoverers/serial Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -94,13 +94,23 @@ public synchronized void retriggerDiscovery(boolean polled) {
9494 for (String newPort : ports ) {
9595
9696 String [] parts = newPort .split ("_" );
97- String port = parts [0 ];
9897
99- if (parts .length != 3 ) {
98+ if (parts .length < 3 ) {
10099 // something went horribly wrong
101100 continue ;
102101 }
103102
103+ if (parts .length > 3 ) {
104+ // port name with _ in it (like CP2102 on OSX)
105+ for (int i = 1 ; i < (parts .length -2 ); i ++) {
106+ parts [0 ] += "_" + parts [i ];
107+ }
108+ parts [1 ] = parts [parts .length -2 ];
109+ parts [2 ] = parts [parts .length -1 ];
110+ }
111+
112+ String port = parts [0 ];
113+
104114 Map <String , Object > boardData = platform .resolveDeviceByVendorIdProductId (port , BaseNoGui .packages );
105115
106116 BoardPort boardPort = null ;
You can’t perform that action at this time.
0 commit comments