@@ -145,36 +145,9 @@ func (b *Board) GeneratePropertiesForConfiguration(config string) (*properties.M
145
145
// containing the properties required to identify the board. The returned sets
146
146
// must not be changed by the caller.
147
147
func (b * Board ) GetIdentificationProperties () []* properties.Map {
148
- if b .identificationProperties ! = nil {
149
- return b .identificationProperties
148
+ if b .identificationProperties = = nil {
149
+ b .identificationProperties = b . Properties . ExtractSubIndexSets ( "upload_port" )
150
150
}
151
- b .identificationProperties = []* properties.Map {}
152
-
153
- portIDPropsSet := b .Properties .SubTree ("upload_port" )
154
- if portIDPropsSet .Size () == 0 {
155
- return b .identificationProperties
156
- }
157
-
158
- // First check the identification properties with sub index "upload_port.N.xxx"
159
- idx := 0
160
- haveIndexedProperties := false
161
- for {
162
- idProps := portIDPropsSet .SubTree (fmt .Sprintf ("%d" , idx ))
163
- idx ++
164
- if idProps .Size () > 0 {
165
- haveIndexedProperties = true
166
- b .identificationProperties = append (b .identificationProperties , idProps )
167
- } else if idx > 1 {
168
- // Always check sub-id 0 and 1 (https://github.com/arduino/arduino-cli/issues/456)
169
- break
170
- }
171
- }
172
-
173
- // if there are no subindexed then check the whole "upload_port.xxx"
174
- if ! haveIndexedProperties {
175
- b .identificationProperties = append (b .identificationProperties , portIDPropsSet )
176
- }
177
-
178
151
return b .identificationProperties
179
152
}
180
153
0 commit comments