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

Running on Windows without flow control #1276

Closed
kealist opened this issue Aug 3, 2017 · 1 comment
Closed

Running on Windows without flow control #1276

kealist opened this issue Aug 3, 2017 · 1 comment
Labels

Comments

@kealist
Copy link
Contributor

kealist commented Aug 3, 2017

  • SerialPort Version: 5.0.0

  • NodeJS Version: v6.11.1

  • Operating System and Hardware Platform: Windows 10

  • Have you checked the right version of the api docs?: I assume so (readme.md)

  • Are you having trouble installing and you checked the Installation Special Cases docs? No

  • Are you using Electron and have you checked the Electron Docs?: No

Summary of Problem

Trying to control robot whose interface requires no flow control. It's not working.

I am not familiar enough with Node modules to test these changes, so I am writing out some questions/concerns. Current issues in terms of how the dcb is treated in src/serialport_win.cpp

EIO_Open

Unsupported openOptions:

  • rtscts (hardcoded)
  • xon (hardcoded)
  • xoff (hardcoded)
  • xany (hardcoded)

Additionally, hupcl is missing from documentation, but it does allow disabling DTR (Yay!)

  if (data->hupcl) {
    dcb.fDtrControl = DTR_CONTROL_ENABLE;
  } else {
    dcb.fDtrControl = DTR_CONTROL_DISABLE;  // disable DTR to avoid reset
  }

Lack of control of RTS:

  dcb.fInX = FALSE;
  dcb.fOutX = FALSE;
  dcb.fOutxDsrFlow = FALSE;
  dcb.fOutxCtsFlow = FALSE;
  dcb.fRtsControl = RTS_CONTROL_ENABLE;

The last hardcoded line is problematic because there is no way to disable RTS. It would be better set as:

  if (data->rtscts) {
    dcb.fRtsControl = RTS_CONTROL_ENABLE;
  } else {
    dcb.fRtsControl = RTS_CONTROL_DISABLE;
 }

to match the Unix version.

Steps and Code to Reproduce the Issue

@reconbot
Copy link
Member

reconbot commented Aug 4, 2017

This is a great catch, thank you!

@reconbot reconbot closed this as completed Aug 6, 2017
@lock lock bot locked and limited conversation to collaborators Feb 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants