bugst / go-serial

A cross-platform serial library for go-lang.
BSD 3-Clause "New" or "Revised" License
622 stars 191 forks source link

Disable RTS/CTS handshake by default #10

Closed cmaglie closed 7 years ago

cmaglie commented 7 years ago

This should disable RTS/CTS flow control.

The constant syscall.CRTSCTS is not defined in golang, so I had to do a bit of research to find its value for all unix flavors.

Hopefully this fix #9, @jcw may you test it? you should need to patch only serial_darwin.go and serial_unix.go to try.

jcw commented 7 years ago

Fantastic, Christian - 100% confirmed on macOS amd64: before it hangs, after this patch it doesn't! Many thanks for helping to resolve this puzzle and the quick fix!

-jcw

cmaglie commented 7 years ago

thank you for finding the real cause of the malfunction, it was not so easy :-)

May I ask you a last favour, I've added some more commits to fix the linux side that touched also the macosx part. Now that this PR is merged can you try to update the library (or redownload from scratch) and try if it still works?

jcw commented 7 years ago

Done. I'm now running off a clean checkout again. It builds on all 7 targets listed in my Makefile.

jcw commented 7 years ago

I'm very sorry - I may have spoken too soon. Double-checking now if there's a regression...

jcw commented 7 years ago

It looks like something went wrong for macos/amd64. Have deleted and done a fresh go get go.bug.st/serial.v1 and the CTS sensitivity is back in.

jcw commented 7 years ago

Did you get a chance to look into this? I think this commit regressed - CTS blocks transmission on Mac again.

jcw commented 7 years ago

Must have been a case of PEBCAK. Seems to be working now, after doing a go build -a. Yippie! Apologies for the noise, and thanks again for resolving this.

PS: keenly looking forward to the new SetDTR code by mash ... :)

cmaglie commented 7 years ago

Oh wonderful! thanks for keep trying!

Sorry for the slow feedback, I must balance my spare time... it's not always easy :-)

PS: keenly looking forward to the new SetDTR code by mash ... :)

I'll take a look during this week-end (but I don't promise anything :-P)