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

Serial Port Parity #73

Open
wecoxSand opened this issue Jan 21, 2022 · 1 comment
Open

Serial Port Parity #73

wecoxSand opened this issue Jan 21, 2022 · 1 comment

Comments

@wecoxSand
Copy link

Using an empty constructor to generate a ModbusClient, then setting its properties. Setting ModbusClient.Parity = Parity.None; before calling .Connect() results in the internal serialport still creating with Parity.Even

@Padanian
Copy link

It all boils down to this deprecable getter/setter

        public Parity Parity
        {
            get
            {
                if (serialport != null)
                    return parity;
                else
                    return Parity.Even;
            }
            set
            {
                if (serialport != null)
                    parity = value;
            }
        }

Definining a property with the same name of an enum is a terrible idea.
Also Parity.Even is returned when serialport is null.

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