Commit Graph

251 Commits

Author SHA1 Message Date
Andrey Demenev
1131ba52fd Do not return -1 from Read() and Write()
Closes #55
2020-04-18 23:52:30 +02:00
Cristian Maglie
f7a06a7c47 Merge remote-tracking branch 'origin/v1' 2020-04-18 23:46:54 +02:00
martin-zaber
9f6eea0188 Fixing getPortList on windows without any ports 2020-04-18 23:43:54 +02:00
Cristian Maglie
820cffa341 Added doc for new USB Product field (windows-only) 2020-04-18 22:22:31 +01:00
giacomoberlin
f0d91f6e0d Product in PortDetails struct
un-commented Product member of the struct PortDetails. This goes with the pull request "completed retrievePortDetailsFromDevInfo #40". Apologies for not submitting together...
2020-04-18 22:09:26 +01:00
giacomoberlin
4df0da8377 completed retrievePortDetailsFromDevInfo
in retrievePortDetailsFromDevInfo:
- updated call to setupDiGetDeviceRegistryProperty with the same style used elsewhere (first get the reqSize, then call)
- use of generic variable names, in case the function is extended to fetch other values than spdrpFriendlyName (or spdrpDeviceDesc)
- re-enabled the assignment of details.Product
2020-04-18 22:08:55 +01:00
giacomoberlin
900c828b75 fixed API procSetupDiGetDeviceRegistryPropertyW
confusingly, in this prototype Microsoft decided to split bufSize and reqSize
2020-04-18 22:08:08 +01:00
Cristian Maglie
6a673bf917 Transparently handle EINTR during Read
This has been observed in particular on MacOS, in this case just retry
the call without throwing the error back to the user.

