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

Control fOutxCtsFlow with flag #114

Open
mishase opened this issue Apr 30, 2023 · 0 comments
Open

Control fOutxCtsFlow with flag #114

mishase opened this issue Apr 30, 2023 · 0 comments

Comments

@mishase
Copy link

mishase commented Apr 30, 2023

💥 Proposal

What feature you'd like to see

I need to control dcb.fOutxCtsFlow (https://github.com/serialport/bindings-cpp/blob/main/src/serialport_win.cpp#L160) value with flag from serial port configuration. Now it's linked directly to rtscts configuration, so it can't be set to false in any way.

Pitch

I have some kind of very exotic serial device that requires dcb.fOutxCtsFlow to be set to false while dcb.fRtsControl is set to RTS_CONTROL_ENABLE. There are the only DCB parameters that works with my device:

dcb.BaudRate = CBR_9600;
dcb.ByteSize = 8;
dcb.StopBits = TWOSTOPBITS;

dcb.Parity = EVENPARITY;
dcb.fDtrControl = DTR_CONTROL_ENABLE;
dcb.fRtsControl = RTS_CONTROL_ENABLE;

dcb.EofChar = 0x0;
dcb.ErrorChar = 0x0;
    
dcb.fErrorChar = 0x0;
dcb.EvtChar = 0x0;
    
dcb.XonChar = 0x11;
dcb.XoffChar = 0x13;

dcb.fOutxCtsFlow = FALSE; // Can't be set to FALSE using serialport library
dcb.fOutX = FALSE;
dcb.XonLim = 2048;
dcb.XoffLim = 512;

So I'm getting the following packet when setting up serial communication:

IOCTL_SERIAL_SET_HANDFLOW: Set handshake information
  ControlHandShake=1
  FlowReplace=64
  XonLimit=2048
  XoffLimit=512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant