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

support variable stop bits #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

karlp
Copy link

@karlp karlp commented Aug 26, 2019

The commonly required settings are not just baud and parity, but also
sometimes stop bits. Add as an extra parameter to mbascii and mbrtu.

Signed-off-by: Karl Palsson [email protected]

The commonly required settings are not just baud and parity, but also
sometimes stop bits.  Add as an extra parameter to mbascii and mbrtu.

Signed-off-by: Karl Palsson <[email protected]>
@DipSwitch
Copy link

Nice addition but to be modbus compliant you should only use 2 bits when no parity is used. So it's always MB_PAR_EVEN, MB_PAR_ODD or MB_PAR_NONE. Where MB_PAR_EVEN and MB_PAR_ODD have 1 stop bit and MB_PAR_NONE should have 2 stop bits.

So if you want to be modbus compliant you de number of stop bits can be deducted from the chosen parity.

@karlp
Copy link
Author

karlp commented Nov 24, 2020

I would love to live in this beautiful standards compliant world of yours :) By all means, it can be automatically selected based on parity by default, but the options are still required if you actually want to use it.

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

Successfully merging this pull request may close these issues.

2 participants