Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In binary mode fails because sometimes the ioctl does not complete fast enough? #25

Open
esteimle opened this issue Apr 13, 2022 · 1 comment

Comments

@esteimle
Copy link

Feel free to close this if you don't think it is an issue. I was using your library to communicate with a USB serial port on Ubuntu 20.04. The device only communicates in binary mode. I was seeing some issues that happen sometimes when canonical mode was not disabled. Basically it seemed to hang or timeout when certain characters came through. I read through your setup code and it looked good though. But then I dropped a single print in SerialPort.cpp right before this line: this->SetTermios2(tty); all of a sudden all my problems went away :)

So I added a sleep but that seems a little hackish. I was wondering if you had any ideas or had seen something like this? I notice you had commented out a flush on the file descriptor and I wondered if something similar might have to happen with that ioctl call inside SetTermios2. Anyway just wondering if you had any thoughts on it, not complaining or anything. I'm just curious what's going wrong for me.

Thanks!

@gbmhunter
Copy link
Owner

Interesting @esteimle , I not sure sorry though whether it would help or not. If you do want to play around with fixing it, try adding a flush or similar and see if that changes things. Agreed that a print/sleep statement is a bit hackish, and is probably hiding the true issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants