Skip to content

Commit 5c1c638

Browse files
committed
Remove fallback completely
1 parent 98b3829 commit 5c1c638

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

serial.go

+20-20
Original file line numberDiff line numberDiff line change
@@ -472,26 +472,26 @@ func spListDual(network bool) {
472472
// happen on windows in a fallback scenario where an
473473
// open port can't be identified because it is locked,
474474
// so just solve that by manually inserting
475-
if network {
476-
for port := range sh.ports {
477-
478-
isFound := false
479-
for _, item := range list {
480-
if strings.ToLower(port.portConf.Name) == strings.ToLower(item.Name) {
481-
isFound = true
482-
}
483-
}
484-
485-
if !isFound {
486-
// artificially push to front of port list
487-
log.Println(fmt.Sprintf("Did not find an open port in the serial port list. We are going to artificially push it onto the list. port:%v", port.portConf.Name))
488-
var ossp OsSerialPort
489-
ossp.Name = port.portConf.Name
490-
ossp.FriendlyName = port.portConf.Name
491-
list = append([]OsSerialPort{ossp}, list...)
492-
}
493-
}
494-
}
475+
// if network {
476+
// for port := range sh.ports {
477+
478+
// isFound := false
479+
// for _, item := range list {
480+
// if strings.ToLower(port.portConf.Name) == strings.ToLower(item.Name) {
481+
// isFound = true
482+
// }
483+
// }
484+
485+
// if !isFound {
486+
// // artificially push to front of port list
487+
// log.Println(fmt.Sprintf("Did not find an open port in the serial port list. We are going to artificially push it onto the list. port:%v", port.portConf.Name))
488+
// var ossp OsSerialPort
489+
// ossp.Name = port.portConf.Name
490+
// ossp.FriendlyName = port.portConf.Name
491+
// list = append([]OsSerialPort{ossp}, list...)
492+
// }
493+
// }
494+
// }
495495

496496
// we have a full clean list of ports now. iterate thru them
497497
// to append the open/close state, baud rates, etc to make

0 commit comments

Comments
 (0)