tarm / serial

BSD 3-Clause "New" or "Revised" License
1.6k stars 453 forks source link

Use "golang.org/x/sys/unix" instead of "syscall" (fix #59) #73

Closed hnw closed 6 years ago

hnw commented 6 years ago

According to the discussion on golang/go#18866, Termios from golang.org/x/sys/unix has better portability than syscall.Termios. So we should use it.

This PR works fine on mipsle.

tarm commented 6 years ago

Thanks for the PR!

nocko commented 6 years ago

This doesn't seem to fix #59. I have the same error (mipsle):

../vendor/github.com/tarm/serial/serial_linux.go:105:9: unknown field 'Ispeed' in struct literal of type syscall.Termios
../vendor/github.com/tarm/serial/serial_linux.go:106:9: unknown field 'Ospeed' in struct literal of type syscall.Termios

I don't see how it could work since Ispeed and Ospeed aren't in the struct on mips or mipsle, but are still referenced after this patch.

tarm commented 6 years ago

@nocko (repeating this comment from #59...) I believe this is compiling as expected on mips. I just pushed a change to the travis.yml file that adds cross compile targets for arm, mips, and mipsle and those at least compile (I have not personally tested mips, but arm and x64 are in production).