Skip to content

Commit

Permalink
Merge branch 'master' into andre-rs485
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreRenaud committed May 27, 2024
2 parents e1a84d8 + 0925f99 commit d3432f7
Show file tree
Hide file tree
Showing 40 changed files with 248 additions and 78 deletions.
78 changes: 78 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/forms/platform-dependent/bug-report.yml
# See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms

name: Bug report
description: Report a problem with the code or documentation in this repository.
labels:
- bug
body:
- type: textarea
id: description
attributes:
label: Describe the problem
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: To reproduce
description: |
Provide the specific set of steps we can follow to reproduce the
problem in particular the exact golang source code you used.
validations:
required: true
- type: checkboxes
id: checklist-reproduce
attributes:
label: |
Please double-check that you have reported each of the following
before submitting the issue.
options:
- label: I've provided the FULL source code that causes the problem
required: true
- label: I've provided all the actions required to reproduce the problem
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
description: |
What would you expect to happen after following those instructions?
validations:
required: true
- type: input
id: os
attributes:
label: Operating system and version
description: |
Which operating system(s) version are you using on your computer?
validations:
required: true
- type: textarea
id: boards
attributes:
label: Please describe your hardware setup
description: |
Arduino boards, USB dongles, hubs or embedded devices you are using and how they
are connected together.
- type: textarea
id: additional
attributes:
label: Additional context
description: |
Add here any additional information that you think might be relevant to
the problem.
validations:
required: false
- type: checkboxes
id: checklist
attributes:
label: Issue checklist
description: |
Please double-check that you have done each of the following things before
submitting the issue.
options:
- label: I searched for previous requests in [the issue tracker](https://github.com/bugst/go-serial/issues)
required: true
- label: My request contains all necessary details
required: true
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/forms/platform-dependent/feature-request.yml
# See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms

name: Feature request
description: Suggest an enhancement to this project.
labels:
- "type: enhancement"
body:
- type: textarea
id: description
attributes:
label: Describe the new feature or change suggestion
validations:
required: true
- type: textarea
id: additional
attributes:
label: Additional context
description: Add any additional information about the feature request here.
- type: checkboxes
id: checklist
attributes:
label: Issue checklist
description: Please double-check that you have done each of the following things before submitting the issue.
options:
- label: I searched for previous requests in [the issue tracker](https://github.com/bugst/go-serial/issues)
required: true
- label: My request contains all necessary details
required: true
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Copyright (c) 2014-2023, Cristian Maglie.
Copyright (c) 2014-2024, Cristian Maglie.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion enumerator/doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion enumerator/enumerator.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion enumerator/example_getdetailedportlist_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion enumerator/usb_darwin.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion enumerator/usb_freebsd.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion enumerator/usb_linux.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion enumerator/usb_openbsd.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
11 changes: 11 additions & 0 deletions enumerator/usb_wasm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//

package enumerator

func nativeGetDetailedPortsList() ([]*PortDetails, error) {
return nil, &PortEnumerationError{}
}
2 changes: 1 addition & 1 deletion enumerator/usb_windows.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion enumerator/usb_windows_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
15 changes: 15 additions & 0 deletions enumerator_wasm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//

package serial

import (
"errors"
)

func nativeGetPortsList() ([]string, error) {
return nil, errors.New("nativeGetPortsList is not supported on wasm")
}
2 changes: 1 addition & 1 deletion example_getportlist_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion example_modem_bits_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion example_serialport_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ go 1.17

require (
github.com/creack/goselect v0.1.2
github.com/stretchr/testify v1.7.0
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261
github.com/stretchr/testify v1.8.4
golang.org/x/sys v0.17.0
)

require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
20 changes: 12 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
github.com/creack/goselect v0.1.2 h1:2DNy14+JPjRBgPzAd1thbQp4BSIihxcBf0IXhQXDRa0=
github.com/creack/goselect v0.1.2/go.mod h1:a/NhLweNvqIYMuxcMOuWY516Cimucms3DglDzQP3hKY=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k=
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 h1:v6hYoSR9T5oet+pMXwUWkbiVqx/63mlHjefrHmxwfeY=
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 1 addition & 1 deletion portlist/portlist.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion serial.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion serial_bsd.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
11 changes: 8 additions & 3 deletions serial_darwin.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//

package serial

import "golang.org/x/sys/unix"
import (
"regexp"

"golang.org/x/sys/unix"
)

const devFolder = "/dev"
const regexFilter = "^(cu|tty)\\..*"

var osPortFilter = regexp.MustCompile("^(cu|tty)\\..*")

const ioctlTcgetattr = unix.TIOCGETA
const ioctlTcsetattr = unix.TIOCSETA
Expand Down
2 changes: 1 addition & 1 deletion serial_darwin_386.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
2 changes: 1 addition & 1 deletion serial_darwin_64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Expand Down
11 changes: 8 additions & 3 deletions serial_freebsd.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//

package serial

import "golang.org/x/sys/unix"
import (
"regexp"

"golang.org/x/sys/unix"
)

const devFolder = "/dev"
const regexFilter = "^(cu|tty)\\..*"

var osPortFilter = regexp.MustCompile("^(cu|tty)\\..*")

// termios manipulation functions

Expand Down
11 changes: 8 additions & 3 deletions serial_linux.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
//
// Copyright 2014-2023 Cristian Maglie. All rights reserved.
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//

package serial

import "golang.org/x/sys/unix"
import (
"regexp"

"golang.org/x/sys/unix"
)

const devFolder = "/dev"
const regexFilter = "(ttyS|ttyHS|ttyUSB|ttyACM|ttyAMA|rfcomm|ttyO|ttymxc)[0-9]{1,3}"

var osPortFilter = regexp.MustCompile("(ttyS|ttyHS|ttyUSB|ttyACM|ttyAMA|rfcomm|ttyO|ttymxc)[0-9]{1,3}")

// termios manipulation functions

Expand Down
Loading

0 comments on commit d3432f7

Please sign in to comment.