-
Notifications
You must be signed in to change notification settings - Fork 126
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
OSX custom baudrates: fixed and refactored #62
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few remarks...
struct termios tio0; | ||
int baudrate0; | ||
|
||
if ( fd >= 3 ) { /* don't apply this workaround for stdin/stdout/stderr */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why special-case these three? I see no reason to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On startup (e.g. picocom /dev/tty.usbserial -b12345
), I'd observed 2 calls to tcsetattr():
tcsetattr(3, 2, 12345)
tcsetattr(0, 2, 9600)
For the 2nd call (fd=0=stdin), when it runs into my workaround code, the ioctl(IOSSIOSPEED)
call fail with "Inappropriate ioctl for device".
Normally, this should not happen, because I also check for term_baud_std()
and I see 9600 baud in this case. But I dont want to rely on, that I always see 9600 baud for the stdin call.
So I decide to don't apply the workaround, if I was called with fd=0 (stdin), fd=1 (stdout) or fd=2 (stderr).
/* Need to undef tcsetattr to get access to the original tcsetattr() | ||
* function inside our module. | ||
*/ | ||
#undef tcsetattr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also avoid including custbaud_osx.h
, instead of the undef... Whatever feels better to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok as it is.
Now I'd just tried custom baudrates with FreeBsd (native FreeBsd 11 installation).
I'll perform the work when this OSX PR is merged. |
might consider merge? |
what matter, won't merge? |
Reminder … what about merging this PR or not? |
No response since about 5 month; stopped activity on this project? |
Tx for the patch. Works perfect for me. Needed 74880 baud for ESP8266 ... |
There is no activity on this whole github account since 2016-12-16 and I don't know the reason why. |
Sorry guys, some personal issues (which I won't get into here) prevented me from dealing with this for way too long. Finaly merged |
See also #57 and #59