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

this only used:“ baudRate: 9600, dataBits: 8, parity: 'none', stopBits: 1, flowControl: ??f #206

Closed
robinxc opened this issue Aug 22, 2013 · 7 comments
Labels

Comments

@robinxc
Copy link

robinxc commented Aug 22, 2013

this only used:“ baudRate: 9600, dataBits: 8, parity: 'none', stopBits: 1, flowControl: false ” ??
when set: baudRate: 2400 or parity: 'even' ,send unreadable code

@JayBeavers
Copy link
Collaborator

I'm having a hard time following this issue. Can you restate?

@robinxc
Copy link
Author

robinxc commented Oct 30, 2013

i alter -unix file and rebuild :
could used "even"

::
switch (data->parity)
  {
  case SERIALPORT_PARITY_NONE: 
    options.c_cflag &= ~PARENB;
    options.c_cflag &= ~CSTOPB;
   // options.c_cflag &= ~CSIZE;
    //options.c_iflag &= ~INPCK;
   // options.c_cflag |= CS8;
    break;
  case SERIALPORT_PARITY_ODD: 
    options.c_cflag |= PARENB;
    options.c_cflag |= PARODD;
   // options.c_cflag &= ~CSTOPB;
    //options.c_cflag &= ~CSIZE;
   // options.c_cflag |= CS7; 
    options.c_iflag |= (INPCK | ISTRIP); 
    //snprintf(str, sizeof(str ), "Invalid odd setting %d", data->baudRate);
    break;
  case SERIALPORT_PARITY_EVEN: 
    options.c_cflag |= PARENB;
    options.c_cflag &= ~PARODD;
   // options.c_cflag &= ~CSTOPB;
    //options.c_cflag &= ~CSIZE;
    //options.c_cflag |= CS7; 
    options.c_iflag |= (INPCK | ISTRIP); 
    //snprintf(str, sizeof(str ), "Invalid even setting %d", data->baudRate);
    break;
  default:
    snprintf(data->errorString, sizeof(data->errorString), "Invalid parity setting %d", data->parity);
    close(fd);
    return;
  }

@robinxc
Copy link
Author

robinxc commented Oct 31, 2013

i think the linux and windos ver should split in switch (data->parity)
{

@reconbot
Copy link
Member

If I understand what you are saying (It would help if you said the problem again a different way.). When you set the baud rate to 2400 with parity 'even' node-serialport sends bad data?

@robinxc
Copy link
Author

robinxc commented Oct 31, 2013

dada no problem , use with parity 'none' could used.
'even' sends dada is error.

@robinxc
Copy link
Author

robinxc commented Oct 31, 2013

#219

@voodootikigod
Copy link
Collaborator

@robinxc please try the branch : https://github.com/voodootikigod/node-serialport/tree/databits

see if this resolves your issues.

@robinxc robinxc closed this as completed Nov 20, 2013
@lock lock bot locked as resolved and limited conversation to collaborators May 7, 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

4 participants