Skip to content

Commit 3c10109

Browse files
committed
Automatically add port detection properties for network discovery
1 parent d7a576c commit 3c10109

File tree

3 files changed

+30
-19
lines changed

3 files changed

+30
-19
lines changed

arduino/cores/packagemanager/loader.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,17 @@ func convertLegacyPlatformToPluggableDiscovery(platform *cores.PlatformRelease)
382382
if oldUploadTool == toolName && !board.Properties.ContainsKey("upload.tool.network") {
383383
board.Properties.Set("upload.tool.network", convertedToolName)
384384
// fmt.Printf("ADDED: %s.upload.tool.network=%s\n", board, convertedToolName)
385+
386+
// Add identification properties for network protocol
387+
i := 0
388+
for {
389+
if !board.Properties.ContainsKey(fmt.Sprintf("upload_port.%d.vid", i)) {
390+
break
391+
}
392+
i++
393+
}
394+
board.Properties.Set(fmt.Sprintf("upload_port.%d.board", i), board.BoardID)
395+
// fmt.Printf("ADDED: upload_port.%d.board=%s\n", i, board.BoardID)
385396
}
386397
}
387398
}

i18n/data/en.po

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,7 +2128,7 @@ msgstr "can't find latest release of %s"
21282128
msgid "can't find main Sketch file in %s"
21292129
msgstr "can't find main Sketch file in %s"
21302130

2131-
#: arduino/cores/packagemanager/loader.go:687
2131+
#: arduino/cores/packagemanager/loader.go:751
21322132
msgid "can't find pattern for discovery with id %s"
21332133
msgstr "can't find pattern for discovery with id %s"
21342134

@@ -2238,7 +2238,7 @@ msgstr "copying output file %s"
22382238
msgid "could not find a valid build artifact"
22392239
msgstr "could not find a valid build artifact"
22402240

2241-
#: arduino/cores/packagemanager/loader.go:659
2241+
#: arduino/cores/packagemanager/loader.go:723
22422242
msgid "creating discovery: %s"
22432243
msgstr "creating discovery: %s"
22442244

@@ -2293,11 +2293,11 @@ msgstr "destination dir %s already exists, cannot install"
22932293
msgid "discovery %[1]s process not started: %[2]w"
22942294
msgstr "discovery %[1]s process not started: %[2]w"
22952295

2296-
#: arduino/cores/packagemanager/loader.go:648
2296+
#: arduino/cores/packagemanager/loader.go:712
22972297
msgid "discovery not found: %s"
22982298
msgstr "discovery not found: %s"
22992299

2300-
#: arduino/cores/packagemanager/loader.go:653
2300+
#: arduino/cores/packagemanager/loader.go:717
23012301
msgid "discovery not installed: %s"
23022302
msgstr "discovery not installed: %s"
23032303

@@ -2496,7 +2496,7 @@ msgstr "getting build properties for board %[1]s: %[2]s"
24962496
msgid "getting discovery dependencies for platform %[1]s: %[2]s"
24972497
msgstr "getting discovery dependencies for platform %[1]s: %[2]s"
24982498

2499-
#: arduino/cores/packagemanager/loader.go:587
2499+
#: arduino/cores/packagemanager/loader.go:651
25002500
msgid "getting parent dir of %[1]s: %[2]s"
25012501
msgstr "getting parent dir of %[1]s: %[2]s"
25022502

@@ -2758,7 +2758,7 @@ msgstr "loading board data: %s"
27582758
msgid "loading boards: %s"
27592759
msgstr "loading boards: %s"
27602760

2761-
#: arduino/cores/packagemanager/loader.go:542
2761+
#: arduino/cores/packagemanager/loader.go:606
27622762
msgid "loading bundled tools from %[1]s: %[2]s"
27632763
msgstr "loading bundled tools from %[1]s: %[2]s"
27642764

@@ -2785,7 +2785,7 @@ msgstr "loading platform release %[1]s: %[2]s"
27852785
msgid "loading platform.txt: %v"
27862786
msgstr "loading platform.txt: %v"
27872787

2788-
#: arduino/cores/packagemanager/loader.go:509
2788+
#: arduino/cores/packagemanager/loader.go:573
27892789
msgid "loading tool release in %[1]s: %[2]s"
27902790
msgstr "loading tool release in %[1]s: %[2]s"
27912791

@@ -2997,7 +2997,7 @@ msgstr "platform not found: %s"
29972997

29982998
#: arduino/cores/packagemanager/install_uninstall.go:65
29992999
#: arduino/cores/packagemanager/install_uninstall.go:108
3000-
#: arduino/cores/packagemanager/loader.go:371
3000+
#: arduino/cores/packagemanager/loader.go:435
30013001
#: commands/compile/compile.go:128
30023002
msgid "platform not installed"
30033003
msgstr "platform not installed"
@@ -3050,7 +3050,7 @@ msgstr "quitting discovery %[1]s: %[2]w"
30503050
msgid "reading %[1]s directory: %[2]s"
30513051
msgstr "reading %[1]s directory: %[2]s"
30523052

3053-
#: arduino/cores/packagemanager/loader.go:592
3053+
#: arduino/cores/packagemanager/loader.go:656
30543054
msgid "reading %[1]s: %[2]s"
30553055
msgstr "reading %[1]s: %[2]s"
30563056

@@ -3064,7 +3064,7 @@ msgid "reading dir %[1]s: %[2]s"
30643064
msgstr "reading dir %[1]s: %[2]s"
30653065

30663066
#: arduino/cores/packagemanager/loader.go:162
3067-
#: arduino/cores/packagemanager/loader.go:500
3067+
#: arduino/cores/packagemanager/loader.go:564
30683068
msgid "reading directory %[1]s: %[2]s"
30693069
msgstr "reading directory %[1]s: %[2]s"
30703070

@@ -3163,7 +3163,7 @@ msgstr "saving downloaded index signature: %s"
31633163
msgid "scanning examples: %s"
31643164
msgstr "scanning examples: %s"
31653165

3166-
#: arduino/cores/packagemanager/loader.go:578
3166+
#: arduino/cores/packagemanager/loader.go:642
31673167
msgid "searching for builtin_tools_versions.txt in %[1]s: %[2]s"
31683168
msgstr "searching for builtin_tools_versions.txt in %[1]s: %[2]s"
31693169

@@ -3184,7 +3184,7 @@ msgstr "signature verification error: %s"
31843184
msgid "sketchPath"
31853185
msgstr "sketchPath"
31863186

3187-
#: arduino/cores/packagemanager/loader.go:434
3187+
#: arduino/cores/packagemanager/loader.go:498
31883188
msgid "skipping loading of boards %s: malformed custom board options"
31893189
msgstr "skipping loading of boards %s: malformed custom board options"
31903190

i18n/rice-box.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)