@@ -32,6 +32,9 @@ func removeNonArduinoBoards(ports []OsSerialPort) []OsSerialPort {
32
32
//log.Println(string(cmdOutput))
33
33
cmdOutSlice := strings .Split (string (cmdOutput ), "\n " )
34
34
35
+ var arduino_ports []OsSerialPort
36
+ var other_ports []OsSerialPort
37
+
35
38
// how many lines is the output? boards attached = lines/8
36
39
for i := 0 ; i < len (cmdOutSlice )/ 8 ; i ++ {
37
40
@@ -59,17 +62,22 @@ func removeNonArduinoBoards(ports []OsSerialPort) []OsSerialPort {
59
62
if ! strings .Contains (port .Name , "/cu" ) {
60
63
port .RelatedNames = append (port .RelatedNames , archBoardName )
61
64
port .FriendlyName = strings .Trim (boardName , "\n " )
65
+ arduino_ports = append (arduino_ports , port )
66
+ } else {
67
+ other_ports = append (other_ports , port )
62
68
}
63
69
}
64
70
}
65
71
}
66
72
73
+ arduino_ports = append (arduino_ports , other_ports ... )
74
+
67
75
// additional remove phase
68
- ports = Filter (ports , func (port OsSerialPort ) bool {
76
+ arduino_ports = Filter (arduino_ports , func (port OsSerialPort ) bool {
69
77
return ! strings .Contains (port .Name , "Blue" ) && ! strings .Contains (port .Name , "/cu" )
70
78
})
71
79
72
- return ports
80
+ return arduino_ports
73
81
}
74
82
75
83
func getList () ([]OsSerialPort , os.SyscallError ) {
0 commit comments