Related to:
https://github.com/arduino/arduino-cli/issues/504
https://github.com/arduino/arduino-pro-ide/issues/157
2019-12-03 20:26:03 +01:00
Cristian Maglie
d1a463e324 Updated build-passing badge 2019-12-03 17:03:28 +01:00
Cristian Maglie
88e081691b Fixed enumerator build for openbsd (unsupported operation) 2019-12-03 17:03:28 +01:00
Cristian Maglie
96546e190f Added some cross-os builds 2019-12-03 17:03:28 +01:00
Cristian Maglie
15b0a663d5 Switch to gh-actions (WIP 1/2) (#67) 2019-12-03 16:39:18 +01:00
Cristian Maglie
f2a9ea925f Updates to readme 2019-12-02 20:00:32 +01:00
Cristian Maglie
df95023074 Introducing go.mod for dep management 2019-12-02 19:51:36 +01:00
Cristian Maglie
24a6610f05 Updated license years
Updated to 2020 even if we are less than one month ahead.
2019-12-02 19:27:10 +01:00
Cristian Maglie
5f7892a7bb Merge pull request #52 from bugst/osx-fix-again
Fix osx build (again...)
2018-08-27 14:33:49 +02:00
Cristian Maglie
219de06186 Fixed darwin build for go1.10+ 2018-08-27 14:18:10 +02:00
Cristian Maglie
d3b8f81e83 Added go1.11 to travis build 2018-08-27 14:10:46 +02:00
Cristian Maglie
d759e28145 Merge pull request #51 from bugst/osx-fix
Fix 'darwin' build with latest releases of golang
2018-08-23 15:47:59 +02:00
Cristian Maglie
1c2446b92c Implementing compatibility with go latest
This should allow darwin to be compatible with all the latest

go1.7.x
go1.8.x
go1.9.x
2018-08-20 01:02:49 +02:00
Cristian Maglie
e42339511c Fixed wrong build tags... oops 2018-08-19 18:57:32 +02:00
Cristian Maglie
de1714d049 Added portlist cmd-line utility 2018-08-19 18:52:20 +02:00
Cristian Maglie
338c399730 Factored out C.IORegistryEntryCreateCFProperty method 2018-08-19 18:51:07 +02:00
Cristian Maglie
6085517433 Made error variable explicit in search loop 2018-08-19 18:41:24 +02:00
Cristian Maglie
cdac3b30e1 Removed extra parenthesis 2018-08-19 18:41:00 +02:00
Cristian Maglie
71fe05aedd Added Release method to CFTypeRef 2018-08-19 18:40:47 +02:00
Cristian Maglie
ee147ffce4 Added Release method to CFStringRef 2018-08-19 18:28:57 +02:00
Cristian Maglie
75aa16d69f CFRef are no more internally represented as pointer but as integers
This is due to improvements in CGO compiler for darwin OS
2018-08-19 18:13:24 +02:00
Cristian Maglie
ef634e5745 Removed duplicated methods on (nowadays) equivalent type C.io_*_t
This is due to improvements on the cgo builder related to darwin OS.
2018-08-19 18:11:32 +02:00
Cristian Maglie
3c7a545ca2 Removed -fconstant-cfstrings CGO build flag 2018-08-19 18:09:25 +02:00
Cristian Maglie
3ee4586c58 Splitted usb_darwing.go in two different build units based on go version 2018-08-19 18:08:03 +02:00
Cristian Maglie
c702e0a9aa Added OSX environment to travis builds 2018-08-19 17:44:27 +02:00
Cristian Maglie
eae1344f9f Merge pull request #36 from Lobaro/v1
Windows: Set DTS via setCommState
2017-07-28 10:12:30 +02:00
Tobias Kaupat
04b4ab1e45 Remove GetDTR() and GetRTS() 2017-07-28 09:49:49 +02:00
Veniamin Albaev
86b770d218 Enumerator: Fixed go:generate comment
It pointing to mksyscal_windows.go in local folder which already removed
2017-07-25 13:33:03 +02:00
Tobias Kaupat
fd75bf3895 Windows: Set DTS via setCommState
https://github.com/bugst/go-serial/issues/35
2017-07-25 13:07:20 +02:00
Cristian Maglie
1ba1196861 Fixed build of USB enumerator for go compiler >=1.8.3 (@facchinm)
Fixes #30
2017-06-22 15:40:40 +02:00
Cristian Maglie
c4db4e3956 Allow travis build failure on GOOS=openbsd GOARCH=arm
It seems that the package:

  golang.org/x/sys/unix

has a build failure on openbsd/arm:

  # golang.org/x/sys/unix
  ../../golang.org/x/sys/unix/flock.go:18: undefined: Flock_t
  ../../golang.org/x/sys/unix/sockcmsg_unix.go:36: undefined: Cmsghdr
  ../../golang.org/x/sys/unix/sockcmsg_unix.go:42: undefined: Cmsghdr

it seems a failure on the upstream package, so for now let's allow
the build failure.

This commit removes also the build for dragonfly that is not officially
supported.
2017-03-12 22:47:07 +01:00
Cristian Maglie
4366d1c449 Tentative support for OpenBSD
See #27
2017-03-12 22:41:52 +01:00
Cristian Maglie
4cc831e192 Some serial constants replaced by sys/unix package 2017-03-12 21:23:58 +01:00
Veniamin Albaev
8b7629bfe1 Added buffer flush methods
+ serial.Port.ResetInputBuffer()
+ serial.Port.ResetOutputBuffer()
2017-03-09 11:47:38 +03:00
Veniamin Albaev
4d886c1028 Unix: move from syscall to golang.org/x/sys/unix
Prepare to using `unix.TCFLSH`/`unix.TIOCFLUSH`
which is missing in `syscall` package
2017-03-09 11:04:37 +03:00
Veniamin Albaev
ccc846995c TravisCI: add go 1.8.x 2017-03-09 10:53:16 +03:00
Veniamin Albaev
4da3278c95 Use mksyscall_windows.go from $GOROOT 2017-03-09 10:46:44 +03:00
Cristian Maglie
48d7240ab8 Fixed typo 2017-03-04 22:54:59 +01:00
Cristian Maglie
970475ed06 Updated licenses 2017-03-04 16:29:55 +01:00
Veniamin Albaev
b55fdf163b All //sys instructions moved to separate syscall_* files
Generated `syscall_*` files ranamed to `zsyscall_*` ones
like it done in `golang.org/x/sys` package.
2017-02-23 21:40:47 +03:00
Martino Facchin
51237629e6 Fix build using Darwin and osxcross 2017-02-13 16:33:49 +01:00
Cristian Maglie
0d8c7bfd78 Merge branch 'usb' into v1 2017-02-04 00:56:12 +01:00
Cristian Maglie
11d1e54246 Updated docs for USB 2017-02-04 00:53:51 +01:00