File tree 1 file changed +12
-2
lines changed
arduino-core/src/cc/arduino/packages/discoverers/serial
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) {
94
94
for (String newPort : ports ) {
95
95
96
96
String [] parts = newPort .split ("_" );
97
- String port = parts [0 ];
98
97
99
- if (parts .length != 3 ) {
98
+ if (parts .length < 3 ) {
100
99
// something went horribly wrong
101
100
continue ;
102
101
}
103
102
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
+
104
114
Map <String , Object > boardData = platform .resolveDeviceByVendorIdProductId (port , BaseNoGui .packages );
105
115
106
116
BoardPort boardPort = null ;
You can’t perform that action at this time.
0 commit comments