Commit Graph

265 Commits

Author SHA1 Message Date
Cristian Maglie
fb4b111d50 Hack for CH340 support 2025-03-12 20:50:56 +01:00
Cristian Maglie
0996f840dd Merge pull request #187 from twpayne/sys-windows
Use Windows serial comm functions from golang.org/x/sys/windows
2024-06-25 23:56:14 +02:00
Cristian Maglie
f5a4685ea0 Fixed examples for docs 2024-06-25 23:52:38 +02:00
Tom Payne
56ac2d4e76 Restore check for no detected serial ports on Windows 2024-06-25 11:02:05 +02:00
Tom Payne
1c72447e64 Fix typos
Co-authored-by: Cristian Maglie <c.maglie@bug.st>
2024-06-25 10:48:18 +02:00
Tom Payne
45e996e1b0 Use Windows serial comm functions from golang.org/x/sys/windows 2024-06-24 18:28:26 +02:00
Andreas Deininger
0b7848559a Fix typos (#183)
Co-authored-by: Cristian Maglie <c.maglie@bug.st>
2024-06-24 17:33:18 +02:00
Cristian Maglie
c18d387887 Merge pull request #184 from deining/gofmt
Go-format source code: fix warning
2024-06-24 17:26:52 +02:00
Cristian Maglie
c768d77847 Merge pull request #188 from twpayne/doc-fixes
Fixed minor documentation typos
2024-06-24 17:25:22 +02:00
Andreas Deininger
1282f62c6e Bump GitHub workflow actions to latest versions (#185)
* Bump GitHub workflow actions to latest versions

* Fixed typo

---------

Co-authored-by: Cristian Maglie <c.maglie@bug.st>
2024-06-24 17:24:35 +02:00
Cristian Maglie
4f7d935be3 Merge pull request #186 from AndreRenaud/enumerator-build
Workflows: Use CGO_ENABLED=1 for MacOS
2024-06-24 17:13:45 +02:00
Andre Renaud
03c961bc8a Workflows: Use CGO_ENABLED=1 for MacOS
Also enable explicit ARM64 builds
2024-05-28 09:27:43 +12:00
Andreas Deininger
671075c6ac Go-format source code 2024-04-01 16:04:53 +02:00
Tom Payne
bac809c5a1 Fixed minor documentation typos 2024-03-18 22:25:55 +01:00
Cristian Maglie
0925f99089 Merge pull request #176 from paralin/fix-wasm
fix: add shims for GOARCH=wasm with GOOS=js and GOOS=wasip1
2024-03-11 19:03:49 +01:00
Christian Stewart
42bc112d18 fix: add shims for GOARCH=wasm with GOOS=js and GOOS=wasip1
Fixes build errors:

GOOS=js GOARCH=wasm go build
GOOS=wasip1 GOARCH=wasm go build

Signed-off-by: Christian Stewart <christian@aperture.us>
2024-03-01 14:26:58 -08:00
Cristian Maglie
259bdeb6c7 Fixed typo 2024-02-20 15:57:58 +01:00
Cristian Maglie
572f392ca9 Updated license year 2024-02-20 15:27:44 +01:00
Cristian Maglie
14e5ea68ce Precompile port-filter regexp 2024-02-20 15:24:37 +01:00
Cristian Maglie
bcd8695df4 Removed deprecated package io/ioutil 2024-02-20 15:13:12 +01:00
Cristian Maglie
92703ecb02 Improved issue template message 2024-02-20 09:55:49 +01:00
Cristian Maglie
674fbae95a Upgraded dependencies 2024-02-20 09:52:27 +01:00
Cristian Maglie
2aa105e32e Improved issue template message 2024-02-20 09:51:06 +01:00
Cristian Maglie
7f490f208a Added issues templates 2024-02-18 19:33:23 +01:00
Cristian Maglie
9a2045a5ff Merge pull request #174 from bugst/windows-multi-set-rtscts
windows: Avoid double-set of communication parameters on Open
v1.6.2
2024-02-16 14:29:21 +01:00
Cristian Maglie
8b563a8428 Merge pull request #175 from cmaglie/improve_error_messages
Improved error messages
2024-02-16 14:23:34 +01:00
Cristian Maglie
9aae282f09 Improved error messages 2024-02-16 14:17:53 +01:00
Cristian Maglie
1d3c0099c3 Merge pull request #173 from jes/master
unix: nativeOpen: always close the port on errors
2024-02-16 13:51:41 +01:00
Cristian Maglie
c414e4f55c windows: Avoid double-set of communication parameters on Open 2024-02-16 13:32:43 +01:00
James Stanley
0f730e491f unix: nativeOpen: always close the port on errors 2024-02-11 21:08:52 +00:00
Cristian Maglie
8a31fcbd9b Merge pull request #165 from cmaglie/fix_darwin_enumerator
Fix some rare MacOSX USB port enumerator failures
2023-09-14 15:31:58 +02:00
Cristian Maglie
f3f01227e9 Fix some rare IOServiceGetMatchingServices failure on MacOSX
We had reports of users always getting:

  IOServiceGetMatchingServices failed, data changed while iterating

The issue seems related to the function getMatchingServices that
returns an always-invalid iterator even if there are no actual services.

This is a workaround for this issue.
2023-09-14 15:24:41 +02:00
Cristian Maglie
2e9030760a Merge pull request #163 from deadprogram/define-darwin-cgo-types
darwin: use Go type wrappers to avoid declaring Go methods on C types.
2023-08-10 13:10:52 +02:00
Cristian Maglie
1e13b2f610 removed leftover print 2023-08-10 13:10:27 +02:00
Cristian Maglie
c9a9ed456d darwin: wrap cgo-types directly (without using a struct)
This makes easier the boxing/unboxing of the wrapped types.
2023-08-10 13:10:27 +02:00
Cristian Maglie
c1ded5fc98 darwin: moved type definitions near methods definition 2023-08-10 13:10:27 +02:00
deadprogram
80a3721f8b darwin: use Go type wrappers to avoid declaring Go methods on C types.
This is needed starting with Go 1.21 due to stricter enforcement of rules
about adding methods to existing types, now including C types.

See https://github.com/golang/go/issues/60725 for further details.

Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-08-10 13:10:27 +02:00
Cristian Maglie
74e194ea45 Updated license 2023-08-10 01:09:42 +02:00
Cristian Maglie
386b387977 Updated license 2023-08-10 01:07:25 +02:00
Cristian Maglie
93097bf495 Removed obsolete +build directives in favor of modern go:build 2023-08-09 18:54:02 +02:00
Cristian Maglie
75c59a9418 Removed obsolete code 2023-08-09 18:48:09 +02:00
Daniel Lublin
d2a59a651d Make Open return a nil interface on failure
Closes #154

Signed-off-by: Daniel Lublin <daniel@lublin.se>
2023-08-09 18:41:06 +02:00
Cristian Maglie
a2c15aa1f5 Merge pull request #159 from AndreRenaud/feature/drain-support
Feature/drain support
2023-08-09 18:36:31 +02:00
Cristian Maglie
cce21700eb Added informative comment 2023-08-09 18:29:02 +02:00
Andre Renaud
bafe313749 Rework for Linux & BSD differences 2023-08-09 18:27:06 +02:00
Cristian Maglie
c89f81c053 Merge pull request #164 from ian-xu/master
feat: add ttyHS support for linux
2023-08-09 11:45:40 +02:00
Ancient Xu
10b7b3e7af feat: add ttyHS support for linux
Signed-off-by: Ancient Xu <ancientxu@gmail.com>
2023-08-08 18:17:02 +08:00
Tomáš Polomský
ff38fe2a78 add support for drain
Tested on Mac OS, Linux and Windows with UART emulated on USB.

I wrote general BSD code, because it should work, but I am not able to test
it.

On Mac OS I am quite sure that drain behaves as expected because it fixed
an issue with buffer overflow (which OS does not report but fails).

For Windows it seems that drain is actually part of `Write`, because
`Write` was long and `Drain` was fast. But I have not found any mention in
Win32 docs about buffering and asynchronous write, so I put there flushing
code to be sure, and this code did not break anything.

For Linux `Drain` is also taking more time than writing so it looks working
too.
2023-06-16 09:14:39 +02:00
Cristian Maglie
e381f2c133 Merge pull request #153 from cmaglie/fix_windows_enumerator
windows: Avoid panic if USB Product name is empty
2023-01-03 23:39:20 +01:00
Cristian Maglie
e6cff1a986 windows: Avoid panic if USB Product name is empty 2023-01-02 14:44:56 +01:00