-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add java constant for non-standard baud rate 921600 #177
Add java constant for non-standard baud rate 921600 #177
Conversation
@hiddenalpha some questions:
@alonarbel , in #176 you mention that you believe a buffer overflow occurs as a result of this value. What may be helpful in that bug report is:
|
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.
More discussion is needed before we can definitely say that this PR closes #176. Please see main thread bullet points.
Feel free :D I guess originally only the most common/portable values were added as constants. Because setParams() takes an integer, a caller can pass whatever value he likes. So theoretically the constants are not needed at all and seem to be there more for convenience.
The UINT_MAX is handled in setParams() (the else branch). Additionally, there seem to be some extra code for
Agree. As already mentioned before, to me those java constants look like pure convenience. Adding more constants does not change any functionality. Therefore one could argue to just close this PR and explain that raw integer values could be passed to setParam whenever someone needs some special baud rates (likely #176 would be such a place where explanation is requested). |
Hi @tresf and @hiddenalpha , As you mentioned, adding a constant for 921600 wouldn't help. In our application, we allow users to select the baud rate they want to use based on their hardware. When a user wants to connect, we use your setParam function and provide any baud rate parameter they choose, not just the predefined ones in your library. However, we've encountered an issue when users send very long commands (via the writeBytes function) at 921600 baud. The commands are being truncated even if they use rts/cts flow control.(when the command are with regular size the command are sent fine, for example a command that truncated has 980 characters). |
Ok. Then I vote to decline this PR :) I opened because I was not sure if the constants maybe led to confusion.
Thanks for clarification. So we have to look for the cause somewhere else :)
As its not an issue with the java constants, I think we should continue collecting more facts (in scope of #176) as tresf already suggested. |
Fixes: issue 176