Skip to content

Commit 5e37994

Browse files
authored
Implementation of port discovery through Pluggable discovery (#900)
* Upgraded arduino-cli and replaced serialutils dep * Refined ports filter * Silenced linter warning * Use pointers in ports lists * Made spList a method of SpPortList * Renamed SpPortList in SerialPortList * Removed unneded initialization * Inlined discovery loop * Made updateSerialPortList a method of SerialPortList * Made enumerationLock private * Made portsLock (ex Mu) field private * Inlined function call * Made findPortByName a method of serialhub and moved near it * Inlined call to 'write' and removed the function * Removed unused ManufacutrerId and DeviceClass, renamed some fields * Simplified enumerateSerialPorts function * Removed redundant loggin of serial port list * Removed seriallist.go and inlined function calls * Make the singleton 'tools' a pointer * Implemented serial-discovery * Remove no more used 'Busy' field * Fixed error message
1 parent ef266fa commit 5e37994

File tree

16 files changed

+1027
-1042
lines changed

16 files changed

+1027
-1042
lines changed

.licensed.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ allowed:
5555
# The following are based on: https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses
5656
- gpl-1.0-or-later
5757
- gpl-1.0+ # Deprecated ID for `gpl-1.0-or-later`
58+
- gpl-2.0
5859
- gpl-2.0-or-later
5960
- gpl-2.0+ # Deprecated ID for `gpl-2.0-or-later`
6061
- gpl-3.0-only

.licenses/arduino-create-agent/go/github.com/arduino/arduino-cli/arduino/serialutils.dep.yml

Lines changed: 0 additions & 720 deletions
This file was deleted.

.licenses/arduino-create-agent/go/github.com/arduino/go-properties-orderedmap.dep.yml

Lines changed: 350 additions & 0 deletions
Large diffs are not rendered by default.

.licenses/arduino-create-agent/go/github.com/arduino/go-serial-utils.dep.yml

Lines changed: 458 additions & 0 deletions
Large diffs are not rendered by default.

.licenses/arduino-create-agent/go/github.com/arduino/arduino-cli/i18n.dep.yml renamed to .licenses/arduino-create-agent/go/github.com/arduino/pluggable-discovery-protocol-handler/v2.dep.yml

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
11
---
2-
name: github.com/arduino/arduino-cli/i18n
3-
version: v0.35.0
2+
name: github.com/arduino/pluggable-discovery-protocol-handler/v2
3+
version: v2.2.0
44
type: go
5-
summary:
6-
homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/i18n
7-
license: gpl-3.0-only
5+
summary: Package discovery is a library for handling the Arduino Pluggable-Discovery
6+
protocol (https://github.com/arduino/tooling-rfcs/blob/main/RFCs/0002-pluggable-discovery.md#pluggable-discovery-api-via-stdinstdout)
7+
homepage: https://pkg.go.dev/github.com/arduino/pluggable-discovery-protocol-handler/v2
8+
license: other
89
licenses:
9-
- sources: arduino-cli@v0.35.0/LICENSE.txt
10-
text: |2
10+
- sources: LICENSE.txt
11+
text: |
12+
This file includes licensing information for serial-discovery
13+
14+
Copyright (c) 2018 ARDUINO SA (www.arduino.cc)
15+
16+
The software is released under the GNU General Public License, which covers the main body
17+
of the serial-discovery code. The terms of this license can be found at:
18+
https://www.gnu.org/licenses/gpl-3.0.en.html
19+
20+
You can be released from the requirements of the above licenses by purchasing
21+
a commercial license. Buying such a license is mandatory if you want to modify or
22+
otherwise use the software for commercial activities involving the Arduino
23+
software without disclosing the source code of your own applications. To purchase
24+
a commercial license, send an email to license@arduino.cc
25+
1126
GNU GENERAL PUBLIC LICENSE
1227
Version 3, 29 June 2007
1328
@@ -682,20 +697,13 @@ licenses:
682697
the library. If this is what you want to do, use the GNU Lesser General
683698
Public License instead of this License. But first, please read
684699
<https://www.gnu.org/licenses/why-not-lgpl.html>.
685-
- sources: arduino-cli@v0.35.0/license_header.tpl
686-
text: |
687-
This file is part of arduino-cli.
700+
- sources: README.md
701+
text: |-
702+
Copyright (c) 2021 ARDUINO SA (www.arduino.cc)
688703
689-
Copyright{{ if .Year }} {{.Year}}{{ end }} {{.Holder}}
690-
691-
This software is released under the GNU General Public License version 3,
692-
which covers the main part of arduino-cli.
693-
The terms of this license can be found at:
704+
The software is released under the GNU General Public License, which covers the main body
705+
of the serial-discovery code. The terms of this license can be found at:
694706
https://www.gnu.org/licenses/gpl-3.0.en.html
695707
696-
You can be released from the requirements of the above licenses by purchasing
697-
a commercial license. Buying such a license is mandatory if you want to
698-
modify or otherwise use the software for commercial activities involving the
699-
Arduino software without disclosing the source code of your own applications.
700-
To purchase a commercial license, send an email to license@arduino.cc.
708+
See [LICENSE.txt](https://github.com/arduino/pluggable-discovery-protocol-handler/blob/master/LICENSE.txt) for details.
701709
notices: []

.licenses/arduino-create-agent/go/github.com/leonelquinteros/gotext.dep.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.licenses/arduino-create-agent/go/github.com/leonelquinteros/gotext/plurals.dep.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func uploadHandler(c *gin.Context) {
161161

162162
go func() {
163163
// Resolve commandline
164-
commandline, err := upload.PartiallyResolve(data.Board, filePath, tmpdir, data.Commandline, data.Extra, &Tools)
164+
commandline, err := upload.PartiallyResolve(data.Board, filePath, tmpdir, data.Commandline, data.Extra, Tools)
165165
if err != nil {
166166
send(map[string]string{uploadStatusStr: "Error", "Msg": err.Error()})
167167
return

go.mod

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ go 1.21
55
require (
66
fyne.io/systray v1.10.0
77
github.com/ProtonMail/go-crypto v1.1.0-alpha.0
8-
github.com/arduino/arduino-cli v0.35.0
98
github.com/arduino/go-paths-helper v1.12.0
9+
github.com/arduino/go-serial-utils v0.1.2
10+
github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.0
1011
github.com/blang/semver v3.5.1+incompatible
1112
github.com/codeclysm/extract/v3 v3.1.1
1213
github.com/gin-contrib/cors v1.5.0
@@ -28,6 +29,7 @@ require (
2829

2930
require (
3031
github.com/AnatolyRugalev/goregen v0.1.0 // indirect
32+
github.com/arduino/go-properties-orderedmap v1.8.0 // indirect
3133
github.com/bytedance/sonic v1.10.1 // indirect
3234
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
3335
github.com/chenzhuoyu/iasm v0.9.0 // indirect
@@ -56,13 +58,13 @@ require (
5658
github.com/kr/binarydist v0.1.0 // indirect
5759
github.com/kr/pretty v0.3.1 // indirect
5860
github.com/leodido/go-urn v1.2.4 // indirect
59-
github.com/leonelquinteros/gotext v1.4.0 // indirect
6061
github.com/manveru/faker v0.0.0-20171103152722-9fbc68a78c4d // indirect
6162
github.com/mattn/go-isatty v0.0.20 // indirect
6263
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6364
github.com/modern-go/reflect2 v1.0.2 // indirect
6465
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
6566
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
67+
github.com/rogpeppe/go-internal v1.12.0 // indirect
6668
github.com/sergi/go-diff v1.3.1 // indirect
6769
github.com/smartystreets/goconvey v1.6.4 // indirect
6870
github.com/tevino/abool v1.2.0 // indirect
@@ -76,5 +78,6 @@ require (
7678
golang.org/x/text v0.14.0 // indirect
7779
golang.org/x/tools v0.17.0 // indirect
7880
google.golang.org/protobuf v1.32.0 // indirect
81+
gopkg.in/ini.v1 v1.67.0 // indirect
7982
gopkg.in/yaml.v3 v3.0.1 // indirect
8083
)

go.sum

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ github.com/AnatolyRugalev/goregen v0.1.0 h1:xrdXkLaskMnbxW0x4FWNj2yoednv0X2bcTBW
44
github.com/AnatolyRugalev/goregen v0.1.0/go.mod h1:sVlY1tjcirqLBRZnCcIq1+7/Lwmqz5g7IK8AStjOVzI=
55
github.com/ProtonMail/go-crypto v1.1.0-alpha.0 h1:nHGfwXmFvJrSR9xu8qL7BkO4DqTHXE9N5vPhgY2I+j0=
66
github.com/ProtonMail/go-crypto v1.1.0-alpha.0/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE=
7-
github.com/arduino/arduino-cli v0.35.0 h1:tkSpGun1hMgJPkvZJjofejWD+ivhCpvsl49H4n81iSc=
8-
github.com/arduino/arduino-cli v0.35.0/go.mod h1:9aoXZdVGQ9uwf2M1nCSB+T051KbldslMFiJaHVycVsg=
7+
github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
98
github.com/arduino/go-paths-helper v1.12.0 h1:xizOQtI9iHdl19qXd1EmWg5i9W//2bOCOYwlNv8F61E=
109
github.com/arduino/go-paths-helper v1.12.0/go.mod h1:jcpW4wr0u69GlXhTYydsdsqAjLaYK5n7oWHfKqOG6LM=
10+
github.com/arduino/go-properties-orderedmap v1.8.0 h1:wEfa6hHdpezrVOh787OmClsf/Kd8qB+zE3P2Xbrn0CQ=
11+
github.com/arduino/go-properties-orderedmap v1.8.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk=
12+
github.com/arduino/go-serial-utils v0.1.2 h1:MRFwME4w/uaVkJ1R+wzz4KSbI9cF9IDVrYorazvjpTk=
13+
github.com/arduino/go-serial-utils v0.1.2/go.mod h1:kzIsNPgz8DFAd1sAFKve4ubxrdGcwQ4XzvRLlztsgnE=
14+
github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.0 h1:v7og6LpskewFabmaShKVzWXl5MXbmsxaRP3yo4dJta8=
15+
github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.0/go.mod h1:1dgblsmK2iBx3L5iNTyRIokeaxbTLUrYiUbHBK6yC3Y=
1116
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
1217
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
1318
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
@@ -97,8 +102,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
97102
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
98103
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
99104
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
100-
github.com/leonelquinteros/gotext v1.4.0 h1:2NHPCto5IoMXbrT0bldPrxj0qM5asOCwtb1aUQZ1tys=
101-
github.com/leonelquinteros/gotext v1.4.0/go.mod h1:yZGXREmoGTtBvZHNcc+Yfug49G/2spuF/i/Qlsvz1Us=
102105
github.com/manveru/faker v0.0.0-20171103152722-9fbc68a78c4d h1:Zj+PHjnhRYWBK6RqCDBcAhLXoi3TzC27Zad/Vn+gnVQ=
103106
github.com/manveru/faker v0.0.0-20171103152722-9fbc68a78c4d/go.mod h1:WZy8Q5coAB1zhY9AOBJP0O6J4BuDfbupUDavKY+I3+s=
104107
github.com/manveru/gobdd v0.0.0-20131210092515-f1a17fdd710b h1:3E44bLeN8uKYdfQqVQycPnaVviZdBLbizFhU49mtbe4=
@@ -123,8 +126,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
123126
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
124127
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
125128
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
126-
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
127-
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
129+
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
130+
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
128131
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
129132
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
130133
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=

0 commit comments

Comments
 (0)